From bb6d43028a5f6575baa0ba7cb13d23acda1cde42 Mon Sep 17 00:00:00 2001 From: elkaix Date: Sat, 22 Aug 2026 21:52:40 -0400 Subject: [PATCH 1/8] Clear the dependency advisories and gate them in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The full-workspace audit returned 88 advisory records across 78 unique advisories. The lockfile now resolves clean at every severity. Runtime: ws to 8.21.3, protobufjs, React Router to 7.18.2, find-my-way, ip-address, and fast-uri move to patched floors. tar is dropped outright — nothing has imported it since the hosted ripgrep bootstrap was removed. Browser: Mermaid to 11.17.0 and DOMPurify to a patched release. Monaco has no release carrying the fix, so patches/monaco-editor@0.55.1.patch pins its bundled DOMPurify. That patch has to reach the Nix build too, so flake.nix adds ./patches to the fileset alongside the refreshed pnpmDeps hash — without it the Nix build installs an unpatched Monaco while every other build path gets the patched one. Tooling: Vite to 6.4.3, plus esbuild, PostCSS, nanoid, brace-expansion, js-yaml, linkify-it, qs, and body-parser. Fixing the versions once is not the same as keeping them fixed, so this also adds the guards: dependabot for the update stream, CodeQL for source analysis, and security.yml, which packs the CLI tarball and the VSIX and audits what those artifacts actually ship — a clean lockfile says nothing about what ends up inside a published package. check-artifacts.mjs asserts the Monaco patch survived install rather than trusting that it did. docs/security/dependency-remediation-2026-08.md records the evidence and the ownership split behind each floor. --- .github/dependabot.yml | 33 +- .github/workflows/codeql.yml | 31 + .github/workflows/security.yml | 65 + SECURITY.md | 12 +- apps/desktop/scripts/stage-runtime.ts | 1 + .../dist-web/.web-bundle-manifest.json | 2 +- ...-DqRBT_Oz.js => CodeBlockNode-BWr5oh7o.js} | 4 +- ...p23i6M.js => DesignSystemView-Dsz3gtgF.js} | 2 +- ...ooltip-B67PeCrl.js => Tooltip-dS-vJocY.js} | 2 +- .../assets/abnfDiagram-VCTEODGH-DeEmmaFj.js | 1 + .../assets/abnfDiagram-VCTEODGH-xwFTI9aD.js | 1 + .../dist-web/assets/arc-BpETntJr.js | 1 + .../{arc-Doj0wRZ0.js => arc-DA5u9y8s.js} | 2 +- .../dist-web/assets/arc-DcJEsGTv.js | 1 - .../architectureDiagram-3BPJPVTR-CQ09RrbH.js | 36 - .../architectureDiagram-3BPJPVTR-D0usObfC.js | 36 - .../architectureDiagram-5GKGNRK7-CZbHV5Jm.js | 36 + .../architectureDiagram-5GKGNRK7-DnfzDi4m.js | 36 + .../assets/blockDiagram-GPEHLZMM-9SgEZEpV.js | 132 -- .../assets/blockDiagram-GPEHLZMM-CAtDjkJt.js | 132 -- .../assets/blockDiagram-NRAW4CY4-b2ZKcyhh.js | 129 ++ .../assets/blockDiagram-NRAW4CY4-peJxU5TA.js | 129 ++ .../assets/c4Diagram-AAUBKEIU-BVFBsXNc.js | 10 - .../assets/c4Diagram-AAUBKEIU-DtzacMnD.js | 10 - .../assets/c4Diagram-UCG6FXSJ-BvorLsjE.js | 38 + .../assets/c4Diagram-UCG6FXSJ-wCnV6Dw5.js | 38 + .../dist-web/assets/channel-BKkxHUFp.js | 1 + .../dist-web/assets/channel-DNkUo9e6.js | 1 - .../dist-web/assets/channel-DxVW30WC.js | 1 - .../dist-web/assets/channel-vcmCqkai.js | 1 + .../assets/chunk-2J33WTMH-C5fSlY2E.js | 1 - .../assets/chunk-2J33WTMH-w4sdiKFO.js | 1 - ...B-qKGIEB.js => chunk-2Q5K7J3B-CTeS1k9U.js} | 2 +- ..._Rz9_NuS.js => chunk-2Q5K7J3B-Fw0ursww.js} | 2 +- .../assets/chunk-55IACEB6-B5dE1-Um.js | 1 - ...B2zs_Y-d.js => chunk-5VM5RSS4-B6TwRhtM.js} | 2 +- ...CO8Ccrhy.js => chunk-5VM5RSS4-CfUbytH6.js} | 2 +- .../assets/chunk-AQP2D5EJ-FS8-f8lF.js | 231 --- .../assets/chunk-AQP2D5EJ-rrDVh6P6.js | 231 --- .../assets/chunk-F27PBJKO-8JlkC2jZ.js | 1 + ...C4-rwdcv.js => chunk-F27PBJKO-CYKbU5Oh.js} | 2 +- .../assets/chunk-G27WJ6UU-BoJm4Mow.js | 231 +++ .../assets/chunk-G27WJ6UU-mRrNgd-1.js | 231 +++ ...WqrE2gaw.js => chunk-JWPE2WC7-B_FDSHPF.js} | 2 +- ...Byfpbsm0.js => chunk-JWPE2WC7-CM6UswKM.js} | 2 +- ...CWadnQqE.js => chunk-LCL6LL3I-9vzzXY8X.js} | 10 +- ...Dn5wkDO_.js => chunk-LCL6LL3I-BjRYBbf4.js} | 10 +- .../assets/chunk-ND2GUHAM-BBoWOe8j.js | 1 - .../assets/chunk-POPQ4Y6H-ClOHKyvb.js | 1 + .../assets/chunk-POPQ4Y6H-Enw1vTgw.js | 1 + .../assets/chunk-SVP7TREG-B7jXwGMz.js | 88 ++ .../assets/chunk-SVP7TREG-Ch8YtWzR.js | 88 ++ ...CeJhGgl3.js => chunk-XXDRQBXY-CiRZidGx.js} | 2 +- .../assets/chunk-XXDRQBXY-O3ugxnCs.js | 1 + .../assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js | 1 - .../assets/classDiagram-4FO5ZUOK-CLPflg_T.js | 1 - .../assets/classDiagram-DTDB5LWJ-DMBwBDk3.js | 1 + .../assets/classDiagram-DTDB5LWJ-DbeVASAq.js | 1 + .../classDiagram-v2-JRS7N3AN-DMBwBDk3.js | 1 + .../classDiagram-v2-JRS7N3AN-DbeVASAq.js | 1 + .../classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js | 1 - .../classDiagram-v2-Q7XG4LA2-CLPflg_T.js | 1 - .../assets/cose-bilkent-JH36ORCC-DJdft2Tr.js | 1 + ...-.js => cose-bilkent-JH36ORCC-w63tkgMG.js} | 2 +- .../assets/cose-bilkent-S5V4N54A-DgdiiLCl.js | 1 - .../dist-web/assets/cssMode-9bWh8C7-.js | 1 - .../dist-web/assets/cssMode-k4cBIe4o.js | 1 + .../assets/cynefin-OW5HDTMX-B2xW2LGa.js | 178 +++ .../assets/cynefin-OW5HDTMX-CZChzy6K.js | 178 +++ .../cynefinDiagram-5FMLGOSQ-D_g9voaT.js | 62 + .../cynefinDiagram-5FMLGOSQ-EyurVxGj.js | 62 + .../dist-web/assets/cytoscape.esm-CNiYdHpY.js | 331 ++++ .../dist-web/assets/cytoscape.esm-nFXppDBa.js | 331 ---- .../assets/dagre-3AP2YEHR-BUpPhzu2.js | 4 + .../assets/dagre-3AP2YEHR-_WUM64Jb.js | 4 + .../assets/dagre-BM42HDAG-DLMfLCoV.js | 4 - .../assets/dagre-BM42HDAG-DO9CTD4-.js | 4 - .../assets/diagram-2AECGRRQ-CnlnSMrm.js | 43 - .../assets/diagram-2AECGRRQ-DQTst0OH.js | 43 - .../assets/diagram-5GNKFQAL-DADFx60c.js | 10 - .../assets/diagram-5GNKFQAL-DoE6q7H1.js | 10 - .../assets/diagram-KO2AKTUF-pPjzS6D9.js | 3 - .../assets/diagram-LMA3HP47-B54EfHBU.js | 24 - .../assets/diagram-OG6HWLK6-BDwqGV4K.js | 24 - .../assets/diagram-OG6HWLK6-DRyxjFMa.js | 24 - .../assets/diagram-S7CK7UJ4-B0ALSF6V.js | 30 + .../assets/diagram-S7CK7UJ4-CJtzWWk1.js | 30 + .../assets/diagram-UQ7AKVKN-DGT16fis.js | 41 + .../assets/diagram-UQ7AKVKN-G5T6ytbm.js | 41 + ...Qs13i5.js => diagram-VSXAHHWV-CNAgJCU-.js} | 6 +- .../assets/diagram-VSXAHHWV-DJYRW0Gs.js | 3 + .../assets/diagram-VX7I27RA-B6ZYWMRE.js | 24 + .../assets/diagram-VX7I27RA-C4ywS35g.js | 24 + ...5zlyMt.js => diagram-Z3DM3KII-D6P8_UB8.js} | 4 +- .../assets/diagram-Z3DM3KII-D_WNFbDS.js | 24 + .../assets/ebnfDiagram-PWID7BFC-Bk08WD3m.js | 1 + .../assets/ebnfDiagram-PWID7BFC-Dd5PiLFs.js | 1 + ...in-PjnZnl8g.js => editor.main-CYqrlDj5.js} | 361 +++-- .../assets/erDiagram-SSCWMZ5O-CBECm49E.js | 99 ++ .../assets/erDiagram-SSCWMZ5O-CyT2KwqT.js | 99 ++ .../assets/erDiagram-TEJ5UH35-BXhIpQde.js | 85 - .../assets/erDiagram-TEJ5UH35-yd6SOv_7.js | 85 - .../assets/flowDiagram-A5DVABFB-93_AFKE1.js | 168 ++ .../assets/flowDiagram-A5DVABFB-B-bmDgjW.js | 168 ++ .../assets/flowDiagram-I6XJVG4X-C0NzPZfg.js | 162 -- .../assets/flowDiagram-I6XJVG4X-DkYNQv0R.js | 162 -- ...r2-C_dr9LiI.js => freemarker2-C0l6anS_.js} | 4 +- .../assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js | 292 ---- .../assets/ganttDiagram-6RSMTGT7-D0aRnxaO.js | 292 ---- .../assets/ganttDiagram-EL5Y4UJY-Cv91TEJM.js | 292 ++++ .../assets/ganttDiagram-EL5Y4UJY-e6aGOOKl.js | 292 ++++ .../gitGraphDiagram-PVQCEYII-BRUFe5tO.js | 106 -- .../gitGraphDiagram-WWUBYQGX-Ba6FufWL.js | 106 ++ ...s => gitGraphDiagram-WWUBYQGX-NJxV01JK.js} | 6 +- .../dist-web/assets/graph--OzhPTMs.js | 1 - .../dist-web/assets/graph-BwjfAU3j.js | 1 - .../dist-web/assets/handlebars-C3vjJ5wA.js | 1 - .../dist-web/assets/handlebars-CrwlbXzI.js | 1 + .../dist-web/assets/html-BG3YQOlK.js | 1 - .../dist-web/assets/html-Clnn5ww4.js | 1 + .../dist-web/assets/htmlMode-B2JxHnrC.js | 1 + .../dist-web/assets/htmlMode-DzKTVOy0.js | 1 - .../{index-BALCJgS_.js => index-CsDiodhg.js} | 2 +- .../{index-CfPLtZNG.js => index-DOHUxrC7.js} | 4 +- .../{index-D4amJRyl.js => index-F0Uxsiuo.js} | 2 +- .../{index-C-zUV3mO.js => index-rMXX6Fbt.js} | 16 +- ...ndex10-AW8N8rWg.js => index10-D0MNok2L.js} | 2 +- ...ndex11-16yWfZMq.js => index11-k-mhqMlJ.js} | 2 +- ...{index5-CBYFkVKG.js => index5-Dh6mobVc.js} | 2 +- ...{index6-w-biay8h.js => index6-nJ5Uhicq.js} | 2 +- ...{index7-CZyA1Z1y.js => index7-BXXLhFeb.js} | 2 +- ...{index8-DXv0w_HB.js => index8-DmR_F8YQ.js} | 2 +- .../assets/infoDiagram-5YYISTIA-2JF3XEdD.js | 2 - .../assets/infoDiagram-5YYISTIA-BDR-yI5p.js | 2 - .../assets/infoDiagram-RXCK75RN-CGPD6Iqj.js | 2 + .../assets/infoDiagram-RXCK75RN-CHWvKJZZ.js | 2 + ...s => ishikawaDiagram-5VMMS53U-2_equ-mr.js} | 4 +- ...s => ishikawaDiagram-5VMMS53U-BwuVcBjJ.js} | 10 +- .../dist-web/assets/javascript-CO6b1bN1.js | 1 + .../dist-web/assets/javascript-Dkp43T8T.js | 1 - ...js => journeyDiagram-EYS64GPL-CC_sV6JN.js} | 2 +- ...js => journeyDiagram-EYS64GPL-kKnR_Agl.js} | 4 +- ...nMode-BWwbZhu8.js => jsonMode-1xqDoFsh.js} | 8 +- ...=> kanban-definition-3QL26DDD-C7CsUKds.js} | 16 +- ...=> kanban-definition-3QL26DDD-KKako_TX.js} | 16 +- .../dist-web/assets/layout-0mnwPCmk.js | 1 + .../dist-web/assets/layout-BYPkgL46.js | 1 + .../dist-web/assets/layout-C1ojF0zw.js | 1 - .../dist-web/assets/layout-SsrduOYp.js | 1 - ...{linear-HCDmDFmI.js => linear-BzSwLvr2.js} | 2 +- ...{linear-3mB6q2-g.js => linear-C54H8aK0.js} | 2 +- .../dist-web/assets/liquid-BL1JohJf.js | 1 + .../dist-web/assets/liquid-C_k_bMvD.js | 1 - ...7da.js => lspLanguageFeatures-CQG5isp7.js} | 2 +- .../dist-web/assets/mdx-B0qq4UAz.js | 1 - .../dist-web/assets/mdx-BtwBPXgy.js | 1 + .../dist-web/assets/mermaid.core-Bt2TZ_t_.js | 309 ---- .../dist-web/assets/mermaid.core-CM2luXFy.js | 310 ++++ .../assets/mermaidParser.worker-DimdFOud.js | 316 ++++ .../assets/mermaidParser.worker-Dx4jPi9z.js | 313 ---- ...> mindmap-definition-FBJOCRG2-BCpkkoGH.js} | 2 +- ...> mindmap-definition-FBJOCRG2-rDzqtc6o.js} | 8 +- .../assets/pegDiagram-XKGWAZYB-9nULmqYj.js | 1 + .../assets/pegDiagram-XKGWAZYB-UL6Anq6D.js | 1 + .../assets/pieDiagram-4H26LBE5-BkwDAvbt.js | 30 - .../assets/pieDiagram-4H26LBE5-C1xD2bvS.js | 30 - .../assets/pieDiagram-E7YTZNPT-Cxg1I09N.js | 39 + .../assets/pieDiagram-E7YTZNPT-DXKAJ64V.js | 39 + .../dist-web/assets/purify.es-5AjVNlXF.js | 3 + .../dist-web/assets/python-BQPyZP7x.js | 1 - .../dist-web/assets/python-Cg60ZTQb.js | 1 + ...s => quadrantDiagram-AXDQQJYC-D5x9CG6S.js} | 6 +- ...s => quadrantDiagram-AXDQQJYC-DluZGGzz.js} | 6 +- .../railroadDiagram-O6MQD6OU-DUqXMsdR.js | 1 + .../railroadDiagram-O6MQD6OU-MITsjn7P.js | 1 + .../dist-web/assets/razor-B77IdrOm.js | 1 + .../dist-web/assets/razor-CW3YV4Fr.js | 1 - .../requirementDiagram-4Y6WPE33-DbSdmJHe.js | 84 - .../requirementDiagram-EFPCY7ZU-Dkdx_R5h.js | 84 + ...> requirementDiagram-EFPCY7ZU-tSkBqFOE.js} | 24 +- .../assets/sankeyDiagram-5OEKKPKP-BTjuxaGZ.js | 40 - .../assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js | 40 - .../assets/sankeyDiagram-P5KCCOFB-C-Pxs8DE.js | 40 + .../assets/sankeyDiagram-P5KCCOFB-CEE-pKOB.js | 40 + .../sequenceDiagram-3UESZ5HK-VAxffBe7.js | 162 -- .../sequenceDiagram-3UESZ5HK-jthqk_Dn.js | 162 -- .../sequenceDiagram-WJ2MYXX4-BoGn1vke.js | 162 ++ .../sequenceDiagram-WJ2MYXX4-DZKUZvF6.js | 162 ++ .../assets/sizeCapture-X5ZJPWSS-CcGm6AKu.js | 1 + .../assets/sizeCapture-X5ZJPWSS-DajlBTKq.js | 1 + .../assets/stateDiagram-AJRCARHV-DtBzWZqF.js | 1 - .../assets/stateDiagram-AJRCARHV-nDExQydZ.js | 1 - .../assets/stateDiagram-HBIQ2CUA-CNu2cBAR.js | 1 + .../assets/stateDiagram-HBIQ2CUA-CPR8Qv_k.js | 1 + .../stateDiagram-v2-4QOOHH4V-C7sDw95j.js | 1 + .../stateDiagram-v2-4QOOHH4V-CU-fhbLr.js | 1 + .../stateDiagram-v2-BHNVJYJU-BzwD_BIl.js | 1 - .../stateDiagram-v2-BHNVJYJU-YIOYws7B.js | 1 - .../assets/swimlanes-XN3QIQJK-Bs_quOY7.js | 1 + .../assets/swimlanes-XN3QIQJK-DqtsohfR.js | 1 + .../swimlanesDiagram-VK2B7HYN-BtlMyMQ1.js | 8 + .../swimlanesDiagram-VK2B7HYN-DlRuQmRz.js | 8 + ... timeline-definition-24CTP7MA-CW8yyqmp.js} | 8 +- ... timeline-definition-24CTP7MA-D9Z2Ng-D.js} | 8 +- ...{tsMode-D0gNUxS2.js => tsMode-D10OTffV.js} | 4 +- .../dist-web/assets/typescript-BF2N5gRo.js | 1 + .../dist-web/assets/typescript-DPgjF7mr.js | 1 - .../assets/vennDiagram-4TSXK5OY-DRUqDn-A.js | 34 + .../assets/vennDiagram-4TSXK5OY-xguKbcgO.js | 34 + .../assets/vennDiagram-CIIHVFJN-BBHQmCFf.js | 34 - .../assets/vennDiagram-CIIHVFJN-C7PdVpUj.js | 34 - ...js => vue.runtime.esm-bundler-Bl9qLXWV.js} | 2 +- .../assets/wardley-L42UT6IY-7UoWEQ2c.js | 173 --- .../assets/wardley-L42UT6IY-BJFn8eDD.js | 173 --- ...js => wardleyDiagram-VM6X3IG4-BH-UBKMK.js} | 10 +- ...js => wardleyDiagram-VM6X3IG4-pD07e8-Q.js} | 6 +- .../dist-web/assets/xml-CKVlGCVv.js | 1 + .../dist-web/assets/xml-DnfXpm1w.js | 1 - .../xychartDiagram-2RQKCTM6-D45pZk24.js | 7 - .../xychartDiagram-2RQKCTM6-Db_VoDBV.js | 7 - .../xychartDiagram-S5SC5T6Z-Bwh1piW_.js | 7 + .../xychartDiagram-S5SC5T6Z-DbpgOBtW.js | 7 + .../dist-web/assets/yaml-C7wg11Lz.js | 1 - .../dist-web/assets/yaml-D9hqJrzJ.js | 1 + apps/pythinker-code/dist-web/index.html | 2 +- apps/pythinker-inspect/package.json | 2 +- apps/pythinker-web/package.json | 7 +- apps/vis/web/package.json | 4 +- apps/vscode/package.json | 2 +- docs/package.json | 2 +- .../dependency-remediation-2026-08.md | 74 + flake.nix | 3 +- package.json | 1 + packages/agent-core-v2/package.json | 2 - packages/agent-core/package.json | 2 - packages/agent-gateway/package.json | 2 +- packages/klient/package.json | 2 +- patches/monaco-editor@0.55.1.patch | 1366 +++++++++++++++++ pnpm-lock.yaml | 746 +++------ pnpm-workspace.yaml | 32 +- scripts/security/check-artifacts.mjs | 244 +++ scripts/security/check-built-browser.mjs | 331 ++++ 242 files changed, 7374 insertions(+), 5008 deletions(-) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/security.yml rename apps/pythinker-code/dist-web/assets/{CodeBlockNode-DqRBT_Oz.js => CodeBlockNode-BWr5oh7o.js} (99%) rename apps/pythinker-code/dist-web/assets/{DesignSystemView-Egp23i6M.js => DesignSystemView-Dsz3gtgF.js} (99%) rename apps/pythinker-code/dist-web/assets/{Tooltip-B67PeCrl.js => Tooltip-dS-vJocY.js} (98%) create mode 100644 apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DeEmmaFj.js create mode 100644 apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-xwFTI9aD.js create mode 100644 apps/pythinker-code/dist-web/assets/arc-BpETntJr.js rename apps/pythinker-code/dist-web/assets/{arc-Doj0wRZ0.js => arc-DA5u9y8s.js} (98%) delete mode 100644 apps/pythinker-code/dist-web/assets/arc-DcJEsGTv.js delete mode 100644 apps/pythinker-code/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js delete mode 100644 apps/pythinker-code/dist-web/assets/architectureDiagram-3BPJPVTR-D0usObfC.js create mode 100644 apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CZbHV5Jm.js create mode 100644 apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-DnfzDi4m.js delete mode 100644 apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-9SgEZEpV.js delete mode 100644 apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js create mode 100644 apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-b2ZKcyhh.js create mode 100644 apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-peJxU5TA.js delete mode 100644 apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-BVFBsXNc.js delete mode 100644 apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js create mode 100644 apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-BvorLsjE.js create mode 100644 apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-wCnV6Dw5.js create mode 100644 apps/pythinker-code/dist-web/assets/channel-BKkxHUFp.js delete mode 100644 apps/pythinker-code/dist-web/assets/channel-DNkUo9e6.js delete mode 100644 apps/pythinker-code/dist-web/assets/channel-DxVW30WC.js create mode 100644 apps/pythinker-code/dist-web/assets/channel-vcmCqkai.js delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-C5fSlY2E.js delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js rename apps/pythinker-code/dist-web/assets/{chunk-QZHKN3VN-B-qKGIEB.js => chunk-2Q5K7J3B-CTeS1k9U.js} (67%) rename apps/pythinker-code/dist-web/assets/{chunk-QZHKN3VN-_Rz9_NuS.js => chunk-2Q5K7J3B-Fw0ursww.js} (68%) delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js rename apps/pythinker-code/dist-web/assets/{chunk-FMBD7UC4-B2zs_Y-d.js => chunk-5VM5RSS4-B6TwRhtM.js} (82%) rename apps/pythinker-code/dist-web/assets/{chunk-FMBD7UC4-CO8Ccrhy.js => chunk-5VM5RSS4-CfUbytH6.js} (83%) delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-rrDVh6P6.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-8JlkC2jZ.js rename apps/pythinker-code/dist-web/assets/{chunk-ND2GUHAM-C4-rwdcv.js => chunk-F27PBJKO-CYKbU5Oh.js} (87%) create mode 100644 apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-BoJm4Mow.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-mRrNgd-1.js rename apps/pythinker-code/dist-web/assets/{chunk-4BX2VUAB-WqrE2gaw.js => chunk-JWPE2WC7-B_FDSHPF.js} (72%) rename apps/pythinker-code/dist-web/assets/{chunk-4BX2VUAB-Byfpbsm0.js => chunk-JWPE2WC7-CM6UswKM.js} (71%) rename apps/pythinker-code/dist-web/assets/{chunk-727SXJPM-CWadnQqE.js => chunk-LCL6LL3I-9vzzXY8X.js} (50%) rename apps/pythinker-code/dist-web/assets/{chunk-727SXJPM-Dn5wkDO_.js => chunk-LCL6LL3I-BjRYBbf4.js} (69%) delete mode 100644 apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-BBoWOe8j.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-ClOHKyvb.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Enw1vTgw.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-B7jXwGMz.js create mode 100644 apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-Ch8YtWzR.js rename apps/pythinker-code/dist-web/assets/{chunk-55IACEB6-CeJhGgl3.js => chunk-XXDRQBXY-CiRZidGx.js} (54%) create mode 100644 apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-O3ugxnCs.js delete mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js delete mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-CLPflg_T.js create mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DMBwBDk3.js create mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DbeVASAq.js create mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DMBwBDk3.js create mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DbeVASAq.js delete mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js delete mode 100644 apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-CLPflg_T.js create mode 100644 apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJdft2Tr.js rename apps/pythinker-code/dist-web/assets/{cose-bilkent-S5V4N54A-Bi19n8m-.js => cose-bilkent-JH36ORCC-w63tkgMG.js} (99%) delete mode 100644 apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-DgdiiLCl.js delete mode 100644 apps/pythinker-code/dist-web/assets/cssMode-9bWh8C7-.js create mode 100644 apps/pythinker-code/dist-web/assets/cssMode-k4cBIe4o.js create mode 100644 apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B2xW2LGa.js create mode 100644 apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CZChzy6K.js create mode 100644 apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-D_g9voaT.js create mode 100644 apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-EyurVxGj.js create mode 100644 apps/pythinker-code/dist-web/assets/cytoscape.esm-CNiYdHpY.js delete mode 100644 apps/pythinker-code/dist-web/assets/cytoscape.esm-nFXppDBa.js create mode 100644 apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BUpPhzu2.js create mode 100644 apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-_WUM64Jb.js delete mode 100644 apps/pythinker-code/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js delete mode 100644 apps/pythinker-code/dist-web/assets/dagre-BM42HDAG-DO9CTD4-.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-2AECGRRQ-CnlnSMrm.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DADFx60c.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-pPjzS6D9.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-B54EfHBU.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-BDwqGV4K.js delete mode 100644 apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-B0ALSF6V.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CJtzWWk1.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-DGT16fis.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-G5T6ytbm.js rename apps/pythinker-code/dist-web/assets/{diagram-KO2AKTUF-CFQs13i5.js => diagram-VSXAHHWV-CNAgJCU-.js} (88%) create mode 100644 apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-DJYRW0Gs.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-B6ZYWMRE.js create mode 100644 apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-C4ywS35g.js rename apps/pythinker-code/dist-web/assets/{diagram-LMA3HP47-He5zlyMt.js => diagram-Z3DM3KII-D6P8_UB8.js} (68%) create mode 100644 apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D_WNFbDS.js create mode 100644 apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Bk08WD3m.js create mode 100644 apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Dd5PiLFs.js rename apps/pythinker-code/dist-web/assets/{editor.main-PjnZnl8g.js => editor.main-CYqrlDj5.js} (52%) create mode 100644 apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CBECm49E.js create mode 100644 apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CyT2KwqT.js delete mode 100644 apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-BXhIpQde.js delete mode 100644 apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js create mode 100644 apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-93_AFKE1.js create mode 100644 apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-B-bmDgjW.js delete mode 100644 apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-C0NzPZfg.js delete mode 100644 apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js rename apps/pythinker-code/dist-web/assets/{freemarker2-C_dr9LiI.js => freemarker2-C0l6anS_.js} (92%) delete mode 100644 apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js delete mode 100644 apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-D0aRnxaO.js create mode 100644 apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-Cv91TEJM.js create mode 100644 apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-e6aGOOKl.js delete mode 100644 apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-BRUFe5tO.js create mode 100644 apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-Ba6FufWL.js rename apps/pythinker-code/dist-web/assets/{gitGraphDiagram-PVQCEYII-DMbTATyw.js => gitGraphDiagram-WWUBYQGX-NJxV01JK.js} (94%) delete mode 100644 apps/pythinker-code/dist-web/assets/graph--OzhPTMs.js delete mode 100644 apps/pythinker-code/dist-web/assets/graph-BwjfAU3j.js delete mode 100644 apps/pythinker-code/dist-web/assets/handlebars-C3vjJ5wA.js create mode 100644 apps/pythinker-code/dist-web/assets/handlebars-CrwlbXzI.js delete mode 100644 apps/pythinker-code/dist-web/assets/html-BG3YQOlK.js create mode 100644 apps/pythinker-code/dist-web/assets/html-Clnn5ww4.js create mode 100644 apps/pythinker-code/dist-web/assets/htmlMode-B2JxHnrC.js delete mode 100644 apps/pythinker-code/dist-web/assets/htmlMode-DzKTVOy0.js rename apps/pythinker-code/dist-web/assets/{index-BALCJgS_.js => index-CsDiodhg.js} (99%) rename apps/pythinker-code/dist-web/assets/{index-CfPLtZNG.js => index-DOHUxrC7.js} (99%) rename apps/pythinker-code/dist-web/assets/{index-D4amJRyl.js => index-F0Uxsiuo.js} (99%) rename apps/pythinker-code/dist-web/assets/{index-C-zUV3mO.js => index-rMXX6Fbt.js} (98%) rename apps/pythinker-code/dist-web/assets/{index10-AW8N8rWg.js => index10-D0MNok2L.js} (99%) rename apps/pythinker-code/dist-web/assets/{index11-16yWfZMq.js => index11-k-mhqMlJ.js} (99%) rename apps/pythinker-code/dist-web/assets/{index5-CBYFkVKG.js => index5-Dh6mobVc.js} (95%) rename apps/pythinker-code/dist-web/assets/{index6-w-biay8h.js => index6-nJ5Uhicq.js} (98%) rename apps/pythinker-code/dist-web/assets/{index7-CZyA1Z1y.js => index7-BXXLhFeb.js} (98%) rename apps/pythinker-code/dist-web/assets/{index8-DXv0w_HB.js => index8-DmR_F8YQ.js} (99%) delete mode 100644 apps/pythinker-code/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js delete mode 100644 apps/pythinker-code/dist-web/assets/infoDiagram-5YYISTIA-BDR-yI5p.js create mode 100644 apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-CGPD6Iqj.js create mode 100644 apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-CHWvKJZZ.js rename apps/pythinker-code/dist-web/assets/{ishikawaDiagram-YF4QCWOH-DZ2DBeOa.js => ishikawaDiagram-5VMMS53U-2_equ-mr.js} (83%) rename apps/pythinker-code/dist-web/assets/{ishikawaDiagram-YF4QCWOH-C5OstRVV.js => ishikawaDiagram-5VMMS53U-BwuVcBjJ.js} (83%) create mode 100644 apps/pythinker-code/dist-web/assets/javascript-CO6b1bN1.js delete mode 100644 apps/pythinker-code/dist-web/assets/javascript-Dkp43T8T.js rename apps/pythinker-code/dist-web/assets/{journeyDiagram-JHISSGLW-yctdo4bX.js => journeyDiagram-EYS64GPL-CC_sV6JN.js} (98%) rename apps/pythinker-code/dist-web/assets/{journeyDiagram-JHISSGLW-zOUbwCXE.js => journeyDiagram-EYS64GPL-kKnR_Agl.js} (85%) rename apps/pythinker-code/dist-web/assets/{jsonMode-BWwbZhu8.js => jsonMode-1xqDoFsh.js} (54%) rename apps/pythinker-code/dist-web/assets/{kanban-definition-UN3LZRKU-CxBCv27E.js => kanban-definition-3QL26DDD-C7CsUKds.js} (89%) rename apps/pythinker-code/dist-web/assets/{kanban-definition-UN3LZRKU-CNuareJL.js => kanban-definition-3QL26DDD-KKako_TX.js} (64%) create mode 100644 apps/pythinker-code/dist-web/assets/layout-0mnwPCmk.js create mode 100644 apps/pythinker-code/dist-web/assets/layout-BYPkgL46.js delete mode 100644 apps/pythinker-code/dist-web/assets/layout-C1ojF0zw.js delete mode 100644 apps/pythinker-code/dist-web/assets/layout-SsrduOYp.js rename apps/pythinker-code/dist-web/assets/{linear-HCDmDFmI.js => linear-BzSwLvr2.js} (98%) rename apps/pythinker-code/dist-web/assets/{linear-3mB6q2-g.js => linear-C54H8aK0.js} (89%) create mode 100644 apps/pythinker-code/dist-web/assets/liquid-BL1JohJf.js delete mode 100644 apps/pythinker-code/dist-web/assets/liquid-C_k_bMvD.js rename apps/pythinker-code/dist-web/assets/{lspLanguageFeatures-BqLYp7da.js => lspLanguageFeatures-CQG5isp7.js} (99%) delete mode 100644 apps/pythinker-code/dist-web/assets/mdx-B0qq4UAz.js create mode 100644 apps/pythinker-code/dist-web/assets/mdx-BtwBPXgy.js delete mode 100644 apps/pythinker-code/dist-web/assets/mermaid.core-Bt2TZ_t_.js create mode 100644 apps/pythinker-code/dist-web/assets/mermaid.core-CM2luXFy.js create mode 100644 apps/pythinker-code/dist-web/assets/mermaidParser.worker-DimdFOud.js delete mode 100644 apps/pythinker-code/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js rename apps/pythinker-code/dist-web/assets/{mindmap-definition-RKZ34NQL-BmJZpjh6.js => mindmap-definition-FBJOCRG2-BCpkkoGH.js} (79%) rename apps/pythinker-code/dist-web/assets/{mindmap-definition-RKZ34NQL-DaxiPEb_.js => mindmap-definition-FBJOCRG2-rDzqtc6o.js} (76%) create mode 100644 apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-9nULmqYj.js create mode 100644 apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-UL6Anq6D.js delete mode 100644 apps/pythinker-code/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js delete mode 100644 apps/pythinker-code/dist-web/assets/pieDiagram-4H26LBE5-C1xD2bvS.js create mode 100644 apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-Cxg1I09N.js create mode 100644 apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-DXKAJ64V.js create mode 100644 apps/pythinker-code/dist-web/assets/purify.es-5AjVNlXF.js delete mode 100644 apps/pythinker-code/dist-web/assets/python-BQPyZP7x.js create mode 100644 apps/pythinker-code/dist-web/assets/python-Cg60ZTQb.js rename apps/pythinker-code/dist-web/assets/{quadrantDiagram-W4KKPZXB-BmT_qM09.js => quadrantDiagram-AXDQQJYC-D5x9CG6S.js} (89%) rename apps/pythinker-code/dist-web/assets/{quadrantDiagram-W4KKPZXB-B58hm53G.js => quadrantDiagram-AXDQQJYC-DluZGGzz.js} (61%) create mode 100644 apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-DUqXMsdR.js create mode 100644 apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-MITsjn7P.js create mode 100644 apps/pythinker-code/dist-web/assets/razor-B77IdrOm.js delete mode 100644 apps/pythinker-code/dist-web/assets/razor-CW3YV4Fr.js delete mode 100644 apps/pythinker-code/dist-web/assets/requirementDiagram-4Y6WPE33-DbSdmJHe.js create mode 100644 apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-Dkdx_R5h.js rename apps/pythinker-code/dist-web/assets/{requirementDiagram-4Y6WPE33-CZrxH1Y2.js => requirementDiagram-EFPCY7ZU-tSkBqFOE.js} (67%) delete mode 100644 apps/pythinker-code/dist-web/assets/sankeyDiagram-5OEKKPKP-BTjuxaGZ.js delete mode 100644 apps/pythinker-code/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js create mode 100644 apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-C-Pxs8DE.js create mode 100644 apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-CEE-pKOB.js delete mode 100644 apps/pythinker-code/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js delete mode 100644 apps/pythinker-code/dist-web/assets/sequenceDiagram-3UESZ5HK-jthqk_Dn.js create mode 100644 apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-BoGn1vke.js create mode 100644 apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-DZKUZvF6.js create mode 100644 apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-CcGm6AKu.js create mode 100644 apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-DajlBTKq.js delete mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-AJRCARHV-DtBzWZqF.js delete mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js create mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-CNu2cBAR.js create mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-CPR8Qv_k.js create mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-C7sDw95j.js create mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-CU-fhbLr.js delete mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js delete mode 100644 apps/pythinker-code/dist-web/assets/stateDiagram-v2-BHNVJYJU-YIOYws7B.js create mode 100644 apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-Bs_quOY7.js create mode 100644 apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-DqtsohfR.js create mode 100644 apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-BtlMyMQ1.js create mode 100644 apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-DlRuQmRz.js rename apps/pythinker-code/dist-web/assets/{timeline-definition-PNZ67QCA-DsVZdrZa.js => timeline-definition-24CTP7MA-CW8yyqmp.js} (90%) rename apps/pythinker-code/dist-web/assets/{timeline-definition-PNZ67QCA-B9fuplLY.js => timeline-definition-24CTP7MA-D9Z2Ng-D.js} (82%) rename apps/pythinker-code/dist-web/assets/{tsMode-D0gNUxS2.js => tsMode-D10OTffV.js} (59%) create mode 100644 apps/pythinker-code/dist-web/assets/typescript-BF2N5gRo.js delete mode 100644 apps/pythinker-code/dist-web/assets/typescript-DPgjF7mr.js create mode 100644 apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-DRUqDn-A.js create mode 100644 apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-xguKbcgO.js delete mode 100644 apps/pythinker-code/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js delete mode 100644 apps/pythinker-code/dist-web/assets/vennDiagram-CIIHVFJN-C7PdVpUj.js rename apps/pythinker-code/dist-web/assets/{vue.runtime.esm-bundler-BKeUZrw-.js => vue.runtime.esm-bundler-Bl9qLXWV.js} (98%) delete mode 100644 apps/pythinker-code/dist-web/assets/wardley-L42UT6IY-7UoWEQ2c.js delete mode 100644 apps/pythinker-code/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js rename apps/pythinker-code/dist-web/assets/{wardleyDiagram-YWT4CUSO-7r8ugOU-.js => wardleyDiagram-VM6X3IG4-BH-UBKMK.js} (63%) rename apps/pythinker-code/dist-web/assets/{wardleyDiagram-YWT4CUSO-DCiyDQNB.js => wardleyDiagram-VM6X3IG4-pD07e8-Q.js} (93%) create mode 100644 apps/pythinker-code/dist-web/assets/xml-CKVlGCVv.js delete mode 100644 apps/pythinker-code/dist-web/assets/xml-DnfXpm1w.js delete mode 100644 apps/pythinker-code/dist-web/assets/xychartDiagram-2RQKCTM6-D45pZk24.js delete mode 100644 apps/pythinker-code/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js create mode 100644 apps/pythinker-code/dist-web/assets/xychartDiagram-S5SC5T6Z-Bwh1piW_.js create mode 100644 apps/pythinker-code/dist-web/assets/xychartDiagram-S5SC5T6Z-DbpgOBtW.js delete mode 100644 apps/pythinker-code/dist-web/assets/yaml-C7wg11Lz.js create mode 100644 apps/pythinker-code/dist-web/assets/yaml-D9hqJrzJ.js create mode 100644 docs/security/dependency-remediation-2026-08.md create mode 100644 patches/monaco-editor@0.55.1.patch create mode 100644 scripts/security/check-artifacts.mjs create mode 100644 scripts/security/check-built-browser.mjs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 79b2ca70a..3a66eb8c3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,30 +4,11 @@ updates: directory: "/" schedule: interval: "weekly" - # Scheduled version-update PRs are disabled on purpose: this workspace's - # engines.node (>=24.15.0 <25) exceeds the Node.js version Dependabot's own - # updater sandbox ships, so ANY `pnpm install`/update it attempts hard-fails - # with ERR_PNPM_UNSUPPORTED_ENGINE (root .npmrc sets engine-strict=true). - # See dependabot/dependabot-core#7426, #4072, #12976 — there is no - # dependabot.yml-level fix; the real fix is lowering engines.node or - # disabling engine-strict in .npmrc, both out of scope here. This entry - # exists only so the `ignore` rules below apply to security-update PRs, - # which open-pull-requests-limit: 0 does not suppress. + # Scheduled version updates remain disabled because Dependabot's updater + # does not satisfy this workspace's strict Node 24.15 engine requirement. + # Security updates remain enabled and no dependency is ignored. open-pull-requests-limit: 0 - ignore: - # Both advisories are on vite/esbuild resolved transitively through - # docs/package.json's vitepress@1.6.4 (vite@5.4.21 in pnpm-lock.yaml), - # a dev-only docs-site dependency. vitepress@1.6.4 pins `vite: 5.4.21` - # as a hard (non-peer) dependency, so pnpm cannot resolve a fix without - # vitepress 2 (alpha only as of 2026-08) — every attempt reopens the - # same failing PR. Unscoped by version on purpose: Dependabot's actual - # target version for this resolution is unverifiable (no open - # Dependabot PRs exist in this repo to read a target off of, and the - # target is not necessarily the advisory's first-patched version), so a - # version-scoped rule can silently fail to match and let the PR back - # in. Cost: this also suppresses vite/esbuild security-update PRs for - # apps/*, which today sit at patched vite@6.4.3+ directly — revisit if - # that changes. Drop both rules once docs/package.json moves to - # vitepress 2 stable. - - dependency-name: "vite" - - dependency-name: "esbuild" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..31ca37a45 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,31 @@ +name: CodeQL + +on: + pull_request: + push: + branches: [main] + schedule: + - cron: '43 4 * * 1' + workflow_dispatch: + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: CodeQL + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false + - uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 + with: + build-mode: none + languages: javascript-typescript + queries: security-extended + - uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 + with: + category: /language:javascript-typescript diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 000000000..364dd9dcc --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,65 @@ +name: Security + +on: + pull_request: + push: + branches: [main] + schedule: + - cron: '17 4 * * *' + workflow_dispatch: + +permissions: + contents: read + +jobs: + audit: + name: Security audit + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + with: + node-version-file: .nvmrc + - run: pnpm audit --json + + dependency-review: + name: Dependency review + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false + - uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 + with: + fail-on-scopes: runtime, development, unknown + fail-on-severity: low + vulnerability-check: true + + artifact-security: + name: Artifact security + if: github.event_name != 'schedule' + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + with: + node-version-file: .nvmrc + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm -C apps/desktop run package + - run: pnpm -C docs run build + - run: mkdir -p .tmp/security-artifacts/cli .tmp/security-artifacts/vsix + - run: pnpm --filter @pymodel/pythinker-code pack --pack-destination "${{ github.workspace }}/.tmp/security-artifacts/cli" + - run: pnpm --filter pythinker run package:platform -- --target linux-x64 --out-dir "${{ github.workspace }}/.tmp/security-artifacts/vsix" + - run: pnpm -C apps/pythinker-code run smoke + - run: pnpm run check:security-artifacts diff --git a/SECURITY.md b/SECURITY.md index 0392634d5..d386148f4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -26,7 +26,17 @@ Alternative channel: ## Our Response -We will acknowledge your report and provide an initial assessment as soon as we can. +We triage Critical and High reports within 24 hours. We target a fix within 72 hours for +Critical and High issues, 7 days for Medium issues, and 30 days for Low issues. + +## Dependency Vulnerability Policy + +Pull requests cannot add a vulnerability at any severity. The repository uses a full-workspace +audit because build and package steps can ship workspace code declared as a development +dependency. A production-only audit is informational and is not a security gate. + +If a vulnerability is disclosed after clean code reaches `main`, the response times above apply. +Dismissed or auto-dismissed alert state does not make a vulnerable dependency acceptable. ## Public Disclosure diff --git a/apps/desktop/scripts/stage-runtime.ts b/apps/desktop/scripts/stage-runtime.ts index 262a75ff9..902976633 100644 --- a/apps/desktop/scripts/stage-runtime.ts +++ b/apps/desktop/scripts/stage-runtime.ts @@ -112,6 +112,7 @@ async function deploy(target: string): Promise { await run('pnpm', [ '--config.verify-deps-before-run=false', '--filter', deployPackage, 'deploy', '--legacy', '--prod', '--config.node-linker=hoisted', '--config.auto-install-peers=false', '--config.link-workspace-packages=true', + '--config.allow-unused-patches=true', deployTargetArgument(repositoryRoot, target), ]) } finally { diff --git a/apps/pythinker-code/dist-web/.web-bundle-manifest.json b/apps/pythinker-code/dist-web/.web-bundle-manifest.json index d433f0bf1..74ca75f56 100644 --- a/apps/pythinker-code/dist-web/.web-bundle-manifest.json +++ b/apps/pythinker-code/dist-web/.web-bundle-manifest.json @@ -1,4 +1,4 @@ { - "sourceHash": "5fa1f4113f68cc5a0de3b4985ae517b47ca98f832e89e97cf636845fd3a2cd67", + "sourceHash": "6c3eea494011bc65aa88d7fd6e889fd882255b4d60e720cc332566f9b5b58da0", "sourceFileCount": 388 } diff --git a/apps/pythinker-code/dist-web/assets/CodeBlockNode-DqRBT_Oz.js b/apps/pythinker-code/dist-web/assets/CodeBlockNode-BWr5oh7o.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/CodeBlockNode-DqRBT_Oz.js rename to apps/pythinker-code/dist-web/assets/CodeBlockNode-BWr5oh7o.js index 44dd9aa1e..68544460b 100644 --- a/apps/pythinker-code/dist-web/assets/CodeBlockNode-DqRBT_Oz.js +++ b/apps/pythinker-code/dist-web/assets/CodeBlockNode-BWr5oh7o.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CfPLtZNG.js","assets/index-C-zUV3mO.js","assets/index-qbGiRbdE.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as zo,M as vl,bl as Ci,af as dl,bY as Mi,cc as Bi,b$ as ml,aU as O,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Co,aD as Ho,bE as ae,az as Li,cd as hn,c8 as vt,aI as No,aL as G,s as bn,aw as It,au as mt,bk as V,ce as Mo,u as oe,I as To,A as Oi,bJ as Ut,aY as pt,bL as cl,v as b,t as ye,bB as fl,bb as Me,q as k,b7 as $i,cf as zi,cg as gn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as j,cl as Bo,cm as Di,cn as Ai,co as jt,cp as Eo,bO as Ro,T as ji,G as qi,F as Fo,g as Wi,c7 as _i,b_ as Ii}from"./index-C-zUV3mO.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Po=!1,qt=null,Wt=null,_t=null;function Ui(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield xi(()=>import("./index-CfPLtZNG.js"),__vite__mapDeps([0,1,2]))),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Po?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Po=!0}).finally(()=>{qt=null}),qt)})})(Wt),Si(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Oo=(x,M,w)=>M in x?Vi(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,I=(x,M)=>{for(var w in M||(M={}))Yi.call(M,w)&&Oo(x,w,M[w]);if(Lo)for(var w of Lo(M))Qi.call(M,w)&&Oo(x,w,M[w]);return x},Ce=(x,M)=>Gi(x,Ji(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=vl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=O(!1),we=O(null),be=O(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(Y){var f,$;const yt=Y.target;(f=we.value)!=null&&f.contains(yt)||($=be.value)!=null&&$.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=ml(),ht=k(()=>w.showTooltips!==!1);function Ge(Y,f){ht.value&&_i(Y.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(Y){Ge(Y,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const pl=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Gt=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)>=((f=w.codeFontMax)!=null?f:100)});return(Y,f)=>(G(),oe(Fo,null,[w.showHeader?(G(),oe("div",Xi,[pt(Y.$slots,"header-left"),pt(Y.$slots,"header-right",{},()=>[b("div",Ki,[x.diffStats?(G(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",er,"-"+Me(x.diffStats.removed),1),b("span",tr,"+"+Me(x.diffStats.added),1)],8,Zi)):ye("",!0),w.showCopyButton?(G(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=$=>te("copy")),onMouseenter:f[1]||(f[1]=$=>gt($)),onFocus:f[2]||(f[2]=$=>gt($)),onMouseleave:Be,onBlur:Be},[x.copyText?(G(),oe("svg",or,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(G(),oe("svg",lr,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):ye("",!0),w.showCollapseButton?(G(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=$=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(G(),oe("svg",{style:It({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):ye("",!0),ie.value?(G(),oe("div",rr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Ro(r,["stop"]),onMouseenter:f[6]||(f[6]=$=>Ge($,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=$=>Ge($,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[qi('',1)])],40,ar),To(Wi,{name:"code-menu"},{default:Ut(()=>[ne.value?(G(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(G(),oe(Fo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:pl.value,onClick:f[8]||(f[8]=$=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ur),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=$=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,sr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Gt.value,onClick:f[10]||(f[10]=$=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):ye("",!0),w.showExpandButton?(G(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=$=>{E(),te("toggleExpand")})},[x.isExpanded?(G(),oe("svg",cr,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(G(),oe("svg",fr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(G(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=$=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),cl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(Y.$slots,"default")],2),[[fl,!!x.stream||!x.loading]]),cl(b("div",vr,[pt(Y.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[fl,!x.stream&&x.loading]]),b("span",mr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=zo(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=ml(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DOHUxrC7.js","assets/index-rMXX6Fbt.js","assets/index-qbGiRbdE.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as zo,M as vl,bl as Ci,af as dl,bY as Mi,cc as Bi,b$ as ml,aU as O,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Co,aD as Ho,bE as ae,az as Li,cd as hn,c8 as vt,aI as No,aL as G,s as bn,aw as It,au as mt,bk as V,ce as Mo,u as oe,I as To,A as Oi,bJ as Ut,aY as pt,bL as cl,v as b,t as ye,bB as fl,bb as Me,q as k,b7 as $i,cf as zi,cg as gn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as j,cl as Bo,cm as Di,cn as Ai,co as jt,cp as Eo,bO as Ro,T as ji,G as qi,F as Fo,g as Wi,c7 as _i,b_ as Ii}from"./index-rMXX6Fbt.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Po=!1,qt=null,Wt=null,_t=null;function Ui(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield xi(()=>import("./index-DOHUxrC7.js"),__vite__mapDeps([0,1,2]))),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Po?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Po=!0}).finally(()=>{qt=null}),qt)})})(Wt),Si(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Oo=(x,M,w)=>M in x?Vi(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,I=(x,M)=>{for(var w in M||(M={}))Yi.call(M,w)&&Oo(x,w,M[w]);if(Lo)for(var w of Lo(M))Qi.call(M,w)&&Oo(x,w,M[w]);return x},Ce=(x,M)=>Gi(x,Ji(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=vl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=O(!1),we=O(null),be=O(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(Y){var f,$;const yt=Y.target;(f=we.value)!=null&&f.contains(yt)||($=be.value)!=null&&$.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=ml(),ht=k(()=>w.showTooltips!==!1);function Ge(Y,f){ht.value&&_i(Y.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(Y){Ge(Y,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const pl=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Gt=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)>=((f=w.codeFontMax)!=null?f:100)});return(Y,f)=>(G(),oe(Fo,null,[w.showHeader?(G(),oe("div",Xi,[pt(Y.$slots,"header-left"),pt(Y.$slots,"header-right",{},()=>[b("div",Ki,[x.diffStats?(G(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",er,"-"+Me(x.diffStats.removed),1),b("span",tr,"+"+Me(x.diffStats.added),1)],8,Zi)):ye("",!0),w.showCopyButton?(G(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=$=>te("copy")),onMouseenter:f[1]||(f[1]=$=>gt($)),onFocus:f[2]||(f[2]=$=>gt($)),onMouseleave:Be,onBlur:Be},[x.copyText?(G(),oe("svg",or,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(G(),oe("svg",lr,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):ye("",!0),w.showCollapseButton?(G(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=$=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(G(),oe("svg",{style:It({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):ye("",!0),ie.value?(G(),oe("div",rr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Ro(r,["stop"]),onMouseenter:f[6]||(f[6]=$=>Ge($,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=$=>Ge($,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[qi('',1)])],40,ar),To(Wi,{name:"code-menu"},{default:Ut(()=>[ne.value?(G(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(G(),oe(Fo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:pl.value,onClick:f[8]||(f[8]=$=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ur),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=$=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,sr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Gt.value,onClick:f[10]||(f[10]=$=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):ye("",!0),w.showExpandButton?(G(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=$=>{E(),te("toggleExpand")})},[x.isExpanded?(G(),oe("svg",cr,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(G(),oe("svg",fr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(G(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=$=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),cl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(Y.$slots,"default")],2),[[fl,!!x.stream||!x.loading]]),cl(b("div",vr,[pt(Y.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[fl,!x.stream&&x.loading]]),b("span",mr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=zo(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=ml(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith(" diff --git a/apps/pythinker-code/dist-web/assets/DesignSystemView-Egp23i6M.js b/apps/pythinker-code/dist-web/assets/DesignSystemView-Dsz3gtgF.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/DesignSystemView-Egp23i6M.js rename to apps/pythinker-code/dist-web/assets/DesignSystemView-Dsz3gtgF.js index 89249f7bf..ac9175f98 100644 --- a/apps/pythinker-code/dist-web/assets/DesignSystemView-Egp23i6M.js +++ b/apps/pythinker-code/dist-web/assets/DesignSystemView-Dsz3gtgF.js @@ -1,4 +1,4 @@ -import{M as x,aD as k,aI as C,aL as t,u as f,v as d,G as s,H as e,F as b,aX as g,bb as m,I as v,cx as z,bk as T,cy as S,cz as r,cA as B}from"./index-C-zUV3mO.js";const q={class:"ds-page"},I={class:"layout"},A={class:"content"},M={class:"content-inner"},H={id:"tokens"},L={class:"icon-sizes"},V={class:"sz"},D={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},P={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},W={class:"sz"},R={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},N={class:"icon-grid"},O={class:"icon-group-label"},E={class:"ic-name"},j={id:"primitives"},F={class:"stage-wrap"},K={class:"stage p col"},_={class:"demo-row"},G={class:"p-btn primary disabled"},J={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},Q={class:"stage-wrap"},Y={class:"stage p col"},X={class:"demo-row",style:{"font-size":"22px","line-height":"1"}},Z={class:"demo-row"},$={class:"p-thinking"},aa={class:"p-thinking"},da={class:"stage-wrap"},ta={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},fa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},sa={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},ea={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},oa={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},ia={id:"chat"},la={class:"stage-wrap"},na={class:"stage p col",style:{"align-items":"center",background:"#fff"}},ca={class:"demo-chat"},va={class:"p-thinking"},ra={class:"p-action"},ba={class:"p-action-head"},pa={class:"p-ic",style:{color:"var(--p-accent)"},viewBox:"0 0 24 24",fill:"currentColor"},ha={class:"p-action warn"},ua={class:"p-action-head"},ga={class:"p-ic",style:{color:"var(--p-warning)"},viewBox:"0 0 24 24",fill:"currentColor"},ma=x({__name:"DesignSystemView",emits:["close"],setup(ya,{emit:y}){const w=y;function p(){w("close")}let c=null;function h(n){n.key==="Escape"&&p()}return k(()=>{document.addEventListener("keydown",h);const n=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;n.forEach(l=>{const o=l.getAttribute("href");if(!o)return;const u=document.getElementById(o.slice(1));u&&a.set(u,l)});let i=null;c=new IntersectionObserver(l=>{l.forEach(o=>{o.isIntersecting&&(i&&i.classList.remove("active"),i=a.get(o.target)??null,i&&i.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((l,o)=>c.observe(o)),n.length&&n[0].classList.add("active")}),C(()=>{document.removeEventListener("keydown",h),c&&(c.disconnect(),c=null)}),(n,a)=>(t(),f("div",q,[d("div",{class:"ds-topbar"},[d("button",{class:"ds-back",type:"button",onClick:p},"← Back"),a[0]||(a[0]=d("span",{class:"ds-topbar-title"},"Design system",-1))]),d("div",I,[a[46]||(a[46]=s('',1)),d("main",A,[d("div",M,[a[44]||(a[44]=s('
● Design System · v1.0

Pythinker Web Design System

This document defines the visual language and component specification for Pythinker Web — design tokens, component primitives, the chat interface, theming, and style rules. All UI work is grounded in it: unified, restrained, token-driven, and themeable.

Scope apps/pythinker-webComponent primitivesTheme 1 set · 4 customizable colorsLight / dark mode
i
This spec is the single reference when changing the web UI. Before adding or modifying a component, style, layout, or theme, read this document first; color, font, radius, spacing, shadow, z-index, and motion always use the §02 tokens, components reuse the §03 primitives, and the §06 style rules are followed.
01

Design Principles

Every UI decision traces back to the following principles. Pythinker Web is a local Agent tool for developers: quick scanning, long stretches of staring, often in the dark — the design serves the task, and is restrained, clinical, and density-first.

  • Consistency —— The same semantics use the same component. The primary button, dialog, input, and badge should each have exactly "one" correct way to be written across the entire site.
  • Hierarchy —— Build a clear hierarchy through size, weight, color, and whitespace; emphasize through "restraint" rather than "bolder and bigger".
  • Proximity —— Group related elements, leave whitespace between unrelated ones. A card's padding, line spacing, and group spacing all come from the same spacing scale.
  • Feedback —— hover / active / focus / loading / success / error all have visible states, and the state language is unified.
  • Breathing room —— Control density with the spacing scale rather than arbitrary pixels; prefer restrained whitespace over cramming controls together.
  • Accessibility (A11y) —— Text contrast ≥ 4.5:1, visible focus rings, touch targets ≥ 32px, and states that don't rely on color alone.
  • Reduction —— The number of colors, radii, shadow levels, and type sizes all converge to a finite set of tokens; delete stray values.
Brand tone (the do-not list): calm, clinical, never exaggerated. Reject purple gradients, glassmorphism, glowing shadows, AI purple / blue glows, endlessly looping fussy micro-animations, "Boost your productivity"-style marketing copy, and using emoji as icons. These are all common tells of AI-generated interfaces (an "AI tell"), deliberately avoided.
i
Declare design intent first (Design Read): before adding a component / page, write one sentence describing its scenario, audience, and tone (for example, "a lightweight tool card embedded in a conversation, for developers, calm and restrained"), then build. If the intent isn't clear, ask one question first rather than defaulting to the nearest existing style.
',2)),d("section",H,[a[7]||(a[7]=s(`
02

Design Tokens

Collapse every visual decision into tokens. Color tokens keep the existing short names and fill out the semantics (lowering migration cost), while spacing, z-index, motion, and font-weight fill in the scales that are currently missing. Every token has: name, light value, dark value, and usage.

i
Naming convention: --<category>-<role>-<state>. For example --color-text-muted, --radius-md, --space-4. To reduce churn, the existing short names (--bg / --ink / --line / --blue …) are kept as compatibility aliases for one release cycle.

Color

Semantic-first, in three layers: background / text / border + accent + status colors. All colors are defined in light / dark pairs, with contrast ≥ 4.5:1.

i
The table below shows the derived semantic tokens. The neutrals and the accent are derived from the 4 color seeds in §05 — for example --color-accent comes from --accent-primary, and --color-bg comes from the current light / dark surface. The semantic status colors (success / warning / danger / info) are independent palettes paired with the seeds, one set each for light / dark; they are not auto-derived from the seeds. Day-to-day reskinning usually only needs the 4 seeds, with the status colors fine-tuned as needed.
bg
#ffffff / #121212
surface
#fafbfc / #1f1f1f
surface-sunken
#f3f5f8 / #121212
selected
#eceff3 / #2d333b
fg
#14171c / #e8eaed
fg-muted
#6b7280 / #9aa0a8
line
#e7eaee / #2d333b
accent (KMBlue)
#1783ff / #58a6ff
accent-soft
#e8f3ff / rgba(88,166,255,.14)
TokenLightDarkUsage
--color-bg#ffffff#121212Page background
--color-surface#fafbfc#1f1f1fPanel / sidebar / card head
--color-surface-raised#ffffff#292929Raised card / dialog / input
--color-text#14171c#e8eaedBody text / headings
--color-text-muted#6b7280#9aa0a8Secondary text / placeholder
--color-line#e7eaee#2d333bDivider / card border
--color-selected#00000014#ffffff14Neutral selected fill (sidebar rows, list pickers) — translucent, never accent-tinted
--color-hover#0000000d#ffffff0dRow hover wash — lighter than the selected fill (hover < selected); translucent, sits on any surface
--color-media-alpha-bg-1≈#858585≈#676b72Checkerboard square A of the <img> alpha canvas — color-mix of --color-bg/--color-text (52/48); applied via --media-alpha-canvas (16px period)
--color-media-alpha-bg-2≈#6b6b6b≈#7a7e85Checkerboard square B (42/58) — both squares stay ≥3:1 against white and black; opaque images cover the canvas
--color-sidebar-bg#e9eaf2#2c343aSidebar solid composite (row masks / overlays). The visible sidebar surface is the frost pair --color-sidebar-glass + --sidebar-wash blurred by --p-sidebar-backdrop
--color-accent#1783ff#58a6ffPrimary action / link / focus
--color-success#0e7a38#3fb950Success / pass
--color-warning#a9610a#d29922Warning / pending
--color-danger#c0392b#f85149Danger / error / abort

Surface usage

The four surface layers each have a role — choose by "raised layer / default flat layer / sunken layer / page background", and avoid treating --p-surface-raised as a universal background.

TokenLightDarkUsage
--p-surface-raised#ffffff#292929Raised card / dialog / input (raised layer)
--p-surface#fafbfc#1f1f1fPanel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#121212Code block / inline input / recessed area (sunken layer)
--p-bg#ffffff#121212Page background

Focus ring

All focusable controls (button, input, link, menu item, switch, checkbox) use the focus-ring token uniformly; do not hand-write a box-shadow focus ring.

TokenValueUsage
--p-focus-ring0 0 0 3px var(--p-accent-soft)Default focus ring (link, menu item, switch, checkbox)
--p-focus-ring-strong0 0 0 3px var(--p-accent-soft), 0 0 0 1px var(--p-accent)Strong focus ring (button, primary action)

Text selection

The text-selection color uses --p-selection uniformly (light rgba(23,131,255,.18) / dark rgba(88,166,255,.32)), applied by the global ::selection rule; do not set a separate highlight background.

Disabled state

All disabled controls use opacity:.5 + cursor:not-allowed uniformly; do not separately grey out or recolor.

Font families

Pythinker Web uses two font families: --font-ui (UI and body, Inter first) and --font-mono (code and monospace). Components always reference the variables; do not hard-code font names.

--font-ui · UI & body (Inter first)

Body and UI use self-hosted Inter as the primary face. CJK and platform system UI fonts sit late in the fallback chain so Latin glyphs resolve to Inter while Chinese text can fall through to native CJK fonts:

--font-ui
--font-ui: "Inter Variable", "Inter", "Helvetica Neue", Arial,
+import{M as x,aD as k,aI as C,aL as t,u as f,v as d,G as s,H as e,F as b,aX as g,bb as m,I as v,cx as z,bk as T,cy as S,cz as r,cA as B}from"./index-rMXX6Fbt.js";const q={class:"ds-page"},I={class:"layout"},A={class:"content"},M={class:"content-inner"},H={id:"tokens"},L={class:"icon-sizes"},V={class:"sz"},D={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},P={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},W={class:"sz"},R={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},N={class:"icon-grid"},O={class:"icon-group-label"},E={class:"ic-name"},j={id:"primitives"},F={class:"stage-wrap"},K={class:"stage p col"},_={class:"demo-row"},G={class:"p-btn primary disabled"},J={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},Q={class:"stage-wrap"},Y={class:"stage p col"},X={class:"demo-row",style:{"font-size":"22px","line-height":"1"}},Z={class:"demo-row"},$={class:"p-thinking"},aa={class:"p-thinking"},da={class:"stage-wrap"},ta={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},fa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},sa={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},ea={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},oa={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},ia={id:"chat"},la={class:"stage-wrap"},na={class:"stage p col",style:{"align-items":"center",background:"#fff"}},ca={class:"demo-chat"},va={class:"p-thinking"},ra={class:"p-action"},ba={class:"p-action-head"},pa={class:"p-ic",style:{color:"var(--p-accent)"},viewBox:"0 0 24 24",fill:"currentColor"},ha={class:"p-action warn"},ua={class:"p-action-head"},ga={class:"p-ic",style:{color:"var(--p-warning)"},viewBox:"0 0 24 24",fill:"currentColor"},ma=x({__name:"DesignSystemView",emits:["close"],setup(ya,{emit:y}){const w=y;function p(){w("close")}let c=null;function h(n){n.key==="Escape"&&p()}return k(()=>{document.addEventListener("keydown",h);const n=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;n.forEach(l=>{const o=l.getAttribute("href");if(!o)return;const u=document.getElementById(o.slice(1));u&&a.set(u,l)});let i=null;c=new IntersectionObserver(l=>{l.forEach(o=>{o.isIntersecting&&(i&&i.classList.remove("active"),i=a.get(o.target)??null,i&&i.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((l,o)=>c.observe(o)),n.length&&n[0].classList.add("active")}),C(()=>{document.removeEventListener("keydown",h),c&&(c.disconnect(),c=null)}),(n,a)=>(t(),f("div",q,[d("div",{class:"ds-topbar"},[d("button",{class:"ds-back",type:"button",onClick:p},"← Back"),a[0]||(a[0]=d("span",{class:"ds-topbar-title"},"Design system",-1))]),d("div",I,[a[46]||(a[46]=s('',1)),d("main",A,[d("div",M,[a[44]||(a[44]=s('
● Design System · v1.0

Pythinker Web Design System

This document defines the visual language and component specification for Pythinker Web — design tokens, component primitives, the chat interface, theming, and style rules. All UI work is grounded in it: unified, restrained, token-driven, and themeable.

Scope apps/pythinker-webComponent primitivesTheme 1 set · 4 customizable colorsLight / dark mode
i
This spec is the single reference when changing the web UI. Before adding or modifying a component, style, layout, or theme, read this document first; color, font, radius, spacing, shadow, z-index, and motion always use the §02 tokens, components reuse the §03 primitives, and the §06 style rules are followed.
01

Design Principles

Every UI decision traces back to the following principles. Pythinker Web is a local Agent tool for developers: quick scanning, long stretches of staring, often in the dark — the design serves the task, and is restrained, clinical, and density-first.

  • Consistency —— The same semantics use the same component. The primary button, dialog, input, and badge should each have exactly "one" correct way to be written across the entire site.
  • Hierarchy —— Build a clear hierarchy through size, weight, color, and whitespace; emphasize through "restraint" rather than "bolder and bigger".
  • Proximity —— Group related elements, leave whitespace between unrelated ones. A card's padding, line spacing, and group spacing all come from the same spacing scale.
  • Feedback —— hover / active / focus / loading / success / error all have visible states, and the state language is unified.
  • Breathing room —— Control density with the spacing scale rather than arbitrary pixels; prefer restrained whitespace over cramming controls together.
  • Accessibility (A11y) —— Text contrast ≥ 4.5:1, visible focus rings, touch targets ≥ 32px, and states that don't rely on color alone.
  • Reduction —— The number of colors, radii, shadow levels, and type sizes all converge to a finite set of tokens; delete stray values.
Brand tone (the do-not list): calm, clinical, never exaggerated. Reject purple gradients, glassmorphism, glowing shadows, AI purple / blue glows, endlessly looping fussy micro-animations, "Boost your productivity"-style marketing copy, and using emoji as icons. These are all common tells of AI-generated interfaces (an "AI tell"), deliberately avoided.
i
Declare design intent first (Design Read): before adding a component / page, write one sentence describing its scenario, audience, and tone (for example, "a lightweight tool card embedded in a conversation, for developers, calm and restrained"), then build. If the intent isn't clear, ask one question first rather than defaulting to the nearest existing style.
',2)),d("section",H,[a[7]||(a[7]=s(`
02

Design Tokens

Collapse every visual decision into tokens. Color tokens keep the existing short names and fill out the semantics (lowering migration cost), while spacing, z-index, motion, and font-weight fill in the scales that are currently missing. Every token has: name, light value, dark value, and usage.

i
Naming convention: --<category>-<role>-<state>. For example --color-text-muted, --radius-md, --space-4. To reduce churn, the existing short names (--bg / --ink / --line / --blue …) are kept as compatibility aliases for one release cycle.

Color

Semantic-first, in three layers: background / text / border + accent + status colors. All colors are defined in light / dark pairs, with contrast ≥ 4.5:1.

i
The table below shows the derived semantic tokens. The neutrals and the accent are derived from the 4 color seeds in §05 — for example --color-accent comes from --accent-primary, and --color-bg comes from the current light / dark surface. The semantic status colors (success / warning / danger / info) are independent palettes paired with the seeds, one set each for light / dark; they are not auto-derived from the seeds. Day-to-day reskinning usually only needs the 4 seeds, with the status colors fine-tuned as needed.
bg
#ffffff / #121212
surface
#fafbfc / #1f1f1f
surface-sunken
#f3f5f8 / #121212
selected
#eceff3 / #2d333b
fg
#14171c / #e8eaed
fg-muted
#6b7280 / #9aa0a8
line
#e7eaee / #2d333b
accent (KMBlue)
#1783ff / #58a6ff
accent-soft
#e8f3ff / rgba(88,166,255,.14)
TokenLightDarkUsage
--color-bg#ffffff#121212Page background
--color-surface#fafbfc#1f1f1fPanel / sidebar / card head
--color-surface-raised#ffffff#292929Raised card / dialog / input
--color-text#14171c#e8eaedBody text / headings
--color-text-muted#6b7280#9aa0a8Secondary text / placeholder
--color-line#e7eaee#2d333bDivider / card border
--color-selected#00000014#ffffff14Neutral selected fill (sidebar rows, list pickers) — translucent, never accent-tinted
--color-hover#0000000d#ffffff0dRow hover wash — lighter than the selected fill (hover < selected); translucent, sits on any surface
--color-media-alpha-bg-1≈#858585≈#676b72Checkerboard square A of the <img> alpha canvas — color-mix of --color-bg/--color-text (52/48); applied via --media-alpha-canvas (16px period)
--color-media-alpha-bg-2≈#6b6b6b≈#7a7e85Checkerboard square B (42/58) — both squares stay ≥3:1 against white and black; opaque images cover the canvas
--color-sidebar-bg#e9eaf2#2c343aSidebar solid composite (row masks / overlays). The visible sidebar surface is the frost pair --color-sidebar-glass + --sidebar-wash blurred by --p-sidebar-backdrop
--color-accent#1783ff#58a6ffPrimary action / link / focus
--color-success#0e7a38#3fb950Success / pass
--color-warning#a9610a#d29922Warning / pending
--color-danger#c0392b#f85149Danger / error / abort

Surface usage

The four surface layers each have a role — choose by "raised layer / default flat layer / sunken layer / page background", and avoid treating --p-surface-raised as a universal background.

TokenLightDarkUsage
--p-surface-raised#ffffff#292929Raised card / dialog / input (raised layer)
--p-surface#fafbfc#1f1f1fPanel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#121212Code block / inline input / recessed area (sunken layer)
--p-bg#ffffff#121212Page background

Focus ring

All focusable controls (button, input, link, menu item, switch, checkbox) use the focus-ring token uniformly; do not hand-write a box-shadow focus ring.

TokenValueUsage
--p-focus-ring0 0 0 3px var(--p-accent-soft)Default focus ring (link, menu item, switch, checkbox)
--p-focus-ring-strong0 0 0 3px var(--p-accent-soft), 0 0 0 1px var(--p-accent)Strong focus ring (button, primary action)

Text selection

The text-selection color uses --p-selection uniformly (light rgba(23,131,255,.18) / dark rgba(88,166,255,.32)), applied by the global ::selection rule; do not set a separate highlight background.

Disabled state

All disabled controls use opacity:.5 + cursor:not-allowed uniformly; do not separately grey out or recolor.

Font families

Pythinker Web uses two font families: --font-ui (UI and body, Inter first) and --font-mono (code and monospace). Components always reference the variables; do not hard-code font names.

--font-ui · UI & body (Inter first)

Body and UI use self-hosted Inter as the primary face. CJK and platform system UI fonts sit late in the fallback chain so Latin glyphs resolve to Inter while Chinese text can fall through to native CJK fonts:

--font-ui
--font-ui: "Inter Variable", "Inter", "Helvetica Neue", Arial,
       "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
       -apple-system, BlinkMacSystemFont, "Segoe UI",
       Roboto, Ubuntu, sans-serif,
diff --git a/apps/pythinker-code/dist-web/assets/Tooltip-B67PeCrl.js b/apps/pythinker-code/dist-web/assets/Tooltip-dS-vJocY.js
similarity index 98%
rename from apps/pythinker-code/dist-web/assets/Tooltip-B67PeCrl.js
rename to apps/pythinker-code/dist-web/assets/Tooltip-dS-vJocY.js
index 4b20eebdb..00af6b1d6 100644
--- a/apps/pythinker-code/dist-web/assets/Tooltip-B67PeCrl.js
+++ b/apps/pythinker-code/dist-web/assets/Tooltip-dS-vJocY.js
@@ -1 +1 @@
-import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-C-zUV3mO.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
+import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-rMXX6Fbt.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
diff --git a/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DeEmmaFj.js b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DeEmmaFj.js
new file mode 100644
index 000000000..81b3d1da2
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DeEmmaFj.js
@@ -0,0 +1 @@
+import{g as p,r as u,d as a}from"./chunk-SVP7TREG-B7jXwGMz.js";import{p as f}from"./chunk-JWPE2WC7-CM6UswKM.js";import{_ as n,l as o}from"./mermaid.core-CM2luXFy.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-xwFTI9aD.js b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-xwFTI9aD.js
new file mode 100644
index 000000000..704900b2a
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-xwFTI9aD.js
@@ -0,0 +1 @@
+import{g as p,r as u,d as a}from"./chunk-SVP7TREG-Ch8YtWzR.js";import{p as f}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{_ as n,l as o}from"./mermaidParser.worker-DimdFOud.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-CZChzy6K.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/arc-BpETntJr.js b/apps/pythinker-code/dist-web/assets/arc-BpETntJr.js
new file mode 100644
index 000000000..ac6202432
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/arc-BpETntJr.js
@@ -0,0 +1 @@
+import{H as ln,I as un,J as y,K as tn,L as Q,M as I,N as _,O as an,P as rn,Q as j,R as o,S as K,T as sn,V as on,W as fn}from"./mermaid.core-CM2luXFy.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,L,u){var D=q-l,i=O-h,n=L-v,d=u-R,a=d*D-n*i;if(!(a*ar*r+N*N&&(H=w,J=p),{cx:H,cy:J,x01:-n,y01:-d,x11:H*(v/T-1),y11:J*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),O=null,v=gn,R=dn,L=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,M=an(c-f),t=c>f;if(u||(u=n=D()),sy))u.moveTo(0,0);else if(M>tn-y)u.moveTo(s*Q(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*Q(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=M,E=M,H=L.apply(this,arguments)/2,J=H>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(an(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(J>y){var N=sn(J/a*I(H)),z=sn(J/s*I(H));(P-=N*2)>y?(N*=t?1:-1,A+=N,T-=N):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var V=s*Q(m),W=s*I(m),B=a*Q(T),C=a*I(T);if(w>y){var F=s*Q(g),G=s*I(g),X=a*Q(A),Y=a*I(A),S;if(My?x>y?(e=U(X,Y,V,W,s,x,t),r=U(F,G,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?u.lineTo(B,C):p>y?(e=U(B,C,F,G,a,-p,t),r=U(V,W,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),sy))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(Fy?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),sy))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(Fy?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+X*X&&(M=w,N=p),{cx:M,cy:N,x01:-n,y01:-d,x11:M*(v/T-1),y11:N*(v/T-1)}}function hn(){var l=cn,h=yn,D=Q(0),S=null,v=gn,R=dn,V=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,W=rn(c-f),t=c>f;if(a||(a=n=E()),sy))a.moveTo(0,0);else if(W>tn-y)a.moveTo(s*Y(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*Y(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=W,I=W,M=V.apply(this,arguments)/2,N=M>y&&(S?+S.apply(this,arguments):j(u*u+s*s)),w=_(rn(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(N>y){var X=sn(N/u*O(M)),z=sn(N/s*O(M));(P-=X*2)>y?(X*=t?1:-1,A+=X,T-=X):(P=0,A=T=(f+c)/2),(I-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(I=0,m=g=(f+c)/2)}var Z=s*Y(m),$=s*O(m),B=u*Y(T),C=u*O(T);if(w>y){var F=s*Y(g),G=s*O(g),J=u*Y(A),K=u*O(A),q;if(Wy?x>y?(e=H(J,K,Z,$,s,x,t),r=H(F,G,B,C,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(B,C):p>y?(e=H(B,C,F,G,u,-p,t),r=H(Z,$,J,K,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=r}),(function(w,U,L){var u=L(0);function h(){}for(var a in u)h[a]=u[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=h}),(function(w,U,L){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(0),e=L(7),i=L(3),f=L(1),r=L(13),v=L(12),t=L(11);function s(c,l,T){u.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(u.prototype);for(var o in u)s[o]=u[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,N=0;N-1&&S>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(S,1);var b=g.source.owner.getEdges().indexOf(g);if(b==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,N=this.getNodes(),b=N.length,A=0;AT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?d=N[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new v(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,N,b,A,S,V,X=this.nodes,Z=X.length,D=0;DN&&(l=N),TA&&(g=A),dN&&(l=N),TA&&(g=A),d=this.nodes.length){var Z=0;T.forEach(function(D){D.owner==c&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,U,L){var u,h=L(1);function a(e){u=L(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,v){if(f==null&&r==null&&v==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{v=f,r=i,f=e;var t=r.getOwner(),s=v.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,v);if(f.isInterGraph=!0,f.source=r,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof u){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,v=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var v=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(v=1);var t=v*i[0],s=i[1]/v;i[0]t)return i[0]=f,i[1]=o,i[2]=v,i[3]=X,!1;if(rv)return i[0]=s,i[1]=r,i[2]=S,i[3]=t,!1;if(fv?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>v?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-E===y?v>f?(i[2]=V,i[3]=X,m=!0):(i[2]=S,i[3]=A,m=!0):E===y&&(v>f?(i[2]=b,i[3]=A,m=!0):(i[2]=Z,i[3]=X,m=!0)),n&&m)return!1;if(f>v?r>t?(I=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,R=f+-N/y,i[0]=R,i[1]=W;break;case 2:R=g,W=r+d*y,i[0]=R,i[1]=W;break;case 3:W=T,R=f+N/y,i[0]=R,i[1]=W;break;case 4:R=l,W=r+-d*y,i[0]=R,i[1]=W;break}if(!m)switch(M){case 1:Q=A,x=v+-_/y,i[2]=x,i[3]=Q;break;case 2:x=Z,Q=t+D*y,i[2]=x,i[3]=Q;break;case 3:Q=X,x=v+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-D*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,v=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,N=void 0,b=void 0,A=void 0,S=void 0,V=void 0,X=void 0,Z=void 0;return N=s-v,A=r-t,V=t*v-r*s,b=T-c,S=o-l,X=l*c-o*T,Z=N*S-b*A,Z===0?null:(g=(A*X-S*V)/Z,d=(b*V-N*X)/Z,new u(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,w.exports=h}),(function(w,U,L){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},w.exports=u}),(function(w,U,L){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,w.exports=u}),(function(w,U,L){var u=(function(){function r(v,t){for(var s=0;s"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},w.exports=h}),(function(w,U,L){function u(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(N.push(A[0]);N.length>0&&c;){var S=N[0];N.splice(0,1),d.add(S);for(var V=S.getEdges(),g=0;g-1&&A.splice(_,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(X,1);var Z=b.getNeighborsList();Z.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&S.push(n),T.set(n,p)}})}l=l.concat(S),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,U,L){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},w.exports=u}),(function(w,U,L){var u=L(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},w.exports=h}),(function(w,U,L){function u(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oN||d>N)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>N||d>N)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||N>=g[0].length)){for(var b=0;br}}]),i})();w.exports=e}),(function(w,U,L){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,r=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=J;gt--){var mt=u.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==J&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},w.exports=u}),(function(w,U,L){var u=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=v,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var U={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var v in f)r[v]=f[v];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),v=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,N=i(551).DimensionD,b=i(551).Layout,A=i(551).Integer,S=i(551).IGeometry,V=i(551).LGraph,X=i(551).Transform,Z=i(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var _ in f)D[_]=f[_];D.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new v(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var M=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),B=O[tt],O[tt]=O[H],O[H]=B;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:B,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:H,gap:O.gap})}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;Q.has(H)?Q.get(H).push(B):Q.set(H,[B]),Q.has(B)?Q.get(B).push(H):Q.set(B,[H])}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var Y=function(H,B){var tt=[],ht=[],J=new Z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var gt=it;for(J.push(gt),It.add(gt),tt[Nt].push(gt);J.length!=0;){gt=J.shift(),B.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(J.push(At),It.add(At),tt[Nt].push(At))})}Nt++}}),{components:tt,isFixed:ht}},rt=Y(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=Y(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=n.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;RE&&(E=Math.floor(M.y)),I=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=V.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var M=0;M1;){var B=H[0];H.splice(0,1);var tt=z.indexOf(B);tt>=0&&z.splice(tt,1),$--,Y--}m!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(E-p)/Y,J=O;rt!=Y;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=m){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;pm&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var Q=m[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var Y=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,M)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,M=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,M,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;EQ&&(Q=Y.rect.height)}p+=Q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,M=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),M;return IR&&(R=$.getWidth())});var W=I/y,x=M/y,Q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,z=(E-p+Math.sqrt(Q))/(2*(W+E)),Y;m?(Y=Math.ceil(z),Y==z&&Y++):Y=Math.floor(z);var rt=Y*(W+E)-E;return R>rt&&(rt=R),rt+=E*2,rt},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function($,O){var H=W;return M.idealRowWidth?(H=I,H($.id,O.id)):H($,O)});for(var x=0,Q=0,z=0;z0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var M=n.rowWidth[I];if(M+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+R)/(M+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,R=0;RM&&(M=E[R].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)Y[0]+=this.grid[rt][M-1].length+this.grid[rt][M].length-1;if(I0)for(var rt=M;rt<=R;rt++)Y[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=A.MAX_VALUE,O,H,B=0;B{var f=i(551).FDLayoutNode,r=i(551).IMath;function v(s,o,c,l){f.call(this,s,o,c,l)}v.prototype=Object.create(f.prototype);for(var t in f)v[t]=f[t];v.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?N[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?N[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(P){var k=0,K=0,q=0,at=0;if(P.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?k++:K++:N[g.get(j.top)]-N[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,P){E[P]=[F.position.x,F.position.y],y[P]=[d[g.get(F.nodeId)],N[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var P=l.alignmentConstraint.vertical,k=function(et){var j=new Set;P[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).x,P[et].forEach(function(pt){E[F]=[wt,N[g.get(pt)]],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},K=0;K0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).y,q[et].forEach(function(pt){E[F]=[d[g.get(pt)],wt],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,Y=rt);if(z0){var Et={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,P){var k={x:d[g.get(F.nodeId)],y:N[g.get(F.nodeId)]},K=F.position,q=X(K,k);Et.x+=q.x,Et.y+=q.y}),Et.x/=l.fixedNodeConstraint.length,Et.y/=l.fixedNodeConstraint.length,d.forEach(function(F,P){d[P]+=Et.x}),N.forEach(function(F,P){N[P]+=Et.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,N[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(P){var k=new Set;Dt[P].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=Z(k).x,k.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=N[g.get(K.values().next().value)]:q=Z(k).y,k.forEach(function(at){R.has(at)||(N[g.get(at)]=q)})},Ft=0;Ft{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,G){(function(U,L){C.exports=L(dr())})(vr,function(w){return(()=>{var U={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),N;!(l=(N=d.next()).done)&&(c.push(N.value),!(o&&c.length===o));l=!0);}catch(b){T=!0,g=b}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var M=0;M1){N=g[0],b=N.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),X},v.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,N=!1,b=void 0;try{for(var A=s.nodeIndexes[Symbol.iterator](),S;!(d=(S=A.next()).done);d=!0){var V=S.value,X=f(V,2),Z=X[0],D=X[1],_=o.cy.getElementById(Z);if(_){var n=_.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;ml&&(l=p),Eg&&(g=y)}}}catch(x){N=!0,b=x}finally{try{!d&&A.return&&A.return()}finally{if(N)throw b}}var I=t.x-(l+c)/2,M=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+M})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,Y=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=Y),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},v.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,N=void 0,b=void 0,A=void 0,S=void 0,V=t.descendants().not(":parent"),X=V.length,Z=0;ZN&&(l=N),TA&&(g=A),d{var f=i(548),r=i(140).CoSELayout,v=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,N){var b=d.cy,A=d.eles,S=A.nodes(),V=A.edges(),X=void 0,Z=void 0,D=void 0,_={};d.randomize&&(X=N.nodeIndexes,Z=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(b,A),E=function W(x,Q,z,Y){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),B),W(J,H,z,Y)}}},y=function(x,Q,z){for(var Y=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var M=new r,R=M.newGraphManager();return E(R.addRoot(),f.getTopMostNodes(S),M,d),y(M,R,V),I(M,d),M.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(N,b){for(var A=0;A0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(S,A.eles,I),D.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,X.push(o(A))}),A.quality=="default"||A.quality=="proof"){var M=S.collection();if(A.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(z.nodeIndexes.set(vt.nodes()[mt].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),M.length>1){var rt=M.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),D.push(M),X.push(z);for(var $=Y.length-1;$>=0;$--)D.splice(Y[$],1),X.splice(Y[$],1),_.splice(Y[$],1)}}D.forEach(function(vt,it){A.eles=vt,Z.push(l(A,X[it])),t.relocateComponent(_[it],Z[it],A)})}else D.forEach(function(vt,it){t.relocateComponent(_[it],X[it],A)});var O=new Set;if(D.length>1){var H=[],B=V.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(A.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else Z[it][Ot.id()]&&mt.nodes.push({x:Z[it][Ot.id()].getLeft(),y:Z[it][Ot.id()].getTop(),width:Z[it][Ot.id()].getWidth(),height:Z[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else Z[it][Et.id()]&&Z[it][Dt.id()]&&mt.edges.push({startX:Z[it][Et.id()].getCenterX(),startY:Z[it][Et.id()].getCenterY(),endX:Z[it][Dt.id()].getCenterX(),endY:Z[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var tt=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+tt[it].dx}),mt=vt.yCoords.map(function(At){return At+tt[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(Z[vt]).forEach(function(it){var gt=Z[vt][it];gt.setCenter(gt.getCenterX()+tt[ht].dx,gt.getCenterY()+tt[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(_.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=o(A);X.push(y)}A.quality=="default"||A.quality=="proof"?(Z.push(l(A,X[0])),t.relocateComponent(_[0],Z[0],A)):t.relocateComponent(_[0],X[0],A)}var J=function(it,gt){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return Z.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(S,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});A.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,A,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,v=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,N=new Map,b=new Map,A=[],S=[],V=[],X=[],Z=[],D=[],_=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,M=o.nodeSeparation,R=void 0,W=function(){for(var P=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=A[nt],lt=0;ltut&&(ut=Z[Lt],wt=Lt)}return wt},Q=function(P){var k=void 0;if(P){k=Math.floor(Math.random()*m);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(k.isParent()?A[P].push(b.get(k.id())):A[P].push(k.id()))})});var Nt=function(P){var k=N.get(P),K=void 0;d.get(P).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,A[k].push(K),A[N.get(K)].push(P)})},vt=!0,it=!1,gt=void 0;try{for(var mt=d.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){it=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){R=m{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(579);return h})()})})(se)),se.exports}var yr=pr(),Er=Be(yr),De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,G)=>C-G+2,"L"),R:dt((C,G)=>C-2,"R"),T:dt((C,G)=>C-G+2,"T"),B:dt((C,G)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),Wt=dt(function(C){const G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),me=dt(function(C,G){const w=Wt(C)&&qt(G),U=qt(C)&&Wt(G);return w||U},"isArchitectureDirectionXY"),Tr=dt(function(C){const G=C[0],w=C[1],U=Wt(G)&&qt(w),L=qt(G)&&Wt(w);return U||L},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,G){const w=`${C}${G}`;return Nr(w)?w:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,G],w){const U=w[0],L=w[1];return Wt(U)?qt(L)?[C+(U==="L"?-1:1),G+(L==="T"?1:-1)]:[C+(U==="L"?-1:1),G]:Wt(L)?[C+(L==="L"?1:-1),G+(U==="T"?1:-1)]:[C,G+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,G){return me(C,G)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(C){return C.type==="service"},"isArchitectureService"),Mr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=ir.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qe,this.getAccTitle=Qe,this.setDiagramTitle=Je,this.getDiagramTitle=Ke,this.getAccDescription=je,this.setAccDescription=_e,this.clear()}static{dt(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",tr()}addService({id:C,icon:G,in:w,title:U,iconText:L}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[w]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:G,iconText:L,title:U,edges:[],in:w}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:C,in:G}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[G]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:G}}getJunctions(){return Object.values(this.nodes).filter(Mr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:G,in:w,title:U}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[w]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[w]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:G,title:U,in:w}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:G,lhsDir:w,rhsDir:U,lhsInto:L,rhsInto:u,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(w))throw new Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(w)}`);if(!Ie(U))throw new Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[G]===void 0&&this.groups[G]===void 0)throw new Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes[C].in,f=this.nodes[G].in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:C,lhsDir:w,lhsInto:L,lhsGroup:h,rhsId:G,rhsDir:U,rhsInto:u,rhsGroup:a,title:e};this.edges.push(r),this.nodes[C]&&this.nodes[G]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[G].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},G=Object.entries(this.nodes).reduce((a,[e,i])=>(a[e]=i.edges.reduce((f,r)=>{const v=this.getNode(r.lhsId)?.in,t=this.getNode(r.rhsId)?.in;if(v&&t&&v!==t){const s=Ar(r.lhsDir,r.rhsDir);s!=="bend"&&(C[v]??={},C[v][t]=s,C[t]??={},C[t][v]=s)}if(r.lhsId===e){const s=pe(r.lhsDir,r.rhsDir);s&&(f[s]=r.rhsId)}else{const s=pe(r.rhsDir,r.lhsDir);s&&(f[s]=r.lhsId)}return f},{}),a),{}),w=Object.keys(G)[0],U={[w]:1},L=Object.keys(G).reduce((a,e)=>e===w?a:{...a,[e]:1},{}),u=dt(a=>{const e={[a]:[0,0]},i=[a];for(;i.length>0;){const f=i.shift();if(f){U[f]=1,delete L[f];const r=G[f],[v,t]=e[f];Object.entries(r).forEach(([s,o])=>{U[o]||(e[o]=Lr([v,t],s),i.push(o))})}}return e},"BFS"),h=[u(w)];for(;Object.keys(L).length>0;)h.push(u(Object.keys(L)[0]));this.dataStructures={adjList:G,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements[C]=G}getElementById(C){return this.elements[C]}getConfig(){return er({...Or,...rr().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,G)=>{lr(C,G),C.groups.map(w=>G.addGroup(w)),C.services.map(w=>G.addService({...w,type:"service"})),C.junctions.map(w=>G.addJunction({...w,type:"junction"})),C.edges.map(w=>G.addEdge(w))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const G=await fr("architecture",C);Re.debug(G);const w=Pe.parser?.yy;if(!(w instanceof be))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(G,w)},"parse")},xr=dt(C=>`
-  .edge {
-    stroke-width: ${C.archEdgeWidth};
-    stroke: ${C.archEdgeColor};
-    fill: none;
-  }
-
-  .arrow {
-    fill: ${C.archEdgeArrowColor};
-  }
-
-  .node-bkg {
-    fill: none;
-    stroke: ${C.archGroupBorderColor};
-    stroke-width: ${C.archGroupBorderWidth};
-    stroke-dasharray: 8;
-  }
-  .node-icon-text {
-    display: flex; 
-    align-items: center;
-  }
-  
-  .node-icon-text > div {
-    color: #fff;
-    margin: 1px;
-    height: fit-content;
-    text-align: center;
-    overflow: hidden;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-  }
-`,"getStyles"),Ir=xr,re=dt(C=>`${C}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:hr,blank:{body:re("")}}},Rr=dt(async function(C,G,w,U){const L=w.getConfigField("padding"),u=w.getConfigField("iconSize"),h=u/2,a=u/6,e=a/2;await Promise.all(G.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:v,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Fe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:N,y:b}=i[0].midpoint();let{x:A,y:S}=i[0].targetEndpoint();const V=L+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?A+=o==="L"?-V:V:S+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&w.getNode(s)?.type==="junction"&&(Wt(o)?A+=o==="L"?h:-h:S+=o==="T"?h:-h),i[0]._private.rscratch){const X=C.insert("g");if(X.insert("path").attr("d",`M ${g},${d} L ${N},${b} L${A},${S} `).attr("class","edge").attr("id",`${U}-${or(f,s,{prefix:"L"})}`),v){const Z=Wt(r)?oe[r](g,a):g-e,D=qt(r)?oe[r](d,a):d-e;X.insert("polygon").attr("points",xe[r](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(c){const Z=Wt(o)?oe[o](A,a):A-e,D=qt(o)?oe[o](S,a):S-e;X.insert("polygon").attr("points",xe[o](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(T){const Z=me(r,o)?"XY":Wt(r)?"X":"Y";let D=0;Z==="X"?D=Math.abs(g-A):Z==="Y"?D=Math.abs(d-S)/1.5:D=Math.abs(g-A)/2;const _=X.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},ye()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Z==="X")_.attr("transform","translate("+N+", "+b+")");else if(Z==="Y")_.attr("transform","translate("+N+", "+b+") rotate(-90)");else if(Z==="XY"){const n=pe(r,o);if(n&&Tr(n)){const m=_.node().getBoundingClientRect(),[p,E]=Cr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*E*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
-                translate(${N}, ${b-m.height/2})
-                translate(${p*y.width/2}, ${E*y.height/2})
-                rotate(${-1*p*E*45}, 0, ${m.height/2})
-              `)}}}}}))},"drawEdges"),Sr=dt(async function(C,G,w,U){const u=w.getConfigField("padding")*.75,h=w.getConfigField("fontSize"),e=w.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:v,x1:t,y1:s}=i.boundingBox(),o=C.append("rect");o.attr("id",`${U}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",v).attr("height",r).attr("class","node-bkg");const c=C.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:u,width:u,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=u,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ye()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Fr=dt(async function(C,G,w,U){const L=ye();for(const u of w){const h=G.append("g"),a=C.getConfigField("iconSize");if(u.title){const r=h.append("g");await Ee(r,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(u.icon)e.html(`${await ve(u.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(u.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ar(u.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${U}-node-${u.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${U}-service-${u.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();u.width=i,u.height=f,C.setElementForId(u.id,h)}return 0},"drawServices"),br=dt(function(C,G,w,U){w.forEach(L=>{const u=G.append("g"),h=C.getConfigField("iconSize");u.append("g").append("rect").attr("id",`${U}-node-${L.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),u.attr("class","architecture-junction");const{width:e,height:i}=u._groups[0][0].getBBox();u.width=e,u.height=i,C.setElementForId(L.id,u)})},"drawJunctions");sr([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,G){G.nodes().map(w=>{const U=ie(w);if(U.type==="group")return;U.x=w.position().x,U.y=w.position().y,C.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,G){C.forEach(w=>{G.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,G){C.forEach(w=>{const{lhsId:U,rhsId:L,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=w,v=me(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${U}-${L}`,label:r,source:U,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:t,classes:v})})}dt(He,"addEdges");function We(C,G,w){const U=dt((a,e)=>Object.entries(a).reduce((i,[f,r])=>{let v=0;const t=Object.entries(r);if(t.length===1)return i[f]=t[0][1],i;for(let s=0;s{const e={},i={};return Object.entries(a).forEach(([f,[r,v]])=>{const t=C.getNode(f)?.in??"default";e[v]??={},e[v][t]??=[],e[v][t].push(f),i[r]??={},i[r][t]??=[],i[r][t].push(f)}),{horiz:Object.values(U(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(U(i,"vertical")).filter(f=>f.length>1)}}),[u,h]=L.reduce(([a,e],{horiz:i,vert:f})=>[[...a,...i],[...e,...f]],[[],[]]);return{horizontal:u,vertical:h}}dt(We,"getAlignments");function Ve(C,G){const w=[],U=dt(u=>`${u[0]},${u[1]}`,"posToStr"),L=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([f,r])=>[U(r),f])),a=[U([0,0])],e={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const r=h[f];if(r){const v=L(f);Object.entries(i).forEach(([t,s])=>{const o=U([v[0]+s[0],v[1]+s[1]]),c=h[o];c&&!e[o]&&(a.push(o),w.push({[De[t]]:c,[De[mr(t)]]:r,gap:1.5*G.getConfigField("iconSize")}))})}}}}),w}dt(Ve,"getRelativeConstraints");function ze(C,G,w,U,L,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=nr("body").append("div").attr("id","cy").attr("style","display:none"),i=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(w,i),Ge(C,i,L),Ue(G,i,L),He(U,i);const f=We(L,u,h),r=Ve(u,L),v=L.getConfigField("iconSize"),t=L.getConfigField("idealEdgeLengthMultiplier")*v,s=.5*v,o=L.getConfigField("edgeElasticity"),c=i.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),nodeSeparation:L.getConfigField("nodeSeparation"),numIter:L.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?t:s},edgeElasticity(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?o:.001},alignmentConstraint:f,relativePlacementConstraint:r});c.one("layoutstop",()=>{function l(T,g,d,N){let b,A;const{x:S,y:V}=T,{x:X,y:Z}=g;A=(N-V+(S-d)*(V-Z)/(S-X))/Math.sqrt(1+Math.pow((V-Z)/(S-X),2)),b=Math.sqrt(Math.pow(N-V,2)+Math.pow(d-S,2)-Math.pow(A,2));const D=Math.sqrt(Math.pow(X-S,2)+Math.pow(Z-V,2));b=b/D;let _=(X-S)*(N-V)-(Z-V)*(d-S);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let n=(X-S)*(d-S)+(Z-V)*(N-V);switch(!0){case n>=0:n=1;break;case n<0:n=-1;break}return A=Math.abs(A)*_,b=b*n,{distances:A,weights:b}}dt(l,"getSegmentWeights"),i.startBatch();for(const T of Object.values(i.edges()))if(T.data?.()){const{x:g,y:d}=T.source().position(),{x:N,y:b}=T.target().position();if(g!==N&&d!==b){const A=T.sourceEndpoint(),S=T.targetEndpoint(),{sourceDir:V}=Fe(T),[X,Z]=qt(V)?[A.x,S.y]:[S.x,A.y],{weights:D,distances:_}=l(A,S,X,Z);T.style("segment-distances",_),T.style("segment-weights",D)}}i.endBatch(),c.run()}),c.run(),i.ready(l=>{Re.info("Ready",l),a(i)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,G,w,U)=>{const L=U.db;L.setDiagramId(G);const u=L.getServices(),h=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),i=L.getDataStructures(),f=ke(G),r=f.append("g");r.attr("class","architecture-edges");const v=f.append("g");v.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Fr(L,v,u,G),br(L,v,h,G);const s=await ze(u,h,a,e,L,i);await Rr(r,s,L,G),await Sr(t,s,L,G),Ye(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},Wr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{Wr as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/architectureDiagram-3BPJPVTR-D0usObfC.js b/apps/pythinker-code/dist-web/assets/architectureDiagram-3BPJPVTR-D0usObfC.js
deleted file mode 100644
index a076ee2d8..000000000
--- a/apps/pythinker-code/dist-web/assets/architectureDiagram-3BPJPVTR-D0usObfC.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import{b4 as Be,_ as dt,L as ke,af as Ze,l as Re,b as qe,a as Qe,q as Je,t as Ke,g as je,s as _e,A as tr,H as er,F as rr,I as ir,c as ye,aO as Ee,b5 as ve,i as ar,d as nr,y as or,b6 as sr,b7 as hr}from"./mermaid.core-Bt2TZ_t_.js";import{p as lr}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{p as fr}from"./wardley-L42UT6IY-7UoWEQ2c.js";import{c as Se}from"./cytoscape.esm-nFXppDBa.js";import"./index-C-zUV3mO.js";var se={exports:{}},he={exports:{}},le={exports:{}},cr=le.exports,we;function gr(){return we||(we=1,(function(C,G){(function(U,L){C.exports=L()})(cr,function(){return(function(w){var U={};function L(u){if(U[u])return U[u].exports;var h=U[u]={i:u,l:!1,exports:{}};return w[u].call(h.exports,h,h.exports,L),h.l=!0,h.exports}return L.m=w,L.c=U,L.i=function(u){return u},L.d=function(u,h,a){L.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:a})},L.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return L.d(h,"a",h),h},L.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},L.p="",L(L.s=28)})([(function(w,U,L){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,w.exports=u}),(function(w,U,L){var u=L(2),h=L(8),a=L(9);function e(f,r,v){u.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(u.prototype);for(var i in u)e[i]=u[i];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,r){for(var v=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(v.getOwner()==r)return v;if(v.getOwner()==t)break;v=v.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=e}),(function(w,U,L){function u(h){this.vGraphObject=h}w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(13),e=L(0),i=L(16),f=L(5);function r(t,s,o,c){o==null&&c==null&&(c=s),u.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}r.prototype=Object.create(u.prototype);for(var v in u)r[v]=u[v];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=r}),(function(w,U,L){var u=L(0);function h(){}for(var a in u)h[a]=u[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=h}),(function(w,U,L){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},w.exports=u}),(function(w,U,L){var u=L(2),h=L(10),a=L(0),e=L(7),i=L(3),f=L(1),r=L(13),v=L(12),t=L(11);function s(c,l,T){u.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(u.prototype);for(var o in u)s[o]=u[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,N=0;N-1&&S>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(A,1),g.target!=g.source&&g.target.edges.splice(S,1);var b=g.source.owner.getEdges().indexOf(g);if(b==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,N=this.getNodes(),b=N.length,A=0;AT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?d=N[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new v(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,N,b,A,S,V,X=this.nodes,Z=X.length,D=0;DN&&(l=N),TA&&(g=A),dN&&(l=N),TA&&(g=A),d=this.nodes.length){var Z=0;T.forEach(function(D){D.owner==c&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,U,L){var u,h=L(1);function a(e){u=L(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,v){if(f==null&&r==null&&v==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{v=f,r=i,f=e;var t=r.getOwner(),s=v.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,v);if(f.isInterGraph=!0,f.source=r,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof u){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,v=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var v=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(v=1);var t=v*i[0],s=i[1]/v;i[0]t)return i[0]=f,i[1]=o,i[2]=v,i[3]=X,!1;if(rv)return i[0]=s,i[1]=r,i[2]=S,i[3]=t,!1;if(fv?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>v?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-E===y?v>f?(i[2]=V,i[3]=X,m=!0):(i[2]=S,i[3]=A,m=!0):E===y&&(v>f?(i[2]=b,i[3]=A,m=!0):(i[2]=Z,i[3]=X,m=!0)),n&&m)return!1;if(f>v?r>t?(I=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,R=f+-N/y,i[0]=R,i[1]=W;break;case 2:R=g,W=r+d*y,i[0]=R,i[1]=W;break;case 3:W=T,R=f+N/y,i[0]=R,i[1]=W;break;case 4:R=l,W=r+-d*y,i[0]=R,i[1]=W;break}if(!m)switch(M){case 1:Q=A,x=v+-_/y,i[2]=x,i[3]=Q;break;case 2:x=Z,Q=t+D*y,i[2]=x,i[3]=Q;break;case 3:Q=X,x=v+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-D*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,v=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,N=void 0,b=void 0,A=void 0,S=void 0,V=void 0,X=void 0,Z=void 0;return N=s-v,A=r-t,V=t*v-r*s,b=T-c,S=o-l,X=l*c-o*T,Z=N*S-b*A,Z===0?null:(g=(A*X-S*V)/Z,d=(b*V-N*X)/Z,new u(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,w.exports=h}),(function(w,U,L){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},w.exports=u}),(function(w,U,L){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,w.exports=u}),(function(w,U,L){var u=(function(){function r(v,t){for(var s=0;s"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},w.exports=h}),(function(w,U,L){function u(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(N.push(A[0]);N.length>0&&c;){var S=N[0];N.splice(0,1),d.add(S);for(var V=S.getEdges(),g=0;g-1&&A.splice(_,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(X,1);var Z=b.getNeighborsList();Z.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&S.push(n),T.set(n,p)}})}l=l.concat(S),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,U,L){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},w.exports=u}),(function(w,U,L){var u=L(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},w.exports=h}),(function(w,U,L){function u(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oN||d>N)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>N||d>N)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||N>=g[0].length)){for(var b=0;br}}]),i})();w.exports=e}),(function(w,U,L){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,r=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=J;gt--){var mt=u.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==J&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},w.exports=u}),(function(w,U,L){var u=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=v,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var U={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var v in f)r[v]=f[v];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var v in f)r[v]=f[v];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),v=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,N=i(551).DimensionD,b=i(551).Layout,A=i(551).Integer,S=i(551).IGeometry,V=i(551).LGraph,X=i(551).Transform,Z=i(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var _ in f)D[_]=f[_];D.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new v(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var M=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),B=O[tt],O[tt]=O[H],O[H]=B;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:B,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:H,gap:O.gap})}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=M.has(O.left)?M.get(O.left):O.left,B=M.has(O.right)?M.get(O.right):O.right;Q.has(H)?Q.get(H).push(B):Q.set(H,[B]),Q.has(B)?Q.get(B).push(H):Q.set(B,[H])}else{var tt=R.has(O.top)?R.get(O.top):O.top,ht=R.has(O.bottom)?R.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var Y=function(H,B){var tt=[],ht=[],J=new Z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var gt=it;for(J.push(gt),It.add(gt),tt[Nt].push(gt);J.length!=0;){gt=J.shift(),B.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(J.push(At),It.add(At),tt[Nt].push(At))})}Nt++}}),{components:tt,isFixed:ht}},rt=Y(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=Y(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=n.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;RE&&(E=Math.floor(M.y)),I=Math.floor(M.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=V.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var M=0;M1;){var B=H[0];H.splice(0,1);var tt=z.indexOf(B);tt>=0&&z.splice(tt,1),$--,Y--}m!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(E-p)/Y,J=O;rt!=Y;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=m){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,p=0;pm&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[R]=[]),m[R]=m[R].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var Q=m[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var Y=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,M)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,M=E.labelMarginLeft,R=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,M,R)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;EQ&&(Q=Y.rect.height)}p+=Q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,M=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),M;return IR&&(R=$.getWidth())});var W=I/y,x=M/y,Q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,z=(E-p+Math.sqrt(Q))/(2*(W+E)),Y;m?(Y=Math.ceil(z),Y==z&&Y++):Y=Math.floor(z);var rt=Y*(W+E)-E;return R>rt&&(rt=R),rt+=E*2,rt},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(O){return O.rect.width*O.rect.height},W=function(O,H){return R(H)-R(O)};n.sort(function($,O){var H=W;return M.idealRowWidth?(H=I,H($.id,O.id)):H($,O)});for(var x=0,Q=0,z=0;z0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var M=n.rowWidth[I];if(M+n.horizontalPadding+m<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+R)/(M+m+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,R=0;RM&&(M=E[R].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)Y[0]+=this.grid[rt][M-1].length+this.grid[rt][M].length-1;if(I0)for(var rt=M;rt<=R;rt++)Y[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=A.MAX_VALUE,O,H,B=0;B{var f=i(551).FDLayoutNode,r=i(551).IMath;function v(s,o,c,l){f.call(this,s,o,c,l)}v.prototype=Object.create(f.prototype);for(var t in f)v[t]=f[t];v.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?N[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?N[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=P.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(P){var k=0,K=0,q=0,at=0;if(P.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?k++:K++:N[g.get(j.top)]-N[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,P){E[P]=[F.position.x,F.position.y],y[P]=[d[g.get(F.nodeId)],N[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var P=l.alignmentConstraint.vertical,k=function(et){var j=new Set;P[et].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),wt=void 0;ut.size>0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).x,P[et].forEach(function(pt){E[F]=[wt,N[g.get(pt)]],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},K=0;K0?wt=d[g.get(ut.values().next().value)]:wt=Z(j).y,q[et].forEach(function(pt){E[F]=[d[g.get(pt)],wt],y[F]=[d[g.get(pt)],N[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,Y=rt);if(z0){var Et={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,P){var k={x:d[g.get(F.nodeId)],y:N[g.get(F.nodeId)]},K=F.position,q=X(K,k);Et.x+=q.x,Et.y+=q.y}),Et.x/=l.fixedNodeConstraint.length,Et.y/=l.fixedNodeConstraint.length,d.forEach(function(F,P){d[P]+=Et.x}),N.forEach(function(F,P){N[P]+=Et.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,N[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(P){var k=new Set;Dt[P].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=Z(k).x,k.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=N[g.get(K.values().next().value)]:q=Z(k).y,k.forEach(function(at){R.has(at)||(N[g.get(at)]=q)})},Ft=0;Ft{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(45);return h})()})})(he)),he.exports}var vr=se.exports,Oe;function pr(){return Oe||(Oe=1,(function(C,G){(function(U,L){C.exports=L(dr())})(vr,function(w){return(()=>{var U={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),N;!(l=(N=d.next()).done)&&(c.push(N.value),!(o&&c.length===o));l=!0);}catch(b){T=!0,g=b}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var M=0;M1){N=g[0],b=N.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),X},v.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,N=!1,b=void 0;try{for(var A=s.nodeIndexes[Symbol.iterator](),S;!(d=(S=A.next()).done);d=!0){var V=S.value,X=f(V,2),Z=X[0],D=X[1],_=o.cy.getElementById(Z);if(_){var n=_.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;ml&&(l=p),Eg&&(g=y)}}}catch(x){N=!0,b=x}finally{try{!d&&A.return&&A.return()}finally{if(N)throw b}}var I=t.x-(l+c)/2,M=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+M})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,Y=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=Y),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},v.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,N=void 0,b=void 0,A=void 0,S=void 0,V=t.descendants().not(":parent"),X=V.length,Z=0;ZN&&(l=N),TA&&(g=A),d{var f=i(548),r=i(140).CoSELayout,v=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,N){var b=d.cy,A=d.eles,S=A.nodes(),V=A.edges(),X=void 0,Z=void 0,D=void 0,_={};d.randomize&&(X=N.nodeIndexes,Z=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(b,A),E=function W(x,Q,z,Y){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),B),W(J,H,z,Y)}}},y=function(x,Q,z){for(var Y=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var M=new r,R=M.newGraphManager();return E(R.addRoot(),f.getTopMostNodes(S),M,d),y(M,R,V),I(M,d),M.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(N,b){for(var A=0;A0)if(p){var I=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(S,A.eles,I),D.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(vt){A.eles=vt,X.push(o(A))}),A.quality=="default"||A.quality=="proof"){var M=S.collection();if(A.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(z.nodeIndexes.set(vt.nodes()[mt].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),M.length>1){var rt=M.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),D.push(M),X.push(z);for(var $=Y.length-1;$>=0;$--)D.splice(Y[$],1),X.splice(Y[$],1),_.splice(Y[$],1)}}D.forEach(function(vt,it){A.eles=vt,Z.push(l(A,X[it])),t.relocateComponent(_[it],Z[it],A)})}else D.forEach(function(vt,it){t.relocateComponent(_[it],X[it],A)});var O=new Set;if(D.length>1){var H=[],B=V.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(A.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(A.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else Z[it][Ot.id()]&&mt.nodes.push({x:Z[it][Ot.id()].getLeft(),y:Z[it][Ot.id()].getTop(),width:Z[it][Ot.id()].getWidth(),height:Z[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(A.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else Z[it][Et.id()]&&Z[it][Dt.id()]&&mt.edges.push({startX:Z[it][Et.id()].getCenterX(),startY:Z[it][Et.id()].getCenterY(),endX:Z[it][Dt.id()].getCenterX(),endY:Z[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var tt=m.packComponents(H,A.randomize).shifts;if(A.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+tt[it].dx}),mt=vt.yCoords.map(function(At){return At+tt[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(Z[vt]).forEach(function(it){var gt=Z[vt][it];gt.setCenter(gt.getCenterX()+tt[ht].dx,gt.getCenterY()+tt[ht].dy)}),ht++})}}}else{var E=A.eles.boundingBox();if(_.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var y=o(A);X.push(y)}A.quality=="default"||A.quality=="proof"?(Z.push(l(A,X[0])),t.relocateComponent(_[0],Z[0],A)):t.relocateComponent(_[0],X[0],A)}var J=function(it,gt){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return Z.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),A.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(S,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});A.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,A,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,v=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,N=new Map,b=new Map,A=[],S=[],V=[],X=[],Z=[],D=[],_=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,M=o.nodeSeparation,R=void 0,W=function(){for(var P=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=A[nt],lt=0;ltut&&(ut=Z[Lt],wt=Lt)}return wt},Q=function(P){var k=void 0;if(P){k=Math.floor(Math.random()*m);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(k.isParent()?A[P].push(b.get(k.id())):A[P].push(k.id()))})});var Nt=function(P){var k=N.get(P),K=void 0;d.get(P).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,A[k].push(K),A[N.get(K)].push(P)})},vt=!0,it=!1,gt=void 0;try{for(var mt=d.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){it=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){R=m{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=w})},L={};function u(a){var e=L[a];if(e!==void 0)return e.exports;var i=L[a]={exports:{}};return U[a](i,i.exports,u),i.exports}var h=u(579);return h})()})})(se)),se.exports}var yr=pr();const Er=Be(yr);var De={L:"left",R:"right",T:"top",B:"bottom"},xe={L:dt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:dt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:dt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:dt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},oe={L:dt((C,G)=>C-G+2,"L"),R:dt((C,G)=>C-2,"R"),T:dt((C,G)=>C-G+2,"T"),B:dt((C,G)=>C-2,"B")},mr=dt(function(C){return Wt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=dt(function(C){const G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),Wt=dt(function(C){const G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),qt=dt(function(C){const G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),me=dt(function(C,G){const w=Wt(C)&&qt(G),U=qt(C)&&Wt(G);return w||U},"isArchitectureDirectionXY"),Tr=dt(function(C){const G=C[0],w=C[1],U=Wt(G)&&qt(w),L=qt(G)&&Wt(w);return U||L},"isArchitecturePairXY"),Nr=dt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=dt(function(C,G){const w=`${C}${G}`;return Nr(w)?w:void 0},"getArchitectureDirectionPair"),Lr=dt(function([C,G],w){const U=w[0],L=w[1];return Wt(U)?qt(L)?[C+(U==="L"?-1:1),G+(L==="T"?1:-1)]:[C+(U==="L"?-1:1),G]:Wt(L)?[C+(L==="L"?1:-1),G+(U==="T"?1:-1)]:[C,G+(U==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Cr=dt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=dt(function(C,G){return me(C,G)?"bend":Wt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(C){return C.type==="service"},"isArchitectureService"),Mr=dt(function(C){return C.type==="junction"},"isArchitectureJunction"),Fe=dt(C=>C.data(),"edgeData"),ie=dt(C=>C.data(),"nodeData"),Or=ir.architecture,be=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qe,this.getAccTitle=Qe,this.setDiagramTitle=Je,this.getDiagramTitle=Ke,this.getAccDescription=je,this.setAccDescription=_e,this.clear()}static{dt(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",tr()}addService({id:C,icon:G,in:w,title:U,iconText:L}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[w]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:G,iconText:L,title:U,edges:[],in:w}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:C,in:G}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[G]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:G}}getJunctions(){return Object.values(this.nodes).filter(Mr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:G,in:w,title:U}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(w!==void 0){if(C===w)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[w]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[w]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:G,title:U,in:w}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:G,lhsDir:w,rhsDir:U,lhsInto:L,rhsInto:u,lhsGroup:h,rhsGroup:a,title:e}){if(!Ie(w))throw new Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(w)}`);if(!Ie(U))throw new Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(U)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[G]===void 0&&this.groups[G]===void 0)throw new Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes[C].in,f=this.nodes[G].in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:C,lhsDir:w,lhsInto:L,lhsGroup:h,rhsId:G,rhsDir:U,rhsInto:u,rhsGroup:a,title:e};this.edges.push(r),this.nodes[C]&&this.nodes[G]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[G].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},G=Object.entries(this.nodes).reduce((a,[e,i])=>(a[e]=i.edges.reduce((f,r)=>{const v=this.getNode(r.lhsId)?.in,t=this.getNode(r.rhsId)?.in;if(v&&t&&v!==t){const s=Ar(r.lhsDir,r.rhsDir);s!=="bend"&&(C[v]??={},C[v][t]=s,C[t]??={},C[t][v]=s)}if(r.lhsId===e){const s=pe(r.lhsDir,r.rhsDir);s&&(f[s]=r.rhsId)}else{const s=pe(r.rhsDir,r.lhsDir);s&&(f[s]=r.lhsId)}return f},{}),a),{}),w=Object.keys(G)[0],U={[w]:1},L=Object.keys(G).reduce((a,e)=>e===w?a:{...a,[e]:1},{}),u=dt(a=>{const e={[a]:[0,0]},i=[a];for(;i.length>0;){const f=i.shift();if(f){U[f]=1,delete L[f];const r=G[f],[v,t]=e[f];Object.entries(r).forEach(([s,o])=>{U[o]||(e[o]=Lr([v,t],s),i.push(o))})}}return e},"BFS"),h=[u(w)];for(;Object.keys(L).length>0;)h.push(u(Object.keys(L)[0]));this.dataStructures={adjList:G,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements[C]=G}getElementById(C){return this.elements[C]}getConfig(){return er({...Or,...rr().architecture})}getConfigField(C){return this.getConfig()[C]}},Dr=dt((C,G)=>{lr(C,G),C.groups.map(w=>G.addGroup(w)),C.services.map(w=>G.addService({...w,type:"service"})),C.junctions.map(w=>G.addJunction({...w,type:"junction"})),C.edges.map(w=>G.addEdge(w))},"populateDb"),Pe={parser:{yy:void 0},parse:dt(async C=>{const G=await fr("architecture",C);Re.debug(G);const w=Pe.parser?.yy;if(!(w instanceof be))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(G,w)},"parse")},xr=dt(C=>`
-  .edge {
-    stroke-width: ${C.archEdgeWidth};
-    stroke: ${C.archEdgeColor};
-    fill: none;
-  }
-
-  .arrow {
-    fill: ${C.archEdgeArrowColor};
-  }
-
-  .node-bkg {
-    fill: none;
-    stroke: ${C.archGroupBorderColor};
-    stroke-width: ${C.archGroupBorderWidth};
-    stroke-dasharray: 8;
-  }
-  .node-icon-text {
-    display: flex; 
-    align-items: center;
-  }
-  
-  .node-icon-text > div {
-    color: #fff;
-    margin: 1px;
-    height: fit-content;
-    text-align: center;
-    overflow: hidden;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-  }
-`,"getStyles"),Ir=xr,re=dt(C=>`${C}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:hr,blank:{body:re("")}}},Rr=dt(async function(C,G,w,U){const L=w.getConfigField("padding"),u=w.getConfigField("iconSize"),h=u/2,a=u/6,e=a/2;await Promise.all(G.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:v,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Fe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:N,y:b}=i[0].midpoint();let{x:A,y:S}=i[0].targetEndpoint();const V=L+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?A+=o==="L"?-V:V:S+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&w.getNode(s)?.type==="junction"&&(Wt(o)?A+=o==="L"?h:-h:S+=o==="T"?h:-h),i[0]._private.rscratch){const X=C.insert("g");if(X.insert("path").attr("d",`M ${g},${d} L ${N},${b} L${A},${S} `).attr("class","edge").attr("id",`${U}-${or(f,s,{prefix:"L"})}`),v){const Z=Wt(r)?oe[r](g,a):g-e,D=qt(r)?oe[r](d,a):d-e;X.insert("polygon").attr("points",xe[r](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(c){const Z=Wt(o)?oe[o](A,a):A-e,D=qt(o)?oe[o](S,a):S-e;X.insert("polygon").attr("points",xe[o](a)).attr("transform",`translate(${Z},${D})`).attr("class","arrow")}if(T){const Z=me(r,o)?"XY":Wt(r)?"X":"Y";let D=0;Z==="X"?D=Math.abs(g-A):Z==="Y"?D=Math.abs(d-S)/1.5:D=Math.abs(g-A)/2;const _=X.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},ye()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Z==="X")_.attr("transform","translate("+N+", "+b+")");else if(Z==="Y")_.attr("transform","translate("+N+", "+b+") rotate(-90)");else if(Z==="XY"){const n=pe(r,o);if(n&&Tr(n)){const m=_.node().getBoundingClientRect(),[p,E]=Cr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*E*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
-                translate(${N}, ${b-m.height/2})
-                translate(${p*y.width/2}, ${E*y.height/2})
-                rotate(${-1*p*E*45}, 0, ${m.height/2})
-              `)}}}}}))},"drawEdges"),Sr=dt(async function(C,G,w,U){const u=w.getConfigField("padding")*.75,h=w.getConfigField("fontSize"),e=w.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:v,x1:t,y1:s}=i.boundingBox(),o=C.append("rect");o.attr("id",`${U}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",v).attr("height",r).attr("class","node-bkg");const c=C.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:u,width:u,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=u,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ye()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Fr=dt(async function(C,G,w,U){const L=ye();for(const u of w){const h=G.append("g"),a=C.getConfigField("iconSize");if(u.title){const r=h.append("g");await Ee(r,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(u.icon)e.html(`${await ve(u.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(u.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ar(u.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${U}-node-${u.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${U}-service-${u.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();u.width=i,u.height=f,C.setElementForId(u.id,h)}return 0},"drawServices"),br=dt(function(C,G,w,U){w.forEach(L=>{const u=G.append("g"),h=C.getConfigField("iconSize");u.append("g").append("rect").attr("id",`${U}-node-${L.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),u.attr("class","architecture-junction");const{width:e,height:i}=u._groups[0][0].getBBox();u.width=e,u.height=i,C.setElementForId(L.id,u)})},"drawJunctions");sr([{name:ae.prefix,icons:ae}]);Se.use(Er);function Ge(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"service",id:U.id,icon:U.icon,label:U.title,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}dt(Ge,"addServices");function Ue(C,G,w){C.forEach(U=>{G.add({group:"nodes",data:{type:"junction",id:U.id,parent:U.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ue,"addJunctions");function Ye(C,G){G.nodes().map(w=>{const U=ie(w);if(U.type==="group")return;U.x=w.position().x,U.y=w.position().y,C.getElementById(U.id).attr("transform","translate("+(U.x||0)+","+(U.y||0)+")")})}dt(Ye,"positionNodes");function Xe(C,G){C.forEach(w=>{G.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}dt(Xe,"addGroups");function He(C,G){C.forEach(w=>{const{lhsId:U,rhsId:L,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=w,v=me(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${U}-${L}`,label:r,source:U,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:t,classes:v})})}dt(He,"addEdges");function We(C,G,w){const U=dt((a,e)=>Object.entries(a).reduce((i,[f,r])=>{let v=0;const t=Object.entries(r);if(t.length===1)return i[f]=t[0][1],i;for(let s=0;s{const e={},i={};return Object.entries(a).forEach(([f,[r,v]])=>{const t=C.getNode(f)?.in??"default";e[v]??={},e[v][t]??=[],e[v][t].push(f),i[r]??={},i[r][t]??=[],i[r][t].push(f)}),{horiz:Object.values(U(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(U(i,"vertical")).filter(f=>f.length>1)}}),[u,h]=L.reduce(([a,e],{horiz:i,vert:f})=>[[...a,...i],[...e,...f]],[[],[]]);return{horizontal:u,vertical:h}}dt(We,"getAlignments");function Ve(C,G){const w=[],U=dt(u=>`${u[0]},${u[1]}`,"posToStr"),L=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([f,r])=>[U(r),f])),a=[U([0,0])],e={},i={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const r=h[f];if(r){const v=L(f);Object.entries(i).forEach(([t,s])=>{const o=U([v[0]+s[0],v[1]+s[1]]),c=h[o];c&&!e[o]&&(a.push(o),w.push({[De[t]]:c,[De[mr(t)]]:r,gap:1.5*G.getConfigField("iconSize")}))})}}}}),w}dt(Ve,"getRelativeConstraints");function ze(C,G,w,U,L,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=nr("body").append("div").attr("id","cy").attr("style","display:none"),i=Se({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),Xe(w,i),Ge(C,i,L),Ue(G,i,L),He(U,i);const f=We(L,u,h),r=Ve(u,L),v=L.getConfigField("iconSize"),t=L.getConfigField("idealEdgeLengthMultiplier")*v,s=.5*v,o=L.getConfigField("edgeElasticity"),c=i.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),nodeSeparation:L.getConfigField("nodeSeparation"),numIter:L.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?t:s},edgeElasticity(l){const[T,g]=l.connectedNodes(),{parent:d}=ie(T),{parent:N}=ie(g);return d===N?o:.001},alignmentConstraint:f,relativePlacementConstraint:r});c.one("layoutstop",()=>{function l(T,g,d,N){let b,A;const{x:S,y:V}=T,{x:X,y:Z}=g;A=(N-V+(S-d)*(V-Z)/(S-X))/Math.sqrt(1+Math.pow((V-Z)/(S-X),2)),b=Math.sqrt(Math.pow(N-V,2)+Math.pow(d-S,2)-Math.pow(A,2));const D=Math.sqrt(Math.pow(X-S,2)+Math.pow(Z-V,2));b=b/D;let _=(X-S)*(N-V)-(Z-V)*(d-S);switch(!0){case _>=0:_=1;break;case _<0:_=-1;break}let n=(X-S)*(d-S)+(Z-V)*(N-V);switch(!0){case n>=0:n=1;break;case n<0:n=-1;break}return A=Math.abs(A)*_,b=b*n,{distances:A,weights:b}}dt(l,"getSegmentWeights"),i.startBatch();for(const T of Object.values(i.edges()))if(T.data?.()){const{x:g,y:d}=T.source().position(),{x:N,y:b}=T.target().position();if(g!==N&&d!==b){const A=T.sourceEndpoint(),S=T.targetEndpoint(),{sourceDir:V}=Fe(T),[X,Z]=qt(V)?[A.x,S.y]:[S.x,A.y],{weights:D,distances:_}=l(A,S,X,Z);T.style("segment-distances",_),T.style("segment-weights",D)}}i.endBatch(),c.run()}),c.run(),i.ready(l=>{Re.info("Ready",l),a(i)})})}dt(ze,"layoutArchitecture");var Pr=dt(async(C,G,w,U)=>{const L=U.db;L.setDiagramId(G);const u=L.getServices(),h=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),i=L.getDataStructures(),f=ke(G),r=f.append("g");r.attr("class","architecture-edges");const v=f.append("g");v.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Fr(L,v,u,G),br(L,v,h,G);const s=await ze(u,h,a,e,L,i);await Rr(r,s,L,G),await Sr(t,s,L,G),Ye(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Gr={draw:Pr},Vr={parser:Pe,get db(){return new be},renderer:Gr,styles:Ir};export{Vr as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CZbHV5Jm.js b/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CZbHV5Jm.js
new file mode 100644
index 000000000..38523aafd
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CZbHV5Jm.js
@@ -0,0 +1,36 @@
+import{p as Ze}from"./chunk-JWPE2WC7-CM6UswKM.js";import{b4 as qe,_ as ct,G as Qe,ae as Je,l as Se,b as Ke,a as je,p as _e,q as tr,g as er,s as rr,r as ir,D as ar,A as nr,E as or,c as me,b5 as Ee,aj as ve,i as sr,j as hr,t as lr,ak as fr,b6 as cr}from"./mermaid.core-CM2luXFy.js";import{p as gr}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import{c as Fe}from"./cytoscape.esm-CNiYdHpY.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var se={exports:{}},he={exports:{}},le={exports:{}},ur=le.exports,Ae;function dr(){return Ae||(Ae=1,(function(w,F){(function(P,N){w.exports=N()})(ur,function(){return(function(M){var P={};function N(v){if(P[v])return P[v].exports;var h=P[v]={i:v,l:!1,exports:{}};return M[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=M,N.c=P,N.i=function(v){return v},N.d=function(v,h,a){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:a})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(M,P,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,M.exports=v}),(function(M,P,N){var v=N(2),h=N(8),a=N(9);function e(f,r,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(v.prototype);for(var i in v)e[i]=v[i];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,r){for(var u=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(u.getOwner()==r)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},M.exports=e}),(function(M,P,N){function v(h){this.vGraphObject=h}M.exports=v}),(function(M,P,N){var v=N(2),h=N(10),a=N(13),e=N(0),i=N(16),f=N(5);function r(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}r.prototype=Object.create(v.prototype);for(var u in v)r[u]=v[u];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},M.exports=r}),(function(M,P,N){var v=N(0);function h(){}for(var a in v)h[a]=v[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=h}),(function(M,P,N){function v(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},M.exports=v}),(function(M,P,N){var v=N(2),h=N(10),a=N(0),e=N(7),i=N(3),f=N(1),r=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(G,1);var R=g.source.owner.getEdges().indexOf(g);if(R==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(R,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,L=this.getNodes(),R=L.length,C=0;CT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,L,R,C,G,V,Y=this.nodes,$=Y.length,A=0;A<$;A++){var _=Y[A];c&&_.child!=null&&_.updateBounds(),L=_.getLeft(),R=_.getRight(),C=_.getTop(),G=_.getBottom(),l>L&&(l=L),TC&&(g=C),dL&&(l=L),TC&&(g=C),d=this.nodes.length){var $=0;T.forEach(function(A){A.owner==c&&$++}),$==this.nodes.length&&(this.isConnected=!0)}},M.exports=s}),(function(M,P,N){var v,h=N(1);function a(e){v=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,u){if(f==null&&r==null&&u==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{u=f,r=i,f=e;var t=r.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,u);if(f.isInterGraph=!0,f.source=r,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof v){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,u=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*i[0],s=i[1]/u;i[0]t)return i[0]=f,i[1]=o,i[2]=u,i[3]=Y,!1;if(ru)return i[0]=s,i[1]=r,i[2]=G,i[3]=t,!1;if(fu?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>u?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-m===y?u>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=C,E=!0):m===y&&(u>f?(i[2]=R,i[3]=C,E=!0):(i[2]=$,i[3]=Y,E=!0)),n&&E)return!1;if(f>u?r>t?(I=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,S=f+-L/y,i[0]=S,i[1]=W;break;case 2:S=g,W=r+d*y,i[0]=S,i[1]=W;break;case 3:W=T,S=f+L/y,i[0]=S,i[1]=W;break;case 4:S=l,W=r+-d*y,i[0]=S,i[1]=W;break}if(!E)switch(D){case 1:Q=C,x=u+-_/y,i[2]=x,i[3]=Q;break;case 2:x=$,Q=t+A*y,i[2]=x,i[3]=Q;break;case 3:Q=Y,x=u+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-A*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,u=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,L=void 0,R=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,$=void 0;return L=s-u,C=r-t,V=t*u-r*s,R=T-c,G=o-l,Y=l*c-o*T,$=L*G-R*C,$===0?null:(g=(C*Y-G*V)/$,d=(R*V-L*Y)/$,new v(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,M.exports=h}),(function(M,P,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},M.exports=v}),(function(M,P,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,M.exports=v}),(function(M,P,N){var v=(function(){function r(u,t){for(var s=0;s"u"?"undefined":v(a);return a==null||e!="object"&&e!="function"},M.exports=h}),(function(M,P,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),g=0;g-1&&C.splice(_,1)}d=new Set,R=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(Y,1);var $=R.getNeighborsList();$.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&G.push(n),T.set(n,p)}})}l=l.concat(G),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},M.exports=s}),(function(M,P,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},M.exports=v}),(function(M,P,N){var v=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new v(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},M.exports=h}),(function(M,P,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var R=0;Rr}}]),i})();M.exports=e}),(function(M,P,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,r=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,wt){return Tt&&wt})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*e[ut-1],e[ut-1]=Ct*e[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},M.exports=v}),(function(M,P,N){var v=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var P={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var u in f)r[u]=f[u];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),u=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,R=i(551).Layout,C=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,$=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var D=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=O[tt],O[tt]=O[H],O[H]=k;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:O.gap})}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new $,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var S;for(S=0;Sm&&(m=Math.floor(D.y)),I=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),I=new Y;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var D=0;D1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),B--,X--}E!=null?O=(z.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[S]=[]),E[S]=E[S].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;By?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,D=m.labelMarginLeft,S=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,D,S)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),D;return IS&&(S=B.getWidth())});var W=I/y,x=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return S>rt&&(rt=S),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(O){return O.rect.width*O.rect.height},W=function(O,H){return S(H)-S(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=I,H(B.id,O.id)):H(B,O)});for(var x=0,Q=0,z=0;z0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var D=n.rowWidth[I];if(D+n.horizontalPadding+E<=n.width)return!0;var S=0;n.rowHeight[I]0&&(S=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+S)/(D+E+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,S=0;SD&&(D=m[S].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(I0)for(var rt=D;rt<=S;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,k=0;k{var f=i(551).FDLayoutNode,r=i(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var Z=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(b,U){m[U]=[b.position.x,b.position.y],y[U]=[d[g.get(b.nodeId)],L[g.get(b.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var b=0;if(l.alignmentConstraint.vertical){for(var U=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;dt.size>0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).x,U[et].forEach(function(pt){m[b]=[Mt,L[g.get(pt)]],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},K=0;K0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).y,q[et].forEach(function(pt){m[b]=[d[g.get(pt)],Mt],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(b,U){var Z={x:d[g.get(b.nodeId)],y:L[g.get(b.nodeId)]},K=b.position,q=Y(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(b,U){d[U]+=mt.x}),L.forEach(function(b,U){L[U]+=mt.y}),l.fixedNodeConstraint.forEach(function(b){d[g.get(b.nodeId)]=b.position.x,L[g.get(b.nodeId)]=b.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ot=l.alignmentConstraint.vertical,Rt=function(U){var Z=new Set;Ot[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return S.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=$(Z).x,Z.forEach(function(at){S.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=L[g.get(K.values().next().value)]:q=$(Z).y,Z.forEach(function(at){S.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(45);return h})()})})(he)),he.exports}var yr=se.exports,Oe;function mr(){return Oe||(Oe=1,(function(w,F){(function(P,N){w.exports=N(pr())})(yr,function(M){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),L;!(l=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));l=!0);}catch(R){T=!0,g=R}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var D=0;D1){L=g[0],R=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,R=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=C.next()).done);d=!0){var V=G.value,Y=f(V,2),$=Y[0],A=Y[1],_=o.cy.getElementById($);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){L=!0,R=x}finally{try{!d&&C.return&&C.return()}finally{if(L)throw R}}var I=t.x-(l+c)/2,D=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+D})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=B)});var S=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+S,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,R=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,$=0;$L&&(l=L),TC&&(g=C),d{var f=i(548),r=i(140).CoSELayout,u=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,L){var R=d.cy,C=d.eles,G=C.nodes(),V=C.edges(),Y=void 0,$=void 0,A=void 0,_={};d.randomize&&(Y=L.nodeIndexes,$=L.xCoords,A=L.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(R,C),m=function W(x,Q,z,X){for(var rt=Q.length,B=0;B0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,B=0;B0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,S=D.newGraphManager();return m(S.addRoot(),f.getTopMostNodes(G),D,d),y(D,S,V),I(D,d),D.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(L,R){for(var C=0;C0)if(p){var I=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,I),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=G.collection();if(C.tile){var S=new Map,W=[],x=[],Q=0,z={nodeIndexes:S,xCoords:W,yCoords:x},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,$.push(l(C,Y[it])),t.relocateComponent(_[it],$[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],k=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(k).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else $[it][Dt.id()]&&Et.nodes.push({x:$[it][Dt.id()].getLeft(),y:$[it][Dt.id()].getTop(),width:$[it][Dt.id()].getWidth(),height:$[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Gt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Gt.push(Yt.topLeftX+Yt.width/2),Gt.push(Yt.topLeftY+Yt.height/2)}else Gt.push(Y[it].xCoords[Ht]),Gt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Gt[0],endY:Gt[1]})}else $[it][mt.id()]&&$[it][Ot.id()]&&Et.edges.push({startX:$[it][mt.id()].getCenterX(),startY:$[it][mt.id()].getCenterY(),endX:$[it][Ot.id()].getCenterX(),endY:$[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys($[vt]).forEach(function(it){var ut=$[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?($.push(l(C,Y[0])),t.relocateComponent(_[0],$[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return $.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(R,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,u=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,L=new Map,R=new Map,C=[],G=[],V=[],Y=[],$=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,D=o.nodeSeparation,S=void 0,W=function(){for(var U=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=C[nt],lt=0;ltdt&&(dt=$[Lt],Mt=Lt)}return Mt},Q=function(U){var Z=void 0;if(U){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?C[U].push(R.get(Z.id())):C[U].push(Z.id()))})});var Nt=function(U){var Z=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=R.get(q):K=q,C[Z].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(b){it=!0,ut=b}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){S=E{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(579);return h})()})})(se)),se.exports}var Er=mr();const Tr=qe(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:ct(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:ct(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:ct(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},oe={L:ct((w,F)=>w-F+2,"L"),R:ct((w,F)=>w-2,"R"),T:ct((w,F)=>w-F+2,"T"),B:ct((w,F)=>w-2,"B")},Nr=ct(function(w){return Wt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(w){const F=w;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),Wt=ct(function(w){const F=w;return F==="L"||F==="R"},"isArchitectureDirectionX"),qt=ct(function(w){const F=w;return F==="T"||F==="B"},"isArchitectureDirectionY"),Te=ct(function(w,F){const M=Wt(w)&&qt(F),P=qt(w)&&Wt(F);return M||P},"isArchitectureDirectionXY"),Lr=ct(function(w){const F=w[0],M=w[1],P=Wt(F)&&qt(M),N=qt(F)&&Wt(M);return P||N},"isArchitecturePairXY"),wr=ct(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(w,F){const M=`${w}${F}`;return wr(M)?M:void 0},"getArchitectureDirectionPair"),Cr=ct(function([w,F],M){const P=M[0],N=M[1];return Wt(P)?qt(N)?[w+(P==="L"?-1:1),F+(N==="T"?1:-1)]:[w+(P==="L"?-1:1),F]:Wt(N)?[w+(N==="L"?1:-1),F+(P==="T"?1:-1)]:[w,F+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mr=ct(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=ct(function(w,F){return Te(w,F)?"bend":Wt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Dr=ct(function(w){return w.type==="service"},"isArchitectureService"),Or=ct(function(w){return w.type==="junction"},"isArchitectureJunction"),be=ct((w,F)=>{const[M,P]=[w,F].sort();return`${JSON.stringify(M)}-${JSON.stringify(P)}`},"architectureGroupAlignmentKey"),Ge=ct(w=>w.data(),"edgeData"),ie=ct(w=>w.data(),"nodeData"),xr=or.architecture,Pe=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}static{ct(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:w,icon:F,in:M,title:P,iconText:N}){if(this.registeredIds.has(w))throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:F,iconText:N,title:P,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(Dr)}addJunction({id:w,in:F}){if(this.registeredIds.has(w))throw new Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(F!==void 0){if(w===F)throw new Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw new Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw new Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(Or)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:F,in:M,title:P}){if(this.registeredIds.has(w))throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:F,title:P,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:F,lhsDir:M,rhsDir:P,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:a,title:e}){if(!Re(M))throw new Error(`Invalid direction given for left hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(M)}`);if(!Re(P))throw new Error(`Invalid direction given for right hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(P)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw new Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes.get(w).in,f=this.nodes.get(F).in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:w,lhsDir:M,lhsInto:N,lhsGroup:h,rhsId:F,rhsDir:P,rhsInto:v,rhsGroup:a,title:e};this.edges.push(r);const u=this.nodes.get(w),t=this.nodes.get(F);u&&t&&(u.edges.push(this.edges[this.edges.length-1]),t.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw new Error(`An align directive requires at least two members; got ${w.members.length}`);const F=new Set;w.members.forEach(M=>{if(this.registeredIds.get(M)!=="node")throw new Error(`align ${w.direction} references [${M}], which is not a service or junction`);if(F.has(M))throw new Error(`align ${w.direction} lists [${M}] more than once`);F.add(M)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const w=new Map,F=new Map;for(const[h,a]of this.nodes.entries()){const e=new Map;for(const i of a.edges){const f=this.getNode(i.lhsId)?.in,r=this.getNode(i.rhsId)?.in;if(f&&r&&f!==r){const u=Ar(i.lhsDir,i.rhsDir);u!=="bend"&&w.set(be(f,r),u)}if(i.lhsId===h){const u=pe(i.lhsDir,i.rhsDir);u&&e.set(u,i.rhsId)}else{const u=pe(i.rhsDir,i.lhsDir);u&&e.set(u,i.lhsId)}}F.set(h,e)}const M=new Set,P=new Set(F.keys()),N=ct(h=>{const a=new Map([[h,[0,0]]]),e=[h];for(;e.length>0;){const i=e.shift();if(i){M.add(i),P.delete(i);const f=F.get(i);if(!f)throw new Error(`BFS error: adjacency list for id ${i} not found. Please report this as a bug.`);const r=a.get(i);if(!r)throw new Error(`BFS error: position for id ${i} not found in spatial map. Please report this as a bug.`);const[u,t]=r;f.forEach((s,o)=>{M.has(s)||(a.set(s,Cr([u,t],o)),e.push(s))})}}return a},"BFS"),v=[];for(;P.size>0;){const h=P.values().next().value;v.push(N(h))}this.dataStructures={adjList:F,spatialMaps:v,groupAlignments:w}}return this.dataStructures}setElementForId(w,F){this.elements.set(w,F)}getElementById(w){return this.elements.get(w)}getConfig(){return ar({...xr,...nr().architecture})}getConfigField(w){return this.getConfig()[w]}},Ir=ct((w,F)=>{Ze(w,F),w.groups.map(M=>F.addGroup(M)),w.services.map(M=>F.addService({...M,type:"service"})),w.junctions.map(M=>F.addJunction({...M,type:"junction"})),w.edges.map(M=>F.addEdge(M)),w.alignments?.map(M=>F.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Ue={parser:{yy:void 0},parse:ct(async w=>{const F=await gr("architecture",w);Se.debug(F);const M=Ue.parser?.yy;if(!(M instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ir(F,M)},"parse")},Rr=ct(w=>`
+  .edge {
+    stroke-width: ${w.archEdgeWidth};
+    stroke: ${w.archEdgeColor};
+    fill: none;
+  }
+
+  .arrow {
+    fill: ${w.archEdgeArrowColor};
+  }
+
+  .node-bkg {
+    fill: none;
+    stroke: ${w.archGroupBorderColor};
+    stroke-width: ${w.archGroupBorderWidth};
+    stroke-dasharray: 8;
+  }
+  .node-icon-text {
+    display: flex; 
+    align-items: center;
+  }
+  
+  .node-icon-text > div {
+    color: #fff;
+    margin: 1px;
+    height: fit-content;
+    text-align: center;
+    overflow: hidden;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+  }
+`,"getStyles"),Sr=Rr;function ye(w,F){if(w===0)return F();const M=Math.random;let P=w>>>0;Math.random=function(){P=P+1831565813>>>0;let N=P;return N=Math.imul(N^N>>>15,N|1),N^=N+Math.imul(N^N>>>7,N|61),((N^N>>>14)>>>0)/4294967296};try{return F()}finally{Math.random=M}}ct(ye,"withSeededRandom");var re=ct(w=>`${w}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:cr,blank:{body:re("")}}},Fr=ct(async function(w,F,M,P){const N=M.getConfigField("padding"),v=M.getConfigField("iconSize"),h=v/2,a=v/6,e=a/2;await Promise.all(F.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:u,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Ge(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:L,y:R}=i[0].midpoint();let{x:C,y:G}=i[0].targetEndpoint();const V=N+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?C+=o==="L"?-V:V:G+=o==="T"?-V:V+18),!t&&M.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&M.getNode(s)?.type==="junction"&&(Wt(o)?C+=o==="L"?h:-h:G+=o==="T"?h:-h),i[0]._private.rscratch){const Y=w.insert("g");if(Y.insert("path").attr("d",`M ${g},${d} L ${L},${R} L${C},${G} `).attr("class","edge").attr("id",`${P}-${lr(f,s,{prefix:"L"})}`),u){const $=Wt(r)?oe[r](g,a):g-e,A=qt(r)?oe[r](d,a):d-e;Y.insert("polygon").attr("points",Ie[r](a)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(c){const $=Wt(o)?oe[o](C,a):C-e,A=qt(o)?oe[o](G,a):G-e;Y.insert("polygon").attr("points",Ie[o](a)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(T){const $=Te(r,o)?"XY":Wt(r)?"X":"Y";let A=0;$==="X"?A=Math.abs(g-C):$==="Y"?A=Math.abs(d-G)/1.5:A=Math.abs(g-C)/2;const _=Y.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},me()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),$==="X")_.attr("transform","translate("+L+", "+R+")");else if($==="Y")_.attr("transform","translate("+L+", "+R+") rotate(-90)");else if($==="XY"){const n=pe(r,o);if(n&&Lr(n)){const E=_.node().getBoundingClientRect(),[p,m]=Mr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*m*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
+                translate(${L}, ${R-E.height/2})
+                translate(${p*y.width/2}, ${m*y.height/2})
+                rotate(${-1*p*m*45}, 0, ${E.height/2})
+              `)}}}}}))},"drawEdges"),br=ct(async function(w,F,M,P){const v=M.getConfigField("padding")*.75,h=M.getConfigField("fontSize"),e=M.getConfigField("iconSize")/2;await Promise.all(F.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:u,x1:t,y1:s}=i.boundingBox(),o=w.append("rect");o.attr("id",`${P}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",u).attr("height",r).attr("class","node-bkg");const c=w.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:v,width:v,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=v,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:u,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}M.setElementForId(f.id,o)}}))},"drawGroups"),Gr=ct(async function(w,F,M,P){const N=me();for(const v of M){const h=F.append("g"),a=w.getConfigField("iconSize");if(v.title){const r=h.append("g");await Ee(r,v.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},N),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(v.icon)e.html(`${await ve(v.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(v.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(sr(v.iconText,N)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${P}-node-${v.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${P}-service-${v.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();v.width=i,v.height=f,w.setElementForId(v.id,h)}return 0},"drawServices"),Pr=ct(function(w,F,M,P){M.forEach(N=>{const v=F.append("g"),h=w.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${P}-node-${N.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),v.attr("class","architecture-junction");const{width:e,height:i}=v._groups[0][0].getBBox();v.width=e,v.height=i,w.setElementForId(N.id,v)})},"drawJunctions");fr([{name:ae.prefix,icons:ae}]);Fe.use(Tr);function Ye(w,F,M){w.forEach(P=>{F.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-service"})})}ct(Ye,"addServices");function Xe(w,F,M){w.forEach(P=>{F.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-junction"})})}ct(Xe,"addJunctions");function He(w,F){F.nodes().map(M=>{const P=ie(M);if(P.type==="group")return;P.x=M.position().x,P.y=M.position().y,w.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")")})}ct(He,"positionNodes");function We(w,F){w.forEach(M=>{F.add({group:"nodes",data:{type:"group",id:M.id,icon:M.icon,label:M.title,parent:M.in},classes:"node-group"})})}ct(We,"addGroups");function Ve(w,F){w.forEach(M=>{const{lhsId:P,rhsId:N,lhsInto:v,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=M,u=Te(M.lhsDir,M.rhsDir)?"segments":"straight",t={id:`${P}-${N}`,label:r,source:P,sourceDir:e,sourceArrow:v,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:N,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};F.add({group:"edges",data:t,classes:u})})}ct(Ve,"addEdges");function $e(w,F,M,P=[]){const N=ct((u,t)=>{const s=new Map;for(const[o,c]of u.entries()){const l=`${o}`;let T=0;const g=[...c.entries()];if(g.length===1){s.set(l,g[0][1]);continue}for(let d=0;d{const t=new Map,s=new Map;return u.forEach(([o,c],l)=>{const T=w.getNode(l)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const d=s.get(o)??new Map;s.has(o)||s.set(o,d);for(const L of[g,d]){const R=L.get(T)??[];L.has(T)||L.set(T,R),R.push(l)}}),{horiz:[...N(t,"horizontal").values()].filter(o=>o.length>1),vert:[...N(s,"vertical").values()].filter(o=>o.length>1)}}),[h,a]=v.reduce(([u,t],{horiz:s,vert:o})=>[[...u,...s],[...t,...o]],[[],[]]),e=new Set;P.forEach(u=>u.members.forEach(t=>e.add(t)));const i=ct(u=>u.filter(t=>!t.some(s=>e.has(s))),"dropOverlapping"),f=i(h),r=i(a);return P.forEach(u=>{u.members.length<2||(u.direction==="row"?f.push([...u.members]):r.push([...u.members]))}),{horizontal:f,vertical:r}}ct($e,"getAlignments");function ze(w,F,M=[]){const P=[],N=F.getConfigField("iconSize"),v=F.getConfigField("idealEdgeLengthMultiplier"),h=v*N,a=new Set;M.forEach(f=>{for(let r=0;r`${f[0]},${f[1]}`,"posToStr"),i=ct(f=>f.split(",").map(r=>parseInt(r)),"strToPos");return w.forEach(f=>{const r=new Map([...f.entries()].map(([o,c])=>[e(c),o])),u=[e([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;u.length>0;){const o=u.shift();if(o){t[o]=1;const c=r.get(o);if(c){const l=i(o);Object.entries(s).forEach(([T,g])=>{const d=e([l[0]+g[0],l[1]+g[1]]),L=r.get(d);if(L&&!t[d]){if(u.push(d),a.has(`${c}|${L}`))return;P.push({[xe[T]]:L,[xe[Nr(T)]]:c,gap:v*N})}})}}}}),P}ct(ze,"getRelativeConstraints");function Be(w,F,M,P,N,{spatialMaps:v,groupAlignments:h}){return new Promise(a=>{const e=hr("body").append("div").attr("id","cy").attr("style","display:none"),i=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),We(M,i),Ye(w,i,N),Xe(F,i,N),Ve(P,i);const f=N.getLayoutHints(),r=$e(N,v,h,f),u=ze(v,N,f),t=N.getConfigField("iconSize"),s=N.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=N.getConfigField("edgeElasticity"),l=N.getConfigField("seed"),T=i.layout({name:"fcose",quality:"proof",randomize:N.getConfigField("randomize"),nodeSeparation:N.getConfigField("nodeSeparation"),numIter:N.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[d,L]=g.connectedNodes(),{parent:R}=ie(d),{parent:C}=ie(L);return R===C?s:o},edgeElasticity(g){const[d,L]=g.connectedNodes(),{parent:R}=ie(d),{parent:C}=ie(L);return R===C?c:.001},alignmentConstraint:r,relativePlacementConstraint:u});T.one("layoutstop",()=>{function g(d,L,R,C){let G,V;const{x:Y,y:$}=d,{x:A,y:_}=L;V=(C-$+(Y-R)*($-_)/(Y-A))/Math.sqrt(1+Math.pow(($-_)/(Y-A),2)),G=Math.sqrt(Math.pow(C-$,2)+Math.pow(R-Y,2)-Math.pow(V,2));const n=Math.sqrt(Math.pow(A-Y,2)+Math.pow(_-$,2));G=G/n;let E=(A-Y)*(C-$)-(_-$)*(R-Y);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let p=(A-Y)*(R-Y)+(_-$)*(C-$);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return V=Math.abs(V)*E,G=G*p,{distances:V,weights:G}}ct(g,"getSegmentWeights"),i.startBatch();for(const d of Object.values(i.edges()))if(d.data?.()){const{x:L,y:R}=d.source().position(),{x:C,y:G}=d.target().position();if(L!==C&&R!==G){const V=d.sourceEndpoint(),Y=d.targetEndpoint(),{sourceDir:$}=Ge(d),[A,_]=qt($)?[V.x,Y.y]:[Y.x,V.y],{weights:n,distances:E}=g(V,Y,A,_);d.style("segment-distances",E),d.style("segment-weights",n)}}i.endBatch(),ye(l,()=>T.run())});try{ye(l,()=>T.run())}catch(g){throw g instanceof RangeError&&g.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):g}i.ready(g=>{Se.info("Ready",g),a(i)})})}ct(Be,"layoutArchitecture");var Ur=ct(async(w,F,M,P)=>{const N=P.db;N.setDiagramId(F);const v=N.getServices(),h=N.getJunctions(),a=N.getGroups(),e=N.getEdges(),i=N.getDataStructures(),f=Qe(F),r=f.append("g");r.attr("class","architecture-edges");const u=f.append("g");u.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Gr(N,u,v,F),Pr(N,u,h,F);const s=await Be(v,h,a,e,N,i);await Fr(r,s,N,F),await br(t,s,N,F),He(N,s),Je(void 0,f,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Yr={draw:Ur},Br={parser:Ue,get db(){return new Pe},renderer:Yr,styles:Sr};export{Br as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-DnfzDi4m.js b/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-DnfzDi4m.js
new file mode 100644
index 000000000..292436a9b
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-DnfzDi4m.js
@@ -0,0 +1,36 @@
+import{p as Ze}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{b5 as qe,_ as ct,D as Qe,Y as Je,l as Se,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as me,b6 as Ee,ak as ve,i as sr,j as hr,q as lr,al as fr,b7 as cr}from"./mermaidParser.worker-DimdFOud.js";import{p as gr}from"./cynefin-OW5HDTMX-CZChzy6K.js";import{c as Fe}from"./cytoscape.esm-CNiYdHpY.js";var se={exports:{}},he={exports:{}},le={exports:{}},ur=le.exports,Ae;function dr(){return Ae||(Ae=1,(function(w,F){(function(G,N){w.exports=N()})(ur,function(){return(function(M){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return M[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=M,N.c=G,N.i=function(v){return v},N.d=function(v,h,a){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:a})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(M,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,M.exports=v}),(function(M,G,N){var v=N(2),h=N(8),a=N(9);function e(f,r,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(v.prototype);for(var i in v)e[i]=v[i];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,r){for(var u=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(u.getOwner()==r)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},M.exports=e}),(function(M,G,N){function v(h){this.vGraphObject=h}M.exports=v}),(function(M,G,N){var v=N(2),h=N(10),a=N(13),e=N(0),i=N(16),f=N(5);function r(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}r.prototype=Object.create(v.prototype);for(var u in v)r[u]=v[u];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},M.exports=r}),(function(M,G,N){var v=N(0);function h(){}for(var a in v)h[a]=v[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=h}),(function(M,G,N){function v(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},M.exports=v}),(function(M,G,N){var v=N(2),h=N(10),a=N(0),e=N(7),i=N(3),f=N(1),r=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,L=0;L-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(P,1);var R=g.source.owner.getEdges().indexOf(g);if(R==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(R,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,L=this.getNodes(),R=L.length,C=0;CT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,L,R,C,P,V,Y=this.nodes,$=Y.length,A=0;A<$;A++){var _=Y[A];c&&_.child!=null&&_.updateBounds(),L=_.getLeft(),R=_.getRight(),C=_.getTop(),P=_.getBottom(),l>L&&(l=L),TC&&(g=C),dL&&(l=L),TC&&(g=C),d=this.nodes.length){var $=0;T.forEach(function(A){A.owner==c&&$++}),$==this.nodes.length&&(this.isConnected=!0)}},M.exports=s}),(function(M,G,N){var v,h=N(1);function a(e){v=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,u){if(f==null&&r==null&&u==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{u=f,r=i,f=e;var t=r.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,u);if(f.isInterGraph=!0,f.source=r,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof v){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,u=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*i[0],s=i[1]/u;i[0]t)return i[0]=f,i[1]=o,i[2]=u,i[3]=Y,!1;if(ru)return i[0]=s,i[1]=r,i[2]=P,i[3]=t,!1;if(fu?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>u?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-m===y?u>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=P,i[3]=C,E=!0):m===y&&(u>f?(i[2]=R,i[3]=C,E=!0):(i[2]=$,i[3]=Y,E=!0)),n&&E)return!1;if(f>u?r>t?(I=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,S=f+-L/y,i[0]=S,i[1]=W;break;case 2:S=g,W=r+d*y,i[0]=S,i[1]=W;break;case 3:W=T,S=f+L/y,i[0]=S,i[1]=W;break;case 4:S=l,W=r+-d*y,i[0]=S,i[1]=W;break}if(!E)switch(D){case 1:Q=C,x=u+-_/y,i[2]=x,i[3]=Q;break;case 2:x=$,Q=t+A*y,i[2]=x,i[3]=Q;break;case 3:Q=Y,x=u+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-A*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,u=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,L=void 0,R=void 0,C=void 0,P=void 0,V=void 0,Y=void 0,$=void 0;return L=s-u,C=r-t,V=t*u-r*s,R=T-c,P=o-l,Y=l*c-o*T,$=L*P-R*C,$===0?null:(g=(C*Y-P*V)/$,d=(R*V-L*Y)/$,new v(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,M.exports=h}),(function(M,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},M.exports=v}),(function(M,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,M.exports=v}),(function(M,G,N){var v=(function(){function r(u,t){for(var s=0;s"u"?"undefined":v(a);return a==null||e!="object"&&e!="function"},M.exports=h}),(function(M,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var P=L[0];L.splice(0,1),d.add(P);for(var V=P.getEdges(),g=0;g-1&&C.splice(_,1)}d=new Set,R=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(Y,1);var $=R.getNeighborsList();$.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},M.exports=s}),(function(M,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},M.exports=v}),(function(M,G,N){var v=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new v(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},M.exports=h}),(function(M,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var R=0;Rr}}]),i})();M.exports=e}),(function(M,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,r=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,wt){return Tt&&wt})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*e[ut-1],e[ut-1]=Ct*e[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},M.exports=v}),(function(M,G,N){var v=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var G={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var u in f)r[u]=f[u];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),u=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,R=i(551).Layout,C=i(551).Integer,P=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,$=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var D=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=O[tt],O[tt]=O[H],O[H]=k;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:O.gap})}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new $,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var S;for(S=0;Sm&&(m=Math.floor(D.y)),I=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),I=new Y;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var D=0;D1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),B--,X--}E!=null?O=(z.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[S]=[]),E[S]=E[S].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;By?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,D=m.labelMarginLeft,S=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,D,S)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),D;return IS&&(S=B.getWidth())});var W=I/y,x=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return S>rt&&(rt=S),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(O){return O.rect.width*O.rect.height},W=function(O,H){return S(H)-S(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=I,H(B.id,O.id)):H(B,O)});for(var x=0,Q=0,z=0;z0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var D=n.rowWidth[I];if(D+n.horizontalPadding+E<=n.width)return!0;var S=0;n.rowHeight[I]0&&(S=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+S)/(D+E+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,S=0;SD&&(D=m[S].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(I0)for(var rt=D;rt<=S;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,k=0;k{var f=i(551).FDLayoutNode,r=i(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var Z=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(b,U){m[U]=[b.position.x,b.position.y],y[U]=[d[g.get(b.nodeId)],L[g.get(b.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var b=0;if(l.alignmentConstraint.vertical){for(var U=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;dt.size>0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).x,U[et].forEach(function(pt){m[b]=[Mt,L[g.get(pt)]],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},K=0;K0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).y,q[et].forEach(function(pt){m[b]=[d[g.get(pt)],Mt],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(b,U){var Z={x:d[g.get(b.nodeId)],y:L[g.get(b.nodeId)]},K=b.position,q=Y(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(b,U){d[U]+=mt.x}),L.forEach(function(b,U){L[U]+=mt.y}),l.fixedNodeConstraint.forEach(function(b){d[g.get(b.nodeId)]=b.position.x,L[g.get(b.nodeId)]=b.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ot=l.alignmentConstraint.vertical,Rt=function(U){var Z=new Set;Ot[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return S.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=$(Z).x,Z.forEach(function(at){S.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=L[g.get(K.values().next().value)]:q=$(Z).y,Z.forEach(function(at){S.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return G[a](i,i.exports,v),i.exports}var h=v(45);return h})()})})(he)),he.exports}var yr=se.exports,Oe;function mr(){return Oe||(Oe=1,(function(w,F){(function(G,N){w.exports=N(pr())})(yr,function(M){return(()=>{var G={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),L;!(l=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));l=!0);}catch(R){T=!0,g=R}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var D=0;D1){L=g[0],R=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,R=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=C.next()).done);d=!0){var V=P.value,Y=f(V,2),$=Y[0],A=Y[1],_=o.cy.getElementById($);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){L=!0,R=x}finally{try{!d&&C.return&&C.return()}finally{if(L)throw R}}var I=t.x-(l+c)/2,D=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+D})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=B)});var S=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+S,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,R=void 0,C=void 0,P=void 0,V=t.descendants().not(":parent"),Y=V.length,$=0;$L&&(l=L),TC&&(g=C),d{var f=i(548),r=i(140).CoSELayout,u=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,L){var R=d.cy,C=d.eles,P=C.nodes(),V=C.edges(),Y=void 0,$=void 0,A=void 0,_={};d.randomize&&(Y=L.nodeIndexes,$=L.xCoords,A=L.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(R,C),m=function W(x,Q,z,X){for(var rt=Q.length,B=0;B0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,B=0;B0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,S=D.newGraphManager();return m(S.addRoot(),f.getTopMostNodes(P),D,d),y(D,S,V),I(D,d),D.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(L,R){for(var C=0;C0)if(p){var I=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(P,C.eles,I),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=P.collection();if(C.tile){var S=new Map,W=[],x=[],Q=0,z={nodeIndexes:S,xCoords:W,yCoords:x},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,$.push(l(C,Y[it])),t.relocateComponent(_[it],$[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],k=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(k).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else $[it][Dt.id()]&&Et.nodes.push({x:$[it][Dt.id()].getLeft(),y:$[it][Dt.id()].getTop(),width:$[it][Dt.id()].getWidth(),height:$[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else $[it][mt.id()]&&$[it][Ot.id()]&&Et.edges.push({startX:$[it][mt.id()].getCenterX(),startY:$[it][mt.id()].getCenterY(),endX:$[it][Ot.id()].getCenterX(),endY:$[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys($[vt]).forEach(function(it){var ut=$[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?($.push(l(C,Y[0])),t.relocateComponent(_[0],$[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return $.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(P,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(R,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,u=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,L=new Map,R=new Map,C=[],P=[],V=[],Y=[],$=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,D=o.nodeSeparation,S=void 0,W=function(){for(var U=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=C[nt],lt=0;ltdt&&(dt=$[Lt],Mt=Lt)}return Mt},Q=function(U){var Z=void 0;if(U){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?C[U].push(R.get(Z.id())):C[U].push(Z.id()))})});var Nt=function(U){var Z=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=R.get(q):K=q,C[Z].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(b){it=!0,ut=b}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){S=E{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return G[a](i,i.exports,v),i.exports}var h=v(579);return h})()})})(se)),se.exports}var Er=mr(),Tr=qe(Er),xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:ct(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:ct(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:ct(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},oe={L:ct((w,F)=>w-F+2,"L"),R:ct((w,F)=>w-2,"R"),T:ct((w,F)=>w-F+2,"T"),B:ct((w,F)=>w-2,"B")},Nr=ct(function(w){return Wt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(w){const F=w;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),Wt=ct(function(w){const F=w;return F==="L"||F==="R"},"isArchitectureDirectionX"),qt=ct(function(w){const F=w;return F==="T"||F==="B"},"isArchitectureDirectionY"),Te=ct(function(w,F){const M=Wt(w)&&qt(F),G=qt(w)&&Wt(F);return M||G},"isArchitectureDirectionXY"),Lr=ct(function(w){const F=w[0],M=w[1],G=Wt(F)&&qt(M),N=qt(F)&&Wt(M);return G||N},"isArchitecturePairXY"),wr=ct(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(w,F){const M=`${w}${F}`;return wr(M)?M:void 0},"getArchitectureDirectionPair"),Cr=ct(function([w,F],M){const G=M[0],N=M[1];return Wt(G)?qt(N)?[w+(G==="L"?-1:1),F+(N==="T"?1:-1)]:[w+(G==="L"?-1:1),F]:Wt(N)?[w+(N==="L"?1:-1),F+(G==="T"?1:-1)]:[w,F+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mr=ct(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=ct(function(w,F){return Te(w,F)?"bend":Wt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Dr=ct(function(w){return w.type==="service"},"isArchitectureService"),Or=ct(function(w){return w.type==="junction"},"isArchitectureJunction"),be=ct((w,F)=>{const[M,G]=[w,F].sort();return`${JSON.stringify(M)}-${JSON.stringify(G)}`},"architectureGroupAlignmentKey"),Pe=ct(w=>w.data(),"edgeData"),ie=ct(w=>w.data(),"nodeData"),xr=or.architecture,Ge=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}static{ct(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:w,icon:F,in:M,title:G,iconText:N}){if(this.registeredIds.has(w))throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:F,iconText:N,title:G,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(Dr)}addJunction({id:w,in:F}){if(this.registeredIds.has(w))throw new Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(F!==void 0){if(w===F)throw new Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw new Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw new Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(Or)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:F,in:M,title:G}){if(this.registeredIds.has(w))throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:F,title:G,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:F,lhsDir:M,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:a,title:e}){if(!Re(M))throw new Error(`Invalid direction given for left hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(M)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(G)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw new Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes.get(w).in,f=this.nodes.get(F).in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:w,lhsDir:M,lhsInto:N,lhsGroup:h,rhsId:F,rhsDir:G,rhsInto:v,rhsGroup:a,title:e};this.edges.push(r);const u=this.nodes.get(w),t=this.nodes.get(F);u&&t&&(u.edges.push(this.edges[this.edges.length-1]),t.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw new Error(`An align directive requires at least two members; got ${w.members.length}`);const F=new Set;w.members.forEach(M=>{if(this.registeredIds.get(M)!=="node")throw new Error(`align ${w.direction} references [${M}], which is not a service or junction`);if(F.has(M))throw new Error(`align ${w.direction} lists [${M}] more than once`);F.add(M)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const w=new Map,F=new Map;for(const[h,a]of this.nodes.entries()){const e=new Map;for(const i of a.edges){const f=this.getNode(i.lhsId)?.in,r=this.getNode(i.rhsId)?.in;if(f&&r&&f!==r){const u=Ar(i.lhsDir,i.rhsDir);u!=="bend"&&w.set(be(f,r),u)}if(i.lhsId===h){const u=pe(i.lhsDir,i.rhsDir);u&&e.set(u,i.rhsId)}else{const u=pe(i.rhsDir,i.lhsDir);u&&e.set(u,i.lhsId)}}F.set(h,e)}const M=new Set,G=new Set(F.keys()),N=ct(h=>{const a=new Map([[h,[0,0]]]),e=[h];for(;e.length>0;){const i=e.shift();if(i){M.add(i),G.delete(i);const f=F.get(i);if(!f)throw new Error(`BFS error: adjacency list for id ${i} not found. Please report this as a bug.`);const r=a.get(i);if(!r)throw new Error(`BFS error: position for id ${i} not found in spatial map. Please report this as a bug.`);const[u,t]=r;f.forEach((s,o)=>{M.has(s)||(a.set(s,Cr([u,t],o)),e.push(s))})}}return a},"BFS"),v=[];for(;G.size>0;){const h=G.values().next().value;v.push(N(h))}this.dataStructures={adjList:F,spatialMaps:v,groupAlignments:w}}return this.dataStructures}setElementForId(w,F){this.elements.set(w,F)}getElementById(w){return this.elements.get(w)}getConfig(){return ar({...xr,...nr().architecture})}getConfigField(w){return this.getConfig()[w]}},Ir=ct((w,F)=>{Ze(w,F),w.groups.map(M=>F.addGroup(M)),w.services.map(M=>F.addService({...M,type:"service"})),w.junctions.map(M=>F.addJunction({...M,type:"junction"})),w.edges.map(M=>F.addEdge(M)),w.alignments?.map(M=>F.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Ue={parser:{yy:void 0},parse:ct(async w=>{const F=await gr("architecture",w);Se.debug(F);const M=Ue.parser?.yy;if(!(M instanceof Ge))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ir(F,M)},"parse")},Rr=ct(w=>`
+  .edge {
+    stroke-width: ${w.archEdgeWidth};
+    stroke: ${w.archEdgeColor};
+    fill: none;
+  }
+
+  .arrow {
+    fill: ${w.archEdgeArrowColor};
+  }
+
+  .node-bkg {
+    fill: none;
+    stroke: ${w.archGroupBorderColor};
+    stroke-width: ${w.archGroupBorderWidth};
+    stroke-dasharray: 8;
+  }
+  .node-icon-text {
+    display: flex; 
+    align-items: center;
+  }
+  
+  .node-icon-text > div {
+    color: #fff;
+    margin: 1px;
+    height: fit-content;
+    text-align: center;
+    overflow: hidden;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+  }
+`,"getStyles"),Sr=Rr;function ye(w,F){if(w===0)return F();const M=Math.random;let G=w>>>0;Math.random=function(){G=G+1831565813>>>0;let N=G;return N=Math.imul(N^N>>>15,N|1),N^=N+Math.imul(N^N>>>7,N|61),((N^N>>>14)>>>0)/4294967296};try{return F()}finally{Math.random=M}}ct(ye,"withSeededRandom");var re=ct(w=>`${w}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:cr,blank:{body:re("")}}},Fr=ct(async function(w,F,M,G){const N=M.getConfigField("padding"),v=M.getConfigField("iconSize"),h=v/2,a=v/6,e=a/2;await Promise.all(F.edges().map(async i=>{const{source:f,sourceDir:r,sourceArrow:u,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=Pe(i);let{x:g,y:d}=i[0].sourceEndpoint();const{x:L,y:R}=i[0].midpoint();let{x:C,y:P}=i[0].targetEndpoint();const V=N+4;if(t&&(Wt(r)?g+=r==="L"?-V:V:d+=r==="T"?-V:V+18),l&&(Wt(o)?C+=o==="L"?-V:V:P+=o==="T"?-V:V+18),!t&&M.getNode(f)?.type==="junction"&&(Wt(r)?g+=r==="L"?h:-h:d+=r==="T"?h:-h),!l&&M.getNode(s)?.type==="junction"&&(Wt(o)?C+=o==="L"?h:-h:P+=o==="T"?h:-h),i[0]._private.rscratch){const Y=w.insert("g");if(Y.insert("path").attr("d",`M ${g},${d} L ${L},${R} L${C},${P} `).attr("class","edge").attr("id",`${G}-${lr(f,s,{prefix:"L"})}`),u){const $=Wt(r)?oe[r](g,a):g-e,A=qt(r)?oe[r](d,a):d-e;Y.insert("polygon").attr("points",Ie[r](a)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(c){const $=Wt(o)?oe[o](C,a):C-e,A=qt(o)?oe[o](P,a):P-e;Y.insert("polygon").attr("points",Ie[o](a)).attr("transform",`translate(${$},${A})`).attr("class","arrow")}if(T){const $=Te(r,o)?"XY":Wt(r)?"X":"Y";let A=0;$==="X"?A=Math.abs(g-C):$==="Y"?A=Math.abs(d-P)/1.5:A=Math.abs(g-C)/2;const _=Y.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},me()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),$==="X")_.attr("transform","translate("+L+", "+R+")");else if($==="Y")_.attr("transform","translate("+L+", "+R+") rotate(-90)");else if($==="XY"){const n=pe(r,o);if(n&&Lr(n)){const E=_.node().getBoundingClientRect(),[p,m]=Mr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*m*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
+                translate(${L}, ${R-E.height/2})
+                translate(${p*y.width/2}, ${m*y.height/2})
+                rotate(${-1*p*m*45}, 0, ${E.height/2})
+              `)}}}}}))},"drawEdges"),br=ct(async function(w,F,M,G){const v=M.getConfigField("padding")*.75,h=M.getConfigField("fontSize"),e=M.getConfigField("iconSize")/2;await Promise.all(F.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:r,w:u,x1:t,y1:s}=i.boundingBox(),o=w.append("rect");o.attr("id",`${G}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",u).attr("height",r).attr("class","node-bkg");const c=w.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:v,width:v,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+e+1)+", "+(T+e+1)+")"),l+=v,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:u,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+e+4)+", "+(T+e+2)+")")}M.setElementForId(f.id,o)}}))},"drawGroups"),Pr=ct(async function(w,F,M,G){const N=me();for(const v of M){const h=F.append("g"),a=w.getConfigField("iconSize");if(v.title){const r=h.append("g");await Ee(r,v.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},N),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),r.attr("transform","translate("+a/2+", "+a+")")}const e=h.append("g");if(v.icon)e.html(`${await ve(v.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}`);else if(v.iconText){e.html(`${await ve("blank",{height:a,width:a,fallbackPrefix:ae.prefix})}`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(sr(v.iconText,N)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${G}-node-${v.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);h.attr("id",`${G}-service-${v.id}`).attr("class","architecture-service");const{width:i,height:f}=h.node().getBBox();v.width=i,v.height=f,w.setElementForId(v.id,h)}return 0},"drawServices"),Gr=ct(function(w,F,M,G){M.forEach(N=>{const v=F.append("g"),h=w.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${G}-node-${N.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),v.attr("class","architecture-junction");const{width:e,height:i}=v._groups[0][0].getBBox();v.width=e,v.height=i,w.setElementForId(N.id,v)})},"drawJunctions");fr([{name:ae.prefix,icons:ae}]);Fe.use(Tr);function Ye(w,F,M){w.forEach(G=>{F.add({group:"nodes",data:{type:"service",id:G.id,icon:G.icon,label:G.title,parent:G.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-service"})})}ct(Ye,"addServices");function Xe(w,F,M){w.forEach(G=>{F.add({group:"nodes",data:{type:"junction",id:G.id,parent:G.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-junction"})})}ct(Xe,"addJunctions");function He(w,F){F.nodes().map(M=>{const G=ie(M);if(G.type==="group")return;G.x=M.position().x,G.y=M.position().y,w.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")")})}ct(He,"positionNodes");function We(w,F){w.forEach(M=>{F.add({group:"nodes",data:{type:"group",id:M.id,icon:M.icon,label:M.title,parent:M.in},classes:"node-group"})})}ct(We,"addGroups");function Ve(w,F){w.forEach(M=>{const{lhsId:G,rhsId:N,lhsInto:v,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:i,rhsGroup:f,title:r}=M,u=Te(M.lhsDir,M.rhsDir)?"segments":"straight",t={id:`${G}-${N}`,label:r,source:G,sourceDir:e,sourceArrow:v,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:N,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};F.add({group:"edges",data:t,classes:u})})}ct(Ve,"addEdges");function $e(w,F,M,G=[]){const N=ct((u,t)=>{const s=new Map;for(const[o,c]of u.entries()){const l=`${o}`;let T=0;const g=[...c.entries()];if(g.length===1){s.set(l,g[0][1]);continue}for(let d=0;d{const t=new Map,s=new Map;return u.forEach(([o,c],l)=>{const T=w.getNode(l)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const d=s.get(o)??new Map;s.has(o)||s.set(o,d);for(const L of[g,d]){const R=L.get(T)??[];L.has(T)||L.set(T,R),R.push(l)}}),{horiz:[...N(t,"horizontal").values()].filter(o=>o.length>1),vert:[...N(s,"vertical").values()].filter(o=>o.length>1)}}),[h,a]=v.reduce(([u,t],{horiz:s,vert:o})=>[[...u,...s],[...t,...o]],[[],[]]),e=new Set;G.forEach(u=>u.members.forEach(t=>e.add(t)));const i=ct(u=>u.filter(t=>!t.some(s=>e.has(s))),"dropOverlapping"),f=i(h),r=i(a);return G.forEach(u=>{u.members.length<2||(u.direction==="row"?f.push([...u.members]):r.push([...u.members]))}),{horizontal:f,vertical:r}}ct($e,"getAlignments");function ze(w,F,M=[]){const G=[],N=F.getConfigField("iconSize"),v=F.getConfigField("idealEdgeLengthMultiplier"),h=v*N,a=new Set;M.forEach(f=>{for(let r=0;r`${f[0]},${f[1]}`,"posToStr"),i=ct(f=>f.split(",").map(r=>parseInt(r)),"strToPos");return w.forEach(f=>{const r=new Map([...f.entries()].map(([o,c])=>[e(c),o])),u=[e([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;u.length>0;){const o=u.shift();if(o){t[o]=1;const c=r.get(o);if(c){const l=i(o);Object.entries(s).forEach(([T,g])=>{const d=e([l[0]+g[0],l[1]+g[1]]),L=r.get(d);if(L&&!t[d]){if(u.push(d),a.has(`${c}|${L}`))return;G.push({[xe[T]]:L,[xe[Nr(T)]]:c,gap:v*N})}})}}}}),G}ct(ze,"getRelativeConstraints");function Be(w,F,M,G,N,{spatialMaps:v,groupAlignments:h}){return new Promise(a=>{const e=hr("body").append("div").attr("id","cy").attr("style","display:none"),i=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),We(M,i),Ye(w,i,N),Xe(F,i,N),Ve(G,i);const f=N.getLayoutHints(),r=$e(N,v,h,f),u=ze(v,N,f),t=N.getConfigField("iconSize"),s=N.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=N.getConfigField("edgeElasticity"),l=N.getConfigField("seed"),T=i.layout({name:"fcose",quality:"proof",randomize:N.getConfigField("randomize"),nodeSeparation:N.getConfigField("nodeSeparation"),numIter:N.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[d,L]=g.connectedNodes(),{parent:R}=ie(d),{parent:C}=ie(L);return R===C?s:o},edgeElasticity(g){const[d,L]=g.connectedNodes(),{parent:R}=ie(d),{parent:C}=ie(L);return R===C?c:.001},alignmentConstraint:r,relativePlacementConstraint:u});T.one("layoutstop",()=>{function g(d,L,R,C){let P,V;const{x:Y,y:$}=d,{x:A,y:_}=L;V=(C-$+(Y-R)*($-_)/(Y-A))/Math.sqrt(1+Math.pow(($-_)/(Y-A),2)),P=Math.sqrt(Math.pow(C-$,2)+Math.pow(R-Y,2)-Math.pow(V,2));const n=Math.sqrt(Math.pow(A-Y,2)+Math.pow(_-$,2));P=P/n;let E=(A-Y)*(C-$)-(_-$)*(R-Y);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let p=(A-Y)*(R-Y)+(_-$)*(C-$);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return V=Math.abs(V)*E,P=P*p,{distances:V,weights:P}}ct(g,"getSegmentWeights"),i.startBatch();for(const d of Object.values(i.edges()))if(d.data?.()){const{x:L,y:R}=d.source().position(),{x:C,y:P}=d.target().position();if(L!==C&&R!==P){const V=d.sourceEndpoint(),Y=d.targetEndpoint(),{sourceDir:$}=Pe(d),[A,_]=qt($)?[V.x,Y.y]:[Y.x,V.y],{weights:n,distances:E}=g(V,Y,A,_);d.style("segment-distances",E),d.style("segment-weights",n)}}i.endBatch(),ye(l,()=>T.run())});try{ye(l,()=>T.run())}catch(g){throw g instanceof RangeError&&g.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):g}i.ready(g=>{Se.info("Ready",g),a(i)})})}ct(Be,"layoutArchitecture");var Ur=ct(async(w,F,M,G)=>{const N=G.db;N.setDiagramId(F);const v=N.getServices(),h=N.getJunctions(),a=N.getGroups(),e=N.getEdges(),i=N.getDataStructures(),f=Qe(F),r=f.append("g");r.attr("class","architecture-edges");const u=f.append("g");u.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Pr(N,u,v,F),Gr(N,u,h,F);const s=await Be(v,h,a,e,N,i);await Fr(r,s,N,F),await br(t,s,N,F),He(N,s),Je(void 0,f,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Yr={draw:Ur},$r={parser:Ue,get db(){return new Ge},renderer:Yr,styles:Sr};export{$r as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-9SgEZEpV.js b/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-9SgEZEpV.js
deleted file mode 100644
index 3ccaf4b8c..000000000
--- a/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-9SgEZEpV.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import{g as pe}from"./chunk-FMBD7UC4-CO8Ccrhy.js";import{an as fe,ao as Ut,ap as xe,aq as ye,ar as be,as as we,at as me,au as Se,av as Le,aw as ke,ax as ve,ay as Ee,az as _e,aA as Te,aB as De,aC as Be,aD as Ne,aE as Ie,aF as Ce,aG as Oe,aH as Re,aI as Ae,aJ as ze,aK as Me,aL as Pe,_ as d,F as at,d as D,e as Fe,l as k,A as We,C as Ye,aM as He,a9 as Ke,aa as Ue,c as A,a6 as Xe,aN as P,aO as vt,aP as $,aQ as Ve,u as tt,k as je,aR as Ge,i as Ot,aS as Rt,aT as Ze}from"./mermaid.core-Bt2TZ_t_.js";import{G as qe}from"./graph--OzhPTMs.js";import{c as Je}from"./channel-DxVW30WC.js";import"./index-C-zUV3mO.js";function Qe(e){return Array.isArray(e)}function $e(e){if(fe(e))return e;const t=Ut(e);if(!tr(e))return{};if(Qe(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(xe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?rr(i,e):yt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return yt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ar(a,e),yt(a,e),er(a,e),a}function tr(e){switch(Ut(e)){case Pe:case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:return!0;default:return!1}}function yt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function er(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function ar(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=(function(){var e=d(function(T,m,u,y){for(u=u||{},y=T.length;y--;u[T[y]]=m);return u},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],o=[8,10,21,28,29,30,31,39,43,46],p=[1,23],b=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(m,u,y,L,E,h,W){var f=h.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[f-1]),L.setHierarchy(h[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[f]),typeof h[f].length=="number"?this.$=h[f]:this.$=[h[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[f-1]),this.$=[h[f-1]].concat(h[f]);break;case 14:L.getLogger().debug("Rule: link: ",h[f],m),this.$={edgeTypeStr:h[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[f-3],h[f-1],h[f]),this.$={edgeTypeStr:h[f],label:h[f-1]};break;case 18:const O=parseInt(h[f]),q=L.generateId();this.$={id:q,type:"space",label:"",width:O,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[f-2],h[f-1],h[f]," typestr: ",h[f-1].edgeTypeStr);const j=L.edgeStrToEdgeData(h[f-1].edgeTypeStr),st=L.edgeStrToEdgeStartData(h[f-1].edgeTypeStr),dt=L.edgeStrToThickness(h[f-1].edgeTypeStr),R=L.edgeStrToPattern(h[f-1].edgeTypeStr);this.$=[{id:h[f-2].id,label:h[f-2].label,type:h[f-2].type,directions:h[f-2].directions},{id:h[f-2].id+"-"+h[f].id,start:h[f-2].id,end:h[f].id,label:h[f-1].label,type:"edge",thickness:dt,pattern:R,directions:h[f].directions,arrowTypeEnd:j,arrowTypeStart:st},{id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[f-1],h[f]),this.$={id:h[f-1].id,label:h[f-1].label,type:L.typeStr2Type(h[f-1].typeStr),directions:h[f-1].directions,widthInColumns:parseInt(h[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[f]),this.$={id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[f]),this.$={type:"column-setting",columns:h[f]==="auto"?-1:parseInt(h[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[f-2],h[f-1]),L.generateId(),this.$={...h[f-2],type:"composite",children:h[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[f-2],h[f-1],h[f]);const G=L.generateId();this.$={id:G,type:"composite",label:"",children:h[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[f]),this.$={id:h[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[f-1],h[f]),this.$={id:h[f-1],label:h[f].label,typeStr:h[f].typeStr,directions:h[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[f]),this.$=[h[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[f-1],h[f]),this.$=[h[f-1]].concat(h[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[f-2],h[f-1],h[f]),this.$={typeStr:h[f-2]+h[f],label:h[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[f-3],h[f-2]," #3:",h[f-1],h[f]),this.$={typeStr:h[f-3]+h[f],label:h[f-2],directions:h[f-1]};break;case 35:case 36:this.$={type:"classDef",id:h[f-1].trim(),css:h[f].trim()};break;case 37:this.$={type:"applyClass",id:h[f-1].trim(),styleClass:h[f].trim()};break;case 38:this.$={type:"applyStyles",id:h[f-1].trim(),stylesStr:h[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(o,[2,16],{14:22,15:p,16:b}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(x,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(m,u){if(u.recoverable)this.trace(m);else{var y=new Error(m);throw y.hash=u,y}},"parseError"),parse:d(function(m){var u=this,y=[0],L=[],E=[null],h=[],W=this.table,f="",O=0,q=0,j=2,st=1,dt=h.slice.call(arguments,1),R=Object.create(this.lexer),G={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(G.yy[ut]=this.yy[ut]);R.setInput(m,G.yy),G.yy.lexer=R,G.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var pt=R.yylloc;h.push(pt);var de=R.options&&R.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(Y){y.length=y.length-2*Y,E.length=E.length-Y,h.length=h.length-Y}d(ue,"popStack");function It(){var Y;return Y=L.pop()||R.lex()||st,typeof Y!="number"&&(Y instanceof Array&&(L=Y,Y=L.pop()),Y=u.symbols_[Y]||Y),Y}d(It,"lex");for(var F,J,K,ft,Q={},it,Z,Ct,nt;;){if(J=y[y.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=It()),K=W[J]&&W[J][F]),typeof K>"u"||!K.length||!K[0]){var xt="";nt=[];for(it in W[J])this.terminals_[it]&&it>j&&nt.push("'"+this.terminals_[it]+"'");R.showPosition?xt="Parse error on line "+(O+1)+`:
-`+R.showPosition()+`
-Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xt="Parse error on line "+(O+1)+": Unexpected "+(F==st?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xt,{text:R.match,token:this.terminals_[F]||F,line:R.yylineno,loc:pt,expected:nt})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(K[0]){case 1:y.push(F),E.push(R.yytext),h.push(R.yylloc),y.push(K[1]),F=null,q=R.yyleng,f=R.yytext,O=R.yylineno,pt=R.yylloc;break;case 2:if(Z=this.productions_[K[1]][1],Q.$=E[E.length-Z],Q._$={first_line:h[h.length-(Z||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(Z||1)].first_column,last_column:h[h.length-1].last_column},de&&(Q._$.range=[h[h.length-(Z||1)].range[0],h[h.length-1].range[1]]),ft=this.performAction.apply(Q,[f,q,O,G.yy,K[1],E,h].concat(dt)),typeof ft<"u")return ft;Z&&(y=y.slice(0,-1*Z*2),E=E.slice(0,-1*Z),h=h.slice(0,-1*Z)),y.push(this.productions_[K[1]][0]),E.push(Q.$),h.push(Q._$),Ct=W[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},_=(function(){var T={EOF:1,parseError:d(function(u,y){if(this.yy.parser)this.yy.parser.parseError(u,y);else throw new Error(u)},"parseError"),setInput:d(function(m,u){return this.yy=u||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var u=m.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var u=m.length,y=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1&&(this.yylineno-=y.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===L.length?this.yylloc.first_column:0)+L[L.length-y.length].length-y[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
-`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),u=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
-`+u+"^"},"showPosition"),test_match:d(function(m,u){var y,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],y=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,u,y,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hu[0].length)){if(u=y,L=h,this.options.backtrack_lexer){if(m=this.test_match(y,E[h]),m!==!1)return m;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(m=this.test_match(u,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
-`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var u=this.next();return u||this.lex()},"lex"),begin:d(function(u){this.conditionStack.push(u)},"begin"),popState:d(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:d(function(u){this.begin(u)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(u,y,L,E){switch(L){case 0:return u.getLogger().debug("Found block-beta"),10;case 1:return u.getLogger().debug("Found id-block"),29;case 2:return u.getLogger().debug("Found block"),10;case 3:u.getLogger().debug(".",y.yytext);break;case 4:u.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),u.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:u.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return u.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),u.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",u.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),u.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),u.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),u.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),u.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),u.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),u.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),u.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),u.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),u.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),u.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return u.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return u.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return u.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return u.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return u.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return u.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return u.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),u.getLogger().debug("LEX ARR START"),37;case 74:return u.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return u.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:u.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:u.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return u.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:u.getLogger().debug("LEX POPPING"),this.popState();break;case 84:u.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",u.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return u.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return u.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=_;function I(){this.yy={}}return d(I,"Parser"),I.prototype=S,S.Parser=I,new I})();wt.parser=wt;var sr=wt,X=new Map,Et=[],mt=new Map,At="color",zt="fill",ir="bgFill",Xt=",",nr=A(),lt=new Map,_t="",cr=d(e=>je.sanitizeText(e,nr),"sanitizeText"),lr=d(function(e,t=""){let a=lt.get(e);a||(a={id:e,styles:[],textStyles:[]},lt.set(e,a)),t?.split(Xt).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(At).exec(s)){const r=i.replace(zt,ir).replace(At,zt);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),or=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Xt))},"addStyle2Node"),hr=d(function(e,t){e.split(",").forEach(function(a){let s=X.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},X.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Vt=d((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=cr(r.label)),r.type==="classDef"){lr(r.id,r.css);continue}if(r.type==="applyClass"){hr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&or(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Vt(r.children,r),r.type==="space"){const l=r.width??1;for(let g=0;g{k.debug("Clear called"),We(),rt={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",rt]]),Tt=[],lt=new Map,Et=[],mt=new Map,_t=""},"clear");function jt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(jt,"typeStr2Type");function Gt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}d(Gt,"edgeTypeStr2Type");function Zt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Zt,"edgeStrToEdgeData");function qt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}d(qt,"edgeStrToEdgeStartData");function Jt(e){return e.includes("==")?"thick":"normal"}d(Jt,"edgeStrToThickness");function Qt(e){return e.includes(".-")?"dotted":"solid"}d(Qt,"edgeStrToPattern");var Mt=0,dr=d(()=>(Mt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mt),"generateId"),ur=d(e=>{rt.children=e,Vt(e,rt),Tt=rt.children},"setHierarchy"),pr=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),fr=d(()=>[...X.values()],"getBlocksFlat"),xr=d(()=>Tt||[],"getBlocks"),yr=d(()=>Et,"getEdges"),br=d(e=>X.get(e),"getBlock"),wr=d(e=>{X.set(e.id,e)},"setBlock"),mr=d(e=>{_t=e},"setDiagramId"),Sr=d(()=>_t,"getDiagramId"),Lr=d(()=>k,"getLogger"),kr=d(function(){return lt},"getClasses"),vr={getConfig:d(()=>at().block,"getConfig"),typeStr2Type:jt,edgeTypeStr2Type:Gt,edgeStrToEdgeData:Zt,edgeStrToEdgeStartData:qt,edgeStrToThickness:Jt,edgeStrToPattern:Qt,getLogger:Lr,getBlocksFlat:fr,getBlocks:xr,getEdges:yr,setHierarchy:ur,getBlock:br,setBlock:wr,getColumns:pr,getClasses:kr,clear:gr,generateId:dr,setDiagramId:mr,getDiagramId:Sr},Er=vr,bt=d((e,t)=>{const a=Je,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return Ye(s,i,c,t)},"fade"),_r=d(e=>`.label {
-    font-family: ${e.fontFamily};
-    color: ${e.nodeTextColor||e.textColor};
-  }
-  .cluster-label text {
-    fill: ${e.titleColor};
-  }
-  .cluster-label span,p {
-    color: ${e.titleColor};
-  }
-
-
-
-  .label text,span,p {
-    fill: ${e.nodeTextColor||e.textColor};
-    color: ${e.nodeTextColor||e.textColor};
-  }
-
-  .node rect,
-  .node circle,
-  .node ellipse,
-  .node polygon,
-  .node path {
-    fill: ${e.mainBkg};
-    stroke: ${e.nodeBorder};
-    stroke-width: 1px;
-  }
-  .flowchart-label text {
-    text-anchor: middle;
-  }
-  // .flowchart-label .text-outer-tspan {
-  //   text-anchor: middle;
-  // }
-  // .flowchart-label .text-inner-tspan {
-  //   text-anchor: start;
-  // }
-
-  .node .label {
-    text-align: center;
-  }
-  .node.clickable {
-    cursor: pointer;
-  }
-
-  .arrowheadPath {
-    fill: ${e.arrowheadColor};
-  }
-
-  .edgePath .path {
-    stroke: ${e.lineColor};
-    stroke-width: 2.0px;
-  }
-
-  .flowchart-link {
-    stroke: ${e.lineColor};
-    fill: none;
-  }
-
-  .edgeLabel {
-    background-color: ${e.edgeLabelBackground};
-    /*
-     * This is for backward compatibility with existing code that didn't
-     * add a \`

\` around edge labels. - * - * TODO: We should probably remove this in a future release. - */ - p { - margin: 0; - padding: 0; - display: inline; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${e.edgeLabelBackground}; - } - - .node .cluster { - // fill: ${bt(e.mainBkg,.5)}; - fill: ${bt(e.clusterBkg,.5)}; - stroke: ${bt(e.clusterBorder,.2)}; - box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span,p { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - ${pe()} -`,"getStyles"),Tr=_r,Dr=d((e,t,a,s)=>{t.forEach(i=>{Pr[i](e,a,s)})},"insertMarkers"),Br=d((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Nr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ir=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Cr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Or=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Rr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Ar=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),zr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Mr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pr={extension:Br,composition:Nr,aggregation:Ir,dependency:Cr,lollipop:Or,point:Rr,circle:Ar,cross:zr,barb:Mr},Fr=Dr,C=A()?.block?.padding??8;function St(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}d(St,"calculateBlockPosition");var Wr=d(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,s=0){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let i=0,c=0;if(e.children?.length>0){for(const x of e.children)ot(x,t);const r=Wr(e);i=r.width,c=r.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,c);for(const x of e.children)x.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${x.id} ${i} ${c} ${JSON.stringify(x.size)}`),x.size.width=i*(x.widthInColumns??1)+C*((x.widthInColumns??1)-1),x.size.height=c,x.size.x=0,x.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${x.id} maxWidth:${i} maxHeight:${c}`));for(const x of e.children)ot(x,t,i,c);const n=e.columns??-1;let l=0;for(const x of e.children)l+=x.widthInColumns??1;let g=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(x>0){const w=(p-x*C-C)/x;k.debug("abc95 (growing to fit) width",e.id,p,e.size?.width,w);for(const v of e.children)v.size&&(v.size.width=w)}}e.size={width:p,height:b,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Dt(e,t){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const s=e?.children[0]?.size?.width??0,i=e.children.length*s+(e.children.length-1)*C;k.debug("widthOfChildren 88",i,"posX");const c=new Map;{let o=0;for(const p of e.children){if(!p.size)continue;const{py:b}=St(a,o),x=c.get(b)??0;p.size.height>x&&c.set(b,p.size.height);let w=p?.widthInColumns??1;a>0&&(w=Math.min(w,a-o%a)),o+=w}}const r=new Map;{let o=0;const p=[...c.keys()].sort((b,x)=>b-x);for(const b of p)r.set(b,o),o+=(c.get(b)??0)+C}let n=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,g=0;for(const o of e.children){const p=e;if(!o.size)continue;const{width:b,height:x}=o.size,{px:w,py:v}=St(a,n);if(v!=g&&(g=v,l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,k.debug("New row in layout for block",e.id," and child ",o.id,g)),k.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${n} (px, py) ${w},${v} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${b}${C}`),p.size){const _=b/2;o.size.x=l+C+_,k.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${l} new startingPosX${o.size.x} ${_} padding=${C} width=${b} halfWidth=${_} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${b*(o?.widthInColumns??1)/2}`),l=o.size.x+_;const I=r.get(v)??0,T=c.get(v)??x;o.size.y=p.size.y-p.size.height/2+I+T/2+C,k.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${l}${C}${_}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${b*(o?.widthInColumns??1)/2}`)}o.children&&Dt(o);let S=o?.widthInColumns??1;a>0&&(S=Math.min(S,a-n%a)),n+=S,k.debug("abc88 columnsPos",o,n)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Dt,"layoutBlocks");function Bt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Bt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}d(Bt,"findBounds");function $t(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Dt(t),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:s,maxX:i,maxY:c}=Bt(t),r=c-s,n=i-a;return{x:a,y:s,width:n,height:r}}d($t,"layout");var Yr=d(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=A(),n=P(r);return await vt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),U=Yr,Hr=d((e,t,a,s,i)=>{t.arrowTypeStart&&Pt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Pt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Kr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Pt=d((e,t,a,s,i,c)=>{const r=Kr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},Ur=d(async(e,t)=>{const a=A(),s=P(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await vt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),g=l;if(s){const p=n.children[0],b=D(n);l=p.getBoundingClientRect(),g=l,b.attr("width",l.width),b.attr("height",l.height)}else{const p=D(n).select("text").node();p&&typeof p.getBBox=="function"&&(g=p.getBBox())}c.attr("transform",$(g,s)),Lt[t.id]=i,t.width=l.width,t.height=l.height;let o;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=p,et(o,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startRight=p,et(o,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=p,et(o,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endRight=p,et(o,t.endLabelRight)}return n},"insertEdgeLabel");function et(e,t){P(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(et,"setTerminalWidth");var Xr=d((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=A(),{subGraphTitleTotalMargin:i}=Ve(s);if(e.label){const c=Lt[e.id];let r=e.x,n=e.y;if(a){const l=tt.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=M[e.id].startRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=M[e.id].endRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Vr=d((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),jr=d((e,t,a)=>{k.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(t)} - insidePoint : ${JSON.stringify(a)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let p=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Vr(t,c)&&!i){const r=jr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Gr=d(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const g=c.node(t.v);var o=c.node(t.w);o?.intersect&&g?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Ft(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Ft(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const p=n.filter(m=>!Number.isNaN(m.y));let b=Ue;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x,y:w}=He(a),v=Ke().x(x).y(w).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const _=e.append("path").attr("d",v(p)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let I="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(I=Xe(!0)),Hr(_,a,I,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),Zr=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),qr=d((e,t,a,s)=>{const i=Zr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,g=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*g},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*g,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*g},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*g,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-g},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r+g}]:i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:[{x:0,y:0}]},"getArrowPoints");function te(e,t){return e.intersect(t)}d(te,"intersectNode");var Jr=te;function ee(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),g=Math.abs(t*a*r/l);s.x0}d(kt,"sameSign");var $r=se,ta=ie;function ie(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,g=i-e.height/2-n,o=0;o1&&c.sort(function(w,v){var S=w.x-a.x,_=w.y-a.y,I=Math.sqrt(S*S+_*_),T=v.x-a.x,m=v.y-a.y,u=Math.sqrt(T*T+m*m);return I{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,g;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,g=n):(i<0&&(r=-r),l=r,g=i===0?0:r*c/i),{x:a+l,y:s+g}},"intersectRect"),ra=ea,B={node:Jr,circle:Qr,ellipse:re,polygon:ta,rect:ra},z=d(async(e,t,a,s)=>{const i=A();let c;const r=t.useHtmlLabels||P(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o;t.labelType==="markdown"?o=vt(l,Ot(Rt(g),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):o=await U(l,Ot(Rt(g),i),t.labelStyle,!1,s);let p=o.getBBox();const b=t.padding/2;if(P(i)){const x=o.children[0],w=D(o);await Ze(x,g),p=x.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):l.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:b,label:l}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function V(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(V,"insertPolygonShape");var aa=d(async(e,t)=>{t.useHtmlLabels||P(A())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await z(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),N(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),sa=aa,Wt=d(e=>e?" "+e:"","formatClass"),H=d((e,t)=>`${t||"node default"}${Wt(e.classes)} ${Wt(e.class)}`,"getClassesFromNode"),Yt=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=V(a,r,r,n);return l.attr("style",t.style),N(t,l),t.intersect=function(g){return k.warn("Intersect called"),B.polygon(t,n,g)},a},"question"),ia=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),na=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],g=V(a,n,c,l);return g.attr("style",t.style),N(t,g),t.intersect=function(o){return B.polygon(t,l,o)},a},"hexagon"),ca=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,g=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,o=qr(t.directions,s,t,g),p=V(a,g,c,o);return p.attr("style",t.style),N(t,p),t.intersect=function(b){return B.polygon(t,o,b)},a},"block_arrow"),la=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return V(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),oa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),ha=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),ga=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),da=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ua=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),pa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,g=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return N(t,g),t.intersect=function(o){const p=B.rect(t,o),b=p.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let x=r*r*(1-b*b/(c*c));x!=0&&(x=Math.sqrt(x)),x=r-x,o.y-t.y>0&&(x=-x),p.y+=x}return p},a},"cylinder"),fa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"rect"),xa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"composite"),ya=d(async(e,t)=>{const{shapeSvg:a}=await z(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return N(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ht(e,t,a,s){const i=[],c=d(n=>{i.push(n,0)},"addBorder"),r=d(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}d(ht,"applyNodePropertyBorders");var ba=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const g=await U(r,l,t.labelStyle,!0,!0);let o={width:0,height:0};if(P(A())){const v=g.children[0],S=D(g);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}k.info("Text 2",n);const p=n.slice(1,n.length);let b=g.getBBox();const x=await U(r,p.join?p.join("
"):p,t.labelStyle,!0,!0);if(P(A())){const v=x.children[0],S=D(x);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}const w=t.padding/2;return D(x).attr("transform","translate( "+(o.width>b.width?0:(b.width-o.width)/2)+", "+(b.height+w+5)+")"),D(g).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return N(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ma=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),N(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),Sa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),N(t,n),t.intersect=function(g){return k.info("DoubleCircle intersect",t,s.width/2+i+c,g),B.circle(t,s.width/2+i+c,g)},a},"doublecircle"),La=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),ka=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Ht=d((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),va=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),Ea=d(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),g=r.insert("line");let o=0,p=s;const b=r.insert("g").attr("class","label");let x=0;const w=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await U(b,v,t.labelStyle,!0,!0);let _=S.getBBox();if(P(A())){const E=S.children[0],h=D(S);_=E.getBoundingClientRect(),h.attr("width",_.width),h.attr("height",_.height)}t.classData.annotations[0]&&(p+=_.height+s,o+=_.width);let I=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(P(A())?I+="<"+t.classData.type+">":I+="<"+t.classData.type+">");const T=await U(b,I,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(P(A())){const E=T.children[0],h=D(T);m=E.getBoundingClientRect(),h.attr("width",m.width),h.attr("height",m.height)}p+=m.height+s,m.width>o&&(o=m.width);const u=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,u.push(f)}),p+=i;const y=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,y.push(f)}),p+=i,w){let E=(o-_.width)/2;D(S).attr("transform","translate( "+(-1*o/2+E)+", "+-1*p/2+")"),x=_.height+s}let L=(o-m.width)/2;return D(T).attr("transform","translate( "+(-1*o/2+L)+", "+(-1*p/2+x)+")"),x+=m.height+s,l.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,u.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x+i/2)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),x+=i,g.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,y.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(p/2)-a).attr("width",o+t.padding).attr("height",p+t.padding),N(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Kt={rhombus:Yt,composite:xa,question:Yt,rect:fa,labelRect:ya,rectWithTitle:ba,choice:ia,circle:ma,doublecircle:Sa,stadium:wa,hexagon:na,block_arrow:ca,rect_left_inv_arrow:la,lean_right:oa,lean_left:ha,trapezoid:ga,inv_trapezoid:da,rect_right_inv_arrow:ua,cylinder:pa,start:ka,end:va,note:sa,subroutine:La,fork:Ht,join:Ht,class_box:Ea},ct={},ne=d(async(e,t,a)=>{let s,i;if(t.link){let c;A().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Kt[t.shape](s,t,a)}else i=await Kt[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ct[t.id]=s,t.haveCallback&&ct[t.id].attr("class",ct[t.id].attr("class")+" clickable"),s},"insertNode"),_a=d(e=>{const t=ct[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Nt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=Ge(s?.styles??[]),g=s.label,o=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:g,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:s.type,padding:n??at()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}d(Nt,"getNodeFromBlock");async function ce(e,t,a){const s=Nt(t,a,!1);if(s.type==="group")return;const i=at(),c=await ne(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}d(ce,"calculateBlockSize");async function le(e,t,a){const s=Nt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=at();await ne(e,s,{config:c}),t.intersect=s?.intersect,_a(s)}}d(le,"insertBlockPositioned");async function gt(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await gt(e,i.children,a,s)}d(gt,"performOperations");async function oe(e,t,a){await gt(e,t,a,ce)}d(oe,"calculateBlockSizes");async function he(e,t,a){await gt(e,t,a,le)}d(he,"insertBlocks");async function ge(e,t,a,s,i){const c=new qe({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const g=n.size,o=l.size,p=[{x:g.x,y:g.y},{x:g.x+(o.x-g.x)/2,y:g.y+(o.y-g.y)/2},{x:o.x,y:o.y}],b=i?`${i}-${r.id}`:r.id,x=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",w=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${x} ${w} flowchart-link LS-a1 LE-b1`;Gr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v},void 0,"block",c,i),r.label&&(await Ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v}),Xr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}d(ge,"insertEdges");var Ta=d(function(e,t){return t.db.getClasses()},"getClasses"),Da=d(async function(e,t,a,s){const{securityLevel:i,block:c}=at(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),g=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Fr(g,["point","circle","cross"],s.type,t);const p=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),w=g.insert("g").attr("class","block");await oe(w,p,r);const v=$t(r);if(await he(w,p,r),await ge(w,x,b,r,t),v){const S=v,_=Math.max(1,Math.round(.125*(S.width/S.height))),I=S.height+_+10,T=S.width+10,{useMaxWidth:m}=c;Fe(g,I,T,!!m),k.debug("Here Bounds",v,S),g.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ba={draw:Da,getClasses:Ta},Aa={parser:sr,db:Er,renderer:Ba,styles:Tr};export{Aa as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js b/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js deleted file mode 100644 index d1478cb65..000000000 --- a/apps/pythinker-code/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +++ /dev/null @@ -1,132 +0,0 @@ -import{g as pe}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{an as fe,ao as Ut,ap as xe,aq as ye,ar as be,as as we,at as me,au as Se,av as Le,aw as ke,ax as ve,ay as Ee,az as _e,aA as Te,aB as De,aC as Be,aD as Ne,aE as Ie,aF as Ce,aG as Oe,aH as Re,aI as Ae,aJ as ze,aK as Me,aL as Pe,_ as d,D as at,d as D,e as Fe,l as k,z as We,B as Ye,aM as He,R as Ke,S as Ue,c as A,O as Xe,aN as P,aO as vt,aP as $,aQ as Ve,u as tt,k as je,aR as Ge,i as Ot,aS as Rt,aT as Ze}from"./mermaidParser.worker-Dx4jPi9z.js";import{G as qe}from"./graph-BwjfAU3j.js";import{c as Je}from"./channel-DNkUo9e6.js";function Qe(e){return Array.isArray(e)}function $e(e){if(fe(e))return e;const t=Ut(e);if(!tr(e))return{};if(Qe(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(xe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?rr(i,e):yt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return yt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ar(a,e),yt(a,e),er(a,e),a}function tr(e){switch(Ut(e)){case Pe:case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:return!0;default:return!1}}function yt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function er(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function ar(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=(function(){var e=d(function(T,m,u,y){for(u=u||{},y=T.length;y--;u[T[y]]=m);return u},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],o=[8,10,21,28,29,30,31,39,43,46],p=[1,23],b=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(m,u,y,L,E,h,W){var f=h.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[f-1]),L.setHierarchy(h[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[f]),typeof h[f].length=="number"?this.$=h[f]:this.$=[h[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[f-1]),this.$=[h[f-1]].concat(h[f]);break;case 14:L.getLogger().debug("Rule: link: ",h[f],m),this.$={edgeTypeStr:h[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[f-3],h[f-1],h[f]),this.$={edgeTypeStr:h[f],label:h[f-1]};break;case 18:const O=parseInt(h[f]),q=L.generateId();this.$={id:q,type:"space",label:"",width:O,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[f-2],h[f-1],h[f]," typestr: ",h[f-1].edgeTypeStr);const j=L.edgeStrToEdgeData(h[f-1].edgeTypeStr),st=L.edgeStrToEdgeStartData(h[f-1].edgeTypeStr),dt=L.edgeStrToThickness(h[f-1].edgeTypeStr),R=L.edgeStrToPattern(h[f-1].edgeTypeStr);this.$=[{id:h[f-2].id,label:h[f-2].label,type:h[f-2].type,directions:h[f-2].directions},{id:h[f-2].id+"-"+h[f].id,start:h[f-2].id,end:h[f].id,label:h[f-1].label,type:"edge",thickness:dt,pattern:R,directions:h[f].directions,arrowTypeEnd:j,arrowTypeStart:st},{id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[f-1],h[f]),this.$={id:h[f-1].id,label:h[f-1].label,type:L.typeStr2Type(h[f-1].typeStr),directions:h[f-1].directions,widthInColumns:parseInt(h[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[f]),this.$={id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[f]),this.$={type:"column-setting",columns:h[f]==="auto"?-1:parseInt(h[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[f-2],h[f-1]),L.generateId(),this.$={...h[f-2],type:"composite",children:h[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[f-2],h[f-1],h[f]);const G=L.generateId();this.$={id:G,type:"composite",label:"",children:h[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[f]),this.$={id:h[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[f-1],h[f]),this.$={id:h[f-1],label:h[f].label,typeStr:h[f].typeStr,directions:h[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[f]),this.$=[h[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[f-1],h[f]),this.$=[h[f-1]].concat(h[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[f-2],h[f-1],h[f]),this.$={typeStr:h[f-2]+h[f],label:h[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[f-3],h[f-2]," #3:",h[f-1],h[f]),this.$={typeStr:h[f-3]+h[f],label:h[f-2],directions:h[f-1]};break;case 35:case 36:this.$={type:"classDef",id:h[f-1].trim(),css:h[f].trim()};break;case 37:this.$={type:"applyClass",id:h[f-1].trim(),styleClass:h[f].trim()};break;case 38:this.$={type:"applyStyles",id:h[f-1].trim(),stylesStr:h[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(o,[2,16],{14:22,15:p,16:b}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(x,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(m,u){if(u.recoverable)this.trace(m);else{var y=new Error(m);throw y.hash=u,y}},"parseError"),parse:d(function(m){var u=this,y=[0],L=[],E=[null],h=[],W=this.table,f="",O=0,q=0,j=2,st=1,dt=h.slice.call(arguments,1),R=Object.create(this.lexer),G={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(G.yy[ut]=this.yy[ut]);R.setInput(m,G.yy),G.yy.lexer=R,G.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var pt=R.yylloc;h.push(pt);var de=R.options&&R.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(Y){y.length=y.length-2*Y,E.length=E.length-Y,h.length=h.length-Y}d(ue,"popStack");function It(){var Y;return Y=L.pop()||R.lex()||st,typeof Y!="number"&&(Y instanceof Array&&(L=Y,Y=L.pop()),Y=u.symbols_[Y]||Y),Y}d(It,"lex");for(var F,J,K,ft,Q={},it,Z,Ct,nt;;){if(J=y[y.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=It()),K=W[J]&&W[J][F]),typeof K>"u"||!K.length||!K[0]){var xt="";nt=[];for(it in W[J])this.terminals_[it]&&it>j&&nt.push("'"+this.terminals_[it]+"'");R.showPosition?xt="Parse error on line "+(O+1)+`: -`+R.showPosition()+` -Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xt="Parse error on line "+(O+1)+": Unexpected "+(F==st?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xt,{text:R.match,token:this.terminals_[F]||F,line:R.yylineno,loc:pt,expected:nt})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(K[0]){case 1:y.push(F),E.push(R.yytext),h.push(R.yylloc),y.push(K[1]),F=null,q=R.yyleng,f=R.yytext,O=R.yylineno,pt=R.yylloc;break;case 2:if(Z=this.productions_[K[1]][1],Q.$=E[E.length-Z],Q._$={first_line:h[h.length-(Z||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(Z||1)].first_column,last_column:h[h.length-1].last_column},de&&(Q._$.range=[h[h.length-(Z||1)].range[0],h[h.length-1].range[1]]),ft=this.performAction.apply(Q,[f,q,O,G.yy,K[1],E,h].concat(dt)),typeof ft<"u")return ft;Z&&(y=y.slice(0,-1*Z*2),E=E.slice(0,-1*Z),h=h.slice(0,-1*Z)),y.push(this.productions_[K[1]][0]),E.push(Q.$),h.push(Q._$),Ct=W[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},_=(function(){var T={EOF:1,parseError:d(function(u,y){if(this.yy.parser)this.yy.parser.parseError(u,y);else throw new Error(u)},"parseError"),setInput:d(function(m,u){return this.yy=u||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var u=m.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var u=m.length,y=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1&&(this.yylineno-=y.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===L.length?this.yylloc.first_column:0)+L[L.length-y.length].length-y[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),u=new Array(m.length+1).join("-");return m+this.upcomingInput()+` -`+u+"^"},"showPosition"),test_match:d(function(m,u){var y,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],y=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),y)return y;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,u,y,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hu[0].length)){if(u=y,L=h,this.options.backtrack_lexer){if(m=this.test_match(y,E[h]),m!==!1)return m;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(m=this.test_match(u,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var u=this.next();return u||this.lex()},"lex"),begin:d(function(u){this.conditionStack.push(u)},"begin"),popState:d(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:d(function(u){this.begin(u)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(u,y,L,E){switch(L){case 0:return u.getLogger().debug("Found block-beta"),10;case 1:return u.getLogger().debug("Found id-block"),29;case 2:return u.getLogger().debug("Found block"),10;case 3:u.getLogger().debug(".",y.yytext);break;case 4:u.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),u.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:u.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return u.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),u.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",u.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),u.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),u.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),u.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),u.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),u.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),u.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),u.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),u.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),u.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),u.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return u.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return u.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return u.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return u.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return u.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return u.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return u.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),u.getLogger().debug("LEX ARR START"),37;case 74:return u.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return u.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:u.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:u.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return u.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:u.getLogger().debug("LEX POPPING"),this.popState();break;case 84:u.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",u.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return u.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return u.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return u.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),u.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),u.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return u.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=_;function I(){this.yy={}}return d(I,"Parser"),I.prototype=S,S.Parser=I,new I})();wt.parser=wt;var sr=wt,X=new Map,Et=[],mt=new Map,At="color",zt="fill",ir="bgFill",Xt=",",nr=A(),lt=new Map,_t="",cr=d(e=>je.sanitizeText(e,nr),"sanitizeText"),lr=d(function(e,t=""){let a=lt.get(e);a||(a={id:e,styles:[],textStyles:[]},lt.set(e,a)),t?.split(Xt).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(At).exec(s)){const r=i.replace(zt,ir).replace(At,zt);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),or=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Xt))},"addStyle2Node"),hr=d(function(e,t){e.split(",").forEach(function(a){let s=X.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},X.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Vt=d((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=cr(r.label)),r.type==="classDef"){lr(r.id,r.css);continue}if(r.type==="applyClass"){hr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&or(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Vt(r.children,r),r.type==="space"){const l=r.width??1;for(let g=0;g{k.debug("Clear called"),We(),rt={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",rt]]),Tt=[],lt=new Map,Et=[],mt=new Map,_t=""},"clear");function jt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(jt,"typeStr2Type");function Gt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}d(Gt,"edgeTypeStr2Type");function Zt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Zt,"edgeStrToEdgeData");function qt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}d(qt,"edgeStrToEdgeStartData");function Jt(e){return e.includes("==")?"thick":"normal"}d(Jt,"edgeStrToThickness");function Qt(e){return e.includes(".-")?"dotted":"solid"}d(Qt,"edgeStrToPattern");var Mt=0,dr=d(()=>(Mt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Mt),"generateId"),ur=d(e=>{rt.children=e,Vt(e,rt),Tt=rt.children},"setHierarchy"),pr=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),fr=d(()=>[...X.values()],"getBlocksFlat"),xr=d(()=>Tt||[],"getBlocks"),yr=d(()=>Et,"getEdges"),br=d(e=>X.get(e),"getBlock"),wr=d(e=>{X.set(e.id,e)},"setBlock"),mr=d(e=>{_t=e},"setDiagramId"),Sr=d(()=>_t,"getDiagramId"),Lr=d(()=>k,"getLogger"),kr=d(function(){return lt},"getClasses"),vr={getConfig:d(()=>at().block,"getConfig"),typeStr2Type:jt,edgeTypeStr2Type:Gt,edgeStrToEdgeData:Zt,edgeStrToEdgeStartData:qt,edgeStrToThickness:Jt,edgeStrToPattern:Qt,getLogger:Lr,getBlocksFlat:fr,getBlocks:xr,getEdges:yr,setHierarchy:ur,getBlock:br,setBlock:wr,getColumns:pr,getClasses:kr,clear:gr,generateId:dr,setDiagramId:mr,getDiagramId:Sr},Er=vr,bt=d((e,t)=>{const a=Je,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return Ye(s,i,c,t)},"fade"),_r=d(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span,p { - color: ${e.titleColor}; - } - - - - .label text,span,p { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - .flowchart-label text { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePath .path { - stroke: ${e.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - /* - * This is for backward compatibility with existing code that didn't - * add a \`

\` around edge labels. - * - * TODO: We should probably remove this in a future release. - */ - p { - margin: 0; - padding: 0; - display: inline; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${e.edgeLabelBackground}; - } - - .node .cluster { - // fill: ${bt(e.mainBkg,.5)}; - fill: ${bt(e.clusterBkg,.5)}; - stroke: ${bt(e.clusterBorder,.2)}; - box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span,p { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - ${pe()} -`,"getStyles"),Tr=_r,Dr=d((e,t,a,s)=>{t.forEach(i=>{Pr[i](e,a,s)})},"insertMarkers"),Br=d((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Nr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ir=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Cr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Or=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Rr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Ar=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),zr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Mr=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pr={extension:Br,composition:Nr,aggregation:Ir,dependency:Cr,lollipop:Or,point:Rr,circle:Ar,cross:zr,barb:Mr},Fr=Dr,C=A()?.block?.padding??8;function St(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}d(St,"calculateBlockPosition");var Wr=d(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,s=0){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let i=0,c=0;if(e.children?.length>0){for(const x of e.children)ot(x,t);const r=Wr(e);i=r.width,c=r.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,c);for(const x of e.children)x.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${x.id} ${i} ${c} ${JSON.stringify(x.size)}`),x.size.width=i*(x.widthInColumns??1)+C*((x.widthInColumns??1)-1),x.size.height=c,x.size.x=0,x.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${x.id} maxWidth:${i} maxHeight:${c}`));for(const x of e.children)ot(x,t,i,c);const n=e.columns??-1;let l=0;for(const x of e.children)l+=x.widthInColumns??1;let g=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(x>0){const w=(p-x*C-C)/x;k.debug("abc95 (growing to fit) width",e.id,p,e.size?.width,w);for(const v of e.children)v.size&&(v.size.width=w)}}e.size={width:p,height:b,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Dt(e,t){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const s=e?.children[0]?.size?.width??0,i=e.children.length*s+(e.children.length-1)*C;k.debug("widthOfChildren 88",i,"posX");const c=new Map;{let o=0;for(const p of e.children){if(!p.size)continue;const{py:b}=St(a,o),x=c.get(b)??0;p.size.height>x&&c.set(b,p.size.height);let w=p?.widthInColumns??1;a>0&&(w=Math.min(w,a-o%a)),o+=w}}const r=new Map;{let o=0;const p=[...c.keys()].sort((b,x)=>b-x);for(const b of p)r.set(b,o),o+=(c.get(b)??0)+C}let n=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,g=0;for(const o of e.children){const p=e;if(!o.size)continue;const{width:b,height:x}=o.size,{px:w,py:v}=St(a,n);if(v!=g&&(g=v,l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,k.debug("New row in layout for block",e.id," and child ",o.id,g)),k.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${n} (px, py) ${w},${v} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${b}${C}`),p.size){const _=b/2;o.size.x=l+C+_,k.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${l} new startingPosX${o.size.x} ${_} padding=${C} width=${b} halfWidth=${_} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${b*(o?.widthInColumns??1)/2}`),l=o.size.x+_;const I=r.get(v)??0,T=c.get(v)??x;o.size.y=p.size.y-p.size.height/2+I+T/2+C,k.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${l}${C}${_}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${b*(o?.widthInColumns??1)/2}`)}o.children&&Dt(o);let S=o?.widthInColumns??1;a>0&&(S=Math.min(S,a-n%a)),n+=S,k.debug("abc88 columnsPos",o,n)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Dt,"layoutBlocks");function Bt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Bt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}d(Bt,"findBounds");function $t(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Dt(t),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:s,maxX:i,maxY:c}=Bt(t),r=c-s,n=i-a;return{x:a,y:s,width:n,height:r}}d($t,"layout");var Yr=d(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=A(),n=P(r);return await vt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),U=Yr,Hr=d((e,t,a,s,i)=>{t.arrowTypeStart&&Pt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Pt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Kr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Pt=d((e,t,a,s,i,c)=>{const r=Kr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},Ur=d(async(e,t)=>{const a=A(),s=P(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await vt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),g=l;if(s){const p=n.children[0],b=D(n);l=p.getBoundingClientRect(),g=l,b.attr("width",l.width),b.attr("height",l.height)}else{const p=D(n).select("text").node();p&&typeof p.getBBox=="function"&&(g=p.getBBox())}c.attr("transform",$(g,s)),Lt[t.id]=i,t.width=l.width,t.height=l.height;let o;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=p,et(o,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(b,t.startLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].startRight=p,et(o,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelLeft,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=p,et(o,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),b=p.insert("g").attr("class","inner"),x=await U(p,t.endLabelRight,t.labelStyle);o=x;let w=x.getBBox();if(s){const v=x.children[0],S=D(x);w=v.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)}b.attr("transform",$(w,s)),M[t.id]||(M[t.id]={}),M[t.id].endRight=p,et(o,t.endLabelRight)}return n},"insertEdgeLabel");function et(e,t){P(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(et,"setTerminalWidth");var Xr=d((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=A(),{subGraphTitleTotalMargin:i}=Ve(s);if(e.label){const c=Lt[e.id];let r=e.x,n=e.y;if(a){const l=tt.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=M[e.id].startRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=M[e.id].endRight;let r=e.x,n=e.y;if(a){const l=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Vr=d((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),jr=d((e,t,a)=>{k.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(t)} - insidePoint : ${JSON.stringify(a)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let p=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Vr(t,c)&&!i){const r=jr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Gr=d(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const g=c.node(t.v);var o=c.node(t.w);o?.intersect&&g?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Ft(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Ft(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const p=n.filter(m=>!Number.isNaN(m.y));let b=Ue;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x,y:w}=He(a),v=Ke().x(x).y(w).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const _=e.append("path").attr("d",v(p)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let I="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(I=Xe(!0)),Hr(_,a,I,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),Zr=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),qr=d((e,t,a,s)=>{const i=Zr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,g=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*g},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*g,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*g},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*g,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-g},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r+g}]:i.has("left")?[{x:n,y:0},{x:n,y:-g},{x:l-n,y:-g},{x:l-n,y:-r+g},{x:n,y:-r+g},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-g},{x:n,y:-r+g},{x:0,y:-r+g},{x:l/2,y:-r},{x:l,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-g},{x:n,y:-g},{x:n,y:-r+g},{x:l-n,y:-r+g},{x:l-n,y:-g},{x:l,y:-g}]:[{x:0,y:0}]},"getArrowPoints");function te(e,t){return e.intersect(t)}d(te,"intersectNode");var Jr=te;function ee(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),g=Math.abs(t*a*r/l);s.x0}d(kt,"sameSign");var $r=se,ta=ie;function ie(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,g=i-e.height/2-n,o=0;o1&&c.sort(function(w,v){var S=w.x-a.x,_=w.y-a.y,I=Math.sqrt(S*S+_*_),T=v.x-a.x,m=v.y-a.y,u=Math.sqrt(T*T+m*m);return I{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,g;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,g=n):(i<0&&(r=-r),l=r,g=i===0?0:r*c/i),{x:a+l,y:s+g}},"intersectRect"),ra=ea,B={node:Jr,circle:Qr,ellipse:re,polygon:ta,rect:ra},z=d(async(e,t,a,s)=>{const i=A();let c;const r=t.useHtmlLabels||P(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let o;t.labelType==="markdown"?o=vt(l,Ot(Rt(g),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):o=await U(l,Ot(Rt(g),i),t.labelStyle,!1,s);let p=o.getBBox();const b=t.padding/2;if(P(i)){const x=o.children[0],w=D(o);await Ze(x,g),p=x.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):l.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:b,label:l}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function V(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(V,"insertPolygonShape");var aa=d(async(e,t)=>{t.useHtmlLabels||P(A())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await z(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),N(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),sa=aa,Wt=d(e=>e?" "+e:"","formatClass"),H=d((e,t)=>`${t||"node default"}${Wt(e.classes)} ${Wt(e.class)}`,"getClassesFromNode"),Yt=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=V(a,r,r,n);return l.attr("style",t.style),N(t,l),t.intersect=function(g){return k.warn("Intersect called"),B.polygon(t,n,g)},a},"question"),ia=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),na=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],g=V(a,n,c,l);return g.attr("style",t.style),N(t,g),t.intersect=function(o){return B.polygon(t,l,o)},a},"hexagon"),ca=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,g=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,o=qr(t.directions,s,t,g),p=V(a,g,c,o);return p.attr("style",t.style),N(t,p),t.intersect=function(b){return B.polygon(t,o,b)},a},"block_arrow"),la=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return V(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),oa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),ha=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),ga=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),da=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ua=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),pa=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,g=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return N(t,g),t.intersect=function(o){const p=B.rect(t,o),b=p.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let x=r*r*(1-b*b/(c*c));x!=0&&(x=Math.sqrt(x)),x=r-x,o.y-t.y>0&&(x=-x),p.y+=x}return p},a},"cylinder"),fa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"rect"),xa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,g=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",g).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(c,t.props.borders,r,n),o.delete("borders")),o.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return N(t,c),t.intersect=function(o){return B.rect(t,o)},a},"composite"),ya=d(async(e,t)=>{const{shapeSvg:a}=await z(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return N(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ht(e,t,a,s){const i=[],c=d(n=>{i.push(n,0)},"addBorder"),r=d(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}d(ht,"applyNodePropertyBorders");var ba=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const g=await U(r,l,t.labelStyle,!0,!0);let o={width:0,height:0};if(P(A())){const v=g.children[0],S=D(g);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}k.info("Text 2",n);const p=n.slice(1,n.length);let b=g.getBBox();const x=await U(r,p.join?p.join("
"):p,t.labelStyle,!0,!0);if(P(A())){const v=x.children[0],S=D(x);o=v.getBoundingClientRect(),S.attr("width",o.width),S.attr("height",o.height)}const w=t.padding/2;return D(x).attr("transform","translate( "+(o.width>b.width?0:(b.width-o.width)/2)+", "+(b.height+w+5)+")"),D(g).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return N(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ma=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),N(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),Sa=d(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await z(e,t,H(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),N(t,n),t.intersect=function(g){return k.info("DoubleCircle intersect",t,s.width/2+i+c,g),B.circle(t,s.width/2+i+c,g)},a},"doublecircle"),La=d(async(e,t)=>{const{shapeSvg:a,bbox:s}=await z(e,t,H(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=V(a,i,c,r);return n.attr("style",t.style),N(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),ka=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Ht=d((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),va=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),Ea=d(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),g=r.insert("line");let o=0,p=s;const b=r.insert("g").attr("class","label");let x=0;const w=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await U(b,v,t.labelStyle,!0,!0);let _=S.getBBox();if(P(A())){const E=S.children[0],h=D(S);_=E.getBoundingClientRect(),h.attr("width",_.width),h.attr("height",_.height)}t.classData.annotations[0]&&(p+=_.height+s,o+=_.width);let I=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(P(A())?I+="<"+t.classData.type+">":I+="<"+t.classData.type+">");const T=await U(b,I,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(P(A())){const E=T.children[0],h=D(T);m=E.getBoundingClientRect(),h.attr("width",m.width),h.attr("height",m.height)}p+=m.height+s,m.width>o&&(o=m.width);const u=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,u.push(f)}),p+=i;const y=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;P(A())&&(W=W.replace(//g,">"));const f=await U(b,W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0);let O=f.getBBox();if(P(A())){const q=f.children[0],j=D(f);O=q.getBoundingClientRect(),j.attr("width",O.width),j.attr("height",O.height)}O.width>o&&(o=O.width),p+=O.height+s,y.push(f)}),p+=i,w){let E=(o-_.width)/2;D(S).attr("transform","translate( "+(-1*o/2+E)+", "+-1*p/2+")"),x=_.height+s}let L=(o-m.width)/2;return D(T).attr("transform","translate( "+(-1*o/2+L)+", "+(-1*p/2+x)+")"),x+=m.height+s,l.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,u.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x+i/2)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),x+=i,g.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-p/2-a+i+x).attr("y2",-p/2-a+i+x),x+=i,y.forEach(E=>{D(E).attr("transform","translate( "+-o/2+", "+(-1*p/2+x)+")");const h=E?.getBBox();x+=(h?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(p/2)-a).attr("width",o+t.padding).attr("height",p+t.padding),N(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Kt={rhombus:Yt,composite:xa,question:Yt,rect:fa,labelRect:ya,rectWithTitle:ba,choice:ia,circle:ma,doublecircle:Sa,stadium:wa,hexagon:na,block_arrow:ca,rect_left_inv_arrow:la,lean_right:oa,lean_left:ha,trapezoid:ga,inv_trapezoid:da,rect_right_inv_arrow:ua,cylinder:pa,start:ka,end:va,note:sa,subroutine:La,fork:Ht,join:Ht,class_box:Ea},ct={},ne=d(async(e,t,a)=>{let s,i;if(t.link){let c;A().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Kt[t.shape](s,t,a)}else i=await Kt[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ct[t.id]=s,t.haveCallback&&ct[t.id].attr("class",ct[t.id].attr("class")+" clickable"),s},"insertNode"),_a=d(e=>{const t=ct[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Nt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=Ge(s?.styles??[]),g=s.label,o=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:g,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:s.type,padding:n??at()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}d(Nt,"getNodeFromBlock");async function ce(e,t,a){const s=Nt(t,a,!1);if(s.type==="group")return;const i=at(),c=await ne(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}d(ce,"calculateBlockSize");async function le(e,t,a){const s=Nt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=at();await ne(e,s,{config:c}),t.intersect=s?.intersect,_a(s)}}d(le,"insertBlockPositioned");async function gt(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await gt(e,i.children,a,s)}d(gt,"performOperations");async function oe(e,t,a){await gt(e,t,a,ce)}d(oe,"calculateBlockSizes");async function he(e,t,a){await gt(e,t,a,le)}d(he,"insertBlocks");async function ge(e,t,a,s,i){const c=new qe({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const g=n.size,o=l.size,p=[{x:g.x,y:g.y},{x:g.x+(o.x-g.x)/2,y:g.y+(o.y-g.y)/2},{x:o.x,y:o.y}],b=i?`${i}-${r.id}`:r.id,x=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",w=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${x} ${w} flowchart-link LS-a1 LE-b1`;Gr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v},void 0,"block",c,i),r.label&&(await Ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:v}),Xr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}d(ge,"insertEdges");var Ta=d(function(e,t){return t.db.getClasses()},"getClasses"),Da=d(async function(e,t,a,s){const{securityLevel:i,block:c}=at(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),g=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Fr(g,["point","circle","cross"],s.type,t);const p=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),w=g.insert("g").attr("class","block");await oe(w,p,r);const v=$t(r);if(await he(w,p,r),await ge(w,x,b,r,t),v){const S=v,_=Math.max(1,Math.round(.125*(S.width/S.height))),I=S.height+_+10,T=S.width+10,{useMaxWidth:m}=c;Fe(g,I,T,!!m),k.debug("Here Bounds",v,S),g.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ba={draw:Da,getClasses:Ta},Ra={parser:sr,db:Er,renderer:Ba,styles:Tr};export{Ra as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-b2ZKcyhh.js b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-b2ZKcyhh.js new file mode 100644 index 000000000..2b2e08425 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-b2ZKcyhh.js @@ -0,0 +1,129 @@ +import{g as Pe}from"./chunk-5VM5RSS4-CfUbytH6.js";import{aC as Fe,aD as xe,aE as Me,aF as Ke,aG as Ye,aH as We,aI as Ve,aJ as Ue,aK as He,aL as Xe,aM as je,aN as Ge,aO as qe,aP as Je,aQ as Ze,aR as Qe,aS as $e,aT as et,aU as tt,aV as st,aW as rt,aX as it,aY as at,aZ as nt,a_ as ot,_ as u,A as Y,j as X,a$ as ct,d as lt,l as y,r as ut,u as gt,c as Le,a7 as ht,ay as dt,ax as pt,az as ft,k as bt,b0 as St,ah as me,ai as xt}from"./mermaid.core-CM2luXFy.js";import{c as Lt}from"./channel-vcmCqkai.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";function mt(e){return Array.isArray(e)}function yt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(mt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],m=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",t[n],g),this.$={edgeTypeStr:t[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",t[n-3],t[n-1],t[n]),this.$={edgeTypeStr:t[n],label:t[n-1]};break;case 18:const P=parseInt(t[n]),W=p.generateId();this.$={id:W,type:"space",label:"",width:P,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",t[n-2],t[n-1],t[n]," typestr: ",t[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(t[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(t[n-1].edgeTypeStr),Z=p.edgeStrToThickness(t[n-1].edgeTypeStr),D=p.edgeStrToPattern(t[n-1].edgeTypeStr);this.$=[{id:t[n-2].id,label:t[n-2].label,type:t[n-2].type,directions:t[n-2].directions},{id:t[n-2].id+"-"+t[n].id,start:t[n-2].id,end:t[n].id,label:t[n-1].label,type:"edge",thickness:Z,pattern:D,directions:t[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[n-1],t[n]),this.$={id:t[n-1].id,label:t[n-1].label,type:p.typeStr2Type(t[n-1].typeStr),directions:t[n-1].directions,widthInColumns:parseInt(t[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",t[n]),this.$={id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",t[n]),this.$={type:"column-setting",columns:t[n]==="auto"?-1:parseInt(t[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",t[n-2],t[n-1]),p.generateId(),this.$={...t[n-2],type:"composite",children:t[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",t[n-2],t[n-1],t[n]);const A=p.generateId();this.$={id:A,type:"composite",label:"",children:t[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",t[n]),this.$={id:t[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[n-1],t[n]),this.$={id:t[n-1],label:t[n].label,typeStr:t[n].typeStr,directions:t[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",t[n]),this.$=[t[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",t[n-1],t[n]),this.$=[t[n-1]].concat(t[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",t[n-2],t[n-1],t[n]),this.$={typeStr:t[n-2]+t[n],label:t[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[n-3],t[n-2]," #3:",t[n-1],t[n]),this.$={typeStr:t[n-3]+t[n],label:t[n-2],directions:t[n-1]};break;case 35:case 36:this.$={type:"classDef",id:t[n-1].trim(),css:t[n].trim()};break;case 37:this.$={type:"applyClass",id:t[n-1].trim(),styleClass:t[n].trim()};break;case 38:this.$={type:"applyStyles",id:t[n-1].trim(),stylesStr:t[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{8:[1,20]},e(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:r,29:l,31:d,39:s,43:h,46:x}),e(S,[2,16],{14:22,15:f,16:L}),e(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(w,[2,25],{27:[1,25]}),e(S,[2,26]),{19:26,26:12,31:d},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(m,[2,13]),{26:35,31:d},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:L,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(S,[2,28]),e(S,[2,35]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),{36:[1,47]},{33:48,34:k},{15:[1,50]},e(S,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:k,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(g,i){if(i.recoverable)this.trace(g);else{var c=new Error(g);throw c.hash=i,c}},"parseError"),parse:u(function(g){var i=this,c=[0],p=[],E=[null],t=[],M=this.table,n="",P=0,W=0,J=2,V=1,Z=t.slice.call(arguments,1),D=Object.create(this.lexer),A={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(A.yy[Q]=this.yy[Q]);D.setInput(g,A.yy),A.yy.lexer=D,A.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;t.push($);var Be=D.options&&D.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(I){c.length=c.length-2*I,E.length=E.length-I,t.length=t.length-I}u(Re,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,C,ee,F={},U,B,pe,H;;){if(R=c[c.length-1],this.defaultActions[R]?C=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),C=M[R]&&M[R][N]),typeof C>"u"||!C.length||!C[0]){var te="";H=[];for(U in M[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(P+1)+`: +`+D.showPosition()+` +Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(P+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(C[0]){case 1:c.push(N),E.push(D.yytext),t.push(D.yylloc),c.push(C[1]),N=null,W=D.yyleng,n=D.yytext,P=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[C[1]][1],F.$=E[E.length-B],F._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},Be&&(F._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),ee=this.performAction.apply(F,[n,W,P,A.yy,C[1],E,t].concat(Z)),typeof ee<"u")return ee;B&&(c=c.slice(0,-1*B*2),E=E.slice(0,-1*B),t=t.slice(0,-1*B)),c.push(this.productions_[C[1]][0]),E.push(F.$),t.push(F._$),pe=M[c[c.length-2]][c[c.length-1]],c.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(i,c){if(this.yy.parser)this.yy.parser.parseError(i,c);else throw new Error(i)},"parseError"),setInput:u(function(g,i){return this.yy=i||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var i=g.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:u(function(g){var i=g.length,c=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(g){this.unput(this.match.slice(g))},"less"),pastInput:u(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var g=this.pastInput(),i=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+i+"^"},"showPosition"),test_match:u(function(g,i){var c,p,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),p=g[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],c=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in E)this[t]=E[t];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,i,c,p;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),t=0;ti[0].length)){if(i=c,p=t,this.options.backtrack_lexer){if(g=this.test_match(c,E[t]),g!==!1)return g;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(g=this.test_match(i,E[p]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var i=this.next();return i||this.lex()},"lex"),begin:u(function(i){this.conditionStack.push(i)},"begin"),popState:u(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:u(function(i){this.begin(i)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(i,c,p,E){switch(p){case 0:return i.getLogger().debug("Found block-beta"),10;case 1:return i.getLogger().debug("Found id-block"),29;case 2:return i.getLogger().debug("Found block"),10;case 3:i.getLogger().debug(".",c.yytext);break;case 4:i.getLogger().debug("_",c.yytext);break;case 5:return 5;case 6:return c.yytext=-1,28;case 7:return c.yytext=c.yytext.replace(/columns\s+/,""),i.getLogger().debug("COLUMNS (LEX)",c.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:i.getLogger().debug("LEX: POPPING STR:",c.yytext),this.popState();break;case 13:return i.getLogger().debug("LEX: STR end:",c.yytext),"STR";case 14:return c.yytext=c.yytext.replace(/space\:/,""),i.getLogger().debug("SPACE NUM (LEX)",c.yytext),21;case 15:return c.yytext="1",i.getLogger().debug("COLUMNS (LEX)",c.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),i.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),i.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),i.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),i.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),i.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),i.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),i.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),i.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),i.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),i.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return i.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return i.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return i.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return i.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return i.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return i.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return i.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),i.getLogger().debug("LEX ARR START"),37;case 74:return i.getLogger().debug("Lex: NODE_ID",c.yytext),31;case 75:return i.getLogger().debug("Lex: EOF",c.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:i.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:i.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return i.getLogger().debug("LEX: NODE_DESCR:",c.yytext),"NODE_DESCR";case 83:i.getLogger().debug("LEX POPPING"),this.popState();break;case 84:i.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (right): dir:",c.yytext),"DIR";case 86:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (left):",c.yytext),"DIR";case 87:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (x):",c.yytext),"DIR";case 88:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (y):",c.yytext),"DIR";case 89:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (up):",c.yytext),"DIR";case 90:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (down):",c.yytext),"DIR";case 91:return c.yytext="]>",i.getLogger().debug("Lex (ARROW_DIR end):",c.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return i.getLogger().debug("Lex: LINK","#"+c.yytext+"#"),15;case 93:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 94:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 95:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 96:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 97:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 98:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return i.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),i.getLogger().debug("Lex: LINK","#"+c.yytext+"#"),15;case 102:return this.popState(),i.getLogger().debug("Lex: LINK",c.yytext),15;case 103:return this.popState(),i.getLogger().debug("Lex: LINK",c.yytext),15;case 104:return i.getLogger().debug("Lex: COLON",c.yytext),c.yytext=c.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return v})();_.lexer=T;function O(){this.yy={}}return u(O,"Parser"),O.prototype=_,_.Parser=O,new O})();ie.parser=ie;var Dt=ie,z=new Map,oe=[],ae=new Map,fe="color",be="fill",Tt="bgFill",ye=",",j=new Map,ce="",Nt=u(e=>bt.sanitizeText(e,Le()),"sanitizeText"),It=u(function(e,a=""){let o=j.get(e);o||(o={id:e,styles:[],textStyles:[]},j.set(e,o)),a?.split(ye).forEach(r=>{const l=r.replace(/([^;]*);/,"$1").trim();if(RegExp(fe).exec(r)){const s=l.replace(be,Tt).replace(fe,be);o.textStyles.push(s)}o.styles.push(l)})},"addStyleClass"),Ot=u(function(e,a=""){const o=z.get(e);a!=null&&(o.styles=a.split(ye))},"addStyle2Node"),vt=u(function(e,a){e.split(",").forEach(function(o){let r=z.get(o);if(r===void 0){const l=o.trim();r={id:l,type:"na",children:[]},z.set(l,r)}r.classes||(r.classes=[]),r.classes.push(a)})},"setCssClass"),we=u((e,a)=>{const o=e.flat(),r=[],d=o.find(s=>s?.type==="column-setting")?.columns??-1;for(const s of o){if(typeof d=="number"&&d>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>d&&y.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${d}`),s.label&&(s.label=Nt(s.label)),s.type==="classDef"){It(s.id,s.css);continue}if(s.type==="applyClass"){vt(s.id,s?.styleClass??"");continue}if(s.type==="applyStyles"){s?.stylesStr&&Ot(s.id,s?.stylesStr);continue}if(s.type==="column-setting")a.columns=s.columns??-1;else if(s.type==="edge"){const h=(ae.get(s.id)??0)+1;ae.set(s.id,h),s.id=h+"-"+s.id,oe.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const h=z.get(s.id);if(h===void 0?z.set(s.id,s):(s.type!=="na"&&(h.type=s.type),s.label!==s.id&&(h.label=s.label)),s.children&&we(s.children,s),s.type==="space"){const x=s.width??1;for(let m=0;m{y.debug("Clear called"),ut(),K={id:"root",type:"composite",children:[],columns:-1},z=new Map([["root",K]]),le=[],j=new Map,oe=[],ae=new Map,ce=""},"clear");function Ee(e){switch(y.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return y.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}u(Ee,"typeStr2Type");function _e(e){switch(y.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(_e,"edgeTypeStr2Type");function ke(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u(ke,"edgeStrToEdgeData");function De(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}u(De,"edgeStrToEdgeStartData");function Te(e){return e.includes("==")?"thick":"normal"}u(Te,"edgeStrToThickness");function Ne(e){return e.includes(".-")?"dotted":"solid"}u(Ne,"edgeStrToPattern");var Se=0,zt=u(()=>(Se++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Se),"generateId"),At=u(e=>{K.children=e,we(e,K),le=K.children},"setHierarchy"),Bt=u(e=>{const a=z.get(e);return a?a.columns?a.columns:a.children?a.children.length:-1:-1},"getColumns"),Rt=u(()=>[...z.values()],"getBlocksFlat"),Pt=u(()=>le||[],"getBlocks"),Ft=u(()=>oe,"getEdges"),Mt=u(e=>z.get(e),"getBlock"),Kt=u(e=>{z.set(e.id,e)},"setBlock"),Yt=u(e=>{ce=e},"setDiagramId"),Wt=u(()=>ce,"getDiagramId"),Vt=u(()=>y,"getLogger"),Ut=u(function(){return j},"getClasses"),Ht={getConfig:u(()=>Y().block,"getConfig"),typeStr2Type:Ee,edgeTypeStr2Type:_e,edgeStrToEdgeData:ke,edgeStrToEdgeStartData:De,edgeStrToThickness:Te,edgeStrToPattern:Ne,getLogger:Vt,getBlocksFlat:Rt,getBlocks:Pt,getEdges:Ft,setHierarchy:At,getBlock:Mt,setBlock:Kt,getColumns:Bt,getClasses:Ut,clear:Ct,generateId:zt,setDiagramId:Yt,getDiagramId:Wt},Xt=Ht,re=u((e,a)=>{const o=Lt,r=o(e,"r"),l=o(e,"g"),d=o(e,"b");return gt(r,l,d,a)},"fade"),jt=u(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + + + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${re(e.mainBkg,.5)}; + fill: ${re(e.clusterBkg,.5)}; + stroke: ${re(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${Pe()} +`,"getStyles"),Gt=jt;function ne(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const o=a%e,r=Math.floor(a/e);return{px:o,py:r}}u(ne,"calculateBlockPosition");var qt=u(e=>{let a=0,o=0;for(const r of e.children){const{width:l,height:d,x:s,y:h}=r.size??{width:0,height:0,x:0,y:0};if(y.debug("getMaxChildSize abc95 child:",r.id,"width:",l,"height:",d,"x:",s,"y:",h,r.type),r.type==="space")continue;const x=l/(r.widthInColumns??1);x>a&&(a=x),d>o&&(o=d)}return{width:a,height:o}},"getMaxChildSize");function G(e,a,o=0,r=0,l=8){y.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",o),e?.size?.width||(e.size={width:o,height:r,x:0,y:0});let d=0,s=0;if(e.children?.length>0){for(const b of e.children)G(b,a,0,0,l);const h=qt(e);d=h.width,s=h.height,y.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",d,s);for(const b of e.children)b.size&&(y.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${d} ${s} ${JSON.stringify(b.size)}`),b.size.width=d*(b.widthInColumns??1)+l*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,y.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${d} maxHeight:${s}`));for(const b of e.children)G(b,a,d,s,l);const x=e.columns??-1;let m=0;for(const b of e.children)m+=b.widthInColumns??1;let S=e.children.length;x>0&&x0?Math.min(e.children.length,x):e.children.length;if(b>0){const k=(L-b*l-l)/b;y.debug("abc95 (growing to fit) width",e.id,L,e.size?.width,k);for(const _ of e.children)_.size&&(_.size.width=k)}}e.size={width:L,height:w,x:0,y:0}}y.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u(G,"setBlockSizes");function ue(e,a,o=8){y.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const r=e.columns??-1;if(y.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const l=e?.children[0]?.size?.width??0,d=e.children.length*l+(e.children.length-1)*o;y.debug("widthOfChildren 88",d,"posX");const s=new Map;{let f=0;for(const L of e.children){if(!L.size)continue;const{py:w}=ne(r,f),b=s.get(w)??0;L.size.height>b&&s.set(w,L.size.height);let k=L?.widthInColumns??1;r>0&&(k=Math.min(k,r-f%r)),f+=k}}const h=new Map;{let f=0;const L=[...s.keys()].sort((w,b)=>w-b);for(const w of L)h.set(w,f),f+=(s.get(w)??0)+o}let x=0;y.debug("abc91 block?.size?.x",e.id,e?.size?.x);let m=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,S=0;for(const f of e.children){const L=e;if(!f.size)continue;const{width:w,height:b}=f.size,{px:k,py:_}=ne(r,x);if(_!=S&&(S=_,m=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,y.debug("New row in layout for block",e.id," and child ",f.id,S)),y.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${x} (px, py) ${k},${_} (${L?.size?.x},${L?.size?.y}) parent: ${L.id} width: ${w}${o}`),L.size){const O=w/2;f.size.x=m+o+O,y.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${m} new startingPosX${f.size.x} ${O} padding=${o} width=${w} halfWidth=${O} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(f?.widthInColumns??1)/2}`),m=f.size.x+O;const v=h.get(_)??0,g=s.get(_)??b;f.size.y=L.size.y-L.size.height/2+v+g/2+o,y.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${m}${o}${O}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${w*(f?.widthInColumns??1)/2}`)}f.children&&ue(f,a,o);let T=f?.widthInColumns??1;r>0&&(T=Math.min(T,r-x%r)),x+=T,y.debug("abc88 columnsPos",f,x)}}y.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u(ue,"layoutBlocks");function ge(e,{minX:a,minY:o,maxX:r,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:d,y:s,width:h,height:x}=e.size;d-h/2r&&(r=d+h/2),s+x/2>l&&(l=s+x/2)}if(e.children)for(const d of e.children)({minX:a,minY:o,maxX:r,maxY:l}=ge(d,{minX:a,minY:o,maxX:r,maxY:l}));return{minX:a,minY:o,maxX:r,maxY:l}}u(ge,"findBounds");function Ie(e){const a=e.getBlock("root");if(!a)return;const o=Le()?.block?.padding??8;G(a,e,0,0,o),ue(a,e,o),y.debug("getBlocks",JSON.stringify(a,null,2));const{minX:r,minY:l,maxX:d,maxY:s}=ge(a),h=s-l,x=d-r;return{x:r,y:l,width:x,height:h}}u(Ie,"layout");function he(e,a,o=!1){const r=e;let l="default";(r?.classes?.length||0)>0&&(l=(r?.classes??[]).join(" ")),l=l+" flowchart-label";const d=(r?.classes??[]).flatMap(b=>a.getClasses().get(b)?.styles??[]);let s=0,h="rect",x;switch(r.type){case"round":s=5,h="rect";break;case"composite":s=0,h="composite",x=0;break;case"square":h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"group":h="rect";break;case"doublecircle":h="doublecircle";break;default:h="rect"}const m=St(r?.styles??[]),S=r.label,f=r.size??{width:0,height:0,x:0,y:0},L=a.getDiagramId();return{labelStyle:m.labelStyle,shape:h,label:S,labelText:S,rx:s,ry:s,class:l,cssClasses:l,cssStyles:r?.styles??[],cssCompiledStyles:d,style:m.style,id:r.id,domId:L?`${L}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||Number.POSITIVE_INFINITY,x:f.x,y:f.y,positioned:o,intersect:void 0,padding:x??Y()?.block?.padding??0,widthInColumns:r.widthInColumns??1}}u(he,"getNodeFromBlock");async function Oe(e,a,o){const r=he(a,o,!1);if(a.type==="group")return;const l=Y(),d=await me(e,r,{config:l}),s=d.node()?.getBBox()??{width:0,height:0},h=o.getBlock(r.id);h.size={width:s.width,height:s.height,x:0,y:0,node:d},o.setBlock(h),d.remove()}u(Oe,"calculateBlockSize");async function ve(e,a,o){const r=he(a,o,!0);if(o.getBlock(r.id).type!=="space"){const d=Y();await me(e,r,{config:d}),a.intersect=r?.intersect,xt(r)}}u(ve,"insertBlockPositioned");async function q(e,a,o,r){for(const l of a)await r(e,l,o),l.children&&await q(e,l.children,o,r)}u(q,"performOperations");async function Ce(e,a,o){await q(e,a,o,Oe)}u(Ce,"calculateBlockSizes");async function ze(e,a,o){await q(e,a,o,ve)}u(ze,"insertBlocks");async function Ae(e,a,o,r,l){const d=new ht({multigraph:!0,compound:!0});d.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of o)s.size&&d.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of a)if(s.start&&s.end){const h=r.getBlock(s.start),x=r.getBlock(s.end);if(h?.size&&x?.size){const m=h.size,S=x.size,f=[{x:m.x,y:m.y},{x:m.x+(S.x-m.x)/2,y:m.y+(S.y-m.y)/2},{x:S.x,y:S.y}],L=l?`${l}-${s.id}`:s.id,w=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",b=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",k=`${w} ${b} flowchart-link LS-a1 LE-b1`;dt(e,{...s,id:L,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:f,classes:k},{},"block",d.node(s.start),d.node(s.end),l),s.label&&(await pt(e,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:f,classes:k}),ft({...s,x:f[1].x,y:f[1].y},{originalPath:f}))}}}u(Ae,"insertEdges");var Jt=u(function(e,a){return a.db.getClasses()},"getClasses"),Zt=u(async function(e,a,o,r){const{securityLevel:l,block:d}=Y(),s=r.db;s.setDiagramId(a);let h;l==="sandbox"&&(h=X("#i"+a));const x=l==="sandbox"?X(h.nodes()[0].contentDocument.body):X("body"),m=l==="sandbox"?x.select(`[id="${a}"]`):X(`[id="${a}"]`);ct(m,["point","circle","cross"],r.type,a);const f=s.getBlocks(),L=s.getBlocksFlat(),w=s.getEdges(),b=m.insert("g").attr("class","block");await Ce(b,f,s);const k=Ie(s);await ze(b,f,s),await Ae(b,w,L,s,a);const _=b.node()?.getBBox(),T=_&&Number.isFinite(_.width)&&Number.isFinite(_.height)?_:k;if(T){const O=Math.max(1,Math.round(.125*(T.width/T.height))),v=T.height+O+10,g=T.width+10,{useMaxWidth:i}=d;lt(m,v,g,!!i),y.debug("Here Bounds",k,T),m.attr("viewBox",`${T.x-5} ${T.y-5} ${T.width+10} ${T.height+10}`)}},"draw"),Qt={draw:Zt,getClasses:Jt},is={parser:Dt,db:Xt,renderer:Qt,styles:Gt};export{is as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-peJxU5TA.js b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-peJxU5TA.js new file mode 100644 index 000000000..3135a4f9e --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-peJxU5TA.js @@ -0,0 +1,129 @@ +import{g as Pe}from"./chunk-5VM5RSS4-B6TwRhtM.js";import{aD as Fe,aE as xe,aF as Me,aG as Ke,aH as Ye,aI as We,aJ as Ve,aK as Ue,aL as He,aM as Xe,aN as je,aO as Ge,aP as qe,aQ as Je,aR as Ze,aS as Qe,aT as $e,aU as et,aV as tt,aW as st,aX as rt,aY as it,aZ as at,a_ as nt,a$ as ot,_ as u,y as Y,j as X,b0 as ct,d as lt,l as m,p as ut,r as gt,c as Le,Q as ht,az as dt,ay as pt,aA as ft,k as bt,b1 as St,ag as ye,ah as xt}from"./mermaidParser.worker-DimdFOud.js";import{c as Lt}from"./channel-BKkxHUFp.js";function yt(e){return Array.isArray(e)}function mt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(yt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],y=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",t[n],g),this.$={edgeTypeStr:t[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",t[n-3],t[n-1],t[n]),this.$={edgeTypeStr:t[n],label:t[n-1]};break;case 18:const P=parseInt(t[n]),W=p.generateId();this.$={id:W,type:"space",label:"",width:P,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",t[n-2],t[n-1],t[n]," typestr: ",t[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(t[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(t[n-1].edgeTypeStr),Z=p.edgeStrToThickness(t[n-1].edgeTypeStr),D=p.edgeStrToPattern(t[n-1].edgeTypeStr);this.$=[{id:t[n-2].id,label:t[n-2].label,type:t[n-2].type,directions:t[n-2].directions},{id:t[n-2].id+"-"+t[n].id,start:t[n-2].id,end:t[n].id,label:t[n-1].label,type:"edge",thickness:Z,pattern:D,directions:t[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[n-1],t[n]),this.$={id:t[n-1].id,label:t[n-1].label,type:p.typeStr2Type(t[n-1].typeStr),directions:t[n-1].directions,widthInColumns:parseInt(t[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",t[n]),this.$={id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",t[n]),this.$={type:"column-setting",columns:t[n]==="auto"?-1:parseInt(t[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",t[n-2],t[n-1]),p.generateId(),this.$={...t[n-2],type:"composite",children:t[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",t[n-2],t[n-1],t[n]);const A=p.generateId();this.$={id:A,type:"composite",label:"",children:t[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",t[n]),this.$={id:t[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[n-1],t[n]),this.$={id:t[n-1],label:t[n].label,typeStr:t[n].typeStr,directions:t[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",t[n]),this.$=[t[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",t[n-1],t[n]),this.$=[t[n-1]].concat(t[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",t[n-2],t[n-1],t[n]),this.$={typeStr:t[n-2]+t[n],label:t[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[n-3],t[n-2]," #3:",t[n-1],t[n]),this.$={typeStr:t[n-3]+t[n],label:t[n-2],directions:t[n-1]};break;case 35:case 36:this.$={type:"classDef",id:t[n-1].trim(),css:t[n].trim()};break;case 37:this.$={type:"applyClass",id:t[n-1].trim(),styleClass:t[n].trim()};break;case 38:this.$={type:"applyStyles",id:t[n-1].trim(),stylesStr:t[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{8:[1,20]},e(y,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:r,29:l,31:d,39:s,43:h,46:x}),e(S,[2,16],{14:22,15:f,16:L}),e(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(w,[2,25],{27:[1,25]}),e(S,[2,26]),{19:26,26:12,31:d},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(y,[2,13]),{26:35,31:d},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:L,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(S,[2,28]),e(S,[2,35]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),{36:[1,47]},{33:48,34:k},{15:[1,50]},e(S,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:k,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(g,i){if(i.recoverable)this.trace(g);else{var c=new Error(g);throw c.hash=i,c}},"parseError"),parse:u(function(g){var i=this,c=[0],p=[],E=[null],t=[],M=this.table,n="",P=0,W=0,J=2,V=1,Z=t.slice.call(arguments,1),D=Object.create(this.lexer),A={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(A.yy[Q]=this.yy[Q]);D.setInput(g,A.yy),A.yy.lexer=D,A.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;t.push($);var Be=D.options&&D.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(I){c.length=c.length-2*I,E.length=E.length-I,t.length=t.length-I}u(Re,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,C,ee,F={},U,B,pe,H;;){if(R=c[c.length-1],this.defaultActions[R]?C=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),C=M[R]&&M[R][N]),typeof C>"u"||!C.length||!C[0]){var te="";H=[];for(U in M[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(P+1)+`: +`+D.showPosition()+` +Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(P+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(C[0]){case 1:c.push(N),E.push(D.yytext),t.push(D.yylloc),c.push(C[1]),N=null,W=D.yyleng,n=D.yytext,P=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[C[1]][1],F.$=E[E.length-B],F._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},Be&&(F._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),ee=this.performAction.apply(F,[n,W,P,A.yy,C[1],E,t].concat(Z)),typeof ee<"u")return ee;B&&(c=c.slice(0,-1*B*2),E=E.slice(0,-1*B),t=t.slice(0,-1*B)),c.push(this.productions_[C[1]][0]),E.push(F.$),t.push(F._$),pe=M[c[c.length-2]][c[c.length-1]],c.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(i,c){if(this.yy.parser)this.yy.parser.parseError(i,c);else throw new Error(i)},"parseError"),setInput:u(function(g,i){return this.yy=i||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var i=g.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:u(function(g){var i=g.length,c=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(g){this.unput(this.match.slice(g))},"less"),pastInput:u(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var g=this.pastInput(),i=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+i+"^"},"showPosition"),test_match:u(function(g,i){var c,p,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),p=g[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],c=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in E)this[t]=E[t];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,i,c,p;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),t=0;ti[0].length)){if(i=c,p=t,this.options.backtrack_lexer){if(g=this.test_match(c,E[t]),g!==!1)return g;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(g=this.test_match(i,E[p]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var i=this.next();return i||this.lex()},"lex"),begin:u(function(i){this.conditionStack.push(i)},"begin"),popState:u(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:u(function(i){this.begin(i)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(i,c,p,E){switch(p){case 0:return i.getLogger().debug("Found block-beta"),10;case 1:return i.getLogger().debug("Found id-block"),29;case 2:return i.getLogger().debug("Found block"),10;case 3:i.getLogger().debug(".",c.yytext);break;case 4:i.getLogger().debug("_",c.yytext);break;case 5:return 5;case 6:return c.yytext=-1,28;case 7:return c.yytext=c.yytext.replace(/columns\s+/,""),i.getLogger().debug("COLUMNS (LEX)",c.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:i.getLogger().debug("LEX: POPPING STR:",c.yytext),this.popState();break;case 13:return i.getLogger().debug("LEX: STR end:",c.yytext),"STR";case 14:return c.yytext=c.yytext.replace(/space\:/,""),i.getLogger().debug("SPACE NUM (LEX)",c.yytext),21;case 15:return c.yytext="1",i.getLogger().debug("COLUMNS (LEX)",c.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),i.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),i.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),i.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),i.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),i.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),i.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),i.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),i.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),i.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),i.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return i.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return i.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return i.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return i.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return i.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return i.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return i.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),i.getLogger().debug("LEX ARR START"),37;case 74:return i.getLogger().debug("Lex: NODE_ID",c.yytext),31;case 75:return i.getLogger().debug("Lex: EOF",c.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:i.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:i.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return i.getLogger().debug("LEX: NODE_DESCR:",c.yytext),"NODE_DESCR";case 83:i.getLogger().debug("LEX POPPING"),this.popState();break;case 84:i.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (right): dir:",c.yytext),"DIR";case 86:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (left):",c.yytext),"DIR";case 87:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (x):",c.yytext),"DIR";case 88:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (y):",c.yytext),"DIR";case 89:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (up):",c.yytext),"DIR";case 90:return c.yytext=c.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (down):",c.yytext),"DIR";case 91:return c.yytext="]>",i.getLogger().debug("Lex (ARROW_DIR end):",c.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return i.getLogger().debug("Lex: LINK","#"+c.yytext+"#"),15;case 93:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 94:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 95:return i.getLogger().debug("Lex: LINK",c.yytext),15;case 96:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 97:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 98:return i.getLogger().debug("Lex: START_LINK",c.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return i.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),i.getLogger().debug("Lex: LINK","#"+c.yytext+"#"),15;case 102:return this.popState(),i.getLogger().debug("Lex: LINK",c.yytext),15;case 103:return this.popState(),i.getLogger().debug("Lex: LINK",c.yytext),15;case 104:return i.getLogger().debug("Lex: COLON",c.yytext),c.yytext=c.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return v})();_.lexer=T;function O(){this.yy={}}return u(O,"Parser"),O.prototype=_,_.Parser=O,new O})();ie.parser=ie;var Dt=ie,z=new Map,oe=[],ae=new Map,fe="color",be="fill",Tt="bgFill",me=",",j=new Map,ce="",Nt=u(e=>bt.sanitizeText(e,Le()),"sanitizeText"),It=u(function(e,a=""){let o=j.get(e);o||(o={id:e,styles:[],textStyles:[]},j.set(e,o)),a?.split(me).forEach(r=>{const l=r.replace(/([^;]*);/,"$1").trim();if(RegExp(fe).exec(r)){const s=l.replace(be,Tt).replace(fe,be);o.textStyles.push(s)}o.styles.push(l)})},"addStyleClass"),Ot=u(function(e,a=""){const o=z.get(e);a!=null&&(o.styles=a.split(me))},"addStyle2Node"),vt=u(function(e,a){e.split(",").forEach(function(o){let r=z.get(o);if(r===void 0){const l=o.trim();r={id:l,type:"na",children:[]},z.set(l,r)}r.classes||(r.classes=[]),r.classes.push(a)})},"setCssClass"),we=u((e,a)=>{const o=e.flat(),r=[],d=o.find(s=>s?.type==="column-setting")?.columns??-1;for(const s of o){if(typeof d=="number"&&d>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>d&&m.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${d}`),s.label&&(s.label=Nt(s.label)),s.type==="classDef"){It(s.id,s.css);continue}if(s.type==="applyClass"){vt(s.id,s?.styleClass??"");continue}if(s.type==="applyStyles"){s?.stylesStr&&Ot(s.id,s?.stylesStr);continue}if(s.type==="column-setting")a.columns=s.columns??-1;else if(s.type==="edge"){const h=(ae.get(s.id)??0)+1;ae.set(s.id,h),s.id=h+"-"+s.id,oe.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const h=z.get(s.id);if(h===void 0?z.set(s.id,s):(s.type!=="na"&&(h.type=s.type),s.label!==s.id&&(h.label=s.label)),s.children&&we(s.children,s),s.type==="space"){const x=s.width??1;for(let y=0;y{m.debug("Clear called"),ut(),K={id:"root",type:"composite",children:[],columns:-1},z=new Map([["root",K]]),le=[],j=new Map,oe=[],ae=new Map,ce=""},"clear");function Ee(e){switch(m.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return m.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}u(Ee,"typeStr2Type");function _e(e){switch(m.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(_e,"edgeTypeStr2Type");function ke(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u(ke,"edgeStrToEdgeData");function De(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}u(De,"edgeStrToEdgeStartData");function Te(e){return e.includes("==")?"thick":"normal"}u(Te,"edgeStrToThickness");function Ne(e){return e.includes(".-")?"dotted":"solid"}u(Ne,"edgeStrToPattern");var Se=0,zt=u(()=>(Se++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Se),"generateId"),At=u(e=>{K.children=e,we(e,K),le=K.children},"setHierarchy"),Bt=u(e=>{const a=z.get(e);return a?a.columns?a.columns:a.children?a.children.length:-1:-1},"getColumns"),Rt=u(()=>[...z.values()],"getBlocksFlat"),Pt=u(()=>le||[],"getBlocks"),Ft=u(()=>oe,"getEdges"),Mt=u(e=>z.get(e),"getBlock"),Kt=u(e=>{z.set(e.id,e)},"setBlock"),Yt=u(e=>{ce=e},"setDiagramId"),Wt=u(()=>ce,"getDiagramId"),Vt=u(()=>m,"getLogger"),Ut=u(function(){return j},"getClasses"),Ht={getConfig:u(()=>Y().block,"getConfig"),typeStr2Type:Ee,edgeTypeStr2Type:_e,edgeStrToEdgeData:ke,edgeStrToEdgeStartData:De,edgeStrToThickness:Te,edgeStrToPattern:Ne,getLogger:Vt,getBlocksFlat:Rt,getBlocks:Pt,getEdges:Ft,setHierarchy:At,getBlock:Mt,setBlock:Kt,getColumns:Bt,getClasses:Ut,clear:Ct,generateId:zt,setDiagramId:Yt,getDiagramId:Wt},Xt=Ht,re=u((e,a)=>{const o=Lt,r=o(e,"r"),l=o(e,"g"),d=o(e,"b");return gt(r,l,d,a)},"fade"),jt=u(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + + + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${re(e.mainBkg,.5)}; + fill: ${re(e.clusterBkg,.5)}; + stroke: ${re(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${Pe()} +`,"getStyles"),Gt=jt;function ne(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const o=a%e,r=Math.floor(a/e);return{px:o,py:r}}u(ne,"calculateBlockPosition");var qt=u(e=>{let a=0,o=0;for(const r of e.children){const{width:l,height:d,x:s,y:h}=r.size??{width:0,height:0,x:0,y:0};if(m.debug("getMaxChildSize abc95 child:",r.id,"width:",l,"height:",d,"x:",s,"y:",h,r.type),r.type==="space")continue;const x=l/(r.widthInColumns??1);x>a&&(a=x),d>o&&(o=d)}return{width:a,height:o}},"getMaxChildSize");function G(e,a,o=0,r=0,l=8){m.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",o),e?.size?.width||(e.size={width:o,height:r,x:0,y:0});let d=0,s=0;if(e.children?.length>0){for(const b of e.children)G(b,a,0,0,l);const h=qt(e);d=h.width,s=h.height,m.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",d,s);for(const b of e.children)b.size&&(m.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${d} ${s} ${JSON.stringify(b.size)}`),b.size.width=d*(b.widthInColumns??1)+l*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,m.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${d} maxHeight:${s}`));for(const b of e.children)G(b,a,d,s,l);const x=e.columns??-1;let y=0;for(const b of e.children)y+=b.widthInColumns??1;let S=e.children.length;x>0&&x0?Math.min(e.children.length,x):e.children.length;if(b>0){const k=(L-b*l-l)/b;m.debug("abc95 (growing to fit) width",e.id,L,e.size?.width,k);for(const _ of e.children)_.size&&(_.size.width=k)}}e.size={width:L,height:w,x:0,y:0}}m.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u(G,"setBlockSizes");function ue(e,a,o=8){m.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const r=e.columns??-1;if(m.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const l=e?.children[0]?.size?.width??0,d=e.children.length*l+(e.children.length-1)*o;m.debug("widthOfChildren 88",d,"posX");const s=new Map;{let f=0;for(const L of e.children){if(!L.size)continue;const{py:w}=ne(r,f),b=s.get(w)??0;L.size.height>b&&s.set(w,L.size.height);let k=L?.widthInColumns??1;r>0&&(k=Math.min(k,r-f%r)),f+=k}}const h=new Map;{let f=0;const L=[...s.keys()].sort((w,b)=>w-b);for(const w of L)h.set(w,f),f+=(s.get(w)??0)+o}let x=0;m.debug("abc91 block?.size?.x",e.id,e?.size?.x);let y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,S=0;for(const f of e.children){const L=e;if(!f.size)continue;const{width:w,height:b}=f.size,{px:k,py:_}=ne(r,x);if(_!=S&&(S=_,y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,m.debug("New row in layout for block",e.id," and child ",f.id,S)),m.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${x} (px, py) ${k},${_} (${L?.size?.x},${L?.size?.y}) parent: ${L.id} width: ${w}${o}`),L.size){const O=w/2;f.size.x=y+o+O,m.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${y} new startingPosX${f.size.x} ${O} padding=${o} width=${w} halfWidth=${O} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(f?.widthInColumns??1)/2}`),y=f.size.x+O;const v=h.get(_)??0,g=s.get(_)??b;f.size.y=L.size.y-L.size.height/2+v+g/2+o,m.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${y}${o}${O}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${w*(f?.widthInColumns??1)/2}`)}f.children&&ue(f,a,o);let T=f?.widthInColumns??1;r>0&&(T=Math.min(T,r-x%r)),x+=T,m.debug("abc88 columnsPos",f,x)}}m.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u(ue,"layoutBlocks");function ge(e,{minX:a,minY:o,maxX:r,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:d,y:s,width:h,height:x}=e.size;d-h/2r&&(r=d+h/2),s+x/2>l&&(l=s+x/2)}if(e.children)for(const d of e.children)({minX:a,minY:o,maxX:r,maxY:l}=ge(d,{minX:a,minY:o,maxX:r,maxY:l}));return{minX:a,minY:o,maxX:r,maxY:l}}u(ge,"findBounds");function Ie(e){const a=e.getBlock("root");if(!a)return;const o=Le()?.block?.padding??8;G(a,e,0,0,o),ue(a,e,o),m.debug("getBlocks",JSON.stringify(a,null,2));const{minX:r,minY:l,maxX:d,maxY:s}=ge(a),h=s-l,x=d-r;return{x:r,y:l,width:x,height:h}}u(Ie,"layout");function he(e,a,o=!1){const r=e;let l="default";(r?.classes?.length||0)>0&&(l=(r?.classes??[]).join(" ")),l=l+" flowchart-label";const d=(r?.classes??[]).flatMap(b=>a.getClasses().get(b)?.styles??[]);let s=0,h="rect",x;switch(r.type){case"round":s=5,h="rect";break;case"composite":s=0,h="composite",x=0;break;case"square":h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"group":h="rect";break;case"doublecircle":h="doublecircle";break;default:h="rect"}const y=St(r?.styles??[]),S=r.label,f=r.size??{width:0,height:0,x:0,y:0},L=a.getDiagramId();return{labelStyle:y.labelStyle,shape:h,label:S,labelText:S,rx:s,ry:s,class:l,cssClasses:l,cssStyles:r?.styles??[],cssCompiledStyles:d,style:y.style,id:r.id,domId:L?`${L}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||Number.POSITIVE_INFINITY,x:f.x,y:f.y,positioned:o,intersect:void 0,padding:x??Y()?.block?.padding??0,widthInColumns:r.widthInColumns??1}}u(he,"getNodeFromBlock");async function Oe(e,a,o){const r=he(a,o,!1);if(a.type==="group")return;const l=Y(),d=await ye(e,r,{config:l}),s=d.node()?.getBBox()??{width:0,height:0},h=o.getBlock(r.id);h.size={width:s.width,height:s.height,x:0,y:0,node:d},o.setBlock(h),d.remove()}u(Oe,"calculateBlockSize");async function ve(e,a,o){const r=he(a,o,!0);if(o.getBlock(r.id).type!=="space"){const d=Y();await ye(e,r,{config:d}),a.intersect=r?.intersect,xt(r)}}u(ve,"insertBlockPositioned");async function q(e,a,o,r){for(const l of a)await r(e,l,o),l.children&&await q(e,l.children,o,r)}u(q,"performOperations");async function Ce(e,a,o){await q(e,a,o,Oe)}u(Ce,"calculateBlockSizes");async function ze(e,a,o){await q(e,a,o,ve)}u(ze,"insertBlocks");async function Ae(e,a,o,r,l){const d=new ht({multigraph:!0,compound:!0});d.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of o)s.size&&d.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of a)if(s.start&&s.end){const h=r.getBlock(s.start),x=r.getBlock(s.end);if(h?.size&&x?.size){const y=h.size,S=x.size,f=[{x:y.x,y:y.y},{x:y.x+(S.x-y.x)/2,y:y.y+(S.y-y.y)/2},{x:S.x,y:S.y}],L=l?`${l}-${s.id}`:s.id,w=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",b=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",k=`${w} ${b} flowchart-link LS-a1 LE-b1`;dt(e,{...s,id:L,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:f,classes:k},{},"block",d.node(s.start),d.node(s.end),l),s.label&&(await pt(e,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:f,classes:k}),ft({...s,x:f[1].x,y:f[1].y},{originalPath:f}))}}}u(Ae,"insertEdges");var Jt=u(function(e,a){return a.db.getClasses()},"getClasses"),Zt=u(async function(e,a,o,r){const{securityLevel:l,block:d}=Y(),s=r.db;s.setDiagramId(a);let h;l==="sandbox"&&(h=X("#i"+a));const x=l==="sandbox"?X(h.nodes()[0].contentDocument.body):X("body"),y=l==="sandbox"?x.select(`[id="${a}"]`):X(`[id="${a}"]`);ct(y,["point","circle","cross"],r.type,a);const f=s.getBlocks(),L=s.getBlocksFlat(),w=s.getEdges(),b=y.insert("g").attr("class","block");await Ce(b,f,s);const k=Ie(s);await ze(b,f,s),await Ae(b,w,L,s,a);const _=b.node()?.getBBox(),T=_&&Number.isFinite(_.width)&&Number.isFinite(_.height)?_:k;if(T){const O=Math.max(1,Math.round(.125*(T.width/T.height))),v=T.height+O+10,g=T.width+10,{useMaxWidth:i}=d;lt(y,v,g,!!i),m.debug("Here Bounds",k,T),y.attr("viewBox",`${T.x-5} ${T.y-5} ${T.width+10} ${T.height+10}`)}},"draw"),Qt={draw:Zt,getClasses:Jt},ss={parser:Dt,db:Xt,renderer:Qt,styles:Gt};export{ss as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-BVFBsXNc.js b/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-BVFBsXNc.js deleted file mode 100644 index 441465e80..000000000 --- a/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-BVFBsXNc.js +++ /dev/null @@ -1,10 +0,0 @@ -import{g as Oe,d as Re}from"./chunk-ND2GUHAM-BBoWOe8j.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-Bt2TZ_t_.js";import"./index-C-zUV3mO.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: -`+D.showPosition()+` -Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=Ae;function It(){this.yy={}}return y(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=y(function(){return ye},"getC4Type"),Ue=y(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=y(function(e,t,s,o,l,r,a,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(p=>p.from===t&&p.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.techn={text:l};if(r==null)u.descr={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.descr={text:r};if(typeof a=="object"){let[p,g]=Object.entries(a)[0];u[p]=g}else u.sprite=a;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Ve=y(function(e,t,s,o,l,r,a){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.tags=r;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.link=a;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=y(function(e,t,s,o,l,r,a,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.shadowing=r;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.shape=a;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ke=y(function(e,t,s,o,l,r,a){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(r);if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(a)}},"updateRelStyle"),Je=y(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const r=Object.values(t)[0];o=parseInt(r)}else o=parseInt(t);if(typeof s=="object"){const r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=y(function(){return Ut},"getC4ShapeInRow"),$e=y(function(){return Ft},"getC4BoundaryInRow"),t0=y(function(){return B},"getCurrentBoundaryParse"),e0=y(function(){return F},"getParentBoundaryParse"),ge=y(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=y(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=y(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=y(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,s0=y(function(){return Pt},"getRels"),r0=y(function(){return ee},"getTitle"),l0=y(function(e){ae=e},"setWrap"),mt=y(function(){return ae},"autoWrap"),o0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=y(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:s0,getTitle:r0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:y(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=y(function(e,t){return Re(e,t)},"drawRect"),_e=y(function(e,t,s,o,l,r){const a=e.append("image");a.attr("width",t),a.attr("height",s),a.attr("x",o),a.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:Le.sanitizeUrl(r);a.attr("xlink:href",n)},"drawImage"),f0=y((e,t,s,o)=>{const l=e.append("g");let r=0;for(let a of t){let n=a.textColor?a.textColor:"#444444",i=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,d=a.offsetY?parseInt(a.offsetY):0,p="";if(r===0){let m=l.append("line");m.attr("x1",a.startPoint.x),m.attr("y1",a.startPoint.y),m.attr("x2",a.endPoint.x),m.attr("y2",a.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),r=-1}else{let m=l.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(a.label.text,l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:n},g),a.techn&&a.techn.text!==""&&(g=s.messageFont(),Q(s)("["+a.techn.text+"]",l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),p0=y(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",r=t.borderColor?t.borderColor:"#444444",a=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:r,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=a,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=y(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],r=t.fontColor?t.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=r,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:r},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=r,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:r,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:r,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=r,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:r},d)),t.height},"drawC4Shape"),g0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=y(function(e,t){const o=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,r,a,n,i,u,d){const p=r.append("text").attr("x",a+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(p,d)}y(e,"byText");function t(l,r,a,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=y(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=y(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),k0=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let r=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=r.length;let a=0;t[e].height=0,t[e].width=0;for(const n of r)t[e].width=Math.max(Tt(n,o),t[e].width),a=ue(n,o),t[e].height=t[e].height+a}}y(j,"calcC4ShapeTextWH");var ve=y(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Tt(t.label.text,l);j("label",t,o,l,r),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=y(function(e,t,s,o){let l=0;for(const r of o){l=0;const a=s[r];let n=St(_,a.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,a.typeC4Shape.width=Tt("«"+a.typeC4Shape.text+"»",n),a.typeC4Shape.height=n.fontSize+2,a.typeC4Shape.Y=_.c4ShapePadding,l=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height);let i=a.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,a.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",a,i,d,u),a.label.Y=l+8,l=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=St(_,a.typeC4Shape.text);j("type",a,i,m,u),a.type.Y=l+5,l=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=St(_,a.techn.text);j("techn",a,i,m,u),a.techn.Y=l+5,l=a.techn.Y+a.techn.height}let p=l,g=a.label.width;if(a.descr&&a.descr.text!==""){let m=St(_,a.typeC4Shape.text);j("descr",a,i,m,u),a.descr.Y=l+20,l=a.descr.Y+a.descr.height,g=Math.max(a.label.width,a.descr.width),p=l-a.descr.textLines*5}g=g+_.c4ShapePadding,a.width=Math.max(a.width||_.width,g,_.width),a.height=Math.max(a.height||_.height,p,_.height),a.margin=a.margin||_.c4ShapeMargin,e.insert(a),z.drawC4Shape(t,a,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{y(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=y(function(e,t){let s=e.x,o=e.y,l=t.x,r=t.y,a=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-r),d=u/i,p=e.height/e.width,g=null;return o==r&&sl?g=new Y(s,n):s==l&&or&&(g=new Y(a,o)),s>l&&o=d?g=new Y(s,n+d*e.width/2):g=new Y(a-i/u*e.height/2,o+e.height):s=d?g=new Y(s+e.width,n+d*e.width/2):g=new Y(a+i/u*e.height/2,o+e.height):sr?p>=d?g=new Y(s+e.width,n-d*e.width/2):g=new Y(a+e.height/2*i/u,o):s>l&&o>r&&(p>=d?g=new Y(s,n-e.width/2*d):g=new Y(a-e.height/2*i/u,o)),g},"getIntersectPoint"),C0=y(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),w0=y(function(e,t,s,o,l){let r=0;for(let a of t){r=r+1;let n=a.wrap&&_.wrap,i=k0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=r+": "+a.label.text);let d=Tt(a.label.text,i);j("label",a,n,i,d),a.techn&&a.techn.text!==""&&(d=Tt(a.techn.text,i),j("techn",a,n,i,d)),a.descr&&a.descr.text!==""&&(d=Tt(a.descr.text,i),j("descr",a,n,i,d));let p=s(a.from),g=s(a.to),m=C0(p,g);a.startPoint=m.startPoint,a.endPoint=m.endPoint}z.drawRels(e,t,_,l)},"drawRels");function ne(e,t,s,o,l){let r=new me(l);r.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[a,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(a==0||a%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;r.setData(O,O,S,S)}else{let O=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,S=r.data.starty;r.setData(O,O,S,S)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),g=l.db.getC4ShapeKeys(n.alias);g.length>0&&Ee(r,e,p,g),t=n.alias;let m=l.db.getBoundaries(t);m.length>0&&ne(e,t,r,m,l),n.alias!=="global"&&ve(e,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}y(ne,"drawInsideBoundary");var T0=y(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let r;l==="sandbox"&&(r=Nt("#i"+t));const a=l==="sandbox"?Nt(r.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?a.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");ne(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),w0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Vt,u.data.stopy=zt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",g)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:T0},O0=y(e=>`.person { - stroke: ${e.personBorder}; - fill: ${e.personBkg}; - } -`,"getStyles"),R0=O0,B0={parser:Ye,db:Zt,renderer:fe,styles:R0,init:y(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{B0 as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js b/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js deleted file mode 100644 index f8b9f3b82..000000000 --- a/apps/pythinker-code/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js +++ /dev/null @@ -1,10 +0,0 @@ -import{g as Oe,d as Re}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaidParser.worker-Dx4jPi9z.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: -`+D.showPosition()+` -Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=Ae;function It(){this.yy={}}return y(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=y(function(){return ye},"getC4Type"),Ue=y(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=y(function(e,t,s,o,l,r,a,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(p=>p.from===t&&p.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.techn={text:l};if(r==null)u.descr={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.descr={text:r};if(typeof a=="object"){let[p,g]=Object.entries(a)[0];u[p]=g}else u.sprite=a;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Ve=y(function(e,t,s,o,l,r,a){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.tags=r;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.link=a;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=y(function(e,t,s,o,l,r,a,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.shadowing=r;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.shape=a;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ke=y(function(e,t,s,o,l,r,a){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(r);if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(a)}},"updateRelStyle"),Je=y(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const r=Object.values(t)[0];o=parseInt(r)}else o=parseInt(t);if(typeof s=="object"){const r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=y(function(){return Ut},"getC4ShapeInRow"),$e=y(function(){return Ft},"getC4BoundaryInRow"),t0=y(function(){return B},"getCurrentBoundaryParse"),e0=y(function(){return F},"getParentBoundaryParse"),ge=y(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=y(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=y(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=y(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,s0=y(function(){return Pt},"getRels"),r0=y(function(){return ee},"getTitle"),l0=y(function(e){ae=e},"setWrap"),mt=y(function(){return ae},"autoWrap"),o0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=y(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:s0,getTitle:r0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:y(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=y(function(e,t){return Re(e,t)},"drawRect"),_e=y(function(e,t,s,o,l,r){const a=e.append("image");a.attr("width",t),a.attr("height",s),a.attr("x",o),a.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:Le.sanitizeUrl(r);a.attr("xlink:href",n)},"drawImage"),f0=y((e,t,s,o)=>{const l=e.append("g");let r=0;for(let a of t){let n=a.textColor?a.textColor:"#444444",i=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,d=a.offsetY?parseInt(a.offsetY):0,p="";if(r===0){let m=l.append("line");m.attr("x1",a.startPoint.x),m.attr("y1",a.startPoint.y),m.attr("x2",a.endPoint.x),m.attr("y2",a.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),r=-1}else{let m=l.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(a.label.text,l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:n},g),a.techn&&a.techn.text!==""&&(g=s.messageFont(),Q(s)("["+a.techn.text+"]",l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),p0=y(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",r=t.borderColor?t.borderColor:"#444444",a=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:r,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=a,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=y(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],r=t.fontColor?t.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=r,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:r},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=r,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:r,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:r,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=r,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:r},d)),t.height},"drawC4Shape"),g0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=y(function(e,t){const o=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,r,a,n,i,u,d){const p=r.append("text").attr("x",a+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(p,d)}y(e,"byText");function t(l,r,a,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=y(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=y(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),k0=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let r=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=r.length;let a=0;t[e].height=0,t[e].width=0;for(const n of r)t[e].width=Math.max(Tt(n,o),t[e].width),a=ue(n,o),t[e].height=t[e].height+a}}y(j,"calcC4ShapeTextWH");var ve=y(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Tt(t.label.text,l);j("label",t,o,l,r),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=y(function(e,t,s,o){let l=0;for(const r of o){l=0;const a=s[r];let n=St(_,a.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,a.typeC4Shape.width=Tt("«"+a.typeC4Shape.text+"»",n),a.typeC4Shape.height=n.fontSize+2,a.typeC4Shape.Y=_.c4ShapePadding,l=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height);let i=a.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,a.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",a,i,d,u),a.label.Y=l+8,l=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=St(_,a.typeC4Shape.text);j("type",a,i,m,u),a.type.Y=l+5,l=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=St(_,a.techn.text);j("techn",a,i,m,u),a.techn.Y=l+5,l=a.techn.Y+a.techn.height}let p=l,g=a.label.width;if(a.descr&&a.descr.text!==""){let m=St(_,a.typeC4Shape.text);j("descr",a,i,m,u),a.descr.Y=l+20,l=a.descr.Y+a.descr.height,g=Math.max(a.label.width,a.descr.width),p=l-a.descr.textLines*5}g=g+_.c4ShapePadding,a.width=Math.max(a.width||_.width,g,_.width),a.height=Math.max(a.height||_.height,p,_.height),a.margin=a.margin||_.c4ShapeMargin,e.insert(a),z.drawC4Shape(t,a,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{y(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=y(function(e,t){let s=e.x,o=e.y,l=t.x,r=t.y,a=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-r),d=u/i,p=e.height/e.width,g=null;return o==r&&sl?g=new Y(s,n):s==l&&or&&(g=new Y(a,o)),s>l&&o=d?g=new Y(s,n+d*e.width/2):g=new Y(a-i/u*e.height/2,o+e.height):s=d?g=new Y(s+e.width,n+d*e.width/2):g=new Y(a+i/u*e.height/2,o+e.height):sr?p>=d?g=new Y(s+e.width,n-d*e.width/2):g=new Y(a+e.height/2*i/u,o):s>l&&o>r&&(p>=d?g=new Y(s,n-e.width/2*d):g=new Y(a-e.height/2*i/u,o)),g},"getIntersectPoint"),C0=y(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),w0=y(function(e,t,s,o,l){let r=0;for(let a of t){r=r+1;let n=a.wrap&&_.wrap,i=k0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=r+": "+a.label.text);let d=Tt(a.label.text,i);j("label",a,n,i,d),a.techn&&a.techn.text!==""&&(d=Tt(a.techn.text,i),j("techn",a,n,i,d)),a.descr&&a.descr.text!==""&&(d=Tt(a.descr.text,i),j("descr",a,n,i,d));let p=s(a.from),g=s(a.to),m=C0(p,g);a.startPoint=m.startPoint,a.endPoint=m.endPoint}z.drawRels(e,t,_,l)},"drawRels");function ne(e,t,s,o,l){let r=new me(l);r.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[a,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(a==0||a%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;r.setData(O,O,S,S)}else{let O=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,S=r.data.starty;r.setData(O,O,S,S)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),g=l.db.getC4ShapeKeys(n.alias);g.length>0&&Ee(r,e,p,g),t=n.alias;let m=l.db.getBoundaries(t);m.length>0&&ne(e,t,r,m,l),n.alias!=="global"&&ve(e,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}y(ne,"drawInsideBoundary");var T0=y(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let r;l==="sandbox"&&(r=Nt("#i"+t));const a=l==="sandbox"?Nt(r.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?a.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");ne(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),w0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Vt,u.data.stopy=zt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",g)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:T0},O0=y(e=>`.person { - stroke: ${e.personBorder}; - fill: ${e.personBkg}; - } -`,"getStyles"),R0=O0,P0={parser:Ye,db:Zt,renderer:fe,styles:R0,init:y(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{P0 as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-BvorLsjE.js b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-BvorLsjE.js new file mode 100644 index 000000000..efe6f0204 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-BvorLsjE.js @@ -0,0 +1,38 @@ +import{d as Ne}from"./chunk-F27PBJKO-CYKbU5Oh.js";import{s as Ae,g as Le,a as Ie,b as Me,_ as d,c as Ct,l as ce,d as Be,e as Ve,f as Ot,h as Ye,i as ye,j as Kt,w as Fe,k as Jt,m as ue}from"./mermaidParser.worker-DimdFOud.js";var Yt=(function(){var t=d(function(yt,g,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=g);return x},"o"),e=[1,24],r=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],jt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Rt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],re=[12,14,33,42],Lt=[12,14,33,42,76,77,79,80],mt=[12,33],zt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(g,x,E,_,D,o,wt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...o[p]),this.$=o[p];break;case 33:_.addDeploymentNode("nodeL",...o[p]),this.$=o[p];break;case 34:_.addDeploymentNode("nodeR",...o[p]),this.$=o[p];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[p]),this.$=o[p];break;case 40:_.addPersonOrSystem("external_person",...o[p]),this.$=o[p];break;case 41:_.addPersonOrSystem("system",...o[p]),this.$=o[p];break;case 42:_.addPersonOrSystem("system_db",...o[p]),this.$=o[p];break;case 43:_.addPersonOrSystem("system_queue",...o[p]),this.$=o[p];break;case 44:_.addPersonOrSystem("external_system",...o[p]),this.$=o[p];break;case 45:_.addPersonOrSystem("external_system_db",...o[p]),this.$=o[p];break;case 46:_.addPersonOrSystem("external_system_queue",...o[p]),this.$=o[p];break;case 47:_.addContainer("container",...o[p]),this.$=o[p];break;case 48:_.addContainer("container_db",...o[p]),this.$=o[p];break;case 49:_.addContainer("container_queue",...o[p]),this.$=o[p];break;case 50:_.addContainer("external_container",...o[p]),this.$=o[p];break;case 51:_.addContainer("external_container_db",...o[p]),this.$=o[p];break;case 52:_.addContainer("external_container_queue",...o[p]),this.$=o[p];break;case 53:_.addComponent("component",...o[p]),this.$=o[p];break;case 54:_.addComponent("component_db",...o[p]),this.$=o[p];break;case 55:_.addComponent("component_queue",...o[p]),this.$=o[p];break;case 56:_.addComponent("external_component",...o[p]),this.$=o[p];break;case 57:_.addComponent("external_component_db",...o[p]),this.$=o[p];break;case 58:_.addComponent("external_component_queue",...o[p]),this.$=o[p];break;case 60:_.addRel("rel",...o[p]),this.$=o[p];break;case 61:_.addRel("birel",...o[p]),this.$=o[p];break;case 62:_.addRel("rel_u",...o[p]),this.$=o[p];break;case 63:_.addRel("rel_d",...o[p]),this.$=o[p];break;case 64:_.addRel("rel_l",...o[p]),this.$=o[p];break;case 65:_.addRel("rel_r",...o[p]),this.$=o[p];break;case 66:_.addRel("rel_b",...o[p]),this.$=o[p];break;case 67:o[p].splice(0,1),_.addRel("rel",...o[p]),this.$=o[p];break;case 68:_.updateElStyle("update_el_style",...o[p]),this.$=o[p];break;case 69:_.updateRelStyle("update_rel_style",...o[p]),this.$=o[p];break;case 70:_.updateLayoutConfig("update_layout_config",...o[p]),this.$=o[p];break;case 71:this.$=[o[p]];break;case 72:o[p].unshift(o[p-1]),this.$=o[p];break;case 73:case 75:this.$=o[p].trim();break;case 74:let xt={};xt[o[p-1].trim()]=o[p].trim(),this.$=xt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:70,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:71,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:72,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:73,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(kt,[2,14]),t(jt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Rt,[2,19]),t(Rt,[2,20]),{25:[1,78]},{27:[1,79]},t(Rt,[2,23]),{35:80,75:81,76:S,77:k,79:T,80:C},{35:86,75:81,76:S,77:k,79:T,80:C},{35:87,75:81,76:S,77:k,79:T,80:C},{35:88,75:81,76:S,77:k,79:T,80:C},{35:89,75:81,76:S,77:k,79:T,80:C},{35:90,75:81,76:S,77:k,79:T,80:C},{35:91,75:81,76:S,77:k,79:T,80:C},{35:92,75:81,76:S,77:k,79:T,80:C},{35:93,75:81,76:S,77:k,79:T,80:C},{35:94,75:81,76:S,77:k,79:T,80:C},{35:95,75:81,76:S,77:k,79:T,80:C},{35:96,75:81,76:S,77:k,79:T,80:C},{35:97,75:81,76:S,77:k,79:T,80:C},{35:98,75:81,76:S,77:k,79:T,80:C},{35:99,75:81,76:S,77:k,79:T,80:C},{35:100,75:81,76:S,77:k,79:T,80:C},{35:101,75:81,76:S,77:k,79:T,80:C},{35:102,75:81,76:S,77:k,79:T,80:C},{35:103,75:81,76:S,77:k,79:T,80:C},{35:104,75:81,76:S,77:k,79:T,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:k,79:T,80:C},{35:106,75:81,76:S,77:k,79:T,80:C},{35:107,75:81,76:S,77:k,79:T,80:C},{35:108,75:81,76:S,77:k,79:T,80:C},{35:109,75:81,76:S,77:k,79:T,80:C},{35:110,75:81,76:S,77:k,79:T,80:C},{35:111,75:81,76:S,77:k,79:T,80:C},{35:112,75:81,76:S,77:k,79:T,80:C},{35:113,75:81,76:S,77:k,79:T,80:C},{35:114,75:81,76:S,77:k,79:T,80:C},{35:115,75:81,76:S,77:k,79:T,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:k,79:T,80:C},{35:120,75:81,76:S,77:k,79:T,80:C},{35:121,75:81,76:S,77:k,79:T,80:C},{35:122,75:81,76:S,77:k,79:T,80:C},{35:123,75:81,76:S,77:k,79:T,80:C},{35:124,75:81,76:S,77:k,79:T,80:C},{35:125,75:81,76:S,77:k,79:T,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(jt,[2,17],{21:22,19:130,22:e,23:r,24:a,26:u,28:i}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:a,26:u,28:i,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(Rt,[2,21]),t(Rt,[2,22]),t(R,[2,39]),t(re,[2,71],{75:81,35:132,76:S,77:k,79:T,80:C}),t(Lt,[2,73]),{78:[1,133]},t(Lt,[2,75]),t(Lt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(mt,[2,28]),t(mt,[2,29]),t(mt,[2,30]),t(mt,[2,31]),t(mt,[2,32]),t(mt,[2,33]),t(mt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(jt,[2,18]),t(kt,[2,38]),t(re,[2,72]),t(Lt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(zt,[2,25]),t(zt,[2,26],{12:[1,138]}),t(zt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(g,x){if(x.recoverable)this.trace(g);else{var E=new Error(g);throw E.hash=x,E}},"parseError"),parse:d(function(g){var x=this,E=[0],_=[],D=[null],o=[],wt=this.table,p="",xt=0,ae=0,we=2,ie=1,Oe=o.slice.call(arguments,1),A=Object.create(this.lexer),vt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(vt.yy[Xt]=this.yy[Xt]);A.setInput(g,vt.yy),vt.yy.lexer=A,vt.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var qt=A.yylloc;o.push(qt);var Pe=A.options&&A.options.ranges;typeof vt.yy.parseError=="function"?this.parseError=vt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(De,"popStack");function oe(){var B;return B=_.pop()||A.lex()||ie,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(oe,"lex");for(var M,Et,V,Ht,Tt={},Mt,j,le,Bt;;){if(Et=E[E.length-1],this.defaultActions[Et]?V=this.defaultActions[Et]:((M===null||typeof M>"u")&&(M=oe()),V=wt[Et]&&wt[Et][M]),typeof V>"u"||!V.length||!V[0]){var Qt="";Bt=[];for(Mt in wt[Et])this.terminals_[Mt]&&Mt>we&&Bt.push("'"+this.terminals_[Mt]+"'");A.showPosition?Qt="Parse error on line "+(xt+1)+`: +`+A.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Qt="Parse error on line "+(xt+1)+": Unexpected "+(M==ie?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Qt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:qt,expected:Bt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,ae=A.yyleng,p=A.yytext,xt=A.yylineno,qt=A.yylloc;break;case 2:if(j=this.productions_[V[1]][1],Tt.$=D[D.length-j],Tt._$={first_line:o[o.length-(j||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(j||1)].first_column,last_column:o[o.length-1].last_column},Pe&&(Tt._$.range=[o[o.length-(j||1)].range[0],o[o.length-1].range[1]]),Ht=this.performAction.apply(Tt,[p,ae,xt,vt.yy,V[1],D,o].concat(Oe)),typeof Ht<"u")return Ht;j&&(E=E.slice(0,-1*j*2),D=D.slice(0,-1*j),o=o.slice(0,-1*j)),E.push(this.productions_[V[1]][0]),D.push(Tt.$),o.push(Tt._$),le=wt[E[E.length-2]][E[E.length-1]],E.push(le);break;case 3:return!0}}return!0},"parse")},Re=(function(){var yt={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(g,x){return this.yy=x||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var x=g.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:d(function(g){var x=g.length,E=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(g){this.unput(this.match.slice(g))},"less"),pastInput:d(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var g=this.pastInput(),x=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+x+"^"},"showPosition"),test_match:d(function(g,x){var E,_,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),_=g[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var o in D)this[o]=D[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,x,E,_;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),o=0;ox[0].length)){if(x=E,_=o,this.options.backtrack_lexer){if(g=this.test_match(E,D[o]),g!==!1)return g;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(g=this.test_match(x,D[_]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var x=this.next();return x||this.lex()},"lex"),begin:d(function(x){this.conditionStack.push(x)},"begin"),popState:d(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:d(function(x){this.begin(x)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(x,E,_,D){switch(_){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return yt})();Wt.lexer=Re;function It(){this.yy={}}return d(It,"Parser"),It.prototype=Wt,Wt.Parser=It,new It})();Yt.parser=Yt;var Ue=Yt,_e=d(t=>Ct()[t],"getRequiredConfig"),St=d((t,e)=>{for(const[r,a]of Object.entries(e))if(a!==void 0)if(typeof a=="object"){const[u,i]=Object.entries(a)[0];t[u]=i}else t[r]=a},"assignAttributes"),be=d(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),F=[],_t=[""],L="global",Y="",U=[be()],At=[],ee="",ne=!1,Ft=4,Ut=2,ge,je=d(function(){return ge},"getC4Type"),ze=d(function(t){ge=ye(t,Ct())},"setC4Type"),We=d(function(t,e,r,a,u,i,n,l,s){if(t==null||e===void 0||e===null||r===void 0||r===null||a===void 0||a===null)return;let h={};const y=At.find(f=>f.from===e&&f.to===r);if(y?h=y:At.push(h),h.type=t,h.from=e,h.to=r,h.label={text:a},u==null)h.techn={text:""};else if(typeof u=="object"){const[f,b]=Object.entries(u)[0];h[f]={text:b}}else h.techn={text:u};if(i==null)h.descr={text:""};else if(typeof i=="object"){const[f,b]=Object.entries(i)[0];h[f]={text:b}}else h.descr={text:i};St(h,{sprite:n,tags:l,link:s}),h.wrap=gt()},"addRel"),Xe=d(function(t,e,r,a,u,i,n){if(e===null||r===null)return;let l={};const s=F.find(h=>h.alias===e);if(s&&e===s.alias?l=s:(l.alias=e,F.push(l)),r==null?l.label={text:""}:l.label={text:r},a==null)l.descr={text:""};else if(typeof a=="object"){const[h,y]=Object.entries(a)[0];l[h]={text:y}}else l.descr={text:a};St(l,{sprite:u,tags:i,link:n}),l.typeC4Shape={text:t},l.parentBoundary=L,l.wrap=gt()},"addPersonOrSystem"),qe=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=F.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,F.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.techn={text:""};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.techn={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{sprite:i,tags:n,link:l}),s.wrap=gt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addContainer"),He=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=F.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,F.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.techn={text:""};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.techn={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{sprite:i,tags:n,link:l}),s.wrap=gt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addComponent"),Qe=d(function(t,e,r,a,u){if(t===null||e===null)return;let i={};const n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},r==null)i.type={text:"system"};else if(typeof r=="object"){const[l,s]=Object.entries(r)[0];i[l]={text:s}}else i.type={text:r};St(i,{tags:a,link:u}),i.parentBoundary=L,i.wrap=gt(),Y=L,L=t,_t.push(Y)},"addPersonOrSystemBoundary"),Ke=d(function(t,e,r,a,u){if(t===null||e===null)return;let i={};const n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},r==null)i.type={text:"container"};else if(typeof r=="object"){const[l,s]=Object.entries(r)[0];i[l]={text:s}}else i.type={text:r};St(i,{tags:a,link:u}),i.parentBoundary=L,i.wrap=gt(),Y=L,L=t,_t.push(Y)},"addContainerBoundary"),Ge=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=U.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,U.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.type={text:"node"};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.type={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{tags:n,link:l}),s.nodeType=t,s.parentBoundary=L,s.wrap=gt(),Y=L,L=e,_t.push(Y)},"addDeploymentNode"),Je=d(function(){L=Y,_t.pop(),Y=_t.pop(),_t.push(Y)},"popBoundaryParseStack"),Ze=d(function(t,e,r,a,u,i,n,l,s,h,y){let f=F.find(b=>b.alias===e);if(!(f===void 0&&(f=U.find(b=>b.alias===e),f===void 0))){if(r!=null)if(typeof r=="object"){const[b,v]=Object.entries(r)[0];f[b]=v}else f.bgColor=r;if(a!=null)if(typeof a=="object"){const[b,v]=Object.entries(a)[0];f[b]=v}else f.fontColor=a;if(u!=null)if(typeof u=="object"){const[b,v]=Object.entries(u)[0];f[b]=v}else f.borderColor=u;if(i!=null)if(typeof i=="object"){const[b,v]=Object.entries(i)[0];f[b]=v}else f.shadowing=i;if(n!=null)if(typeof n=="object"){const[b,v]=Object.entries(n)[0];f[b]=v}else f.shape=n;if(l!=null)if(typeof l=="object"){const[b,v]=Object.entries(l)[0];f[b]=v}else f.sprite=l;if(s!=null)if(typeof s=="object"){const[b,v]=Object.entries(s)[0];f[b]=v}else f.techn=s;if(h!=null)if(typeof h=="object"){const[b,v]=Object.entries(h)[0];f[b]=v}else f.legendText=h;if(y!=null)if(typeof y=="object"){const[b,v]=Object.entries(y)[0];f[b]=v}else f.legendSprite=y}},"updateElStyle"),$e=d(function(t,e,r,a,u,i,n){const l=At.find(s=>s.from===e&&s.to===r);if(l!==void 0){if(a!=null)if(typeof a=="object"){const[s,h]=Object.entries(a)[0];l[s]=h}else l.textColor=a;if(u!=null)if(typeof u=="object"){const[s,h]=Object.entries(u)[0];l[s]=h}else l.lineColor=u;if(i!=null)if(typeof i=="object"){const[s,h]=Object.entries(i)[0];l[s]=parseInt(h)}else l.offsetX=parseInt(i);if(n!=null)if(typeof n=="object"){const[s,h]=Object.entries(n)[0];l[s]=parseInt(h)}else l.offsetY=parseInt(n)}},"updateRelStyle"),t0=d(function(t,e,r){let a=Ft,u=Ut;if(typeof e=="object"){const i=Object.values(e)[0];a=parseInt(i)}else a=parseInt(e);if(typeof r=="object"){const i=Object.values(r)[0];u=parseInt(i)}else u=parseInt(r);a>=1&&(Ft=a),u>=1&&(Ut=u)},"updateLayoutConfig"),e0=d(function(){return Ft},"getC4ShapeInRow"),n0=d(function(){return Ut},"getC4BoundaryInRow"),s0=d(function(){return L},"getCurrentBoundaryParse"),r0=d(function(){return Y},"getParentBoundaryParse"),me=d(function(t){return t==null?F:F.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),a0=d(function(t){return F.find(e=>e.alias===t)},"getC4Shape"),i0=d(function(t){return Object.keys(me(t))},"getC4ShapeKeys"),xe=d(function(t){return t==null?U:U.filter(e=>e.parentBoundary===t)},"getBoundaries"),o0=xe,l0=d(function(){return At},"getRels"),c0=d(function(){return ee},"getTitle"),u0=d(function(t){ne=t},"setWrap"),gt=d(function(){return ne},"autoWrap"),h0=d(function(){F=[],U=[be()],Y="",L="global",_t=[""],At=[],_t=[""],ee="",ne=!1,Ft=4,Ut=2},"clear"),d0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},p0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},y0=d(function(t){ee=ye(t,Ct())},"setTitle"),Zt={addPersonOrSystem:Xe,addPersonOrSystemBoundary:Qe,addContainer:qe,addContainerBoundary:Ke,addComponent:He,addDeploymentNode:Ge,popBoundaryParseStack:Je,addRel:We,updateElStyle:Ze,updateRelStyle:$e,updateLayoutConfig:t0,autoWrap:gt,setWrap:u0,getC4ShapeArray:me,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:xe,getBoundarys:o0,getCurrentBoundaryParse:s0,getParentBoundaryParse:r0,getRels:l0,getTitle:c0,getC4Type:je,getC4ShapeInRow:e0,getC4BoundaryInRow:n0,setAccTitle:Me,getAccTitle:Ie,getAccDescription:Le,setAccDescription:Ae,getConfig:d(()=>_e("c4"),"getConfig"),clear:h0,LINETYPE:d0,ARROWTYPE:p0,PLACEMENT:f0,setTitle:y0,setC4Type:ze},ve=d(function(t,e){return Ne(t,e)},"drawRect"),_0=d((t,e,r,a)=>{const u=t.append("g");let i=0;for(const n of e){const l=n.textColor?n.textColor:"#444444",s=n.lineColor?n.lineColor:"#444444",h=n.offsetX?parseInt(String(n.offsetX)):0,y=n.offsetY?parseInt(String(n.offsetY)):0,f="";if(i===0){const w=u.append("line");w.attr("x1",n.startPoint.x),w.attr("y1",n.startPoint.y),w.attr("x2",n.endPoint.x),w.attr("y2",n.endPoint.y),w.attr("stroke-width","1"),w.attr("stroke",s),w.style("fill","none"),n.type!=="rel_b"&&w.attr("marker-end","url("+f+"#"+a+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+f+"#"+a+"-arrowend)"),i=-1}else{const w=u.append("path");w.attr("fill","none").attr("stroke-width","1").attr("stroke",s).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",n.startPoint.x).replaceAll("starty",n.startPoint.y).replaceAll("controlx",n.startPoint.x+(n.endPoint.x-n.startPoint.x)/2-(n.endPoint.x-n.startPoint.x)/4).replaceAll("controly",n.startPoint.y+(n.endPoint.y-n.startPoint.y)/2).replaceAll("stopx",n.endPoint.x).replaceAll("stopy",n.endPoint.y)),n.type!=="rel_b"&&w.attr("marker-end","url("+f+"#"+a+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+f+"#"+a+"-arrowend)")}const b=n.label.width;let v=r.messageFont();Pt(r)(n.label.text,u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+y,b,n.label.height,{fill:l},v),n.techn&&n.techn.text!==""&&(v=r.messageFont(),Pt(r)("["+n.techn.text+"]",u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+r.messageFontSize+5+y,Math.max(b,n.techn.width),n.techn.height,{fill:l,"font-style":"italic"},v))}},"drawRels"),b0=d(function(t,e,r){const a=t.append("g"),u=e.bgColor?e.bgColor:"none",i=e.borderColor?e.borderColor:"#444444",n=e.fontColor?e.fontColor:"black";let l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});const s={x:e.x,y:e.y,fill:u,stroke:i,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};ve(a,s);let h=r.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=n,Pt(r)(e.label.text,a,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=r.boundaryFont(),h.fontColor=n,Pt(r)(e.type.text,a,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=r.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=n,Pt(r)(e.descr.text,a,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),g0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),m0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),x0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),v0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),E0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),S0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),k0=d(function(t,e){const a=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);a.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),a.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Pt=(function(){function t(u,i,n,l,s,h,y){const f=i.append("text").attr("x",n+s/2).attr("y",l+h/2+5).style("text-anchor","middle").text(u);a(f,y)}d(t,"byText");function e(u,i,n,l,s,h,y,f){const{fontSize:b,fontFamily:v,fontWeight:w}=f,N=u.split(Jt.lineBreakRegex);for(let O=0;O{if(e==="sandbox"){const a=Kt("#i"+t).node()?.contentDocument;if(!a)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:Kt(a.body),doc:a}}return{root:Kt("body"),doc:document}},"getDiagramRoot"),C0=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),R0=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),w0={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},Gt=d(t=>t?w0[t.toLowerCase()]:void 0,"keywordShape"),O0=d(t=>{const e=Gt(t.shape)??Gt(t.sprite);if(e)return e;if(t.tags)for(const a of t.tags.split(",")){const u=Gt(a.trim());if(u)return u}const r=t.typeC4Shape.text;return r==="person"||r==="external_person"?"person":R0.has(r)?"cylinder":C0.has(r)?"h-cyl":"rounded"},"resolveNodeShape"),P0={person:"Person",system:"Software System",container:"Container",component:"Component"},D0=d(t=>{const e=t.replace(/^external_/,"").replace(/_(db|queue)$/,"");return P0[e]??e.replace(/_/g," ")},"stereotypeLabel"),N0=d(t=>t.startsWith("external_"),"isExternal"),A0=d(t=>{const e=D0(t.typeC4Shape.text);return t.techn?.text?`[${e}: ${t.techn.text}]`:`[${e}]`},"stereotypeText"),Ee=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(t=>[t,`external_${t}`]),L0=new Set(Ee),he=d(t=>L0.has(t),"isC4ElementType"),I0=d((t,e)=>{const r=t.typeC4Shape.text,a=t.bgColor??(he(r)&&e[`${r}_bg_color`]),u=t.borderColor??(he(r)&&e[`${r}_border_color`]),i=[];return a&&i.push(`fill:${a}`),u&&i.push(`stroke:${u}`),i.push(`color:${t.fontColor??"#FFFFFF"}`),i},"elementCssStyles"),de=d((t,e,r,a,u)=>{const i=t.typeC4Shape.text,n=["c4-shape",`c4-${i}`];N0(i)&&n.push("c4-external");const l=O0(t),s=I0(t,e);return(l==="rounded"||l==="fr-rect")&&s.push("rx:12px","ry:12px"),{id:t.alias,label:t.label.text,stereotype:A0(t),description:t.descr?.text?[t.descr.text]:void 0,labelType:"string",isGroup:!1,shape:l,cssClasses:n.join(" "),cssStyles:s,padding:r,look:a,useHtmlLabels:!1,width:u}},"buildC4Node"),Dt=0,Nt=0,Se=4,$t=2;Yt.yy=Zt;var m={},ke=class{static{d(this,"Bounds")}constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,te(t.db.getConfig())}setData(t,e,r,a){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=r,this.nextData.stopy=this.data.stopy=a}updateVal(t,e,r,a){t[e]===void 0?t[e]=r:t[e]=a(r,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;const e=this.nextData.stopx,r=this.data.widthLimit;let a=this.nextData.startx===this.nextData.stopx?e+t.margin:e+t.margin*2,u=a+t.width,i=this.nextData.starty+t.margin*2,n=i+t.height;(a>=r||u>=r||this.nextData.cnt>Se)&&(a=this.nextData.startx+t.margin+m.nextLinePaddingX,i=this.nextData.stopy+t.margin*2,this.nextData.stopx=u=a+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=n=i+t.height,this.nextData.cnt=1),t.x=a,t.y=i,this.updateVal(this.data,"startx",a,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",u,Math.max),this.updateVal(this.data,"stopy",n,Math.max),this.updateVal(this.nextData,"startx",a,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",u,Math.max),this.updateVal(this.nextData,"stopy",n,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},te=d(function(t){Ve(m,t),t?.fontFamily&&(m.personFontFamily=m.systemFontFamily=m.messageFontFamily=t.fontFamily),t?.fontSize&&(m.personFontSize=m.systemFontSize=m.messageFontSize=t.fontSize),t?.fontWeight&&(m.personFontWeight=m.systemFontWeight=m.messageFontWeight=t.fontWeight)},"setConf"),Vt=d(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),M0=d(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function bt(t,e,r,a,u){const i=e[t];if(!i.width)if(r)i.text=Fe(i.text,u,a),i.textLines=i.text.split(Jt.lineBreakRegex).length,i.width=u,i.height=ue(i.text,a);else{const n=i.text.split(Jt.lineBreakRegex);i.textLines=n.length;let l=0;i.height=0,i.width=0;for(const s of n)i.width=Math.max(Ot(s,a),i.width),l=ue(s,a),i.height=i.height+l}return i}d(bt,"calcC4ShapeTextWH");var Te=d(function(t,e,r){const a=r.data.startx,u=r.data.starty;e.x=a,e.y=u,e.width=r.data.stopx-a,e.height=r.data.stopy-u,e.label.y=m.c4ShapeMargin-35;const i=e.wrap&&m.wrap,n=Vt(m);n.fontSize=n.fontSize+2,n.fontWeight="bold";const l=Ot(e.label.text,n);bt("label",e,i,n,l),z.drawBoundary(t,e,m)},"drawBoundary"),Ce=d(async function(t,e,r,a){const u=Ct(),i=u.look??"classic",n={config:u},l=e.attr("id")??"",s=a.map(y=>r[Number(y)]),h=d(y=>{const f=y.shape?Ye[y.shape]:void 0;if(!f)throw new Error(`C4: no shape handler for "${y.shape}"`);return f},"shapeHandlerFor");await Promise.all(s.map(async y=>{const f=de(y,m,m.c4ShapePadding,i,m.width);f.domId=`${l}-${f.id}`;const b=await h(f)(e,f,n);y.width=f.width??m.width,y.height=f.height??m.height,y.margin=m.c4ShapeMargin,b.remove()}));for(const y of s)t.insert(y);await Promise.all(s.map(async y=>{const f=de(y,m,m.c4ShapePadding,i,m.width);f.domId=`${l}-${f.id}`,f.x=y.x+y.width/2,f.y=y.y+y.height/2;const b=e.append("g").attr("transform",`translate(${y.x+y.width/2}, ${y.y+y.height/2})`);await h(f)(b,f,n),y.intersect=f.intersect})),t.bumpLastMargin(m.c4ShapeMargin)},"drawC4ShapeArray"),B0=class{static{d(this,"Point")}constructor(t,e){this.x=t,this.y=e}},pe=d(function(t,e){if(!t.intersect)throw new Error(`C4 shape "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);const{x:r,y:a}=t.intersect(e);return new B0(r,a)},"getIntersectPoint"),V0=d(function(t,e){const r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;const a=pe(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;const u=pe(e,r);return{startPoint:a,endPoint:u}},"getIntersectPoints"),Y0=d(function(t,e,r,a,u){const i=a.db.getC4Type();let n=0;for(const l of e){n=n+1;const s=l.wrap&&m.wrap,h=M0(m);i==="C4Dynamic"&&(l.label.text=n+": "+l.label.text);let y=Ot(l.label.text,h);bt("label",l,s,h,y),l.techn&&l.techn.text!==""&&(y=Ot(l.techn.text,h),bt("techn",l,s,h,y)),l.descr&&l.descr.text!==""&&(y=Ot(l.descr.text,h),bt("descr",l,s,h,y));const f=r(l.from),b=r(l.to);if(!f||!b)throw new Error(`C4 rel "${l.from}" -> "${l.to}" references an unknown shape`);const v=V0(f,b);if(!v.startPoint||!v.endPoint)throw new Error(`Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`);l.startPoint=v.startPoint,l.endPoint=v.endPoint}z.drawRels(t,e,m,u)},"drawRels");async function se(t,e,r,a,u){const i=u.db,n=new ke(u);n.data.widthLimit=r.data.widthLimit/Math.min($t,a.length);for(const[l,s]of a.entries()){let h=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=h,h=s.image.Y+s.image.height);const y=s.wrap&&m.wrap,f=Vt(m);f.fontSize=f.fontSize+2,f.fontWeight="bold";const b=bt("label",s,y,f,n.data.widthLimit);if(b.Y=h+8,h=b.Y+b.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";const O=Vt(m),P=bt("type",s,y,O,n.data.widthLimit);P.Y=h+5,h=P.Y+P.height}if(s.descr&&s.descr.text!==""){const O=Vt(m);O.fontSize=O.fontSize-2;const P=bt("descr",s,y,O,n.data.widthLimit);P.Y=h+20,h=P.Y+P.height}if(l==0||l%$t===0){const O=r.data.startx+m.diagramMarginX,P=r.data.stopy+m.diagramMarginY+h;n.setData(O,O,P,P)}else{const O=n.data.stopx!==n.data.startx?n.data.stopx+m.diagramMarginX:n.data.startx,P=n.data.starty;n.setData(O,O,P,P)}n.name=s.alias;const v=i.getC4ShapeArray(s.alias),w=i.getC4ShapeKeys(s.alias);w.length>0&&await Ce(n,t,v,w),e=s.alias;const N=i.getBoundaries(e);N.length>0&&await se(t,e,n,N,u),s.alias!=="global"&&Te(t,s,n),r.data.stopy=Math.max(n.data.stopy+m.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(n.data.stopx+m.c4ShapeMargin,r.data.stopx),Dt=Math.max(Dt,r.data.stopx),Nt=Math.max(Nt,r.data.stopy)}}d(se,"drawInsideBoundary");var F0=d(async function(t,e,r,a){m=_e("c4");const u=Ct().securityLevel,{root:i}=T0(e,u),n=a.db;n.setWrap(m.wrap),Se=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),ce.debug(`C:${JSON.stringify(m,null,2)}`);const l=i.select(`[id="${e}"]`);z.insertComputerIcon(l,e),z.insertDatabaseIcon(l,e),z.insertClockIcon(l,e);const s=new ke(a);s.setData(m.diagramMarginX,m.diagramMarginX,m.diagramMarginY,m.diagramMarginY),s.data.widthLimit=screen.availWidth,Dt=m.diagramMarginX,Nt=m.diagramMarginY;const h=n.getTitle(),y=n.getBoundaries("");await se(l,"",s,y,a),z.insertArrowHead(l,e),z.insertArrowEnd(l,e),z.insertArrowCrossHead(l,e),z.insertArrowFilledHead(l,e),Y0(l,n.getRels(),n.getC4Shape,a,e),s.data.stopx=Dt,s.data.stopy=Nt;const f=s.data,b=f.startx,v=f.starty,N=Nt-v+2*m.diagramMarginY,O=Dt-b,P=O+2*m.diagramMarginX;h&&l.append("text").text(h).attr("x",O/2-4*m.diagramMarginX).attr("y",v+m.diagramMarginY),Be(l,N,P,m.useMaxWidth);const I=h?60:0;l.attr("viewBox",b-m.diagramMarginX+" -"+(m.diagramMarginY+I)+" "+P+" "+(N+I)),ce.debug("models:",f)},"draw"),fe={drawPersonOrSystemArray:Ce,drawBoundary:Te,setConf:te,draw:F0},U0=d(()=>{const t=Ct().c4??{},e=new CSSStyleSheet;for(const r of Ee){const a=e.cssRules[e.insertRule(`.c4-shape.c4-${r} .label {}`,e.cssRules.length)],u=t[`${r}FontFamily`],i=t[`${r}FontSize`],n=t[`${r}FontWeight`];u&&a.style.setProperty("font-family",u),i&&a.style.setProperty("font-size",typeof i=="number"?`${i}px`:i),n&&a.style.setProperty("font-weight",String(n))}return[...e.cssRules].filter(r=>r.style.length>0).map(r=>` ${r.cssText}`).join(` +`)},"elementFontStyles"),j0=d(t=>`.person { + stroke: ${t.personBorder}; + fill: ${t.personBkg}; + } +${U0()} + + /* The element font colour is set inline per element (default white); the + label text takes it via currentColor. */ + .c4-shape .label, + .c4-shape .label text { + color: inherit; + fill: currentColor; + } + /* Structurizr typography: bold name, smaller stereotype/type and description lines. */ + .c4-shape .label .c4-name { + font-weight: bold; + } + .c4-shape .label .c4-type { + font-size: 0.75em; + } + .c4-shape .label .c4-descr { + font-size: 0.82em; + } + .c4-shape .basic, + .c4-shape rect, + .c4-shape path, + .c4-shape circle, + .c4-shape ellipse, + .c4-shape line { + stroke-width: 2px; + } +`,"getStyles"),z0=j0,q0={parser:Ue,db:Zt,renderer:fe,styles:z0,init:d(({c4:t,wrap:e})=>{fe.setConf(t),Zt.setWrap(e)},"init")};export{q0 as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-wCnV6Dw5.js b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-wCnV6Dw5.js new file mode 100644 index 000000000..0ad62199c --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-wCnV6Dw5.js @@ -0,0 +1,38 @@ +import{d as Ne}from"./chunk-F27PBJKO-8JlkC2jZ.js";import{s as Ae,g as Le,a as Ie,b as Me,_ as d,c as Ct,l as ce,d as Be,e as Ve,f as Ot,h as Ye,i as ye,j as Kt,w as Fe,k as Jt,m as ue}from"./mermaid.core-CM2luXFy.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var Yt=(function(){var t=d(function(yt,m,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=m);return x},"o"),e=[1,24],r=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],jt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Rt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],re=[12,14,33,42],Lt=[12,14,33,42,76,77,79,80],gt=[12,33],zt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,wt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...o[p]),this.$=o[p];break;case 33:_.addDeploymentNode("nodeL",...o[p]),this.$=o[p];break;case 34:_.addDeploymentNode("nodeR",...o[p]),this.$=o[p];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[p]),this.$=o[p];break;case 40:_.addPersonOrSystem("external_person",...o[p]),this.$=o[p];break;case 41:_.addPersonOrSystem("system",...o[p]),this.$=o[p];break;case 42:_.addPersonOrSystem("system_db",...o[p]),this.$=o[p];break;case 43:_.addPersonOrSystem("system_queue",...o[p]),this.$=o[p];break;case 44:_.addPersonOrSystem("external_system",...o[p]),this.$=o[p];break;case 45:_.addPersonOrSystem("external_system_db",...o[p]),this.$=o[p];break;case 46:_.addPersonOrSystem("external_system_queue",...o[p]),this.$=o[p];break;case 47:_.addContainer("container",...o[p]),this.$=o[p];break;case 48:_.addContainer("container_db",...o[p]),this.$=o[p];break;case 49:_.addContainer("container_queue",...o[p]),this.$=o[p];break;case 50:_.addContainer("external_container",...o[p]),this.$=o[p];break;case 51:_.addContainer("external_container_db",...o[p]),this.$=o[p];break;case 52:_.addContainer("external_container_queue",...o[p]),this.$=o[p];break;case 53:_.addComponent("component",...o[p]),this.$=o[p];break;case 54:_.addComponent("component_db",...o[p]),this.$=o[p];break;case 55:_.addComponent("component_queue",...o[p]),this.$=o[p];break;case 56:_.addComponent("external_component",...o[p]),this.$=o[p];break;case 57:_.addComponent("external_component_db",...o[p]),this.$=o[p];break;case 58:_.addComponent("external_component_queue",...o[p]),this.$=o[p];break;case 60:_.addRel("rel",...o[p]),this.$=o[p];break;case 61:_.addRel("birel",...o[p]),this.$=o[p];break;case 62:_.addRel("rel_u",...o[p]),this.$=o[p];break;case 63:_.addRel("rel_d",...o[p]),this.$=o[p];break;case 64:_.addRel("rel_l",...o[p]),this.$=o[p];break;case 65:_.addRel("rel_r",...o[p]),this.$=o[p];break;case 66:_.addRel("rel_b",...o[p]),this.$=o[p];break;case 67:o[p].splice(0,1),_.addRel("rel",...o[p]),this.$=o[p];break;case 68:_.updateElStyle("update_el_style",...o[p]),this.$=o[p];break;case 69:_.updateRelStyle("update_rel_style",...o[p]),this.$=o[p];break;case 70:_.updateLayoutConfig("update_layout_config",...o[p]),this.$=o[p];break;case 71:this.$=[o[p]];break;case 72:o[p].unshift(o[p-1]),this.$=o[p];break;case 73:case 75:this.$=o[p].trim();break;case 74:let xt={};xt[o[p-1].trim()]=o[p].trim(),this.$=xt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:70,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:71,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:72,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:73,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(kt,[2,14]),t(jt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Rt,[2,19]),t(Rt,[2,20]),{25:[1,78]},{27:[1,79]},t(Rt,[2,23]),{35:80,75:81,76:S,77:k,79:T,80:C},{35:86,75:81,76:S,77:k,79:T,80:C},{35:87,75:81,76:S,77:k,79:T,80:C},{35:88,75:81,76:S,77:k,79:T,80:C},{35:89,75:81,76:S,77:k,79:T,80:C},{35:90,75:81,76:S,77:k,79:T,80:C},{35:91,75:81,76:S,77:k,79:T,80:C},{35:92,75:81,76:S,77:k,79:T,80:C},{35:93,75:81,76:S,77:k,79:T,80:C},{35:94,75:81,76:S,77:k,79:T,80:C},{35:95,75:81,76:S,77:k,79:T,80:C},{35:96,75:81,76:S,77:k,79:T,80:C},{35:97,75:81,76:S,77:k,79:T,80:C},{35:98,75:81,76:S,77:k,79:T,80:C},{35:99,75:81,76:S,77:k,79:T,80:C},{35:100,75:81,76:S,77:k,79:T,80:C},{35:101,75:81,76:S,77:k,79:T,80:C},{35:102,75:81,76:S,77:k,79:T,80:C},{35:103,75:81,76:S,77:k,79:T,80:C},{35:104,75:81,76:S,77:k,79:T,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:k,79:T,80:C},{35:106,75:81,76:S,77:k,79:T,80:C},{35:107,75:81,76:S,77:k,79:T,80:C},{35:108,75:81,76:S,77:k,79:T,80:C},{35:109,75:81,76:S,77:k,79:T,80:C},{35:110,75:81,76:S,77:k,79:T,80:C},{35:111,75:81,76:S,77:k,79:T,80:C},{35:112,75:81,76:S,77:k,79:T,80:C},{35:113,75:81,76:S,77:k,79:T,80:C},{35:114,75:81,76:S,77:k,79:T,80:C},{35:115,75:81,76:S,77:k,79:T,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:k,79:T,80:C},{35:120,75:81,76:S,77:k,79:T,80:C},{35:121,75:81,76:S,77:k,79:T,80:C},{35:122,75:81,76:S,77:k,79:T,80:C},{35:123,75:81,76:S,77:k,79:T,80:C},{35:124,75:81,76:S,77:k,79:T,80:C},{35:125,75:81,76:S,77:k,79:T,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(jt,[2,17],{21:22,19:130,22:e,23:r,24:a,26:u,28:i}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:a,26:u,28:i,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(Rt,[2,21]),t(Rt,[2,22]),t(R,[2,39]),t(re,[2,71],{75:81,35:132,76:S,77:k,79:T,80:C}),t(Lt,[2,73]),{78:[1,133]},t(Lt,[2,75]),t(Lt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(gt,[2,28]),t(gt,[2,29]),t(gt,[2,30]),t(gt,[2,31]),t(gt,[2,32]),t(gt,[2,33]),t(gt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(jt,[2,18]),t(kt,[2,38]),t(re,[2,72]),t(Lt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(zt,[2,25]),t(zt,[2,26],{12:[1,138]}),t(zt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],wt=this.table,p="",xt=0,ae=0,we=2,ie=1,Oe=o.slice.call(arguments,1),A=Object.create(this.lexer),vt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(vt.yy[Xt]=this.yy[Xt]);A.setInput(m,vt.yy),vt.yy.lexer=A,vt.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var qt=A.yylloc;o.push(qt);var Pe=A.options&&A.options.ranges;typeof vt.yy.parseError=="function"?this.parseError=vt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(De,"popStack");function oe(){var B;return B=_.pop()||A.lex()||ie,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(oe,"lex");for(var M,Et,V,Ht,Tt={},Mt,j,le,Bt;;){if(Et=E[E.length-1],this.defaultActions[Et]?V=this.defaultActions[Et]:((M===null||typeof M>"u")&&(M=oe()),V=wt[Et]&&wt[Et][M]),typeof V>"u"||!V.length||!V[0]){var Qt="";Bt=[];for(Mt in wt[Et])this.terminals_[Mt]&&Mt>we&&Bt.push("'"+this.terminals_[Mt]+"'");A.showPosition?Qt="Parse error on line "+(xt+1)+`: +`+A.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Qt="Parse error on line "+(xt+1)+": Unexpected "+(M==ie?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Qt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:qt,expected:Bt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,ae=A.yyleng,p=A.yytext,xt=A.yylineno,qt=A.yylloc;break;case 2:if(j=this.productions_[V[1]][1],Tt.$=D[D.length-j],Tt._$={first_line:o[o.length-(j||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(j||1)].first_column,last_column:o[o.length-1].last_column},Pe&&(Tt._$.range=[o[o.length-(j||1)].range[0],o[o.length-1].range[1]]),Ht=this.performAction.apply(Tt,[p,ae,xt,vt.yy,V[1],D,o].concat(Oe)),typeof Ht<"u")return Ht;j&&(E=E.slice(0,-1*j*2),D=D.slice(0,-1*j),o=o.slice(0,-1*j)),E.push(this.productions_[V[1]][0]),D.push(Tt.$),o.push(Tt._$),le=wt[E[E.length-2]][E[E.length-1]],E.push(le);break;case 3:return!0}}return!0},"parse")},Re=(function(){var yt={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+` +`+x+"^"},"showPosition"),test_match:d(function(m,x){var E,_,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),_=m[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var o in D)this[o]=D[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,x,E,_;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),o=0;ox[0].length)){if(x=E,_=o,this.options.backtrack_lexer){if(m=this.test_match(E,D[o]),m!==!1)return m;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(m=this.test_match(x,D[_]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var x=this.next();return x||this.lex()},"lex"),begin:d(function(x){this.conditionStack.push(x)},"begin"),popState:d(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:d(function(x){this.begin(x)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(x,E,_,D){switch(_){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return yt})();Wt.lexer=Re;function It(){this.yy={}}return d(It,"Parser"),It.prototype=Wt,Wt.Parser=It,new It})();Yt.parser=Yt;var Ue=Yt,_e=d(t=>Ct()[t],"getRequiredConfig"),St=d((t,e)=>{for(const[r,a]of Object.entries(e))if(a!==void 0)if(typeof a=="object"){const[u,i]=Object.entries(a)[0];t[u]=i}else t[r]=a},"assignAttributes"),be=d(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),F=[],_t=[""],L="global",Y="",U=[be()],At=[],ee="",ne=!1,Ft=4,Ut=2,me,je=d(function(){return me},"getC4Type"),ze=d(function(t){me=ye(t,Ct())},"setC4Type"),We=d(function(t,e,r,a,u,i,n,l,s){if(t==null||e===void 0||e===null||r===void 0||r===null||a===void 0||a===null)return;let h={};const y=At.find(f=>f.from===e&&f.to===r);if(y?h=y:At.push(h),h.type=t,h.from=e,h.to=r,h.label={text:a},u==null)h.techn={text:""};else if(typeof u=="object"){const[f,b]=Object.entries(u)[0];h[f]={text:b}}else h.techn={text:u};if(i==null)h.descr={text:""};else if(typeof i=="object"){const[f,b]=Object.entries(i)[0];h[f]={text:b}}else h.descr={text:i};St(h,{sprite:n,tags:l,link:s}),h.wrap=mt()},"addRel"),Xe=d(function(t,e,r,a,u,i,n){if(e===null||r===null)return;let l={};const s=F.find(h=>h.alias===e);if(s&&e===s.alias?l=s:(l.alias=e,F.push(l)),r==null?l.label={text:""}:l.label={text:r},a==null)l.descr={text:""};else if(typeof a=="object"){const[h,y]=Object.entries(a)[0];l[h]={text:y}}else l.descr={text:a};St(l,{sprite:u,tags:i,link:n}),l.typeC4Shape={text:t},l.parentBoundary=L,l.wrap=mt()},"addPersonOrSystem"),qe=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=F.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,F.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.techn={text:""};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.techn={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{sprite:i,tags:n,link:l}),s.wrap=mt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addContainer"),He=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=F.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,F.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.techn={text:""};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.techn={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{sprite:i,tags:n,link:l}),s.wrap=mt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addComponent"),Qe=d(function(t,e,r,a,u){if(t===null||e===null)return;let i={};const n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},r==null)i.type={text:"system"};else if(typeof r=="object"){const[l,s]=Object.entries(r)[0];i[l]={text:s}}else i.type={text:r};St(i,{tags:a,link:u}),i.parentBoundary=L,i.wrap=mt(),Y=L,L=t,_t.push(Y)},"addPersonOrSystemBoundary"),Ke=d(function(t,e,r,a,u){if(t===null||e===null)return;let i={};const n=U.find(l=>l.alias===t);if(n&&t===n.alias?i=n:(i.alias=t,U.push(i)),e==null?i.label={text:""}:i.label={text:e},r==null)i.type={text:"container"};else if(typeof r=="object"){const[l,s]=Object.entries(r)[0];i[l]={text:s}}else i.type={text:r};St(i,{tags:a,link:u}),i.parentBoundary=L,i.wrap=mt(),Y=L,L=t,_t.push(Y)},"addContainerBoundary"),Ge=d(function(t,e,r,a,u,i,n,l){if(e===null||r===null)return;let s={};const h=U.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,U.push(s)),r==null?s.label={text:""}:s.label={text:r},a==null)s.type={text:"node"};else if(typeof a=="object"){const[y,f]=Object.entries(a)[0];s[y]={text:f}}else s.type={text:a};if(u==null)s.descr={text:""};else if(typeof u=="object"){const[y,f]=Object.entries(u)[0];s[y]={text:f}}else s.descr={text:u};St(s,{tags:n,link:l}),s.nodeType=t,s.parentBoundary=L,s.wrap=mt(),Y=L,L=e,_t.push(Y)},"addDeploymentNode"),Je=d(function(){L=Y,_t.pop(),Y=_t.pop(),_t.push(Y)},"popBoundaryParseStack"),Ze=d(function(t,e,r,a,u,i,n,l,s,h,y){let f=F.find(b=>b.alias===e);if(!(f===void 0&&(f=U.find(b=>b.alias===e),f===void 0))){if(r!=null)if(typeof r=="object"){const[b,v]=Object.entries(r)[0];f[b]=v}else f.bgColor=r;if(a!=null)if(typeof a=="object"){const[b,v]=Object.entries(a)[0];f[b]=v}else f.fontColor=a;if(u!=null)if(typeof u=="object"){const[b,v]=Object.entries(u)[0];f[b]=v}else f.borderColor=u;if(i!=null)if(typeof i=="object"){const[b,v]=Object.entries(i)[0];f[b]=v}else f.shadowing=i;if(n!=null)if(typeof n=="object"){const[b,v]=Object.entries(n)[0];f[b]=v}else f.shape=n;if(l!=null)if(typeof l=="object"){const[b,v]=Object.entries(l)[0];f[b]=v}else f.sprite=l;if(s!=null)if(typeof s=="object"){const[b,v]=Object.entries(s)[0];f[b]=v}else f.techn=s;if(h!=null)if(typeof h=="object"){const[b,v]=Object.entries(h)[0];f[b]=v}else f.legendText=h;if(y!=null)if(typeof y=="object"){const[b,v]=Object.entries(y)[0];f[b]=v}else f.legendSprite=y}},"updateElStyle"),$e=d(function(t,e,r,a,u,i,n){const l=At.find(s=>s.from===e&&s.to===r);if(l!==void 0){if(a!=null)if(typeof a=="object"){const[s,h]=Object.entries(a)[0];l[s]=h}else l.textColor=a;if(u!=null)if(typeof u=="object"){const[s,h]=Object.entries(u)[0];l[s]=h}else l.lineColor=u;if(i!=null)if(typeof i=="object"){const[s,h]=Object.entries(i)[0];l[s]=parseInt(h)}else l.offsetX=parseInt(i);if(n!=null)if(typeof n=="object"){const[s,h]=Object.entries(n)[0];l[s]=parseInt(h)}else l.offsetY=parseInt(n)}},"updateRelStyle"),t0=d(function(t,e,r){let a=Ft,u=Ut;if(typeof e=="object"){const i=Object.values(e)[0];a=parseInt(i)}else a=parseInt(e);if(typeof r=="object"){const i=Object.values(r)[0];u=parseInt(i)}else u=parseInt(r);a>=1&&(Ft=a),u>=1&&(Ut=u)},"updateLayoutConfig"),e0=d(function(){return Ft},"getC4ShapeInRow"),n0=d(function(){return Ut},"getC4BoundaryInRow"),s0=d(function(){return L},"getCurrentBoundaryParse"),r0=d(function(){return Y},"getParentBoundaryParse"),ge=d(function(t){return t==null?F:F.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),a0=d(function(t){return F.find(e=>e.alias===t)},"getC4Shape"),i0=d(function(t){return Object.keys(ge(t))},"getC4ShapeKeys"),xe=d(function(t){return t==null?U:U.filter(e=>e.parentBoundary===t)},"getBoundaries"),o0=xe,l0=d(function(){return At},"getRels"),c0=d(function(){return ee},"getTitle"),u0=d(function(t){ne=t},"setWrap"),mt=d(function(){return ne},"autoWrap"),h0=d(function(){F=[],U=[be()],Y="",L="global",_t=[""],At=[],_t=[""],ee="",ne=!1,Ft=4,Ut=2},"clear"),d0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},p0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},y0=d(function(t){ee=ye(t,Ct())},"setTitle"),Zt={addPersonOrSystem:Xe,addPersonOrSystemBoundary:Qe,addContainer:qe,addContainerBoundary:Ke,addComponent:He,addDeploymentNode:Ge,popBoundaryParseStack:Je,addRel:We,updateElStyle:Ze,updateRelStyle:$e,updateLayoutConfig:t0,autoWrap:mt,setWrap:u0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:xe,getBoundarys:o0,getCurrentBoundaryParse:s0,getParentBoundaryParse:r0,getRels:l0,getTitle:c0,getC4Type:je,getC4ShapeInRow:e0,getC4BoundaryInRow:n0,setAccTitle:Me,getAccTitle:Ie,getAccDescription:Le,setAccDescription:Ae,getConfig:d(()=>_e("c4"),"getConfig"),clear:h0,LINETYPE:d0,ARROWTYPE:p0,PLACEMENT:f0,setTitle:y0,setC4Type:ze},ve=d(function(t,e){return Ne(t,e)},"drawRect"),_0=d((t,e,r,a)=>{const u=t.append("g");let i=0;for(const n of e){const l=n.textColor?n.textColor:"#444444",s=n.lineColor?n.lineColor:"#444444",h=n.offsetX?parseInt(String(n.offsetX)):0,y=n.offsetY?parseInt(String(n.offsetY)):0,f="";if(i===0){const w=u.append("line");w.attr("x1",n.startPoint.x),w.attr("y1",n.startPoint.y),w.attr("x2",n.endPoint.x),w.attr("y2",n.endPoint.y),w.attr("stroke-width","1"),w.attr("stroke",s),w.style("fill","none"),n.type!=="rel_b"&&w.attr("marker-end","url("+f+"#"+a+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+f+"#"+a+"-arrowend)"),i=-1}else{const w=u.append("path");w.attr("fill","none").attr("stroke-width","1").attr("stroke",s).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",n.startPoint.x).replaceAll("starty",n.startPoint.y).replaceAll("controlx",n.startPoint.x+(n.endPoint.x-n.startPoint.x)/2-(n.endPoint.x-n.startPoint.x)/4).replaceAll("controly",n.startPoint.y+(n.endPoint.y-n.startPoint.y)/2).replaceAll("stopx",n.endPoint.x).replaceAll("stopy",n.endPoint.y)),n.type!=="rel_b"&&w.attr("marker-end","url("+f+"#"+a+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+f+"#"+a+"-arrowend)")}const b=n.label.width;let v=r.messageFont();Pt(r)(n.label.text,u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+y,b,n.label.height,{fill:l},v),n.techn&&n.techn.text!==""&&(v=r.messageFont(),Pt(r)("["+n.techn.text+"]",u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+r.messageFontSize+5+y,Math.max(b,n.techn.width),n.techn.height,{fill:l,"font-style":"italic"},v))}},"drawRels"),b0=d(function(t,e,r){const a=t.append("g"),u=e.bgColor?e.bgColor:"none",i=e.borderColor?e.borderColor:"#444444",n=e.fontColor?e.fontColor:"black";let l={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(l={"stroke-width":1});const s={x:e.x,y:e.y,fill:u,stroke:i,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:l};ve(a,s);let h=r.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=n,Pt(r)(e.label.text,a,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=r.boundaryFont(),h.fontColor=n,Pt(r)(e.type.text,a,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=r.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=n,Pt(r)(e.descr.text,a,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),m0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),g0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),x0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),v0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),E0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),S0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),k0=d(function(t,e){const a=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);a.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),a.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),Pt=(function(){function t(u,i,n,l,s,h,y){const f=i.append("text").attr("x",n+s/2).attr("y",l+h/2+5).style("text-anchor","middle").text(u);a(f,y)}d(t,"byText");function e(u,i,n,l,s,h,y,f){const{fontSize:b,fontFamily:v,fontWeight:w}=f,N=u.split(Jt.lineBreakRegex);for(let O=0;O{if(e==="sandbox"){const a=Kt("#i"+t).node()?.contentDocument;if(!a)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:Kt(a.body),doc:a}}return{root:Kt("body"),doc:document}},"getDiagramRoot"),C0=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),R0=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),w0={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},Gt=d(t=>t?w0[t.toLowerCase()]:void 0,"keywordShape"),O0=d(t=>{const e=Gt(t.shape)??Gt(t.sprite);if(e)return e;if(t.tags)for(const a of t.tags.split(",")){const u=Gt(a.trim());if(u)return u}const r=t.typeC4Shape.text;return r==="person"||r==="external_person"?"person":R0.has(r)?"cylinder":C0.has(r)?"h-cyl":"rounded"},"resolveNodeShape"),P0={person:"Person",system:"Software System",container:"Container",component:"Component"},D0=d(t=>{const e=t.replace(/^external_/,"").replace(/_(db|queue)$/,"");return P0[e]??e.replace(/_/g," ")},"stereotypeLabel"),N0=d(t=>t.startsWith("external_"),"isExternal"),A0=d(t=>{const e=D0(t.typeC4Shape.text);return t.techn?.text?`[${e}: ${t.techn.text}]`:`[${e}]`},"stereotypeText"),Ee=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(t=>[t,`external_${t}`]),L0=new Set(Ee),he=d(t=>L0.has(t),"isC4ElementType"),I0=d((t,e)=>{const r=t.typeC4Shape.text,a=t.bgColor??(he(r)&&e[`${r}_bg_color`]),u=t.borderColor??(he(r)&&e[`${r}_border_color`]),i=[];return a&&i.push(`fill:${a}`),u&&i.push(`stroke:${u}`),i.push(`color:${t.fontColor??"#FFFFFF"}`),i},"elementCssStyles"),de=d((t,e,r,a,u)=>{const i=t.typeC4Shape.text,n=["c4-shape",`c4-${i}`];N0(i)&&n.push("c4-external");const l=O0(t),s=I0(t,e);return(l==="rounded"||l==="fr-rect")&&s.push("rx:12px","ry:12px"),{id:t.alias,label:t.label.text,stereotype:A0(t),description:t.descr?.text?[t.descr.text]:void 0,labelType:"string",isGroup:!1,shape:l,cssClasses:n.join(" "),cssStyles:s,padding:r,look:a,useHtmlLabels:!1,width:u}},"buildC4Node"),Dt=0,Nt=0,Se=4,$t=2;Yt.yy=Zt;var g={},ke=class{static{d(this,"Bounds")}constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,te(t.db.getConfig())}setData(t,e,r,a){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=r,this.nextData.stopy=this.data.stopy=a}updateVal(t,e,r,a){t[e]===void 0?t[e]=r:t[e]=a(r,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;const e=this.nextData.stopx,r=this.data.widthLimit;let a=this.nextData.startx===this.nextData.stopx?e+t.margin:e+t.margin*2,u=a+t.width,i=this.nextData.starty+t.margin*2,n=i+t.height;(a>=r||u>=r||this.nextData.cnt>Se)&&(a=this.nextData.startx+t.margin+g.nextLinePaddingX,i=this.nextData.stopy+t.margin*2,this.nextData.stopx=u=a+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=n=i+t.height,this.nextData.cnt=1),t.x=a,t.y=i,this.updateVal(this.data,"startx",a,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",u,Math.max),this.updateVal(this.data,"stopy",n,Math.max),this.updateVal(this.nextData,"startx",a,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",u,Math.max),this.updateVal(this.nextData,"stopy",n,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},te=d(function(t){Ve(g,t),t?.fontFamily&&(g.personFontFamily=g.systemFontFamily=g.messageFontFamily=t.fontFamily),t?.fontSize&&(g.personFontSize=g.systemFontSize=g.messageFontSize=t.fontSize),t?.fontWeight&&(g.personFontWeight=g.systemFontWeight=g.messageFontWeight=t.fontWeight)},"setConf"),Vt=d(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),M0=d(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function bt(t,e,r,a,u){const i=e[t];if(!i.width)if(r)i.text=Fe(i.text,u,a),i.textLines=i.text.split(Jt.lineBreakRegex).length,i.width=u,i.height=ue(i.text,a);else{const n=i.text.split(Jt.lineBreakRegex);i.textLines=n.length;let l=0;i.height=0,i.width=0;for(const s of n)i.width=Math.max(Ot(s,a),i.width),l=ue(s,a),i.height=i.height+l}return i}d(bt,"calcC4ShapeTextWH");var Te=d(function(t,e,r){const a=r.data.startx,u=r.data.starty;e.x=a,e.y=u,e.width=r.data.stopx-a,e.height=r.data.stopy-u,e.label.y=g.c4ShapeMargin-35;const i=e.wrap&&g.wrap,n=Vt(g);n.fontSize=n.fontSize+2,n.fontWeight="bold";const l=Ot(e.label.text,n);bt("label",e,i,n,l),z.drawBoundary(t,e,g)},"drawBoundary"),Ce=d(async function(t,e,r,a){const u=Ct(),i=u.look??"classic",n={config:u},l=e.attr("id")??"",s=a.map(y=>r[Number(y)]),h=d(y=>{const f=y.shape?Ye[y.shape]:void 0;if(!f)throw new Error(`C4: no shape handler for "${y.shape}"`);return f},"shapeHandlerFor");await Promise.all(s.map(async y=>{const f=de(y,g,g.c4ShapePadding,i,g.width);f.domId=`${l}-${f.id}`;const b=await h(f)(e,f,n);y.width=f.width??g.width,y.height=f.height??g.height,y.margin=g.c4ShapeMargin,b.remove()}));for(const y of s)t.insert(y);await Promise.all(s.map(async y=>{const f=de(y,g,g.c4ShapePadding,i,g.width);f.domId=`${l}-${f.id}`,f.x=y.x+y.width/2,f.y=y.y+y.height/2;const b=e.append("g").attr("transform",`translate(${y.x+y.width/2}, ${y.y+y.height/2})`);await h(f)(b,f,n),y.intersect=f.intersect})),t.bumpLastMargin(g.c4ShapeMargin)},"drawC4ShapeArray"),B0=class{static{d(this,"Point")}constructor(t,e){this.x=t,this.y=e}},pe=d(function(t,e){if(!t.intersect)throw new Error(`C4 shape "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);const{x:r,y:a}=t.intersect(e);return new B0(r,a)},"getIntersectPoint"),V0=d(function(t,e){const r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;const a=pe(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;const u=pe(e,r);return{startPoint:a,endPoint:u}},"getIntersectPoints"),Y0=d(function(t,e,r,a,u){const i=a.db.getC4Type();let n=0;for(const l of e){n=n+1;const s=l.wrap&&g.wrap,h=M0(g);i==="C4Dynamic"&&(l.label.text=n+": "+l.label.text);let y=Ot(l.label.text,h);bt("label",l,s,h,y),l.techn&&l.techn.text!==""&&(y=Ot(l.techn.text,h),bt("techn",l,s,h,y)),l.descr&&l.descr.text!==""&&(y=Ot(l.descr.text,h),bt("descr",l,s,h,y));const f=r(l.from),b=r(l.to);if(!f||!b)throw new Error(`C4 rel "${l.from}" -> "${l.to}" references an unknown shape`);const v=V0(f,b);if(!v.startPoint||!v.endPoint)throw new Error(`Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`);l.startPoint=v.startPoint,l.endPoint=v.endPoint}z.drawRels(t,e,g,u)},"drawRels");async function se(t,e,r,a,u){const i=u.db,n=new ke(u);n.data.widthLimit=r.data.widthLimit/Math.min($t,a.length);for(const[l,s]of a.entries()){let h=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=h,h=s.image.Y+s.image.height);const y=s.wrap&&g.wrap,f=Vt(g);f.fontSize=f.fontSize+2,f.fontWeight="bold";const b=bt("label",s,y,f,n.data.widthLimit);if(b.Y=h+8,h=b.Y+b.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";const O=Vt(g),P=bt("type",s,y,O,n.data.widthLimit);P.Y=h+5,h=P.Y+P.height}if(s.descr&&s.descr.text!==""){const O=Vt(g);O.fontSize=O.fontSize-2;const P=bt("descr",s,y,O,n.data.widthLimit);P.Y=h+20,h=P.Y+P.height}if(l==0||l%$t===0){const O=r.data.startx+g.diagramMarginX,P=r.data.stopy+g.diagramMarginY+h;n.setData(O,O,P,P)}else{const O=n.data.stopx!==n.data.startx?n.data.stopx+g.diagramMarginX:n.data.startx,P=n.data.starty;n.setData(O,O,P,P)}n.name=s.alias;const v=i.getC4ShapeArray(s.alias),w=i.getC4ShapeKeys(s.alias);w.length>0&&await Ce(n,t,v,w),e=s.alias;const N=i.getBoundaries(e);N.length>0&&await se(t,e,n,N,u),s.alias!=="global"&&Te(t,s,n),r.data.stopy=Math.max(n.data.stopy+g.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(n.data.stopx+g.c4ShapeMargin,r.data.stopx),Dt=Math.max(Dt,r.data.stopx),Nt=Math.max(Nt,r.data.stopy)}}d(se,"drawInsideBoundary");var F0=d(async function(t,e,r,a){g=_e("c4");const u=Ct().securityLevel,{root:i}=T0(e,u),n=a.db;n.setWrap(g.wrap),Se=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),ce.debug(`C:${JSON.stringify(g,null,2)}`);const l=i.select(`[id="${e}"]`);z.insertComputerIcon(l,e),z.insertDatabaseIcon(l,e),z.insertClockIcon(l,e);const s=new ke(a);s.setData(g.diagramMarginX,g.diagramMarginX,g.diagramMarginY,g.diagramMarginY),s.data.widthLimit=screen.availWidth,Dt=g.diagramMarginX,Nt=g.diagramMarginY;const h=n.getTitle(),y=n.getBoundaries("");await se(l,"",s,y,a),z.insertArrowHead(l,e),z.insertArrowEnd(l,e),z.insertArrowCrossHead(l,e),z.insertArrowFilledHead(l,e),Y0(l,n.getRels(),n.getC4Shape,a,e),s.data.stopx=Dt,s.data.stopy=Nt;const f=s.data,b=f.startx,v=f.starty,N=Nt-v+2*g.diagramMarginY,O=Dt-b,P=O+2*g.diagramMarginX;h&&l.append("text").text(h).attr("x",O/2-4*g.diagramMarginX).attr("y",v+g.diagramMarginY),Be(l,N,P,g.useMaxWidth);const I=h?60:0;l.attr("viewBox",b-g.diagramMarginX+" -"+(g.diagramMarginY+I)+" "+P+" "+(N+I)),ce.debug("models:",f)},"draw"),fe={drawPersonOrSystemArray:Ce,drawBoundary:Te,setConf:te,draw:F0},U0=d(()=>{const t=Ct().c4??{},e=new CSSStyleSheet;for(const r of Ee){const a=e.cssRules[e.insertRule(`.c4-shape.c4-${r} .label {}`,e.cssRules.length)],u=t[`${r}FontFamily`],i=t[`${r}FontSize`],n=t[`${r}FontWeight`];u&&a.style.setProperty("font-family",u),i&&a.style.setProperty("font-size",typeof i=="number"?`${i}px`:i),n&&a.style.setProperty("font-weight",String(n))}return[...e.cssRules].filter(r=>r.style.length>0).map(r=>` ${r.cssText}`).join(` +`)},"elementFontStyles"),j0=d(t=>`.person { + stroke: ${t.personBorder}; + fill: ${t.personBkg}; + } +${U0()} + + /* The element font colour is set inline per element (default white); the + label text takes it via currentColor. */ + .c4-shape .label, + .c4-shape .label text { + color: inherit; + fill: currentColor; + } + /* Structurizr typography: bold name, smaller stereotype/type and description lines. */ + .c4-shape .label .c4-name { + font-weight: bold; + } + .c4-shape .label .c4-type { + font-size: 0.75em; + } + .c4-shape .label .c4-descr { + font-size: 0.82em; + } + .c4-shape .basic, + .c4-shape rect, + .c4-shape path, + .c4-shape circle, + .c4-shape ellipse, + .c4-shape line { + stroke-width: 2px; + } +`,"getStyles"),z0=j0,Q0={parser:Ue,db:Zt,renderer:fe,styles:z0,init:d(({c4:t,wrap:e})=>{fe.setConf(t),Zt.setWrap(e)},"init")};export{Q0 as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/channel-BKkxHUFp.js b/apps/pythinker-code/dist-web/assets/channel-BKkxHUFp.js new file mode 100644 index 000000000..3c9e2cb3a --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/channel-BKkxHUFp.js @@ -0,0 +1 @@ +import{ai as o,aj as n}from"./mermaidParser.worker-DimdFOud.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c}; diff --git a/apps/pythinker-code/dist-web/assets/channel-DNkUo9e6.js b/apps/pythinker-code/dist-web/assets/channel-DNkUo9e6.js deleted file mode 100644 index a590a8928..000000000 --- a/apps/pythinker-code/dist-web/assets/channel-DNkUo9e6.js +++ /dev/null @@ -1 +0,0 @@ -import{ai as o,aj as n}from"./mermaidParser.worker-Dx4jPi9z.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c}; diff --git a/apps/pythinker-code/dist-web/assets/channel-DxVW30WC.js b/apps/pythinker-code/dist-web/assets/channel-DxVW30WC.js deleted file mode 100644 index 28a409e9e..000000000 --- a/apps/pythinker-code/dist-web/assets/channel-DxVW30WC.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,D as n}from"./mermaid.core-Bt2TZ_t_.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/pythinker-code/dist-web/assets/channel-vcmCqkai.js b/apps/pythinker-code/dist-web/assets/channel-vcmCqkai.js new file mode 100644 index 000000000..5e460ff24 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/channel-vcmCqkai.js @@ -0,0 +1 @@ +import{U as a,C as n}from"./mermaid.core-CM2luXFy.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-C5fSlY2E.js b/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-C5fSlY2E.js deleted file mode 100644 index 28db78393..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-C5fSlY2E.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-Bt2TZ_t_.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js b/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js deleted file mode 100644 index 5c6f33340..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,e as w,l as x}from"./mermaidParser.worker-Dx4jPi9z.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-B-qKGIEB.js b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-CTeS1k9U.js similarity index 67% rename from apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-B-qKGIEB.js rename to apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-CTeS1k9U.js index 4b6cd7870..b495cbc9b 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-B-qKGIEB.js +++ b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-CTeS1k9U.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-Bt2TZ_t_.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-CM2luXFy.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-Fw0ursww.js similarity index 68% rename from apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js rename to apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-Fw0ursww.js index 357d76431..602b46fd5 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js +++ b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-Fw0ursww.js @@ -1 +1 @@ -import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaidParser.worker-DimdFOud.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js b/apps/pythinker-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js deleted file mode 100644 index d504d5f78..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,d as o}from"./mermaidParser.worker-Dx4jPi9z.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-B6TwRhtM.js similarity index 82% rename from apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js rename to apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-B6TwRhtM.js index 9822d0ba9..fada8278a 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js +++ b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-B6TwRhtM.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaidParser.worker-Dx4jPi9z.js";var l=e(()=>` +import{_ as e}from"./mermaidParser.worker-DimdFOud.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-CO8Ccrhy.js b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-CfUbytH6.js similarity index 83% rename from apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-CO8Ccrhy.js rename to apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-CfUbytH6.js index 54b11989c..348053bf0 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-FMBD7UC4-CO8Ccrhy.js +++ b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-CfUbytH6.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-Bt2TZ_t_.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-CM2luXFy.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js b/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js deleted file mode 100644 index a835156af..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +++ /dev/null @@ -1,231 +0,0 @@ -import{g as Zt}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as te}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as f,l as _,c as w,r as ee,u as se,a as ie,b as re,g as ae,s as ne,p as oe,q as le,T as ce,k as W,z as he}from"./mermaidParser.worker-Dx4jPi9z.js";var Dt=(function(){var t=f(function(Y,a,c,r){for(c=c||{},r=Y.length;r--;c[Y[r]]=a);return c},"o"),e=[1,2],l=[1,3],s=[1,4],u=[2,4],d=[1,9],S=[1,11],g=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],A=[1,20],k=[1,21],h=[1,22],x=[1,23],D=[1,24],$=[1,26],L=[1,27],P=[1,28],I=[1,29],J=[1,30],st=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],j=[1,34],p=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],At=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,c,r,y,E,i,F){var o=i.length-1;switch(E){case 3:return y.setRootDoc(i[o]),i[o];case 4:this.$=[];break;case 5:i[o]!="nl"&&(i[o-1].push(i[o]),this.$=i[o-1]);break;case 6:case 7:this.$=i[o];break;case 8:this.$="nl";break;case 12:this.$=i[o];break;case 13:const q=i[o-1];q.description=y.trimColon(i[o]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[o-2],state2:i[o]};break;case 15:const gt=y.trimColon(i[o]);this.$={stmt:"relation",state1:i[o-3],state2:i[o-1],description:gt};break;case 19:this.$={stmt:"state",id:i[o-3],type:"default",description:"",doc:i[o-1]};break;case 20:var B=i[o],H=i[o-2].trim();if(i[o].match(":")){var ht=i[o].split(":");B=ht[0],H=[H,ht[1]]}this.$={stmt:"state",id:B,type:"default",description:H};break;case 21:this.$={stmt:"state",id:i[o-3],type:"default",description:i[o-5],doc:i[o-1]};break;case 22:this.$={stmt:"state",id:i[o],type:"fork"};break;case 23:this.$={stmt:"state",id:i[o],type:"join"};break;case 24:this.$={stmt:"state",id:i[o],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[o-1].trim(),note:{position:i[o-2].trim(),text:i[o].trim()}};break;case 29:this.$=i[o].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[o].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[o-3],url:i[o-2],tooltip:i[o-1]};break;case 33:this.$={stmt:"click",id:i[o-3],url:i[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[o-1].trim(),classes:i[o].trim()};break;case 36:this.$={stmt:"style",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 37:this.$={stmt:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[o].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:l,6:s},{1:[3]},{3:5,4:e,5:l,6:s},{3:6,4:e,5:l,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:N,57:j},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:N,57:j},t(p,[2,17]),t(At,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(p,[2,14],{14:[1,71]}),{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,72],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(p,[2,15]),t(p,[2,19]),t(At,u,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,81],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,c){if(c.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=c,r}},"parseError"),parse:f(function(a){var c=this,r=[0],y=[],E=[null],i=[],F=this.table,o="",B=0,H=0,ht=2,q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),M={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(M.yy[Tt]=this.yy[Tt]);b.setInput(a,M.yy),M.yy.lexer=b,M.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var qt=b.options&&b.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(O){r.length=r.length-2*O,E.length=E.length-O,i.length=i.length-O}f(Qt,"popStack");function xt(){var O;return O=y.pop()||b.lex()||q,typeof O!="number"&&(O instanceof Array&&(y=O,O=y.pop()),O=c.symbols_[O]||O),O}f(xt,"lex");for(var C,U,R,_t,z={},ut,G,Lt,dt;;){if(U=r[r.length-1],this.defaultActions[U]?R=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=xt()),R=F[U]&&F[U][C]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in F[U])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(B+1)+`: -`+b.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[C]||C)+"'":mt="Parse error on line "+(B+1)+": Unexpected "+(C==q?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[C]||C,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(R[0]){case 1:r.push(C),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),C=null,H=b.yyleng,o=b.yytext,B=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],z.$=E[E.length-G],z._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},qt&&(z._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(z,[o,H,B,M.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(z.$),i.push(z._$),Lt=F[r[r.length-2]][r[r.length-1]],r.push(Lt);break;case 3:return!0}}return!0},"parse")},Jt=(function(){var Y={EOF:1,parseError:f(function(c,r){if(this.yy.parser)this.yy.parser.parseError(c,r);else throw new Error(c)},"parseError"),setInput:f(function(a,c){return this.yy=c||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var c=a.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var c=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===y.length?this.yylloc.first_column:0)+y[y.length-r.length].length-r[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:f(function(a,c){var r,y,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),y=a[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,r,y;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=r,y=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,E[y]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var c=this.next();return c||this.lex()},"lex"),begin:f(function(c){this.conditionStack.push(c)},"begin"),popState:f(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:f(function(c){this.begin(c)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(c,r,y,E){function i(){const F=r.yytext.indexOf("%%");if(F===0)return!1;if(F>0){const o=r.yytext.slice(0,F),B=r.yytext.slice(F);B&&c.lexer.unput(B),r.yytext=o}return!0}switch(f(i,"processId"),y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return i()?(this.popState(),"ID"):void 0;case 65:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 67:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return i()?24:void 0;case 73:return r.yytext=r.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return Y})();yt.lexer=Jt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();Dt.parser=Dt;var Ge=Dt,ue="TB",Ft="TB",It="dir",X="state",K="root",vt="relation",de="classDef",fe="style",pe="applyClass",tt="default",Bt="divider",Gt="fill:none",Yt="fill: #333",Vt="c",Mt="markdown",Ut="normal",bt="rect",kt="rectWithTitle",Se="stateStart",ye="stateEnd",Ot="divider",Nt="roundedWithTitle",ge="note",Te="noteGroup",et="statediagram",Ee="state",_e=`${et}-${Ee}`,Wt="transition",me="note",be="note-edge",ke=`${Wt} ${be}`,De=`${et}-${me}`,ve="cluster",Ce=`${et}-${ve}`,Ae="cluster-alt",xe=`${et}-${Ae}`,jt="parent",Ht="note",Le="state",Ct="----",Ie=`${Ct}${Ht}`,Rt=`${Ct}${jt}`,zt=f((t,e=Ft)=>{if(!t.doc)return e;let l=e;for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir"),Oe=f(function(t,e){return e.db.getClasses()},"getClasses"),Ne=f(async function(t,e,l,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:u,state:d,layout:S}=w();s.db.extract(s.db.getRootDocV2());const g=s.db.getData(),n=Zt(e,u);g.type=s.type,g.layoutAlgorithm=S,g.nodeSpacing=d?.nodeSpacing||50,g.rankSpacing=d?.rankSpacing||50,w().look==="neo"?g.markers=["barbNeo"]:g.markers=["barb"],g.diagramId=e,await ee(g,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((A,k)=>{const h=typeof k=="string"?k:typeof k?.id=="string"?k.id:"";if(!h){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const x=n.node()?.querySelectorAll("g");let D;if(x?.forEach(I=>{I.textContent?.trim()===h&&(D=I)}),!D){_.warn("⚠️ Could not find node matching text:",h);return}const $=D.parentNode;if(!$){_.warn("⚠️ Node has no parent, cannot wrap:",h);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),P=A.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),L.setAttribute("target","_blank"),A.tooltip){const I=A.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}$.replaceChild(L,D),L.appendChild(D),_.info("🔗 Wrapped node in tag for:",h,A.url)})}catch(N){_.error("❌ Error injecting clickable links:",N)}se.insertTitle(n,"statediagramTitleText",d?.titleTopMargin??25,s.db.getDiagramTitle()),te(n,m,et,d?.useMaxWidth??!0)},"draw"),Ye={getClasses:Oe,draw:Ne,getDir:zt},pt=new Map,V=0;function St(t="",e=0,l="",s=Ct){const u=l!==null&&l.length>0?`${s}${l}`:"";return`${Le}-${t}${u}-${e}`}f(St,"stateDomId");var Re=f((t,e,l,s,u,d,S,g)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case X:Z(t,n,l,s,u,d,S,g);break;case tt:Z(t,n,l,s,u,d,S,g);break;case vt:{Z(t,n.state1,l,s,u,d,S,g),Z(t,n.state2,l,s,u,d,S,g);const T=S==="neo",m={id:"edge"+V,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:W.sanitizeText(n.description??"",w()),arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,classes:Wt,look:S};u.push(m),V++}break}})},"setupDoc"),wt=f((t,e=Ft)=>{let l=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir");function Q(t,e,l){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(u=>{const d=l.get(u);d&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...d.styles])}));const s=t.find(u=>u.id===e.id);s?Object.assign(s,e):t.push(e)}f(Q,"insertOrUpdateNode");function Kt(t){return t?.classes?.join(" ")??""}f(Kt,"getClassesFromDbInfo");function Xt(t){return t?.styles??[]}f(Xt,"getStylesFromDbInfo");var Z=f((t,e,l,s,u,d,S,g)=>{const n=e.id,T=l.get(n),m=Kt(T),N=Xt(T),A=w();if(_.info("dataFetcher parsedItem",e,T,N),n!=="root"){let k=bt;e.start===!0?k=Se:e.start===!1&&(k=ye),e.type!==tt&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:W.sanitizeText(n,A),cssClasses:`${m} ${_e}`,cssStyles:N});const h=pt.get(n);e.description&&(Array.isArray(h.description)?(h.shape=kt,h.description.push(e.description)):h.description?.length&&h.description.length>0?(h.shape=kt,h.description===n?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=bt,h.description=e.description),h.description=W.sanitizeTextOrArray(h.description,A)),h.description?.length===1&&h.shape===kt&&(h.type==="group"?h.shape=Nt:h.shape=bt),!h.type&&e.doc&&(_.info("Setting cluster for XCX",n,wt(e)),h.type="group",h.isGroup=!0,h.dir=wt(e),h.shape=e.type===Bt?Ot:Nt,h.cssClasses=`${h.cssClasses} ${Ce} ${d?xe:""}`);const x={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:n,dir:h.dir,domId:St(n,V),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:S,labelType:"markdown"};if(x.shape===Ot&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const D={labelStyle:"",shape:ge,label:e.note.text,labelType:"markdown",cssClasses:De,cssStyles:[],cssCompiledStyles:[],id:n+Ie+"-"+V,domId:St(n,V,Ht),type:h.type,isGroup:h.type==="group",padding:A.flowchart?.padding,look:S,position:e.note.position},$=n+Rt,L={labelStyle:"",shape:Te,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,V,jt),type:"group",isGroup:!0,padding:16,look:S,position:e.note.position};V++,L.id=$,D.parentId=$,Q(s,L,g),Q(s,D,g),Q(s,x,g);let P=n,I=D.id;e.note.position==="left of"&&(P=D.id,I=n),u.push({id:P+"-"+I,start:P,end:I,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:ke,arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,look:S})}else Q(s,x,g)}e.doc&&(_.trace("Adding nodes children "),Re(e,e.doc,l,s,u,!d,S,g))},"dataFetcher"),we=f(()=>{pt.clear(),V=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$t=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),Ve=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$t(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case X:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case de:this.addStyleClass(s.id.trim(),s.classes);break;case fe:this.handleStyleDef(s);break;case pe:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),l=w();we(),Z(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,l.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),l=t.styleClass.split(",");for(const s of e){let u=this.getState(s);if(!u){const d=s.trim();this.addState(d),u=this.getState(d)}u&&(u.styles=l.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,l){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===X&&(e.id===v.START_NODE?(e.id=t.id+(l?"_start":"_end"),e.start=l):e.id=e.id.trim()),e.stmt!==K&&e.stmt!==X||!e.doc)return;const s=[];let u=[];for(const d of e.doc)if(d.type===Bt){const S=ft(d);S.doc=ft(u),s.push(S),u=[]}else u.push(d);if(s.length>0&&u.length>0){const d={stmt:X,id:ce(),type:"divider",doc:ft(u)};s.push(ft(d)),e.doc=s}e.doc.forEach(d=>this.docTranslator(e,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(t,e=tt,l=void 0,s=void 0,u=void 0,d=void 0,S=void 0,g=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:X,id:n,descriptions:[],type:e,doc:l,note:u,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=l),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),u){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=u,T.note.text=W.sanitizeText(T.note.text,w())}d&&(_.info("Setting state classes",n,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(n,m.trim()))),S&&(_.info("Setting state styles",n,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(n,m.trim()))),g&&(_.info("Setting state styles",n,S),(Array.isArray(g)?g:[g]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$t(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,l){this.links.set(t,{url:e,tooltip:l}),_.warn("Adding link",t,e,l)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=tt){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=tt){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,l=""){const s=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),d=this.startIdIfNeeded(e.id.trim()),S=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(d,S,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:W.sanitizeText(l,w())})}addRelation(t,e,l){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,l);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),d=this.endIdIfNeeded(e.trim()),S=this.endTypeIfNeeded(e);this.addState(s,u),this.addState(d,S),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:l?W.sanitizeText(l,w()):void 0})}}addDescription(t,e){const l=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;l?.descriptions?.push(W.sanitizeText(s,w()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const l=this.classes.get(t);e&&l&&e.split(v.STYLECLASS_SEP).forEach(s=>{const u=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){const S=u.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);l.textStyles.push(S)}l.styles.push(u)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(l=>{let s=this.getState(l);if(!s){const u=l.trim();this.addState(u),s=this.getState(u)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===It)}getDirection(){return this.getDirectionStatement()?.value??ue}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:It,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=w();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:zt(this.getRootDocV2())}}getConfig(){return w().state}},$e=f(t=>` -defs [id$="-barbEnd"] { - fill: ${t.transitionColor}; - stroke: ${t.transitionColor}; - } -g.stateGroup text { - fill: ${t.nodeBorder}; - stroke: none; - font-size: 10px; -} -g.stateGroup text { - fill: ${t.textColor}; - stroke: none; - font-size: 10px; - -} -g.stateGroup .state-title { - font-weight: bolder; - fill: ${t.stateLabelColor}; -} - -g.stateGroup rect { - fill: ${t.mainBkg}; - stroke: ${t.nodeBorder}; -} - -g.stateGroup line { - stroke: ${t.lineColor}; - stroke-width: ${t.strokeWidth||1}; -} - -.transition { - stroke: ${t.transitionColor}; - stroke-width: ${t.strokeWidth||1}; - fill: none; -} - -.stateGroup .composit { - fill: ${t.background}; - border-bottom: 1px -} - -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} - -.state-note { - stroke: ${t.noteBorderColor}; - fill: ${t.noteBkgColor}; - - text { - fill: ${t.noteTextColor}; - stroke: none; - font-size: 10px; - } -} - -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${t.mainBkg}; - opacity: 0.5; -} - -.edgeLabel .label rect { - fill: ${t.labelBackgroundColor}; - opacity: 0.5; -} -.edgeLabel { - background-color: ${t.edgeLabelBackground}; - p { - background-color: ${t.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${t.edgeLabelBackground}; - fill: ${t.edgeLabelBackground}; - } - text-align: center; -} -.edgeLabel .label text { - fill: ${t.transitionLabelColor||t.tertiaryTextColor}; -} -.label div .edgeLabel { - color: ${t.transitionLabelColor||t.tertiaryTextColor}; -} - -.stateLabel text { - fill: ${t.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} - -.node circle.state-start { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node .fork-join { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node circle.state-end { - fill: ${t.innerEndBackground}; - stroke: ${t.background}; - stroke-width: 1.5 -} -.end-state-inner { - fill: ${t.compositeBackground||t.background}; - // stroke: ${t.background}; - stroke-width: 1.5 -} - -.node rect { - fill: ${t.stateBkg||t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth||1}px; -} -.node polygon { - fill: ${t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder};; - stroke-width: ${t.strokeWidth||1}px; -} -[id$="-barbEnd"] { - fill: ${t.lineColor}; -} - -.statediagram-cluster rect { - fill: ${t.compositeTitleBackground}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth||1}px; -} - -.cluster-label, .nodeLabel { - color: ${t.stateLabelColor}; - // line-height: 1; -} - -.statediagram-cluster rect.outer { - rx: 5px; - ry: 5px; -} -.statediagram-state .divider { - stroke: ${t.stateBorder||t.nodeBorder}; -} - -.statediagram-state .title-state { - rx: 5px; - ry: 5px; -} -.statediagram-cluster.statediagram-cluster .inner { - fill: ${t.compositeBackground||t.background}; -} -.statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.statediagram-cluster .inner { - rx:0; - ry:0; -} - -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.note-edge { - stroke-dasharray: 5; -} - -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} - -.statediagram-note text { - fill: ${t.noteTextColor}; -} - -.statediagram-note .nodeLabel { - color: ${t.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${t.noteTextColor}; -} - -[id$="-dependencyStart"], [id$="-dependencyEnd"] { - fill: ${t.lineColor}; - stroke: ${t.lineColor}; - stroke-width: ${t.strokeWidth||1}; -} - -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.textColor}; -} - -[data-look="neo"].statediagram-cluster rect { - fill: ${t.mainBkg}; - stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth??1}; -} -[data-look="neo"].statediagram-cluster rect.outer { - rx: ${t.radius}px; - ry: ${t.radius}px; - filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} -} -`,"getStyles"),Me=$e;export{Ve as S,Ge as a,Ye as b,Me as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-rrDVh6P6.js b/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-rrDVh6P6.js deleted file mode 100644 index 69cfea8a6..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-AQP2D5EJ-rrDVh6P6.js +++ /dev/null @@ -1,231 +0,0 @@ -import{g as Zt}from"./chunk-55IACEB6-CeJhGgl3.js";import{s as te}from"./chunk-2J33WTMH-C5fSlY2E.js";import{_ as f,l as _,c as w,r as ee,u as se,a as ie,b as re,g as ae,s as ne,q as oe,t as le,ab as ce,k as W,A as he}from"./mermaid.core-Bt2TZ_t_.js";var Dt=(function(){var t=f(function(Y,a,c,r){for(c=c||{},r=Y.length;r--;c[Y[r]]=a);return c},"o"),e=[1,2],l=[1,3],s=[1,4],u=[2,4],d=[1,9],S=[1,11],g=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],A=[1,20],k=[1,21],h=[1,22],x=[1,23],D=[1,24],$=[1,26],L=[1,27],P=[1,28],I=[1,29],J=[1,30],st=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],j=[1,34],p=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],At=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,c,r,y,E,i,F){var o=i.length-1;switch(E){case 3:return y.setRootDoc(i[o]),i[o];case 4:this.$=[];break;case 5:i[o]!="nl"&&(i[o-1].push(i[o]),this.$=i[o-1]);break;case 6:case 7:this.$=i[o];break;case 8:this.$="nl";break;case 12:this.$=i[o];break;case 13:const q=i[o-1];q.description=y.trimColon(i[o]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[o-2],state2:i[o]};break;case 15:const gt=y.trimColon(i[o]);this.$={stmt:"relation",state1:i[o-3],state2:i[o-1],description:gt};break;case 19:this.$={stmt:"state",id:i[o-3],type:"default",description:"",doc:i[o-1]};break;case 20:var B=i[o],H=i[o-2].trim();if(i[o].match(":")){var ht=i[o].split(":");B=ht[0],H=[H,ht[1]]}this.$={stmt:"state",id:B,type:"default",description:H};break;case 21:this.$={stmt:"state",id:i[o-3],type:"default",description:i[o-5],doc:i[o-1]};break;case 22:this.$={stmt:"state",id:i[o],type:"fork"};break;case 23:this.$={stmt:"state",id:i[o],type:"join"};break;case 24:this.$={stmt:"state",id:i[o],type:"choice"};break;case 25:this.$={stmt:"state",id:y.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[o-1].trim(),note:{position:i[o-2].trim(),text:i[o].trim()}};break;case 29:this.$=i[o].trim(),y.setAccTitle(this.$);break;case 30:case 31:this.$=i[o].trim(),y.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[o-3],url:i[o-2],tooltip:i[o-1]};break;case 33:this.$={stmt:"click",id:i[o-3],url:i[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[o-1].trim(),classes:i[o].trim()};break;case 36:this.$={stmt:"style",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 37:this.$={stmt:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:y.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:y.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:y.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:y.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[o].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[o-2].trim(),classes:[i[o].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:l,6:s},{1:[3]},{3:5,4:e,5:l,6:s},{3:6,4:e,5:l,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],u,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:g,17:n,19:T,22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,7]),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(p,[2,11]),t(p,[2,12],{14:[1,40],15:[1,41]}),t(p,[2,16]),{18:[1,42]},t(p,[2,18],{20:[1,43]}),{23:[1,44]},t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(p,[2,28]),{34:[1,49]},{36:[1,50]},t(p,[2,31]),{13:51,24:N,57:j},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,41]),t(p,[2,6]),t(p,[2,13]),{13:58,24:N,57:j},t(p,[2,17]),t(At,u,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(p,[2,29]),t(p,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(p,[2,14],{14:[1,71]}),{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,72],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(p,[2,34]),t(p,[2,35]),t(p,[2,36]),t(p,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(p,[2,15]),t(p,[2,19]),t(At,u,{7:78}),t(p,[2,26]),t(p,[2,27]),{5:[1,79]},{5:[1,80]},{4:d,5:S,8:8,9:10,10:12,11:13,12:14,13:15,16:g,17:n,19:T,21:[1,81],22:m,24:N,25:A,26:k,27:h,28:x,29:D,32:25,33:$,35:L,37:P,38:I,41:J,45:st,48:it,51:rt,52:at,53:nt,54:ot,57:j},t(p,[2,32]),t(p,[2,33]),t(p,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,c){if(c.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=c,r}},"parseError"),parse:f(function(a){var c=this,r=[0],y=[],E=[null],i=[],F=this.table,o="",B=0,H=0,ht=2,q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),M={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(M.yy[Tt]=this.yy[Tt]);b.setInput(a,M.yy),M.yy.lexer=b,M.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var qt=b.options&&b.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Qt(O){r.length=r.length-2*O,E.length=E.length-O,i.length=i.length-O}f(Qt,"popStack");function xt(){var O;return O=y.pop()||b.lex()||q,typeof O!="number"&&(O instanceof Array&&(y=O,O=y.pop()),O=c.symbols_[O]||O),O}f(xt,"lex");for(var C,U,R,_t,z={},ut,G,Lt,dt;;){if(U=r[r.length-1],this.defaultActions[U]?R=this.defaultActions[U]:((C===null||typeof C>"u")&&(C=xt()),R=F[U]&&F[U][C]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in F[U])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(B+1)+`: -`+b.showPosition()+` -Expecting `+dt.join(", ")+", got '"+(this.terminals_[C]||C)+"'":mt="Parse error on line "+(B+1)+": Unexpected "+(C==q?"end of input":"'"+(this.terminals_[C]||C)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[C]||C,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+C);switch(R[0]){case 1:r.push(C),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),C=null,H=b.yyleng,o=b.yytext,B=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],z.$=E[E.length-G],z._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},qt&&(z._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(z,[o,H,B,M.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(z.$),i.push(z._$),Lt=F[r[r.length-2]][r[r.length-1]],r.push(Lt);break;case 3:return!0}}return!0},"parse")},Jt=(function(){var Y={EOF:1,parseError:f(function(c,r){if(this.yy.parser)this.yy.parser.parseError(c,r);else throw new Error(c)},"parseError"),setInput:f(function(a,c){return this.yy=c||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var c=a.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var c=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===y.length?this.yylloc.first_column:0)+y[y.length-r.length].length-r[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:f(function(a,c){var r,y,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),y=a[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,r,y;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=r,y=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,E[y]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var c=this.next();return c||this.lex()},"lex"),begin:f(function(c){this.conditionStack.push(c)},"begin"),popState:f(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:f(function(c){this.begin(c)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(c,r,y,E){function i(){const F=r.yytext.indexOf("%%");if(F===0)return!1;if(F>0){const o=r.yytext.slice(0,F),B=r.yytext.slice(F);B&&c.lexer.unput(B),r.yytext=o}return!0}switch(f(i,"processId"),y){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:return 19;case 53:this.popState();break;case 54:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 56:break;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),59;case 59:return this.popState(),this.pushState("NOTE_ID"),60;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 62:break;case 63:return"NOTE_TEXT";case 64:return i()?(this.popState(),"ID"):void 0;case 65:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 66:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 67:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 57;case 72:return i()?24:void 0;case 73:return r.yytext=r.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 58;case 77:return 5;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,55,56,57,71,72,73,74,75,76],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,54,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};return Y})();yt.lexer=Jt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();Dt.parser=Dt;var Ge=Dt,ue="TB",Ft="TB",It="dir",X="state",K="root",vt="relation",de="classDef",fe="style",pe="applyClass",tt="default",Bt="divider",Gt="fill:none",Yt="fill: #333",Vt="c",Mt="markdown",Ut="normal",bt="rect",kt="rectWithTitle",Se="stateStart",ye="stateEnd",Ot="divider",Nt="roundedWithTitle",ge="note",Te="noteGroup",et="statediagram",Ee="state",_e=`${et}-${Ee}`,Wt="transition",me="note",be="note-edge",ke=`${Wt} ${be}`,De=`${et}-${me}`,ve="cluster",Ce=`${et}-${ve}`,Ae="cluster-alt",xe=`${et}-${Ae}`,jt="parent",Ht="note",Le="state",Ct="----",Ie=`${Ct}${Ht}`,Rt=`${Ct}${jt}`,zt=f((t,e=Ft)=>{if(!t.doc)return e;let l=e;for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir"),Oe=f(function(t,e){return e.db.getClasses()},"getClasses"),Ne=f(async function(t,e,l,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:u,state:d,layout:S}=w();s.db.extract(s.db.getRootDocV2());const g=s.db.getData(),n=Zt(e,u);g.type=s.type,g.layoutAlgorithm=S,g.nodeSpacing=d?.nodeSpacing||50,g.rankSpacing=d?.rankSpacing||50,w().look==="neo"?g.markers=["barbNeo"]:g.markers=["barb"],g.diagramId=e,await ee(g,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((A,k)=>{const h=typeof k=="string"?k:typeof k?.id=="string"?k.id:"";if(!h){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const x=n.node()?.querySelectorAll("g");let D;if(x?.forEach(I=>{I.textContent?.trim()===h&&(D=I)}),!D){_.warn("⚠️ Could not find node matching text:",h);return}const $=D.parentNode;if(!$){_.warn("⚠️ Node has no parent, cannot wrap:",h);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),P=A.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),L.setAttribute("target","_blank"),A.tooltip){const I=A.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}$.replaceChild(L,D),L.appendChild(D),_.info("🔗 Wrapped node in tag for:",h,A.url)})}catch(N){_.error("❌ Error injecting clickable links:",N)}se.insertTitle(n,"statediagramTitleText",d?.titleTopMargin??25,s.db.getDiagramTitle()),te(n,m,et,d?.useMaxWidth??!0)},"draw"),Ye={getClasses:Oe,draw:Ne,getDir:zt},pt=new Map,V=0;function St(t="",e=0,l="",s=Ct){const u=l!==null&&l.length>0?`${s}${l}`:"";return`${Le}-${t}${u}-${e}`}f(St,"stateDomId");var Re=f((t,e,l,s,u,d,S,g)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case X:Z(t,n,l,s,u,d,S,g);break;case tt:Z(t,n,l,s,u,d,S,g);break;case vt:{Z(t,n.state1,l,s,u,d,S,g),Z(t,n.state2,l,s,u,d,S,g);const T=S==="neo",m={id:"edge"+V,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:W.sanitizeText(n.description??"",w()),arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,classes:Wt,look:S};u.push(m),V++}break}})},"setupDoc"),wt=f((t,e=Ft)=>{let l=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(l=s.value);return l},"getDir");function Q(t,e,l){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(u=>{const d=l.get(u);d&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...d.styles])}));const s=t.find(u=>u.id===e.id);s?Object.assign(s,e):t.push(e)}f(Q,"insertOrUpdateNode");function Kt(t){return t?.classes?.join(" ")??""}f(Kt,"getClassesFromDbInfo");function Xt(t){return t?.styles??[]}f(Xt,"getStylesFromDbInfo");var Z=f((t,e,l,s,u,d,S,g)=>{const n=e.id,T=l.get(n),m=Kt(T),N=Xt(T),A=w();if(_.info("dataFetcher parsedItem",e,T,N),n!=="root"){let k=bt;e.start===!0?k=Se:e.start===!1&&(k=ye),e.type!==tt&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:W.sanitizeText(n,A),cssClasses:`${m} ${_e}`,cssStyles:N});const h=pt.get(n);e.description&&(Array.isArray(h.description)?(h.shape=kt,h.description.push(e.description)):h.description?.length&&h.description.length>0?(h.shape=kt,h.description===n?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=bt,h.description=e.description),h.description=W.sanitizeTextOrArray(h.description,A)),h.description?.length===1&&h.shape===kt&&(h.type==="group"?h.shape=Nt:h.shape=bt),!h.type&&e.doc&&(_.info("Setting cluster for XCX",n,wt(e)),h.type="group",h.isGroup=!0,h.dir=wt(e),h.shape=e.type===Bt?Ot:Nt,h.cssClasses=`${h.cssClasses} ${Ce} ${d?xe:""}`);const x={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:n,dir:h.dir,domId:St(n,V),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:S,labelType:"markdown"};if(x.shape===Ot&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const D={labelStyle:"",shape:ge,label:e.note.text,labelType:"markdown",cssClasses:De,cssStyles:[],cssCompiledStyles:[],id:n+Ie+"-"+V,domId:St(n,V,Ht),type:h.type,isGroup:h.type==="group",padding:A.flowchart?.padding,look:S,position:e.note.position},$=n+Rt,L={labelStyle:"",shape:Te,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,V,jt),type:"group",isGroup:!0,padding:16,look:S,position:e.note.position};V++,L.id=$,D.parentId=$,Q(s,L,g),Q(s,D,g),Q(s,x,g);let P=n,I=D.id;e.note.position==="left of"&&(P=D.id,I=n),u.push({id:P+"-"+I,start:P,end:I,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:ke,arrowheadStyle:Yt,labelpos:Vt,labelType:Mt,thickness:Ut,look:S})}else Q(s,x,g)}e.doc&&(_.trace("Adding nodes children "),Re(e,e.doc,l,s,u,!d,S,g))},"dataFetcher"),we=f(()=>{pt.clear(),V=0},"reset"),v={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$t=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),Ve=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$t(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=ie,this.setAccTitle=re,this.getAccDescription=ae,this.setAccDescription=ne,this.setDiagramTitle=oe,this.getDiagramTitle=le,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case X:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case vt:this.addRelation(s.state1,s.state2,s.description);break;case de:this.addStyleClass(s.id.trim(),s.classes);break;case fe:this.handleStyleDef(s);break;case pe:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),l=w();we(),Z(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,l.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),l=t.styleClass.split(",");for(const s of e){let u=this.getState(s);if(!u){const d=s.trim();this.addState(d),u=this.getState(d)}u&&(u.styles=l.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,l){if(e.stmt===vt){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===X&&(e.id===v.START_NODE?(e.id=t.id+(l?"_start":"_end"),e.start=l):e.id=e.id.trim()),e.stmt!==K&&e.stmt!==X||!e.doc)return;const s=[];let u=[];for(const d of e.doc)if(d.type===Bt){const S=ft(d);S.doc=ft(u),s.push(S),u=[]}else u.push(d);if(s.length>0&&u.length>0){const d={stmt:X,id:ce(),type:"divider",doc:ft(u)};s.push(ft(d)),e.doc=s}e.doc.forEach(d=>this.docTranslator(e,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(t,e=tt,l=void 0,s=void 0,u=void 0,d=void 0,S=void 0,g=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:X,id:n,descriptions:[],type:e,doc:l,note:u,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=l),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),u){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=u,T.note.text=W.sanitizeText(T.note.text,w())}d&&(_.info("Setting state classes",n,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(n,m.trim()))),S&&(_.info("Setting state styles",n,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(n,m.trim()))),g&&(_.info("Setting state styles",n,S),(Array.isArray(g)?g:[g]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$t(),t||(this.links=new Map,he())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,l){this.links.set(t,{url:e,tooltip:l}),_.warn("Adding link",t,e,l)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===v.START_NODE?(this.startEndCount++,`${v.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=tt){return t===v.START_NODE?v.START_TYPE:e}endIdIfNeeded(t=""){return t===v.END_NODE?(this.startEndCount++,`${v.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=tt){return t===v.END_NODE?v.END_TYPE:e}addRelationObjs(t,e,l=""){const s=this.startIdIfNeeded(t.id.trim()),u=this.startTypeIfNeeded(t.id.trim(),t.type),d=this.startIdIfNeeded(e.id.trim()),S=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,u,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(d,S,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:W.sanitizeText(l,w())})}addRelation(t,e,l){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,l);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),u=this.startTypeIfNeeded(t),d=this.endIdIfNeeded(e.trim()),S=this.endTypeIfNeeded(e);this.addState(s,u),this.addState(d,S),this.currentDocument.relations.push({id1:s,id2:d,relationTitle:l?W.sanitizeText(l,w()):void 0})}}addDescription(t,e){const l=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;l?.descriptions?.push(W.sanitizeText(s,w()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const l=this.classes.get(t);e&&l&&e.split(v.STYLECLASS_SEP).forEach(s=>{const u=s.replace(/([^;]*);/,"$1").trim();if(RegExp(v.COLOR_KEYWORD).exec(s)){const S=u.replace(v.FILL_KEYWORD,v.BG_FILL).replace(v.COLOR_KEYWORD,v.FILL_KEYWORD);l.textStyles.push(S)}l.styles.push(u)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(l=>{let s=this.getState(l);if(!s){const u=l.trim();this.addState(u),s=this.getState(u)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===It)}getDirection(){return this.getDirectionStatement()?.value??ue}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:It,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=w();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:zt(this.getRootDocV2())}}getConfig(){return w().state}},$e=f(t=>` -defs [id$="-barbEnd"] { - fill: ${t.transitionColor}; - stroke: ${t.transitionColor}; - } -g.stateGroup text { - fill: ${t.nodeBorder}; - stroke: none; - font-size: 10px; -} -g.stateGroup text { - fill: ${t.textColor}; - stroke: none; - font-size: 10px; - -} -g.stateGroup .state-title { - font-weight: bolder; - fill: ${t.stateLabelColor}; -} - -g.stateGroup rect { - fill: ${t.mainBkg}; - stroke: ${t.nodeBorder}; -} - -g.stateGroup line { - stroke: ${t.lineColor}; - stroke-width: ${t.strokeWidth||1}; -} - -.transition { - stroke: ${t.transitionColor}; - stroke-width: ${t.strokeWidth||1}; - fill: none; -} - -.stateGroup .composit { - fill: ${t.background}; - border-bottom: 1px -} - -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} - -.state-note { - stroke: ${t.noteBorderColor}; - fill: ${t.noteBkgColor}; - - text { - fill: ${t.noteTextColor}; - stroke: none; - font-size: 10px; - } -} - -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${t.mainBkg}; - opacity: 0.5; -} - -.edgeLabel .label rect { - fill: ${t.labelBackgroundColor}; - opacity: 0.5; -} -.edgeLabel { - background-color: ${t.edgeLabelBackground}; - p { - background-color: ${t.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${t.edgeLabelBackground}; - fill: ${t.edgeLabelBackground}; - } - text-align: center; -} -.edgeLabel .label text { - fill: ${t.transitionLabelColor||t.tertiaryTextColor}; -} -.label div .edgeLabel { - color: ${t.transitionLabelColor||t.tertiaryTextColor}; -} - -.stateLabel text { - fill: ${t.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} - -.node circle.state-start { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node .fork-join { - fill: ${t.specialStateColor}; - stroke: ${t.specialStateColor}; -} - -.node circle.state-end { - fill: ${t.innerEndBackground}; - stroke: ${t.background}; - stroke-width: 1.5 -} -.end-state-inner { - fill: ${t.compositeBackground||t.background}; - // stroke: ${t.background}; - stroke-width: 1.5 -} - -.node rect { - fill: ${t.stateBkg||t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth||1}px; -} -.node polygon { - fill: ${t.mainBkg}; - stroke: ${t.stateBorder||t.nodeBorder};; - stroke-width: ${t.strokeWidth||1}px; -} -[id$="-barbEnd"] { - fill: ${t.lineColor}; -} - -.statediagram-cluster rect { - fill: ${t.compositeTitleBackground}; - stroke: ${t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth||1}px; -} - -.cluster-label, .nodeLabel { - color: ${t.stateLabelColor}; - // line-height: 1; -} - -.statediagram-cluster rect.outer { - rx: 5px; - ry: 5px; -} -.statediagram-state .divider { - stroke: ${t.stateBorder||t.nodeBorder}; -} - -.statediagram-state .title-state { - rx: 5px; - ry: 5px; -} -.statediagram-cluster.statediagram-cluster .inner { - fill: ${t.compositeBackground||t.background}; -} -.statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.statediagram-cluster .inner { - rx:0; - ry:0; -} - -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${t.altBackground?t.altBackground:"#efefef"}; -} - -.note-edge { - stroke-dasharray: 5; -} - -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} -.statediagram-note rect { - fill: ${t.noteBkgColor}; - stroke: ${t.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} - -.statediagram-note text { - fill: ${t.noteTextColor}; -} - -.statediagram-note .nodeLabel { - color: ${t.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${t.noteTextColor}; -} - -[id$="-dependencyStart"], [id$="-dependencyEnd"] { - fill: ${t.lineColor}; - stroke: ${t.lineColor}; - stroke-width: ${t.strokeWidth||1}; -} - -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.textColor}; -} - -[data-look="neo"].statediagram-cluster rect { - fill: ${t.mainBkg}; - stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; - stroke-width: ${t.strokeWidth??1}; -} -[data-look="neo"].statediagram-cluster rect.outer { - rx: ${t.radius}px; - ry: ${t.radius}px; - filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} -} -`,"getStyles"),Me=$e;export{Ve as S,Ge as a,Ye as b,Me as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-8JlkC2jZ.js b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-8JlkC2jZ.js new file mode 100644 index 000000000..5675b7ff3 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-8JlkC2jZ.js @@ -0,0 +1 @@ +import{_ as i,j as l,n as d,o}from"./mermaid.core-CM2luXFy.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CYKbU5Oh.js similarity index 87% rename from apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js rename to apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CYKbU5Oh.js index bc630d08b..cbb987d62 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js +++ b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CYKbU5Oh.js @@ -1 +1 @@ -import{_ as i,d as l,U as d,j as o}from"./mermaidParser.worker-Dx4jPi9z.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,w as c,x as d,g as e,m as f,h as g,y as h}; +import{_ as i,j as l,U as d,G as o}from"./mermaidParser.worker-DimdFOud.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-BoJm4Mow.js b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-BoJm4Mow.js new file mode 100644 index 000000000..d64d16409 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-BoJm4Mow.js @@ -0,0 +1,231 @@ +import{g as te}from"./chunk-XXDRQBXY-CiRZidGx.js";import{s as ee}from"./chunk-POPQ4Y6H-Enw1vTgw.js";import{_ as f,l as _,c as $,y as se,z as ie,a as re,b as ae,g as ne,s as oe,p as le,q as ce,aa as he,k as j,r as ue,j as bt}from"./mermaid.core-CM2luXFy.js";import{f as de}from"./chunk-F27PBJKO-8JlkC2jZ.js";import{p as fe}from"./purify.es-5AjVNlXF.js";var vt=(function(){var t=f(function(V,a,u,r){for(u=u||{},r=V.length;r--;u[V[r]]=a);return u},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],x=[1,20],k=[1,21],d=[1,22],L=[1,23],R=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],I=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,u,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:N,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:N,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,u){if(u.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=u,r}},"parseError"),parse:f(function(a){var u=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(w){r.length=r.length-2*w,E.length=E.length-w,i.length=i.length-w}f(Zt,"popStack");function Lt(){var w;return w=g.pop()||b.lex()||Q,typeof w!="number"&&(w instanceof Array&&(g=w,w=g.pop()),w=u.symbols_[w]||w),w}f(Lt,"lex");for(var A,W,O,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?O=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),O=B[W]&&B[W][A]),typeof O>"u"||!O.length||!O[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +`+b.showPosition()+` +Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(O[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(O[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[O[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,O[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[O[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(u,r){if(this.yy.parser)this.yy.parser.parseError(u,r);else throw new Error(u)},"parseError"),setInput:f(function(a,u){return this.yy=u||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var u=a.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var u=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),u=new Array(a.length+1).join("-");return a+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:f(function(a,u){var r,g,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),g=a[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,u,r,g;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;iu[0].length)){if(u=r,g=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(a=this.test_match(u,E[g]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var u=this.next();return u||this.lex()},"lex"),begin:f(function(u){this.conditionStack.push(u)},"begin"),popState:f(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:f(function(u){this.begin(u)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(u,r,g,E){function i(){const B=r.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=r.yytext.slice(0,B),Y=r.yytext.slice(B);Y&&u.lexer.unput(Y),r.yytext=l}return!0}switch(f(i,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+r.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 68:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return r.yytext=r.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return V})();yt.lexer=qt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();vt.parser=vt;var We=vt,pe="TB",Bt="TB",wt="dir",q="state",J="root",Ct="relation",Se="classDef",ye="style",ge="applyClass",et="default",Yt="divider",Gt="fill:none",Vt="fill: #333",Mt="c",Ut="markdown",Wt="normal",kt="rect",Dt="rectWithTitle",Te="stateStart",Ee="stateEnd",Nt="divider",Ot="roundedWithTitle",_e="note",me="noteGroup",st="statediagram",be="state",ke=`${st}-${be}`,jt="transition",De="note",ve="note-edge",Ce=`${jt} ${ve}`,Ae=`${st}-${De}`,xe="cluster",Le=`${st}-${xe}`,Ie="cluster-alt",we=`${st}-${Ie}`,Ht="parent",zt="note",Ne="state",At="----",Oe=`${At}${zt}`,Rt=`${At}${Ht}`,Kt=f((t,e=Bt)=>{if(!t.doc)return e;let o=e;for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir"),Re=f(function(t,e){return e.db.getClasses()},"getClasses"),$e=f(async function(t,e,o,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:c,state:h,layout:p}=$();s.db.extract(s.db.getRootDocV2());const y=s.db.getData(),n=te(e,c);y.type=s.type,y.layoutAlgorithm=p,y.nodeSpacing=h?.nodeSpacing||50,y.rankSpacing=h?.rankSpacing||50,$().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await se(y,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((x,k)=>{const d=typeof k=="string"?k:typeof k?.id=="string"?k.id:"",L=y.nodes.find(I=>I.id===d);if(!d){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const R=n.node()?.querySelectorAll("g.node, g.rough-node");let v;if(R?.forEach(I=>{const H=I.textContent?.trim();(I.id===L?.domId||H===d)&&(v=I)}),!v){_.warn("⚠️ Could not find node matching text:",d);return}const F=v.parentNode;if(!F){_.warn("⚠️ Node has no parent, cannot wrap:",d);return}const C=document.createElementNS("http://www.w3.org/2000/svg","a"),P=x.url.replace(/^"+|"+$/g,"");if(C.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),C.setAttribute("target","_blank"),x.tooltip){const I=x.tooltip.replace(/^"+|"+$/g,"");C.setAttribute("title",I),v.setAttribute("title",I)}F.replaceChild(C,v),C.appendChild(v),_.info("🔗 Wrapped node in tag for:",d,x.url)})}catch(N){_.error("❌ Error injecting clickable links:",N)}ie.insertTitle(n,"statediagramTitleText",h?.titleTopMargin??25,s.db.getDiagramTitle()),ee(n,m,st,h?.useMaxWidth??!0)},"draw"),je={getClasses:Re,draw:$e,getDir:Kt},pt=new Map,M=0;function St(t="",e=0,o="",s=At){const c=o!==null&&o.length>0?`${s}${o}`:"";return`${Ne}-${t}${c}-${e}`}f(St,"stateDomId");var Fe=f((t,e,o,s,c,h,p,y)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case q:tt(t,n,o,s,c,h,p,y);break;case et:tt(t,n,o,s,c,h,p,y);break;case Ct:{tt(t,n.state1,o,s,c,h,p,y),tt(t,n.state2,o,s,c,h,p,y);const T=p==="neo",m={id:"edge"+M,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:j.sanitizeText(n.description??"",$()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,classes:jt,look:p};c.push(m),M++}break}})},"setupDoc"),$t=f((t,e=Bt)=>{let o=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir");function Z(t,e,o){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(c=>{const h=o.get(c);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));const s=t.find(c=>c.id===e.id);s?Object.assign(s,e):t.push(e)}f(Z,"insertOrUpdateNode");function Xt(t){return t?.classes?.join(" ")??""}f(Xt,"getClassesFromDbInfo");function Jt(t){return t?.styles??[]}f(Jt,"getStylesFromDbInfo");var tt=f((t,e,o,s,c,h,p,y)=>{const n=e.id,T=o.get(n),m=Xt(T),N=Jt(T),x=$();if(_.info("dataFetcher parsedItem",e,T,N),n!=="root"){let k=kt;e.start===!0?k=Te:e.start===!1&&(k=Ee),e.type!==et&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:j.sanitizeText(n,x),cssClasses:`${m} ${ke}`,cssStyles:N});const d=pt.get(n);e.description&&(Array.isArray(d.description)?(d.shape=Dt,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=Dt,d.description===n?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=kt,d.description=e.description),d.description=j.sanitizeTextOrArray(d.description,x)),d.description?.length===1&&d.shape===Dt&&(d.type==="group"?d.shape=Ot:d.shape=kt),!d.type&&e.doc&&(_.info("Setting cluster for XCX",n,$t(e)),d.type="group",d.isGroup=!0,d.dir=$t(e),d.shape=e.type===Yt?Nt:Ot,d.cssClasses=`${d.cssClasses} ${Le} ${h?we:""}`);const L={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:n,dir:d.dir,domId:St(n,M),type:d.type,isGroup:d.type==="group",padding:8,rx:10,ry:10,look:p,labelType:"markdown"};if(L.shape===Nt&&(L.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){const R={labelStyle:"",shape:_e,label:e.note.text,labelType:"markdown",cssClasses:Ae,cssStyles:[],cssCompiledStyles:[],id:n+Oe+"-"+M,domId:St(n,M,zt),type:d.type,isGroup:d.type==="group",padding:x.flowchart?.padding,look:p,position:e.note.position},v=n+Rt,F={labelStyle:"",shape:me,label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,M,Ht),type:"group",isGroup:!0,padding:16,look:p,position:e.note.position};M++,F.id=v,R.parentId=v,Z(s,F,y),Z(s,R,y),Z(s,L,y);let C=n,P=R.id;e.note.position==="left of"&&(C=R.id,P=n),c.push({id:C+"-"+P,start:C,end:P,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:Ce,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,look:p})}else Z(s,L,y)}e.doc&&(_.trace("Adding nodes children "),Fe(e,e.doc,o,s,c,!h,p,y))},"dataFetcher"),Pe=f(()=>{pt.clear(),M=0},"reset"),D={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Ft=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),He=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Ft(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=oe,this.setDiagramTitle=le,this.getDiagramTitle=ce,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case q:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case Ct:this.addRelation(s.state1,s.state2,s.description);break;case Se:this.addStyleClass(s.id.trim(),s.classes);break;case ye:this.handleStyleDef(s);break;case ge:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),o=$();Pe(),tt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,o.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),o=t.styleClass.split(",");for(const s of e){let c=this.getState(s);if(!c){const h=s.trim();this.addState(h),c=this.getState(h)}c&&(c.styles=o.map(h=>h.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,o){if(e.stmt===Ct){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===q&&(e.id===D.START_NODE?(e.id=t.id+(o?"_start":"_end"),e.start=o):e.id=e.id.trim()),e.stmt!==J&&e.stmt!==q||!e.doc)return;const s=[];let c=[];for(const h of e.doc)if(h.type===Yt){const p=ft(h);p.doc=ft(c),s.push(p),c=[]}else c.push(h);if(s.length>0&&c.length>0){const h={stmt:q,id:he(),type:"divider",doc:ft(c)};s.push(ft(h)),e.doc=s}e.doc.forEach(h=>this.docTranslator(e,h,!0))}getRootDocV2(){return this.docTranslator({id:J,stmt:J},{id:J,stmt:J,doc:this.rootDoc},!0),{id:J,doc:this.rootDoc}}addState(t,e=et,o=void 0,s=void 0,c=void 0,h=void 0,p=void 0,y=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:q,id:n,descriptions:[],type:e,doc:o,note:c,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=o),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),c){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=c,T.note.text=j.sanitizeText(T.note.text,$())}h&&(_.info("Setting state classes",n,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(n,m.trim()))),p&&(_.info("Setting state styles",n,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(n,m.trim()))),y&&(_.info("Setting state styles",n,p),(Array.isArray(y)?y:[y]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Ft(),t||(this.links=new Map,ue())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,o){this.links.set(t,{url:e,tooltip:o}),_.warn("Adding link",t,e,o)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===D.START_NODE?(this.startEndCount++,`${D.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=et){return t===D.START_NODE?D.START_TYPE:e}endIdIfNeeded(t=""){return t===D.END_NODE?(this.startEndCount++,`${D.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=et){return t===D.END_NODE?D.END_TYPE:e}addRelationObjs(t,e,o=""){const s=this.startIdIfNeeded(t.id.trim()),c=this.startTypeIfNeeded(t.id.trim(),t.type),h=this.startIdIfNeeded(e.id.trim()),p=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,c,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(h,p,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:j.sanitizeText(o,$())})}addRelation(t,e,o){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,o);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),c=this.startTypeIfNeeded(t),h=this.endIdIfNeeded(e.trim()),p=this.endTypeIfNeeded(e);this.addState(s,c),this.addState(h,p),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:o?j.sanitizeText(o,$()):void 0})}}addDescription(t,e){const o=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;o?.descriptions?.push(j.sanitizeText(s,$()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const o=this.classes.get(t);e&&o&&e.split(D.STYLECLASS_SEP).forEach(s=>{const c=s.replace(/([^;]*);/,"$1").trim();if(RegExp(D.COLOR_KEYWORD).exec(s)){const p=c.replace(D.FILL_KEYWORD,D.BG_FILL).replace(D.COLOR_KEYWORD,D.FILL_KEYWORD);o.textStyles.push(p)}o.styles.push(c)})}getClasses(){return this.classes}setupToolTips(t){const e=de();bt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",c=>{const h=bt(c.currentTarget),p=h.attr("title");if(p===null)return;const y=c.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+y.left+(y.right-y.left)/2+"px").style("top",window.scrollY+y.bottom+"px"),e.html(fe.sanitize(p)),h.classed("hover",!0)}).on("mouseout",c=>{e.transition().duration(500).style("opacity",0),bt(c.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(o=>{let s=this.getState(o);if(!s){const c=o.trim();this.addState(c),s=this.getState(c)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===wt)}getDirection(){return this.getDirectionStatement()?.value??pe}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:wt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=$();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Kt(this.getRootDocV2())}}getConfig(){return $().state}},Be=f(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),ze=Be;export{He as S,We as a,je as b,ze as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-mRrNgd-1.js b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-mRrNgd-1.js new file mode 100644 index 000000000..1d963ba27 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-mRrNgd-1.js @@ -0,0 +1,231 @@ +import{g as te}from"./chunk-XXDRQBXY-O3ugxnCs.js";import{s as ee}from"./chunk-POPQ4Y6H-ClOHKyvb.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,T as he,k as j,p as ue,j as bt,O as de}from"./mermaidParser.worker-DimdFOud.js";import{f as fe}from"./chunk-F27PBJKO-CYKbU5Oh.js";var vt=(function(){var t=f(function(V,a,u,r){for(u=u||{},r=V.length;r--;u[V[r]]=a);return u},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],d=[1,22],L=[1,23],R=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],I=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,u,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,u){if(u.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=u,r}},"parseError"),parse:f(function(a){var u=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(w){r.length=r.length-2*w,E.length=E.length-w,i.length=i.length-w}f(Zt,"popStack");function Lt(){var w;return w=g.pop()||b.lex()||Q,typeof w!="number"&&(w instanceof Array&&(g=w,w=g.pop()),w=u.symbols_[w]||w),w}f(Lt,"lex");for(var A,W,N,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),N=B[W]&&B[W][A]),typeof N>"u"||!N.length||!N[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +`+b.showPosition()+` +Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(N[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(N[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[N[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,N[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[N[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(u,r){if(this.yy.parser)this.yy.parser.parseError(u,r);else throw new Error(u)},"parseError"),setInput:f(function(a,u){return this.yy=u||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var u=a.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var u=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),u=new Array(a.length+1).join("-");return a+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:f(function(a,u){var r,g,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),g=a[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,u,r,g;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;iu[0].length)){if(u=r,g=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(a=this.test_match(u,E[g]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var u=this.next();return u||this.lex()},"lex"),begin:f(function(u){this.conditionStack.push(u)},"begin"),popState:f(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:f(function(u){this.begin(u)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(u,r,g,E){function i(){const B=r.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=r.yytext.slice(0,B),Y=r.yytext.slice(B);Y&&u.lexer.unput(Y),r.yytext=l}return!0}switch(f(i,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+r.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 68:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return r.yytext=r.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return V})();yt.lexer=qt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();vt.parser=vt;var Ue=vt,pe="TB",Bt="TB",wt="dir",q="state",J="root",Ct="relation",Se="classDef",ye="style",ge="applyClass",et="default",Yt="divider",Gt="fill:none",Vt="fill: #333",Mt="c",Ut="markdown",Wt="normal",kt="rect",Dt="rectWithTitle",Te="stateStart",Ee="stateEnd",Ot="divider",Nt="roundedWithTitle",_e="note",me="noteGroup",st="statediagram",be="state",ke=`${st}-${be}`,jt="transition",De="note",ve="note-edge",Ce=`${jt} ${ve}`,Ae=`${st}-${De}`,xe="cluster",Le=`${st}-${xe}`,Ie="cluster-alt",we=`${st}-${Ie}`,Ht="parent",zt="note",Oe="state",At="----",Ne=`${At}${zt}`,Rt=`${At}${Ht}`,Kt=f((t,e=Bt)=>{if(!t.doc)return e;let o=e;for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir"),Re=f(function(t,e){return e.db.getClasses()},"getClasses"),$e=f(async function(t,e,o,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:c,state:h,layout:p}=$();s.db.extract(s.db.getRootDocV2());const y=s.db.getData(),n=te(e,c);y.type=s.type,y.layoutAlgorithm=p,y.nodeSpacing=h?.nodeSpacing||50,y.rankSpacing=h?.rankSpacing||50,$().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await se(y,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((x,k)=>{const d=typeof k=="string"?k:typeof k?.id=="string"?k.id:"",L=y.nodes.find(I=>I.id===d);if(!d){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const R=n.node()?.querySelectorAll("g.node, g.rough-node");let v;if(R?.forEach(I=>{const H=I.textContent?.trim();(I.id===L?.domId||H===d)&&(v=I)}),!v){_.warn("⚠️ Could not find node matching text:",d);return}const F=v.parentNode;if(!F){_.warn("⚠️ Node has no parent, cannot wrap:",d);return}const C=document.createElementNS("http://www.w3.org/2000/svg","a"),P=x.url.replace(/^"+|"+$/g,"");if(C.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),C.setAttribute("target","_blank"),x.tooltip){const I=x.tooltip.replace(/^"+|"+$/g,"");C.setAttribute("title",I),v.setAttribute("title",I)}F.replaceChild(C,v),C.appendChild(v),_.info("🔗 Wrapped node in tag for:",d,x.url)})}catch(O){_.error("❌ Error injecting clickable links:",O)}ie.insertTitle(n,"statediagramTitleText",h?.titleTopMargin??25,s.db.getDiagramTitle()),ee(n,m,st,h?.useMaxWidth??!0)},"draw"),We={getClasses:Re,draw:$e,getDir:Kt},pt=new Map,M=0;function St(t="",e=0,o="",s=At){const c=o!==null&&o.length>0?`${s}${o}`:"";return`${Oe}-${t}${c}-${e}`}f(St,"stateDomId");var Fe=f((t,e,o,s,c,h,p,y)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case q:tt(t,n,o,s,c,h,p,y);break;case et:tt(t,n,o,s,c,h,p,y);break;case Ct:{tt(t,n.state1,o,s,c,h,p,y),tt(t,n.state2,o,s,c,h,p,y);const T=p==="neo",m={id:"edge"+M,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:j.sanitizeText(n.description??"",$()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,classes:jt,look:p};c.push(m),M++}break}})},"setupDoc"),$t=f((t,e=Bt)=>{let o=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir");function Z(t,e,o){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(c=>{const h=o.get(c);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));const s=t.find(c=>c.id===e.id);s?Object.assign(s,e):t.push(e)}f(Z,"insertOrUpdateNode");function Xt(t){return t?.classes?.join(" ")??""}f(Xt,"getClassesFromDbInfo");function Jt(t){return t?.styles??[]}f(Jt,"getStylesFromDbInfo");var tt=f((t,e,o,s,c,h,p,y)=>{const n=e.id,T=o.get(n),m=Xt(T),O=Jt(T),x=$();if(_.info("dataFetcher parsedItem",e,T,O),n!=="root"){let k=kt;e.start===!0?k=Te:e.start===!1&&(k=Ee),e.type!==et&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:j.sanitizeText(n,x),cssClasses:`${m} ${ke}`,cssStyles:O});const d=pt.get(n);e.description&&(Array.isArray(d.description)?(d.shape=Dt,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=Dt,d.description===n?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=kt,d.description=e.description),d.description=j.sanitizeTextOrArray(d.description,x)),d.description?.length===1&&d.shape===Dt&&(d.type==="group"?d.shape=Nt:d.shape=kt),!d.type&&e.doc&&(_.info("Setting cluster for XCX",n,$t(e)),d.type="group",d.isGroup=!0,d.dir=$t(e),d.shape=e.type===Yt?Ot:Nt,d.cssClasses=`${d.cssClasses} ${Le} ${h?we:""}`);const L={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:n,dir:d.dir,domId:St(n,M),type:d.type,isGroup:d.type==="group",padding:8,rx:10,ry:10,look:p,labelType:"markdown"};if(L.shape===Ot&&(L.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){const R={labelStyle:"",shape:_e,label:e.note.text,labelType:"markdown",cssClasses:Ae,cssStyles:[],cssCompiledStyles:[],id:n+Ne+"-"+M,domId:St(n,M,zt),type:d.type,isGroup:d.type==="group",padding:x.flowchart?.padding,look:p,position:e.note.position},v=n+Rt,F={labelStyle:"",shape:me,label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,M,Ht),type:"group",isGroup:!0,padding:16,look:p,position:e.note.position};M++,F.id=v,R.parentId=v,Z(s,F,y),Z(s,R,y),Z(s,L,y);let C=n,P=R.id;e.note.position==="left of"&&(C=R.id,P=n),c.push({id:C+"-"+P,start:C,end:P,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:Ce,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,look:p})}else Z(s,L,y)}e.doc&&(_.trace("Adding nodes children "),Fe(e,e.doc,o,s,c,!h,p,y))},"dataFetcher"),Pe=f(()=>{pt.clear(),M=0},"reset"),D={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Ft=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),je=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Ft(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=oe,this.setDiagramTitle=le,this.getDiagramTitle=ce,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case q:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case Ct:this.addRelation(s.state1,s.state2,s.description);break;case Se:this.addStyleClass(s.id.trim(),s.classes);break;case ye:this.handleStyleDef(s);break;case ge:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),o=$();Pe(),tt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,o.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),o=t.styleClass.split(",");for(const s of e){let c=this.getState(s);if(!c){const h=s.trim();this.addState(h),c=this.getState(h)}c&&(c.styles=o.map(h=>h.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,o){if(e.stmt===Ct){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===q&&(e.id===D.START_NODE?(e.id=t.id+(o?"_start":"_end"),e.start=o):e.id=e.id.trim()),e.stmt!==J&&e.stmt!==q||!e.doc)return;const s=[];let c=[];for(const h of e.doc)if(h.type===Yt){const p=ft(h);p.doc=ft(c),s.push(p),c=[]}else c.push(h);if(s.length>0&&c.length>0){const h={stmt:q,id:he(),type:"divider",doc:ft(c)};s.push(ft(h)),e.doc=s}e.doc.forEach(h=>this.docTranslator(e,h,!0))}getRootDocV2(){return this.docTranslator({id:J,stmt:J},{id:J,stmt:J,doc:this.rootDoc},!0),{id:J,doc:this.rootDoc}}addState(t,e=et,o=void 0,s=void 0,c=void 0,h=void 0,p=void 0,y=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:q,id:n,descriptions:[],type:e,doc:o,note:c,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=o),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),c){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=c,T.note.text=j.sanitizeText(T.note.text,$())}h&&(_.info("Setting state classes",n,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(n,m.trim()))),p&&(_.info("Setting state styles",n,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(n,m.trim()))),y&&(_.info("Setting state styles",n,p),(Array.isArray(y)?y:[y]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Ft(),t||(this.links=new Map,ue())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,o){this.links.set(t,{url:e,tooltip:o}),_.warn("Adding link",t,e,o)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===D.START_NODE?(this.startEndCount++,`${D.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=et){return t===D.START_NODE?D.START_TYPE:e}endIdIfNeeded(t=""){return t===D.END_NODE?(this.startEndCount++,`${D.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=et){return t===D.END_NODE?D.END_TYPE:e}addRelationObjs(t,e,o=""){const s=this.startIdIfNeeded(t.id.trim()),c=this.startTypeIfNeeded(t.id.trim(),t.type),h=this.startIdIfNeeded(e.id.trim()),p=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,c,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(h,p,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:j.sanitizeText(o,$())})}addRelation(t,e,o){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,o);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),c=this.startTypeIfNeeded(t),h=this.endIdIfNeeded(e.trim()),p=this.endTypeIfNeeded(e);this.addState(s,c),this.addState(h,p),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:o?j.sanitizeText(o,$()):void 0})}}addDescription(t,e){const o=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;o?.descriptions?.push(j.sanitizeText(s,$()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const o=this.classes.get(t);e&&o&&e.split(D.STYLECLASS_SEP).forEach(s=>{const c=s.replace(/([^;]*);/,"$1").trim();if(RegExp(D.COLOR_KEYWORD).exec(s)){const p=c.replace(D.FILL_KEYWORD,D.BG_FILL).replace(D.COLOR_KEYWORD,D.FILL_KEYWORD);o.textStyles.push(p)}o.styles.push(c)})}getClasses(){return this.classes}setupToolTips(t){const e=fe();bt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",c=>{const h=bt(c.currentTarget),p=h.attr("title");if(p===null)return;const y=c.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+y.left+(y.right-y.left)/2+"px").style("top",window.scrollY+y.bottom+"px"),e.html(de.sanitize(p)),h.classed("hover",!0)}).on("mouseout",c=>{e.transition().duration(500).style("opacity",0),bt(c.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(o=>{let s=this.getState(o);if(!s){const c=o.trim();this.addState(c),s=this.getState(c)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===wt)}getDirection(){return this.getDirectionStatement()?.value??pe}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:wt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=$();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Kt(this.getRootDocV2())}}getConfig(){return $().state}},Be=f(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),He=Be;export{je as S,Ue as a,We as b,He as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-B_FDSHPF.js similarity index 72% rename from apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js rename to apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-B_FDSHPF.js index 9b2357e5c..e0393943d 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js +++ b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-B_FDSHPF.js @@ -1 +1 @@ -import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaidParser.worker-DimdFOud.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-Byfpbsm0.js b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CM6UswKM.js similarity index 71% rename from apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-Byfpbsm0.js rename to apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CM6UswKM.js index 2d2a7e0c3..8b080b237 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-4BX2VUAB-Byfpbsm0.js +++ b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CM6UswKM.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-Bt2TZ_t_.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-CM2luXFy.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-727SXJPM-CWadnQqE.js b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-9vzzXY8X.js similarity index 50% rename from apps/pythinker-code/dist-web/assets/chunk-727SXJPM-CWadnQqE.js rename to apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-9vzzXY8X.js index 966d3bc8a..429b15fc0 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-727SXJPM-CWadnQqE.js +++ b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-9vzzXY8X.js @@ -1,9 +1,9 @@ -import{g as tt}from"./chunk-FMBD7UC4-CO8Ccrhy.js";import{c as st}from"./chunk-ND2GUHAM-BBoWOe8j.js";import{g as it}from"./chunk-55IACEB6-CeJhGgl3.js";import{s as at}from"./chunk-2J33WTMH-C5fSlY2E.js";import{_ as f,l as Ie,c as F,p as rt,r as nt,u as Oe,d as de,z as ut,b as lt,a as ct,s as ot,g as ht,q as dt,t as pt,k as I,A as At,y as ft,i as gt,a8 as G}from"./mermaid.core-Bt2TZ_t_.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],c=[1,26],l=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],re=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],ne=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,u,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:u.addRelation(e[s]);break;case 20:e[s-1].title=u.cleanupLabel(e[s]),u.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),u.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),u.setAccDescription(this.$);break;case 34:u.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 35:u.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 36:this.$=u.addNamespace(e[s]);break;case 37:this.$=u.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:u.setCssClass(e[s-2],e[s]);break;case 49:u.addMembers(e[s-3],e[s-1]);break;case 51:u.setCssClass(e[s-5],e[s-3]),u.addMembers(e[s-5],e[s-1]);break;case 52:u.addAnnotation(e[s-3],e[s-1]);break;case 53:u.addAnnotation(e[s-6],e[s-4]),u.addMembers(e[s-6],e[s-1]);break;case 54:u.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],u.addClass(e[s]);break;case 56:this.$=e[s-1],u.addClass(e[s-1]),u.setClassLabel(e[s-1],e[s]);break;case 60:u.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:u.addMember(e[s-1],u.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=u.addNote(e[s],e[s-1]);break;case 72:this.$=u.addNote(e[s]);break;case 73:this.$=e[s-2],u.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:u.setDirection("TB");break;case 77:u.setDirection("BT");break;case 78:u.setDirection("RL");break;case 79:u.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=u.relationType.AGGREGATION;break;case 85:this.$=u.relationType.EXTENSION;break;case 86:this.$=u.relationType.COMPOSITION;break;case 87:this.$=u.relationType.DEPENDENCY;break;case 88:this.$=u.relationType.LOLLIPOP;break;case 89:this.$=u.lineType.LINE;break;case 90:this.$=u.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],u.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],u.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],u.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],u.setLink(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],u.setLink(e[s-3],e[s-2],e[s]),u.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],u.setClickEvent(e[s-3],e[s-2],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],u.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],u.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],u.setLink(e[s-3],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],u.setLink(e[s-4],e[s-2],e[s]),u.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],u.setCssStyle(e[s-1],e[s]);break;case 106:u.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:l,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:re},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(ne,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:l,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:re},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(ne,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:l,54:g,56:N},{45:163,51:re},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(ne,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:re},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],u=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=u.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(u=S,S=u.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-CfUbytH6.js";import{g as st}from"./chunk-XXDRQBXY-CiRZidGx.js";import{s as it}from"./chunk-POPQ4Y6H-Enw1vTgw.js";import{_ as f,l as Ie,c as F,x as at,y as nt,z as Oe,j as de,b as rt,a as ut,s as lt,g as ct,p as ot,q as ht,k as I,r as dt,t as pt,i as At,a6 as G}from"./mermaid.core-CM2luXFy.js";import{f as ft}from"./chunk-F27PBJKO-8JlkC2jZ.js";import{p as gt}from"./purify.es-5AjVNlXF.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` -Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` -`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,u,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,u;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,u=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[u]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,u,C){switch(u){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=gt(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const c=n[1]?n[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=n[2],this.parameters=n[3]?n[3].trim():"",i=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",i===""){const l=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(l)&&(i=l,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=t.length,n=t.substring(0,1),c=t.substring(r-1);je.includes(n)&&(this.visibility=n),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?r:r-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=st();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const l=de(c.currentTarget),d=l.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(ut.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),l.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=lt,this.getAccTitle=ct,this.setAccDescription=ot,this.getAccDescription=ht,this.setDiagramTitle=dt,this.getDiagramTitle=pt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let r="",n=a;if(a.indexOf("~")>0){const c=a.split("~");n=P(c[0]),r=P(c[1])}return{className:n,type:r}}setClassLabel(i,a){const r=I.sanitizeText(i,F());a&&(a=P(a));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=a,this.classes.get(n).text=`${a}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:r,type:n}=this.splitClassNameAndType(a);if(this.classes.has(r))return;const c=I.sanitizeText(r,F());this.classes.set(c,{id:c,type:n,label:c,text:`${c}${n?`<${n}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const r={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(r)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const r=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${r}`:r}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",At()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const r=this.splitClassNameAndType(i).className;this.classes.get(r).annotations.push(a)}addMember(i,a){this.addClass(i);const r=this.splitClassNameAndType(i).className,n=this.classes.get(r);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?n.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?n.methods.push(new Xe(c,"method")):c&&n.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(r=>this.addMember(i,r)))}addNote(i,a){const r=this.notes.size,n={id:`note${r}`,class:a,text:i,index:r};return this.notes.set(n.id,n),n.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(r=>{let n=r;/\d/.exec(r[0])&&(n=pe+n);const c=this.classes.get(n);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const r of i){let n=this.styleClasses.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,n)),a&&a.forEach(c=>{if(/color/.exec(c)){const l=c.replace("fill","bgFill");n.textStyles.push(l)}n.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(r)&&c.styles.push(...a.flatMap(l=>l.split(",")))})}}setTooltip(i,a){i.split(",").forEach(r=>{a!==void 0&&(this.classes.get(r).tooltip=P(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,r){const n=F();i.split(",").forEach(c=>{let l=c;/\d/.exec(c[0])&&(l=pe+l);const d=this.classes.get(l);d&&(d.link=Oe.formatUrl(a,n),n.securityLevel==="sandbox"?d.linkTarget="_top":typeof r=="string"?d.linkTarget=P(r):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,r){i.split(",").forEach(n=>{this.setClickFunc(n,a,r),this.classes.get(n).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,r){const n=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const l=n;if(this.classes.has(l)){let d=[];if(typeof r=="string"){d=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(l),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const r=a.at(-1);return r?`${r}.${i}`:i}static getAncestorIds(i){const a=i.split("."),r=new Array(a.length);r[0]=a[0];for(let n=1;n0?c[l-1]:void 0,g=l===c.length-1,N=g&&a?a:n[l];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,r){if(this.namespaces.has(i)){for(const n of a){const{className:c}=this.splitClassNameAndType(n),l=this.getClass(c);l.parent=i,this.namespaces.get(i).classes.set(c,l)}for(const n of r){const c=this.getNote(n);c.parent=i,this.namespaces.get(i).notes.set(n,c)}}}setCssStyle(i,a){const r=this.classes.get(i);if(!(!a||!r))for(const n of a)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const r=this.namespaces.get(a);if(!r)return;if(r.explicit)return a;a=r.parent}}getData(){const i=[],a=[],r=F(),n=r.class?.hierarchicalNamespaces??!0;for(const l of this.namespaces.values()){if(!n&&!l.explicit)continue;const d={id:l.id,label:n?l.label:l.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:[],look:r.look,parentId:n?l.parent:void 0};i.push(d)}for(const l of this.classes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={...l,type:void 0,isGroup:!1,parentId:d,look:r.look};i.push(m)}for(const l of this.notes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(l.class)?.id;if(g){const N={id:`edgeNote${l.index}`,start:l.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};a.push(N)}}for(const l of this.interfaces){const d={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};i.push(d)}let c=0;for(const l of this.relations){c++;const d={id:ft(l.id1,l.id2,{prefix:"id",counter:c}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:r.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:r,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var _t=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=At(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(r){const c=r[1]?r[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=r[2],this.parameters=r[3]?r[3].trim():"",i=r[4]?r[4].trim():"",this.returnType=r[5]?r[5].trim():"",i===""){const u=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(u)&&(i=u,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,r=t.substring(0,1),c=t.substring(n-1);je.includes(r)&&(this.visibility=r),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?n:n-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),St=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=ft();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const u=de(c.currentTarget),d=u.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(gt.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),u.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=rt,this.getAccTitle=ut,this.setAccDescription=lt,this.getAccDescription=ct,this.setDiagramTitle=ot,this.getDiagramTitle=ht,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let n="",r=a;if(a.indexOf("~")>0){const c=a.split("~");r=P(c[0]),n=P(c[1])}return{className:r,type:n}}setClassLabel(i,a){const n=I.sanitizeText(i,F());a&&(a=P(a));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=a,this.classes.get(r).text=`${a}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:n,type:r}=this.splitClassNameAndType(a);if(this.classes.has(n))return;const c=I.sanitizeText(n,F());this.classes.set(c,{id:c,type:r,label:c,text:`${c}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const n={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(n)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const n=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",dt()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const n=this.splitClassNameAndType(i).className;this.classes.get(n).annotations.push(a)}addMember(i,a){this.addClass(i);const n=this.splitClassNameAndType(i).className,r=this.classes.get(n);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?r.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?r.methods.push(new Xe(c,"method")):c&&r.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(n=>this.addMember(i,n)))}addNote(i,a){const n=this.notes.size,r={id:`note${n}`,class:a,text:i,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(n=>{let r=n;/\d/.exec(n[0])&&(r=pe+r),r=this.splitClassNameAndType(r).className;const c=this.classes.get(r);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const n of i){let r=this.styleClasses.get(n);r===void 0&&(r={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,r)),a&&a.forEach(c=>{if(/color/.exec(c)){const u=c.replace("fill","bgFill");r.textStyles.push(u)}r.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(n)&&c.styles.push(...a.flatMap(u=>u.split(",")))})}}setTooltip(i,a){i.split(",").forEach(n=>{if(a!==void 0){const r=this.splitClassNameAndType(n).className,c=this.classes.get(r);c&&(c.tooltip=P(a))}})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,n){const r=F();i.split(",").forEach(c=>{let u=c;/\d/.exec(c[0])&&(u=pe+u),u=this.splitClassNameAndType(u).className;const d=this.classes.get(u);d&&(d.link=Oe.formatUrl(a,r),r.securityLevel==="sandbox"?d.linkTarget="_top":typeof n=="string"?d.linkTarget=P(n):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,n){i.split(",").forEach(r=>{this.setClickFunc(r,a,n);const c=this.splitClassNameAndType(r).className,u=this.classes.get(c);u&&(u.haveCallback=!0)}),this.setCssClass(i,"clickable")}setClickFunc(i,a,n){const r=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const u=this.splitClassNameAndType(r).className;if(this.classes.has(u)){let d=[];if(typeof n=="string"){d=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(u),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const n=a.at(-1);return n?`${n}.${i}`:i}static getAncestorIds(i){const a=i.split("."),n=new Array(a.length);n[0]=a[0];for(let r=1;r0?c[u-1]:void 0,g=u===c.length-1,N=g&&a?a:r[u];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,n){if(this.namespaces.has(i)){for(const r of a){const{className:c}=this.splitClassNameAndType(r),u=this.getClass(c);u.parent=i,this.namespaces.get(i).classes.set(c,u)}for(const r of n){const c=this.getNote(r);c.parent=i,this.namespaces.get(i).notes.set(r,c)}}}setCssStyle(i,a){const n=this.classes.get(i);if(!(!a||!n))for(const r of a)r.includes(",")?n.styles.push(...r.split(",")):n.styles.push(r)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const n=this.namespaces.get(a);if(!n)return;if(n.explicit)return a;a=n.parent}}getData(){const i=[],a=[],n=F(),r=n.class?.hierarchicalNamespaces??!0;for(const u of this.namespaces.values()){if(!r&&!u.explicit)continue;const d={id:u.id,label:r?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:r?u.parent:void 0};i.push(d)}for(const u of this.classes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={...u,type:void 0,isGroup:!1,parentId:d,look:n.look};i.push(m)}for(const u of this.notes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(u.class)?.id;if(g){const N={id:`edgeNote${u.index}`,start:u.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};a.push(N)}}for(const u of this.interfaces){const d={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};i.push(d)}let c=0;for(const u of this.relations){c++;const d={id:pt(u.id1,u.id2,{prefix:"id",counter:c}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:u.relationTitle1==="none"?"":u.relationTitle1,endLabelLeft:u.relationTitle2==="none"?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:u.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:n,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -203,4 +203,4 @@ g.classGroup line { text-align: center; } ${tt()} -`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const r of t.doc)r.stmt==="dir"&&(a=r.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,r){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:n,state:c,layout:l}=F();r.db.setDiagramId(i);const d=r.db.getData(),m=it(i,n);d.type=r.type,d.layoutAlgorithm=rt(l),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,r.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; +`,"getStyles"),Nt=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const n of t.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,n){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=st(i,r);d.type=n.type,d.layoutAlgorithm=at(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),it(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Lt={getClasses:bt,draw:kt,getDir:Ct};export{St as C,_t as a,Lt as c,Nt as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BjRYBbf4.js similarity index 69% rename from apps/pythinker-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js rename to apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BjRYBbf4.js index 082e6dc05..006d57988 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js +++ b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BjRYBbf4.js @@ -1,9 +1,9 @@ -import{g as tt}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{c as st}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{g as it}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as at}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as f,l as Ie,c as F,o as rt,r as nt,u as Oe,d as de,y as ut,b as lt,a as ct,s as ot,g as ht,p as dt,q as pt,k as I,z as At,x as ft,i as gt,Q as G}from"./mermaidParser.worker-Dx4jPi9z.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],c=[1,26],l=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],re=[1,103],z=[1,121],Y=[1,117],K=[1,113],Q=[1,119],W=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],ne=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,u,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:u.addRelation(e[s]);break;case 20:e[s-1].title=u.cleanupLabel(e[s]),u.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),u.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),u.setAccDescription(this.$);break;case 34:u.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 35:u.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),u.popNamespace();break;case 36:this.$=u.addNamespace(e[s]);break;case 37:this.$=u.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:u.setCssClass(e[s-2],e[s]);break;case 49:u.addMembers(e[s-3],e[s-1]);break;case 51:u.setCssClass(e[s-5],e[s-3]),u.addMembers(e[s-5],e[s-1]);break;case 52:u.addAnnotation(e[s-3],e[s-1]);break;case 53:u.addAnnotation(e[s-6],e[s-4]),u.addMembers(e[s-6],e[s-1]);break;case 54:u.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],u.addClass(e[s]);break;case 56:this.$=e[s-1],u.addClass(e[s-1]),u.setClassLabel(e[s-1],e[s]);break;case 60:u.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:u.addMember(e[s-1],u.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=u.addNote(e[s],e[s-1]);break;case 72:this.$=u.addNote(e[s]);break;case 73:this.$=e[s-2],u.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:u.setDirection("TB");break;case 77:u.setDirection("BT");break;case 78:u.setDirection("RL");break;case 79:u.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=u.relationType.AGGREGATION;break;case 85:this.$=u.relationType.EXTENSION;break;case 86:this.$=u.relationType.COMPOSITION;break;case 87:this.$=u.relationType.DEPENDENCY;break;case 88:this.$=u.relationType.LOLLIPOP;break;case 89:this.$=u.lineType.LINE;break;case 90:this.$=u.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],u.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],u.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],u.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],u.setLink(e[s-2],e[s-1]),u.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],u.setLink(e[s-3],e[s-2],e[s]),u.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],u.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],u.setClickEvent(e[s-3],e[s-2],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],u.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],u.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],u.setLink(e[s-3],e[s-1]),u.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],u.setLink(e[s-4],e[s-2],e[s]),u.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],u.setCssStyle(e[s-1],e[s]);break;case 106:u.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:c,48:l,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:l,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:re},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:Q,84:111,85:112,86:W,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:Q,84:111,85:112,86:W,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(ne,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:l,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:re},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:Q,86:W,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(ne,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:l,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:l,54:g,56:N},{45:163,51:re},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:Q,84:169,85:112,86:W,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(ne,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:re},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:Q,86:W,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],u=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function Qe(){var S;return S=u.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(u=S,S=u.pop()),S=h.symbols_[S]||S),S}f(Qe,"lex");for(var B,V,L,xe,R={},oe,v,We,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=Qe()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-B6TwRhtM.js";import{g as st}from"./chunk-XXDRQBXY-O3ugxnCs.js";import{s as it}from"./chunk-POPQ4Y6H-ClOHKyvb.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,j as de,O as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,P as G}from"./mermaidParser.worker-DimdFOud.js";import{f as gt}from"./chunk-F27PBJKO-CYKbU5Oh.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` -Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),We=J[p[p.length-2]][p[p.length-1]],p.push(We);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` -`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,u,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,u;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,u=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[u]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,u,C){switch(u){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=gt(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(n){const c=n[1]?n[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=n[2],this.parameters=n[3]?n[3].trim():"",i=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",i===""){const l=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(l)&&(i=l,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const r=t.length,n=t.substring(0,1),c=t.substring(r-1);je.includes(n)&&(this.visibility=n),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?r:r-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=st();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const l=de(c.currentTarget),d=l.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(ut.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),l.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=lt,this.getAccTitle=ct,this.setAccDescription=ot,this.getAccDescription=ht,this.setDiagramTitle=dt,this.getDiagramTitle=pt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let r="",n=a;if(a.indexOf("~")>0){const c=a.split("~");n=P(c[0]),r=P(c[1])}return{className:n,type:r}}setClassLabel(i,a){const r=I.sanitizeText(i,F());a&&(a=P(a));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=a,this.classes.get(n).text=`${a}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:r,type:n}=this.splitClassNameAndType(a);if(this.classes.has(r))return;const c=I.sanitizeText(r,F());this.classes.set(c,{id:c,type:n,label:c,text:`${c}${n?`<${n}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const r={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(r)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const r=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${r}`:r}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",At()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const r=this.splitClassNameAndType(i).className;this.classes.get(r).annotations.push(a)}addMember(i,a){this.addClass(i);const r=this.splitClassNameAndType(i).className,n=this.classes.get(r);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?n.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?n.methods.push(new Xe(c,"method")):c&&n.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(r=>this.addMember(i,r)))}addNote(i,a){const r=this.notes.size,n={id:`note${r}`,class:a,text:i,index:r};return this.notes.set(n.id,n),n.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(r=>{let n=r;/\d/.exec(r[0])&&(n=pe+n);const c=this.classes.get(n);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const r of i){let n=this.styleClasses.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,n)),a&&a.forEach(c=>{if(/color/.exec(c)){const l=c.replace("fill","bgFill");n.textStyles.push(l)}n.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(r)&&c.styles.push(...a.flatMap(l=>l.split(",")))})}}setTooltip(i,a){i.split(",").forEach(r=>{a!==void 0&&(this.classes.get(r).tooltip=P(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,r){const n=F();i.split(",").forEach(c=>{let l=c;/\d/.exec(c[0])&&(l=pe+l);const d=this.classes.get(l);d&&(d.link=Oe.formatUrl(a,n),n.securityLevel==="sandbox"?d.linkTarget="_top":typeof r=="string"?d.linkTarget=P(r):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,r){i.split(",").forEach(n=>{this.setClickFunc(n,a,r),this.classes.get(n).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,r){const n=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const l=n;if(this.classes.has(l)){let d=[];if(typeof r=="string"){d=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(l),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const r=a.at(-1);return r?`${r}.${i}`:i}static getAncestorIds(i){const a=i.split("."),r=new Array(a.length);r[0]=a[0];for(let n=1;n0?c[l-1]:void 0,g=l===c.length-1,N=g&&a?a:n[l];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,r){if(this.namespaces.has(i)){for(const n of a){const{className:c}=this.splitClassNameAndType(n),l=this.getClass(c);l.parent=i,this.namespaces.get(i).classes.set(c,l)}for(const n of r){const c=this.getNote(n);c.parent=i,this.namespaces.get(i).notes.set(n,c)}}}setCssStyle(i,a){const r=this.classes.get(i);if(!(!a||!r))for(const n of a)n.includes(",")?r.styles.push(...n.split(",")):r.styles.push(n)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const r=this.namespaces.get(a);if(!r)return;if(r.explicit)return a;a=r.parent}}getData(){const i=[],a=[],r=F(),n=r.class?.hierarchicalNamespaces??!0;for(const l of this.namespaces.values()){if(!n&&!l.explicit)continue;const d={id:l.id,label:n?l.label:l.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:[],look:r.look,parentId:n?l.parent:void 0};i.push(d)}for(const l of this.classes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={...l,type:void 0,isGroup:!1,parentId:d,look:r.look};i.push(m)}for(const l of this.notes.values()){const d=n?l.parent:this.resolveExplicitAncestor(l.parent),m={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(l.class)?.id;if(g){const N={id:`edgeNote${l.index}`,start:l.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};a.push(N)}}for(const l of this.interfaces){const d={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};i.push(d)}let c=0;for(const l of this.relations){c++;const d={id:ft(l.id1,l.id2,{prefix:"id",counter:c}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:r.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:r,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=ft(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(r){const c=r[1]?r[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=r[2],this.parameters=r[3]?r[3].trim():"",i=r[4]?r[4].trim():"",this.returnType=r[5]?r[5].trim():"",i===""){const u=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(u)&&(i=u,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,r=t.substring(0,1),c=t.substring(n-1);je.includes(r)&&(this.visibility=r),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?n:n-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=gt();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const u=de(c.currentTarget),d=u.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(rt.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),u.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=ut,this.getAccTitle=lt,this.setAccDescription=ct,this.getAccDescription=ot,this.setDiagramTitle=ht,this.getDiagramTitle=dt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let n="",r=a;if(a.indexOf("~")>0){const c=a.split("~");r=P(c[0]),n=P(c[1])}return{className:r,type:n}}setClassLabel(i,a){const n=I.sanitizeText(i,F());a&&(a=P(a));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=a,this.classes.get(r).text=`${a}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:n,type:r}=this.splitClassNameAndType(a);if(this.classes.has(n))return;const c=I.sanitizeText(n,F());this.classes.set(c,{id:c,type:r,label:c,text:`${c}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const n={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(n)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const n=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",pt()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const n=this.splitClassNameAndType(i).className;this.classes.get(n).annotations.push(a)}addMember(i,a){this.addClass(i);const n=this.splitClassNameAndType(i).className,r=this.classes.get(n);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?r.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?r.methods.push(new Xe(c,"method")):c&&r.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(n=>this.addMember(i,n)))}addNote(i,a){const n=this.notes.size,r={id:`note${n}`,class:a,text:i,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(n=>{let r=n;/\d/.exec(n[0])&&(r=pe+r),r=this.splitClassNameAndType(r).className;const c=this.classes.get(r);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const n of i){let r=this.styleClasses.get(n);r===void 0&&(r={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,r)),a&&a.forEach(c=>{if(/color/.exec(c)){const u=c.replace("fill","bgFill");r.textStyles.push(u)}r.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(n)&&c.styles.push(...a.flatMap(u=>u.split(",")))})}}setTooltip(i,a){i.split(",").forEach(n=>{if(a!==void 0){const r=this.splitClassNameAndType(n).className,c=this.classes.get(r);c&&(c.tooltip=P(a))}})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,n){const r=F();i.split(",").forEach(c=>{let u=c;/\d/.exec(c[0])&&(u=pe+u),u=this.splitClassNameAndType(u).className;const d=this.classes.get(u);d&&(d.link=Oe.formatUrl(a,r),r.securityLevel==="sandbox"?d.linkTarget="_top":typeof n=="string"?d.linkTarget=P(n):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,n){i.split(",").forEach(r=>{this.setClickFunc(r,a,n);const c=this.splitClassNameAndType(r).className,u=this.classes.get(c);u&&(u.haveCallback=!0)}),this.setCssClass(i,"clickable")}setClickFunc(i,a,n){const r=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const u=this.splitClassNameAndType(r).className;if(this.classes.has(u)){let d=[];if(typeof n=="string"){d=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(u),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const n=a.at(-1);return n?`${n}.${i}`:i}static getAncestorIds(i){const a=i.split("."),n=new Array(a.length);n[0]=a[0];for(let r=1;r0?c[u-1]:void 0,g=u===c.length-1,N=g&&a?a:r[u];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,n){if(this.namespaces.has(i)){for(const r of a){const{className:c}=this.splitClassNameAndType(r),u=this.getClass(c);u.parent=i,this.namespaces.get(i).classes.set(c,u)}for(const r of n){const c=this.getNote(r);c.parent=i,this.namespaces.get(i).notes.set(r,c)}}}setCssStyle(i,a){const n=this.classes.get(i);if(!(!a||!n))for(const r of a)r.includes(",")?n.styles.push(...r.split(",")):n.styles.push(r)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const n=this.namespaces.get(a);if(!n)return;if(n.explicit)return a;a=n.parent}}getData(){const i=[],a=[],n=F(),r=n.class?.hierarchicalNamespaces??!0;for(const u of this.namespaces.values()){if(!r&&!u.explicit)continue;const d={id:u.id,label:r?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:r?u.parent:void 0};i.push(d)}for(const u of this.classes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={...u,type:void 0,isGroup:!1,parentId:d,look:n.look};i.push(m)}for(const u of this.notes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(u.class)?.id;if(g){const N={id:`edgeNote${u.index}`,start:u.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};a.push(N)}}for(const u of this.interfaces){const d={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};i.push(d)}let c=0;for(const u of this.relations){c++;const d={id:At(u.id1,u.id2,{prefix:"id",counter:c}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:u.relationTitle1==="none"?"":u.relationTitle1,endLabelLeft:u.relationTitle2==="none"?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:u.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:n,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -203,4 +203,4 @@ g.classGroup line { text-align: center; } ${tt()} -`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const r of t.doc)r.stmt==="dir"&&(a=r.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,r){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:n,state:c,layout:l}=F();r.db.setDiagramId(i);const d=r.db.getData(),m=it(i,n);d.type=r.type,d.layoutAlgorithm=rt(l),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,r.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; +`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const n of t.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,n){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=st(i,r);d.type=n.type,d.layoutAlgorithm=at(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),it(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-BBoWOe8j.js b/apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-BBoWOe8j.js deleted file mode 100644 index f9a8a1ef6..000000000 --- a/apps/pythinker-code/dist-web/assets/chunk-ND2GUHAM-BBoWOe8j.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,d as l,n as d,j as o}from"./mermaid.core-Bt2TZ_t_.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,w as c,x as d,g as e,m as f,h as g,y as h}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-ClOHKyvb.js b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-ClOHKyvb.js new file mode 100644 index 000000000..35ca2cd15 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-ClOHKyvb.js @@ -0,0 +1 @@ +import{_ as a,d as w,l as x}from"./mermaidParser.worker-DimdFOud.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Enw1vTgw.js b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Enw1vTgw.js new file mode 100644 index 000000000..2d80bfeb2 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Enw1vTgw.js @@ -0,0 +1 @@ +import{_ as a,d as w,l as x}from"./mermaid.core-CM2luXFy.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-B7jXwGMz.js b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-B7jXwGMz.js new file mode 100644 index 000000000..a1527d2f2 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-B7jXwGMz.js @@ -0,0 +1,88 @@ +import{_ as p,l as w,G as L,A as E,r as X,X as I,d as G,i as H,c as q}from"./mermaid.core-CM2luXFy.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,q()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),X(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +`),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...I(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` + .railroad-diagram { + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-terminal rect { + fill: ${r}; + stroke: ${t}; + stroke-width: ${c}px; + } + + .railroad-terminal text { + fill: ${n}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${h}; + stroke: ${s}; + stroke-width: ${c}px; + } + + .railroad-nonterminal text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${u}; + stroke-width: ${c}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${d}; + } + + .railroad-comment ellipse { + fill: ${x}; + stroke: ${l}; + stroke-width: ${c}px; + } + + .railroad-comment text { + fill: ${f}; + font-style: italic; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${y}; + stroke: ${v}; + stroke-width: ${c}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${C}; + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles"),T=class{constructor(){this.d=""}static{p(this,"PathBuilder")}moveTo(e,i){return this.d+=`M ${e} ${i} `,this}lineTo(e,i){return this.d+=`L ${e} ${i} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,i,a,r,t,n,h){return this.d+=`A ${e} ${i} ${a} ${r?1:0} ${t?1:0} ${n} ${h} `,this}build(){return this.d.trim()}},me=class{constructor(e,i=M()){this.textCache=new Map,this.svg=e,this.config=i}static{p(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const i=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),a=i.node().getBBox(),r={width:a.width,height:a.height};return i.remove(),this.textCache.set(e,r),r}renderTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-terminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t).attr("rx",10).attr("ry",10),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderNonTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-nonterminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderSequence(e,i){const a=i.map(o=>this.renderExpression(e,o));let r=0,t=0,n=0;for(const o of a)r+=o.dimensions.width,t=Math.max(t,o.dimensions.up),n=Math.max(n,o.dimensions.down);r+=(a.length-1)*this.config.horizontalSeparation;const h=e.append("g").attr("class","railroad-sequence");let s=0;for(let o=0;othis.renderExpression(e,d));let r=0,t=0;for(const d of a)r=Math.max(r,d.dimensions.width),t+=d.dimensions.height;t+=(a.length-1)*this.config.verticalSeparation;const n=this.config.arcRadius,h=n*4,s=r+h,o=e.append("g").attr("class","railroad-choice");let u=0;const c=t/2;for(const d of a){const x=u,l=x+d.dimensions.up,f=n*2+(r-d.dimensions.width)/2;o.node().appendChild(d.element).setAttribute("transform",`translate(${f}, ${x})`);const v=new T,C=l>c;l===c?v.moveTo(0,c).lineTo(f,l):v.moveTo(0,c).arcTo(n,n,0,!1,C,n,c+(C?n:-n)).lineTo(n,l-(C?n:-n)).arcTo(n,n,0,!1,!C,n*2,l).lineTo(f,l),o.append("path").attr("class","railroad-line").attr("d",v.build());const $=new T,O=f+d.dimensions.width,P=s-n*2;l===c?$.moveTo(O,l).lineTo(s,c):$.moveTo(O,l).lineTo(P,l).arcTo(n,n,0,!1,!C,s-n,l+(C?-n:n)).lineTo(s-n,c+(C?n:-n)).arcTo(n,n,0,!1,C,s,c),o.append("path").attr("class","railroad-line").attr("d",$.build()),u+=d.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:s,height:t,up:c,down:t-c}}}renderOptional(e,i){const a=this.renderExpression(e,i),r=this.config.arcRadius,t=r*2,n=a.dimensions.width+r*4,h=a.dimensions.height+t,s=e.append("g").attr("class","railroad-optional"),o=r*2,u=t;s.node().appendChild(a.element).setAttribute("transform",`translate(${o}, ${u})`);const d=u+a.dimensions.up,x=new T().moveTo(0,d).lineTo(r*2,d);s.append("path").attr("class","railroad-line").attr("d",x.build());const l=new T().moveTo(o+a.dimensions.width,d).lineTo(n,d);s.append("path").attr("class","railroad-line").attr("d",l.build());const f=new T().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(n-r*2,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,d-r).arcTo(r,r,0,!1,!1,n,d);return s.append("path").attr("class","railroad-line").attr("d",f.build()),{element:s.node(),dimensions:{width:n,height:h,up:d,down:h-d}}}renderRepetition(e,i,a){const r=this.renderExpression(e,i),t=this.config.arcRadius,n=t*2,h=r.dimensions.width+t*4,s=a===0,o=r.dimensions.height+n+(s?n:0),u=e.append("g").attr("class","railroad-repetition"),c=t*2,d=s?n:0;u.node().appendChild(r.element).setAttribute("transform",`translate(${c}, ${d})`);const l=d+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(0,l).lineTo(t*2,l).build()),u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(c+r.dimensions.width,l).lineTo(h,l).build());const f=d+r.dimensions.height+t,y=new T().moveTo(c+r.dimensions.width,l).arcTo(t,t,0,!1,!0,c+r.dimensions.width+t,l+t).lineTo(c+r.dimensions.width+t,f).arcTo(t,t,0,!1,!0,c+r.dimensions.width,f+t).lineTo(t*2,f+t).arcTo(t,t,0,!1,!0,t,f).lineTo(t,l+t).arcTo(t,t,0,!1,!0,t*2,l);if(u.append("path").attr("class","railroad-line").attr("d",y.build()),s){const v=new T().moveTo(0,l).arcTo(t,t,0,!1,!1,t,l-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(h-t*2,0).arcTo(t,t,0,!1,!0,h-t,t).lineTo(h-t,l-t).arcTo(t,t,0,!1,!1,h,l);u.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:u.node(),dimensions:{width:h,height:o,up:l,down:o-l}}}renderSpecial(e,i){const a=this.measureText("? "+i+" ?"),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-special");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text("? "+i+" ?"),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderExpression(e,i){switch(i.type){case"terminal":return this.renderTerminal(e,i.value);case"nonterminal":return this.renderNonTerminal(e,i.name);case"sequence":return this.renderSequence(e,i.elements);case"choice":return this.renderChoice(e,i.alternatives);case"optional":return this.renderOptional(e,i.element);case"repetition":return this.renderRepetition(e,i.element,i.min);case"special":return this.renderSpecial(e,i.text);default:throw new Error(`Unknown node type: ${i.type}`)}}renderRule(e,i){const a=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${i})`),r=e.name+" =",t=this.measureText(r).width+20,n=t+20,h=a.append("g"),s=this.renderExpression(h,e.definition),o=Math.max(20,s.dimensions.up),u=o-s.dimensions.up;return h.attr("transform",`translate(${n}, ${u})`),a.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),a.append("g").attr("class","railroad-start").append("circle").attr("cx",t).attr("cy",o).attr("r",this.config.markerRadius),a.append("g").attr("class","railroad-end").append("circle").attr("cx",n+s.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(t+this.config.markerRadius,o).lineTo(n,o).build()),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(n+s.dimensions.width,o).lineTo(n+s.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:n+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let i=this.config.padding,a=0;for(const r of e){const t=this.renderRule(r,i);i+=t.height+this.config.verticalSeparation,a=Math.max(a,t.width)}return{width:a+this.config.padding*2,height:i+this.config.padding}}},D=p((e,i,a)=>{G(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),he=p((e,i,a)=>{w.debug(`[Railroad] Rendering diagram +`+e);try{const r=L(i);r.attr("class","railroad-diagram");const n=E().railroad?.useMaxWidth??!0,h=ie.getRules();if(w.debug(`[Railroad] Rendering ${h.length} rules`),h.length===0){w.warn("[Railroad] No rules to render"),D(r,{height:100,width:200},n);return}const o=new me(r,M()).renderDiagram(h);D(r,o,n),w.debug("[Railroad] Render complete")}catch(r){throw w.error("[Railroad] Render error:",r),r}},"draw"),ge={draw:he};export{ie as d,ue as g,ge as r}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-Ch8YtWzR.js b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-Ch8YtWzR.js new file mode 100644 index 000000000..b38a17873 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-Ch8YtWzR.js @@ -0,0 +1,88 @@ +import{_ as p,l as w,D as L,y as E,p as I,E as X,d as H,i as q,c as G}from"./mermaidParser.worker-DimdFOud.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +`),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` + .railroad-diagram { + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-terminal rect { + fill: ${r}; + stroke: ${t}; + stroke-width: ${c}px; + } + + .railroad-terminal text { + fill: ${n}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${h}; + stroke: ${s}; + stroke-width: ${c}px; + } + + .railroad-nonterminal text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${u}; + stroke-width: ${c}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${d}; + } + + .railroad-comment ellipse { + fill: ${x}; + stroke: ${l}; + stroke-width: ${c}px; + } + + .railroad-comment text { + fill: ${f}; + font-style: italic; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${y}; + stroke: ${v}; + stroke-width: ${c}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${C}; + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles"),T=class{constructor(){this.d=""}static{p(this,"PathBuilder")}moveTo(e,i){return this.d+=`M ${e} ${i} `,this}lineTo(e,i){return this.d+=`L ${e} ${i} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,i,a,r,t,n,h){return this.d+=`A ${e} ${i} ${a} ${r?1:0} ${t?1:0} ${n} ${h} `,this}build(){return this.d.trim()}},me=class{constructor(e,i=M()){this.textCache=new Map,this.svg=e,this.config=i}static{p(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const i=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),a=i.node().getBBox(),r={width:a.width,height:a.height};return i.remove(),this.textCache.set(e,r),r}renderTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-terminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t).attr("rx",10).attr("ry",10),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderNonTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-nonterminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderSequence(e,i){const a=i.map(o=>this.renderExpression(e,o));let r=0,t=0,n=0;for(const o of a)r+=o.dimensions.width,t=Math.max(t,o.dimensions.up),n=Math.max(n,o.dimensions.down);r+=(a.length-1)*this.config.horizontalSeparation;const h=e.append("g").attr("class","railroad-sequence");let s=0;for(let o=0;othis.renderExpression(e,d));let r=0,t=0;for(const d of a)r=Math.max(r,d.dimensions.width),t+=d.dimensions.height;t+=(a.length-1)*this.config.verticalSeparation;const n=this.config.arcRadius,h=n*4,s=r+h,o=e.append("g").attr("class","railroad-choice");let u=0;const c=t/2;for(const d of a){const x=u,l=x+d.dimensions.up,f=n*2+(r-d.dimensions.width)/2;o.node().appendChild(d.element).setAttribute("transform",`translate(${f}, ${x})`);const v=new T,C=l>c;l===c?v.moveTo(0,c).lineTo(f,l):v.moveTo(0,c).arcTo(n,n,0,!1,C,n,c+(C?n:-n)).lineTo(n,l-(C?n:-n)).arcTo(n,n,0,!1,!C,n*2,l).lineTo(f,l),o.append("path").attr("class","railroad-line").attr("d",v.build());const $=new T,O=f+d.dimensions.width,P=s-n*2;l===c?$.moveTo(O,l).lineTo(s,c):$.moveTo(O,l).lineTo(P,l).arcTo(n,n,0,!1,!C,s-n,l+(C?-n:n)).lineTo(s-n,c+(C?n:-n)).arcTo(n,n,0,!1,C,s,c),o.append("path").attr("class","railroad-line").attr("d",$.build()),u+=d.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:s,height:t,up:c,down:t-c}}}renderOptional(e,i){const a=this.renderExpression(e,i),r=this.config.arcRadius,t=r*2,n=a.dimensions.width+r*4,h=a.dimensions.height+t,s=e.append("g").attr("class","railroad-optional"),o=r*2,u=t;s.node().appendChild(a.element).setAttribute("transform",`translate(${o}, ${u})`);const d=u+a.dimensions.up,x=new T().moveTo(0,d).lineTo(r*2,d);s.append("path").attr("class","railroad-line").attr("d",x.build());const l=new T().moveTo(o+a.dimensions.width,d).lineTo(n,d);s.append("path").attr("class","railroad-line").attr("d",l.build());const f=new T().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(n-r*2,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,d-r).arcTo(r,r,0,!1,!1,n,d);return s.append("path").attr("class","railroad-line").attr("d",f.build()),{element:s.node(),dimensions:{width:n,height:h,up:d,down:h-d}}}renderRepetition(e,i,a){const r=this.renderExpression(e,i),t=this.config.arcRadius,n=t*2,h=r.dimensions.width+t*4,s=a===0,o=r.dimensions.height+n+(s?n:0),u=e.append("g").attr("class","railroad-repetition"),c=t*2,d=s?n:0;u.node().appendChild(r.element).setAttribute("transform",`translate(${c}, ${d})`);const l=d+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(0,l).lineTo(t*2,l).build()),u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(c+r.dimensions.width,l).lineTo(h,l).build());const f=d+r.dimensions.height+t,y=new T().moveTo(c+r.dimensions.width,l).arcTo(t,t,0,!1,!0,c+r.dimensions.width+t,l+t).lineTo(c+r.dimensions.width+t,f).arcTo(t,t,0,!1,!0,c+r.dimensions.width,f+t).lineTo(t*2,f+t).arcTo(t,t,0,!1,!0,t,f).lineTo(t,l+t).arcTo(t,t,0,!1,!0,t*2,l);if(u.append("path").attr("class","railroad-line").attr("d",y.build()),s){const v=new T().moveTo(0,l).arcTo(t,t,0,!1,!1,t,l-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(h-t*2,0).arcTo(t,t,0,!1,!0,h-t,t).lineTo(h-t,l-t).arcTo(t,t,0,!1,!1,h,l);u.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:u.node(),dimensions:{width:h,height:o,up:l,down:o-l}}}renderSpecial(e,i){const a=this.measureText("? "+i+" ?"),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-special");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text("? "+i+" ?"),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderExpression(e,i){switch(i.type){case"terminal":return this.renderTerminal(e,i.value);case"nonterminal":return this.renderNonTerminal(e,i.name);case"sequence":return this.renderSequence(e,i.elements);case"choice":return this.renderChoice(e,i.alternatives);case"optional":return this.renderOptional(e,i.element);case"repetition":return this.renderRepetition(e,i.element,i.min);case"special":return this.renderSpecial(e,i.text);default:throw new Error(`Unknown node type: ${i.type}`)}}renderRule(e,i){const a=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${i})`),r=e.name+" =",t=this.measureText(r).width+20,n=t+20,h=a.append("g"),s=this.renderExpression(h,e.definition),o=Math.max(20,s.dimensions.up),u=o-s.dimensions.up;return h.attr("transform",`translate(${n}, ${u})`),a.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),a.append("g").attr("class","railroad-start").append("circle").attr("cx",t).attr("cy",o).attr("r",this.config.markerRadius),a.append("g").attr("class","railroad-end").append("circle").attr("cx",n+s.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(t+this.config.markerRadius,o).lineTo(n,o).build()),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(n+s.dimensions.width,o).lineTo(n+s.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:n+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let i=this.config.padding,a=0;for(const r of e){const t=this.renderRule(r,i);i+=t.height+this.config.verticalSeparation,a=Math.max(a,t.width)}return{width:a+this.config.padding*2,height:i+this.config.padding}}},D=p((e,i,a)=>{H(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),he=p((e,i,a)=>{w.debug(`[Railroad] Rendering diagram +`+e);try{const r=L(i);r.attr("class","railroad-diagram");const n=E().railroad?.useMaxWidth??!0,h=ie.getRules();if(w.debug(`[Railroad] Rendering ${h.length} rules`),h.length===0){w.warn("[Railroad] No rules to render"),D(r,{height:100,width:200},n);return}const o=new me(r,M()).renderDiagram(h);D(r,o,n),w.debug("[Railroad] Render complete")}catch(r){throw w.error("[Railroad] Render error:",r),r}},"draw"),ge={draw:he};export{ie as d,ue as g,ge as r}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-55IACEB6-CeJhGgl3.js b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-CiRZidGx.js similarity index 54% rename from apps/pythinker-code/dist-web/assets/chunk-55IACEB6-CeJhGgl3.js rename to apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-CiRZidGx.js index c57520286..1e63af6bf 100644 --- a/apps/pythinker-code/dist-web/assets/chunk-55IACEB6-CeJhGgl3.js +++ b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-CiRZidGx.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-Bt2TZ_t_.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,j as o}from"./mermaid.core-CM2luXFy.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g}; diff --git a/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-O3ugxnCs.js b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-O3ugxnCs.js new file mode 100644 index 000000000..8c99d6d45 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-O3ugxnCs.js @@ -0,0 +1 @@ +import{_ as a,j as o}from"./mermaidParser.worker-DimdFOud.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js b/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js deleted file mode 100644 index 0551a8e8d..000000000 --- a/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Dn5wkDO_.js";import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";import"./chunk-FMBD7UC4-B2zs_Y-d.js";import"./chunk-ND2GUHAM-C4-rwdcv.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-CLPflg_T.js b/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-CLPflg_T.js deleted file mode 100644 index 6f0380ab0..000000000 --- a/apps/pythinker-code/dist-web/assets/classDiagram-4FO5ZUOK-CLPflg_T.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-CWadnQqE.js";import{_ as i}from"./mermaid.core-Bt2TZ_t_.js";import"./chunk-FMBD7UC4-CO8Ccrhy.js";import"./chunk-ND2GUHAM-BBoWOe8j.js";import"./chunk-55IACEB6-CeJhGgl3.js";import"./chunk-2J33WTMH-C5fSlY2E.js";import"./index-C-zUV3mO.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DMBwBDk3.js b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DMBwBDk3.js new file mode 100644 index 000000000..249e3332a --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DMBwBDk3.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-BjRYBbf4.js";import{_ as i}from"./mermaidParser.worker-DimdFOud.js";import"./chunk-5VM5RSS4-B6TwRhtM.js";import"./chunk-XXDRQBXY-O3ugxnCs.js";import"./chunk-POPQ4Y6H-ClOHKyvb.js";import"./chunk-F27PBJKO-CYKbU5Oh.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DbeVASAq.js b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DbeVASAq.js new file mode 100644 index 000000000..c39e9e464 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-DbeVASAq.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-9vzzXY8X.js";import{_ as i}from"./mermaid.core-CM2luXFy.js";import"./chunk-5VM5RSS4-CfUbytH6.js";import"./chunk-XXDRQBXY-CiRZidGx.js";import"./chunk-POPQ4Y6H-Enw1vTgw.js";import"./chunk-F27PBJKO-8JlkC2jZ.js";import"./purify.es-5AjVNlXF.js";import"./index-rMXX6Fbt.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DMBwBDk3.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DMBwBDk3.js new file mode 100644 index 000000000..249e3332a --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DMBwBDk3.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-BjRYBbf4.js";import{_ as i}from"./mermaidParser.worker-DimdFOud.js";import"./chunk-5VM5RSS4-B6TwRhtM.js";import"./chunk-XXDRQBXY-O3ugxnCs.js";import"./chunk-POPQ4Y6H-ClOHKyvb.js";import"./chunk-F27PBJKO-CYKbU5Oh.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DbeVASAq.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DbeVASAq.js new file mode 100644 index 000000000..c39e9e464 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-DbeVASAq.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-9vzzXY8X.js";import{_ as i}from"./mermaid.core-CM2luXFy.js";import"./chunk-5VM5RSS4-CfUbytH6.js";import"./chunk-XXDRQBXY-CiRZidGx.js";import"./chunk-POPQ4Y6H-Enw1vTgw.js";import"./chunk-F27PBJKO-8JlkC2jZ.js";import"./purify.es-5AjVNlXF.js";import"./index-rMXX6Fbt.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js deleted file mode 100644 index 0551a8e8d..000000000 --- a/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Dn5wkDO_.js";import{_ as i}from"./mermaidParser.worker-Dx4jPi9z.js";import"./chunk-FMBD7UC4-B2zs_Y-d.js";import"./chunk-ND2GUHAM-C4-rwdcv.js";import"./chunk-55IACEB6-B5dE1-Um.js";import"./chunk-2J33WTMH-w4sdiKFO.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-CLPflg_T.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-CLPflg_T.js deleted file mode 100644 index 6f0380ab0..000000000 --- a/apps/pythinker-code/dist-web/assets/classDiagram-v2-Q7XG4LA2-CLPflg_T.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-CWadnQqE.js";import{_ as i}from"./mermaid.core-Bt2TZ_t_.js";import"./chunk-FMBD7UC4-CO8Ccrhy.js";import"./chunk-ND2GUHAM-BBoWOe8j.js";import"./chunk-55IACEB6-CeJhGgl3.js";import"./chunk-2J33WTMH-C5fSlY2E.js";import"./index-C-zUV3mO.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJdft2Tr.js b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJdft2Tr.js new file mode 100644 index 000000000..f9d11cf60 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJdft2Tr.js @@ -0,0 +1 @@ +import{b4 as lt,_ as V,l as $,j as gt}from"./mermaid.core-CM2luXFy.js";import{c as tt}from"./cytoscape.esm-CNiYdHpY.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-w63tkgMG.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js rename to apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-w63tkgMG.js index be5a935b3..76370928c 100644 --- a/apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js +++ b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-w63tkgMG.js @@ -1 +1 @@ -import{b4 as lt,_ as V,l as $,d as gt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as tt}from"./cytoscape.esm-nFXppDBa.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt(),Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),At=Lt;export{At as render}; +import{b5 as lt,_ as V,l as $,j as gt}from"./mermaidParser.worker-DimdFOud.js";import{c as tt}from"./cytoscape.esm-CNiYdHpY.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt(),Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),At=Lt;export{At as render}; diff --git a/apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-DgdiiLCl.js b/apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-DgdiiLCl.js deleted file mode 100644 index e470efeb2..000000000 --- a/apps/pythinker-code/dist-web/assets/cose-bilkent-S5V4N54A-DgdiiLCl.js +++ /dev/null @@ -1 +0,0 @@ -import{b4 as lt,_ as V,l as $,d as gt}from"./mermaid.core-Bt2TZ_t_.js";import{c as tt}from"./cytoscape.esm-nFXppDBa.js";import"./index-C-zUV3mO.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Nt=Lt;export{Nt as render}; diff --git a/apps/pythinker-code/dist-web/assets/cssMode-9bWh8C7-.js b/apps/pythinker-code/dist-web/assets/cssMode-9bWh8C7-.js deleted file mode 100644 index a52e136c1..000000000 --- a/apps/pythinker-code/dist-web/assets/cssMode-9bWh8C7-.js +++ /dev/null @@ -1 +0,0 @@ -import{c as h,l as s}from"./editor.main-PjnZnl8g.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-BqLYp7da.js";import{h as H,i as y,j as U,t as T,k as x}from"./lspLanguageFeatures-BqLYp7da.js";import"./index-C-zUV3mO.js";const A=120*1e3;class C{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>A&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-uch7pA5g.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function E(o){const n=[],e=[],a=new C(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,H as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,C as WorkerManager,y as fromPosition,U as fromRange,E as setupMode,T as toRange,x as toTextEdit}; diff --git a/apps/pythinker-code/dist-web/assets/cssMode-k4cBIe4o.js b/apps/pythinker-code/dist-web/assets/cssMode-k4cBIe4o.js new file mode 100644 index 000000000..a89c46f17 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cssMode-k4cBIe4o.js @@ -0,0 +1 @@ +import{c as h,l as s}from"./editor.main-CYqrlDj5.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-CQG5isp7.js";import{h as y,i as U,j as T,t as x,k as j}from"./lspLanguageFeatures-CQG5isp7.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";const A=120*1e3;class C{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>A&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-uch7pA5g.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function L(o){const n=[],e=[],a=new C(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,y as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,C as WorkerManager,U as fromPosition,T as fromRange,L as setupMode,x as toRange,j as toTextEdit}; diff --git a/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B2xW2LGa.js b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B2xW2LGa.js new file mode 100644 index 000000000..50c2b942a --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B2xW2LGa.js @@ -0,0 +1,178 @@ +import{bR as et}from"./index-rMXX6Fbt.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}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 new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}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 r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}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(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,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,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(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})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(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})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(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"})(sf||(sf={})),(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"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +`,`\r +`,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f0&&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(),r=0,n=t.length;if(n===0)return ie.create(0,e);for(;re?n=s:r=s+1}let a=r-1;return ie.create(a,e-t[a])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1"u"}i(n,"undefined"),e.undefined=n;function a(g){return g===!0||g===!1}i(a,"boolean"),e.boolean=a;function s(g){return t.call(g)==="[object String]"}i(s,"string"),e.string=s;function o(g){return t.call(g)==="[object Number]"}i(o,"number"),e.number=o;function l(g,v,b){return t.call(g)==="[object Number]"&&v<=g&&g<=b}i(l,"numberRange"),e.numberRange=l;function u(g){return t.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}i(u,"integer"),e.integer=u;function c(g){return t.call(g)==="[object Number]"&&0<=g&&g<=2147483647}i(c,"uinteger"),e.uinteger=c;function f(g){return t.call(g)==="[object Function]"}i(f,"func"),e.func=f;function d(g){return g!==null&&typeof g=="object"}i(d,"objectLiteral"),e.objectLiteral=d;function m(g,v){return Array.isArray(g)&&g.every(v)}i(m,"typedArray"),e.typedArray=m})(A||(A={}))}}),Dn=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}i(r,"RAL"),(function(n){function a(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");t=s}i(a,"install"),n.install=a})(r||(r={})),e.default=r}}),Ms=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(u){return u===!0||u===!1}i(t,"boolean"),e.boolean=t;function r(u){return typeof u=="string"||u instanceof String}i(r,"string"),e.string=r;function n(u){return typeof u=="number"||u instanceof Number}i(n,"number"),e.number=n;function a(u){return u instanceof Error}i(a,"error"),e.error=a;function s(u){return typeof u=="function"}i(s,"func"),e.func=s;function o(u){return Array.isArray(u)}i(o,"array"),e.array=o;function l(u){return o(u)&&u.every(c=>r(c))}i(l,"stringArray"),e.stringArray=l}}),ei=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=Dn(),r;(function(s){const o={dispose(){}};s.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{i(this,"CallbackList")}add(s,o=null,l){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(l)&&l.push({dispose:i(()=>this.remove(s,o),"dispose")})}remove(s,o=null){if(!this._callbacks)return;let l=!1;for(let u=0,c=this._callbacks.length;u{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,l);const c={dispose:i(()=>{this._callbacks&&(this._callbacks.remove(o,l),c.dispose=jg._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(u)&&u.push(c),c}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=a,a._noop=function(){}}}),xl=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=Dn(),r=Ms(),n=ei(),a;(function(u){u.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),u.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(f){const d=f;return d&&(d===u.None||d===u.Cancelled||r.boolean(d.isCancellationRequested)&&!!d.onCancellationRequested)}i(c,"is"),u.is=c})(a||(e.CancellationToken=a={}));var s=Object.freeze(function(u,c){const f=(0,t.default)().timer.setTimeout(u.bind(c),0);return{dispose(){f.dispose()}}}),o=class{static{i(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{i(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}};e.CancellationTokenSource=l}}),Bg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){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 t=Ms(),r;(function(y){y.ParseError=-32700,y.InvalidRequest=-32600,y.MethodNotFound=-32601,y.InvalidParams=-32602,y.InternalError=-32603,y.jsonrpcReservedErrorRangeStart=-32099,y.serverErrorStart=-32099,y.MessageWriteError=-32099,y.MessageReadError=-32098,y.PendingResponseRejected=-32097,y.ConnectionInactive=-32096,y.ServerNotInitialized=-32002,y.UnknownErrorCode=-32001,y.jsonrpcReservedErrorRangeEnd=-32e3,y.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class Ug extends Error{static{i(this,"ResponseError")}constructor(E,T,$){super(T),this.code=t.number(E)?E:r.UnknownErrorCode,this.data=$,Object.setPrototypeOf(this,Ug.prototype)}toJson(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),E}};e.ResponseError=n;var a=class No{static{i(this,"ParameterStructures")}constructor(E){this.kind=E}static is(E){return E===No.auto||E===No.byName||E===No.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{static{i(this,"AbstractMessageSignature")}constructor(y,E){this.method=y,this.numberOfParams=E}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s;var o=class extends s{static{i(this,"RequestType0")}constructor(y){super(y,0)}};e.RequestType0=o;var l=class extends s{static{i(this,"RequestType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType=l;var u=class extends s{static{i(this,"RequestType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType1=u;var c=class extends s{static{i(this,"RequestType2")}constructor(y){super(y,2)}};e.RequestType2=c;var f=class extends s{static{i(this,"RequestType3")}constructor(y){super(y,3)}};e.RequestType3=f;var d=class extends s{static{i(this,"RequestType4")}constructor(y){super(y,4)}};e.RequestType4=d;var m=class extends s{static{i(this,"RequestType5")}constructor(y){super(y,5)}};e.RequestType5=m;var g=class extends s{static{i(this,"RequestType6")}constructor(y){super(y,6)}};e.RequestType6=g;var v=class extends s{static{i(this,"RequestType7")}constructor(y){super(y,7)}};e.RequestType7=v;var b=class extends s{static{i(this,"RequestType8")}constructor(y){super(y,8)}};e.RequestType8=b;var S=class extends s{static{i(this,"RequestType9")}constructor(y){super(y,9)}};e.RequestType9=S;var w=class extends s{static{i(this,"NotificationType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType=w;var I=class extends s{static{i(this,"NotificationType0")}constructor(y){super(y,0)}};e.NotificationType0=I;var R=class extends s{static{i(this,"NotificationType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=R;var P=class extends s{static{i(this,"NotificationType2")}constructor(y){super(y,2)}};e.NotificationType2=P;var z=class extends s{static{i(this,"NotificationType3")}constructor(y){super(y,3)}};e.NotificationType3=z;var X=class extends s{static{i(this,"NotificationType4")}constructor(y){super(y,4)}};e.NotificationType4=X;var Z=class extends s{static{i(this,"NotificationType5")}constructor(y){super(y,5)}};e.NotificationType5=Z;var ce=class extends s{static{i(this,"NotificationType6")}constructor(y){super(y,6)}};e.NotificationType6=ce;var se=class extends s{static{i(this,"NotificationType7")}constructor(y){super(y,7)}};e.NotificationType7=se;var Se=class extends s{static{i(this,"NotificationType8")}constructor(y){super(y,8)}};e.NotificationType8=Se;var k=class extends s{static{i(this,"NotificationType9")}constructor(y){super(y,9)}};e.NotificationType9=k;var C;(function(y){function E(_){const O=_;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}i(E,"isRequest"),y.isRequest=E;function T(_){const O=_;return O&&t.string(O.method)&&_.id===void 0}i(T,"isNotification"),y.isNotification=T;function $(_){const O=_;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}i($,"isResponse"),y.isResponse=$})(C||(e.Message=C={}))}}),Kg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(r||(e.Touch=r={}));var n=class{static{i(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=r.None){const l=this._map.get(s);if(l)return o!==r.None&&this.touch(l,o),l.value}set(s,o,l=r.None){let u=this._map.get(s);if(u)u.value=o,l!==r.None&&this.touch(u,l);else{switch(u={key:s,value:o,next:void 0,previous:void 0},l){case r.None:this.addItemLast(u);break;case r.First:this.addItemFirst(u);break;case r.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const l=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==l)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}values(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}entries(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,l=this.size;for(;o&&l>s;)this._map.delete(o.key),o=o.next,l--;this._head=o,this._size=l,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,l=s.previous;if(!o||!l)throw new Error("Invalid list");o.previous=l,l.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(s===this._head)return;const l=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(l.previous=u,u.next=l),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===r.Last){if(s===this._tail)return;const l=s.next,u=s.previous;s===this._head?(l.previous=void 0,this._head=l):(l.previous=u,u.next=l),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,l)=>{s.push([l,o])}),s}fromJSON(s){this.clear();for(const[o,l]of s)this.set(o,l)}};e.LinkedMap=n;var a=class extends n{static{i(this,"LRUCache")}constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=r.AsNew){return super.get(s,o)}peek(s){return super.get(s,r.None)}set(s,o){return super.set(s,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=a}}),_I=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(a){return{dispose:a}}i(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),SI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=xl(),r;(function(l){l.Continue=0,l.Cancelled=1})(r||(r={}));var n=class{static{i(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=r.Continue,this.buffers.set(l.id,u),l.$cancellationData=u}async sendCancellation(l,u){const c=this.buffers.get(u);if(c===void 0)return;const f=new Int32Array(c,0,1);Atomics.store(f,0,r.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var a=class{static{i(this,"SharedArrayBufferCancellationToken")}constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{static{i(this,"SharedArrayBufferCancellationTokenSource")}constructor(l){this.token=new a(l)}cancel(){}dispose(){}},o=class{static{i(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(l){const u=l.$cancellationData;return u===void 0?new t.CancellationTokenSource:new s(u)}};e.SharedArrayReceiverStrategy=o}}),Wg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=Dn(),r=class{static{i(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((a,s)=>{this._waiting.push({thunk:n,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=n.thunk();a instanceof Promise?a.then(s=>{this._active--,n.resolve(s),this.runNext()},s=>{this._active--,n.reject(s),this.runNext()}):(this._active--,n.resolve(a),this.runNext())}catch(a){this._active--,n.reject(a),this.runNext()}}};e.Semaphore=r}}),wI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=Dn(),r=Ms(),n=ei(),a=Wg(),s;(function(c){function f(d){let m=d;return m&&r.func(m.listen)&&r.func(m.dispose)&&r.func(m.onError)&&r.func(m.onClose)&&r.func(m.onPartialMessage)}i(f,"is"),c.is=f})(s||(e.MessageReader=s={}));var o=class{static{i(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${r.string(c.message)?c.message:"unknown"}`)}};e.AbstractMessageReader=o;var l;(function(c){function f(d){let m,g;const v=new Map;let b;const S=new Map;if(d===void 0||typeof d=="string")m=d??"utf-8";else{if(m=d.charset??"utf-8",d.contentDecoder!==void 0&&(g=d.contentDecoder,v.set(g.name,g)),d.contentDecoders!==void 0)for(const w of d.contentDecoders)v.set(w.name,w);if(d.contentTypeDecoder!==void 0&&(b=d.contentTypeDecoder,S.set(b.name,b)),d.contentTypeDecoders!==void 0)for(const w of d.contentTypeDecoders)S.set(w.name,w)}return b===void 0&&(b=(0,t.default)().applicationJson.decoder,S.set(b.name,b)),{charset:m,contentDecoder:g,contentDecoders:v,contentTypeDecoder:b,contentTypeDecoders:S}}i(f,"fromOptions"),c.fromOptions=f})(l||(l={}));var u=class extends o{static{i(this,"ReadableStreamMessageReader")}constructor(c,f){super(),this.readable=c,this.options=l.fromOptions(f),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const f=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),f}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const m=d.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(d))}`));return}const g=parseInt(m);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=g}const f=this.buffer.tryReadBody(this.nextMessageLength);if(f===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(f):f,m=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(m)}).catch(d=>{this.fireError(d)})}}catch(f){this.fireError(f)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,f)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:f}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=u}}),II=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=Dn(),r=Ms(),n=Wg(),a=ei(),s="Content-Length: ",o=`\r +`,l;(function(d){function m(g){let v=g;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}i(m,"is"),d.is=m})(l||(e.MessageWriter=l={}));var u=class{static{i(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,m,g){this.errorEmitter.fire([this.asError(d),m,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${r.string(d.message)?d.message:"unknown"}`)}};e.AbstractMessageWriter=u;var c;(function(d){function m(g){return g===void 0||typeof g=="string"?{charset:g??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:g.charset??"utf-8",contentEncoder:g.contentEncoder,contentTypeEncoder:g.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}i(m,"fromOptions"),d.fromOptions=m})(c||(c={}));var f=class extends u{static{i(this,"WriteableStreamMessageWriter")}constructor(d,m){super(),this.writable=d,this.options=c.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const v=[];return v.push(s,g.byteLength.toString(),o),v.push(o),this.doWrite(d,v,g)},g=>{throw this.fireError(g),g}))}async doWrite(d,m,g){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(g)}catch(v){return this.handleError(v,d),Promise.reject(v)}}handleError(d,m){this.errorCount++,this.fireError(d,m,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=f}}),NI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r +`,a=class{static{i(this,"AbstractMessageBuffer")}constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,l=0,u=0,c=0;e:for(;lthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],f=this.asNative(c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,f}const o=this.allocNative(s);let l=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const f=c.slice(0,s);o.set(f,l),l+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else o.set(c,l),l+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return o}};e.AbstractMessageBuffer=a}}),PI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=Dn(),r=Ms(),n=Bg(),a=Kg(),s=ei(),o=xl(),l;(function(y){y.type=new n.NotificationType("$/cancelRequest")})(l||(l={}));var u;(function(y){function E(T){return typeof T=="string"||typeof T=="number"}i(E,"is"),y.is=E})(u||(e.ProgressToken=u={}));var c;(function(y){y.type=new n.NotificationType("$/progress")})(c||(c={}));var f=class{static{i(this,"ProgressType")}constructor(){}};e.ProgressType=f;var d;(function(y){function E(T){return r.func(T)}i(E,"is"),y.is=E})(d||(d={})),e.NullLogger=Object.freeze({error:i(()=>{},"error"),warn:i(()=>{},"warn"),info:i(()=>{},"info"),log:i(()=>{},"log")});var m;(function(y){y[y.Off=0]="Off",y[y.Messages=1]="Messages",y[y.Compact=2]="Compact",y[y.Verbose=3]="Verbose"})(m||(e.Trace=m={}));var g;(function(y){y.Off="off",y.Messages="messages",y.Compact="compact",y.Verbose="verbose"})(g||(e.TraceValues=g={})),(function(y){function E($){if(!r.string($))return y.Off;switch($=$.toLowerCase(),$){case"off":return y.Off;case"messages":return y.Messages;case"compact":return y.Compact;case"verbose":return y.Verbose;default:return y.Off}}i(E,"fromString"),y.fromString=E;function T($){switch($){case y.Off:return"off";case y.Messages:return"messages";case y.Compact:return"compact";case y.Verbose:return"verbose";default:return"off"}}i(T,"toString"),y.toString=T})(m||(e.Trace=m={}));var v;(function(y){y.Text="text",y.JSON="json"})(v||(e.TraceFormat=v={})),(function(y){function E(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?y.JSON:y.Text):y.Text}i(E,"fromString"),y.fromString=E})(v||(e.TraceFormat=v={}));var b;(function(y){y.type=new n.NotificationType("$/setTrace")})(b||(e.SetTraceNotification=b={}));var S;(function(y){y.type=new n.NotificationType("$/logTrace")})(S||(e.LogTraceNotification=S={}));var w;(function(y){y[y.Closed=1]="Closed",y[y.Disposed=2]="Disposed",y[y.AlreadyListening=3]="AlreadyListening"})(w||(e.ConnectionErrors=w={}));var I=class Vg extends Error{static{i(this,"ConnectionError")}constructor(E,T){super(T),this.code=E,Object.setPrototypeOf(this,Vg.prototype)}};e.ConnectionError=I;var R;(function(y){function E(T){const $=T;return $&&r.func($.cancelUndispatched)}i(E,"is"),y.is=E})(R||(e.ConnectionStrategy=R={}));var P;(function(y){function E(T){const $=T;return $&&($.kind===void 0||$.kind==="id")&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(P||(e.IdCancellationReceiverStrategy=P={}));var z;(function(y){function E(T){const $=T;return $&&$.kind==="request"&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(z||(e.RequestCancellationReceiverStrategy=z={}));var X;(function(y){y.Message=Object.freeze({createCancellationTokenSource(T){return new o.CancellationTokenSource}});function E(T){return P.is(T)||z.is(T)}i(E,"is"),y.is=E})(X||(e.CancellationReceiverStrategy=X={}));var Z;(function(y){y.Message=Object.freeze({sendCancellation(T,$){return T.sendNotification(l.type,{id:$})},cleanup(T){}});function E(T){const $=T;return $&&r.func($.sendCancellation)&&r.func($.cleanup)}i(E,"is"),y.is=E})(Z||(e.CancellationSenderStrategy=Z={}));var ce;(function(y){y.Message=Object.freeze({receiver:X.Message,sender:Z.Message});function E(T){const $=T;return $&&X.is($.receiver)&&Z.is($.sender)}i(E,"is"),y.is=E})(ce||(e.CancellationStrategy=ce={}));var se;(function(y){function E(T){const $=T;return $&&r.func($.handleMessage)}i(E,"is"),y.is=E})(se||(e.MessageStrategy=se={}));var Se;(function(y){function E(T){const $=T;return $&&(ce.is($.cancellationStrategy)||R.is($.connectionStrategy)||se.is($.messageStrategy))}i(E,"is"),y.is=E})(Se||(e.ConnectionOptions=Se={}));var k;(function(y){y[y.New=1]="New",y[y.Listening=2]="Listening",y[y.Closed=3]="Closed",y[y.Disposed=4]="Disposed"})(k||(k={}));function C(y,E,T,$){const _=T!==void 0?T:e.NullLogger;let O=0,x=0,D=0;const G="2.0";let W;const Y=new Map;let V;const Pe=new Map,oe=new Map;let Le,De=new a.LinkedMap,ke=new Map,Ze=new Set,Je=new Map,ne=m.Off,Kt=v.Text,Ee,kt=k.New;const ra=new s.Emitter,fi=new s.Emitter,di=new s.Emitter,pi=new s.Emitter,mi=new s.Emitter,Ot=$&&$.cancellationStrategy?$.cancellationStrategy:ce.Message;function na(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}i(na,"createRequestQueueKey");function hi(h){return h===null?"res-unknown-"+(++D).toString():"res-"+h.toString()}i(hi,"createResponseQueueKey");function yi(){return"not-"+(++x).toString()}i(yi,"createNotificationQueueKey");function gi(h,N){n.Message.isRequest(N)?h.set(na(N.id),N):n.Message.isResponse(N)?h.set(hi(N.id),N):h.set(yi(),N)}i(gi,"addMessageToQueue");function vi(h){}i(vi,"cancelUndispatched");function aa(){return kt===k.Listening}i(aa,"isListening");function ia(){return kt===k.Closed}i(ia,"isClosed");function Wt(){return kt===k.Disposed}i(Wt,"isDisposed");function sa(){(kt===k.New||kt===k.Listening)&&(kt=k.Closed,fi.fire(void 0))}i(sa,"closeHandler");function Ti(h){ra.fire([h,void 0,void 0])}i(Ti,"readErrorHandler");function $i(h){ra.fire(h)}i($i,"writeErrorHandler"),y.onClose(sa),y.onError(Ti),E.onClose(sa),E.onError($i);function oa(){Le||De.size===0||(Le=(0,t.default)().timer.setImmediate(()=>{Le=void 0,Ri()}))}i(oa,"triggerMessageQueue");function la(h){n.Message.isRequest(h)?Ai(h):n.Message.isNotification(h)?Ci(h):n.Message.isResponse(h)?Ei(h):bi(h)}i(la,"handleMessage");function Ri(){if(De.size===0)return;const h=De.shift();try{const N=$?.messageStrategy;se.is(N)?N.handleMessage(h,la):la(h)}finally{oa()}}i(Ri,"processMessageQueue");const no=i(h=>{try{if(n.Message.isNotification(h)&&h.method===l.type.method){const N=h.params.id,L=na(N),M=De.get(L);if(n.Message.isRequest(M)){const fe=$?.connectionStrategy,Ce=fe&&fe.cancelUndispatched?fe.cancelUndispatched(M,vi):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){De.delete(L),Je.delete(N),Ce.id=M.id,Lr(Ce,h.method,Date.now()),E.write(Ce).catch(()=>_.error("Sending response for canceled message failed."));return}}const he=Je.get(N);if(he!==void 0){he.cancel(),Jr(h);return}else Ze.add(N)}gi(De,h)}finally{oa()}},"callback");function Ai(h){if(Wt())return;function N(te,$e,le){const xe={jsonrpc:G,id:h.id};te instanceof n.ResponseError?xe.error=te.toJson():xe.result=te===void 0?null:te,Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(N,"reply");function L(te,$e,le){const xe={jsonrpc:G,id:h.id,error:te.toJson()};Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(L,"replyError");function M(te,$e,le){te===void 0&&(te=null);const xe={jsonrpc:G,id:h.id,result:te};Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(M,"replySuccess"),wi(h);const he=Y.get(h.method);let fe,Ce;he&&(fe=he.type,Ce=he.handler);const we=Date.now();if(Ce||W){const te=h.id??String(Date.now()),$e=P.is(Ot.receiver)?Ot.receiver.createCancellationTokenSource(te):Ot.receiver.createCancellationTokenSource(h);h.id!==null&&Ze.has(h.id)&&$e.cancel(),h.id!==null&&Je.set(te,$e);try{let le;if(Ce)if(h.params===void 0){if(fe!==void 0&&fe.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines ${fe.numberOfParams} params but received none.`),h.method,we);return}le=Ce($e.token)}else if(Array.isArray(h.params)){if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,we);return}le=Ce(...h.params,$e.token)}else{if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,we);return}le=Ce(h.params,$e.token)}else W&&(le=W(h.method,h.params,$e.token));const xe=le;le?xe.then?xe.then(Qe=>{Je.delete(te),N(Qe,h.method,we)},Qe=>{Je.delete(te),Qe instanceof n.ResponseError?L(Qe,h.method,we):Qe&&r.string(Qe.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${Qe.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}):(Je.delete(te),N(le,h.method,we)):(Je.delete(te),M(le,h.method,we))}catch(le){Je.delete(te),le instanceof n.ResponseError?N(le,h.method,we):le&&r.string(le.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${le.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,we)}i(Ai,"handleRequest");function Ei(h){if(!Wt())if(h.id===null)h.error?_.error(`Received response message without id: Error is: +${JSON.stringify(h.error,void 0,4)}`):_.error("Received response message without id. No further error information provided.");else{const N=h.id,L=ke.get(N);if(Ii(h,L),L!==void 0){ke.delete(N);try{if(h.error){const M=h.error;L.reject(new n.ResponseError(M.code,M.message,M.data))}else if(h.result!==void 0)L.resolve(h.result);else throw new Error("Should never happen.")}catch(M){M.message?_.error(`Response handler '${L.method}' failed with message: ${M.message}`):_.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}i(Ei,"handleResponse");function Ci(h){if(Wt())return;let N,L;if(h.method===l.type.method){const M=h.params.id;Ze.delete(M),Jr(h);return}else{const M=Pe.get(h.method);M&&(L=M.handler,N=M.type)}if(L||V)try{if(Jr(h),L)if(h.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received none.`),L();else if(Array.isArray(h.params)){const M=h.params;h.method===c.type.method&&M.length===2&&u.is(M[0])?L({token:M[0],value:M[1]}):(N!==void 0&&(N.parameterStructures===n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines parameters by name but received parameters by position`),N.numberOfParams!==h.params.length&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received ${M.length} arguments`)),L(...M))}else N!==void 0&&N.parameterStructures===n.ParameterStructures.byPosition&&_.error(`Notification ${h.method} defines parameters by position but received parameters by name`),L(h.params);else V&&V(h.method,h.params)}catch(M){M.message?_.error(`Notification handler '${h.method}' failed with message: ${M.message}`):_.error(`Notification handler '${h.method}' failed unexpectedly.`)}else di.fire(h)}i(Ci,"handleNotification");function bi(h){if(!h){_.error("Received empty message.");return}_.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(h,null,4)}`);const N=h;if(r.string(N.id)||r.number(N.id)){const L=N.id,M=ke.get(L);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}i(bi,"handleInvalidMessage");function bt(h){if(h!=null)switch(ne){case m.Verbose:return JSON.stringify(h,null,4);case m.Compact:return JSON.stringify(h);default:return}}i(bt,"stringifyTrace");function _i(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${bt(h.params)} + +`),Ee.log(`Sending request '${h.method} - (${h.id})'.`,N)}else Vt("send-request",h)}i(_i,"traceSendingRequest");function Si(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${bt(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Sending notification '${h.method}'.`,N)}else Vt("send-notification",h)}i(Si,"traceSendingNotification");function Lr(h,N,L){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let M;(ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?M=`Error data: ${bt(h.error.data)} + +`:h.result?M=`Result: ${bt(h.result)} + +`:h.error===void 0&&(M=`No result returned. + +`)),Ee.log(`Sending response '${N} - (${h.id})'. Processing request took ${Date.now()-L}ms`,M)}else Vt("send-response",h)}i(Lr,"traceSendingResponse");function wi(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${bt(h.params)} + +`),Ee.log(`Received request '${h.method} - (${h.id})'.`,N)}else Vt("receive-request",h)}i(wi,"traceReceivedRequest");function Jr(h){if(!(ne===m.Off||!Ee||h.method===S.type.method))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${bt(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Received notification '${h.method}'.`,N)}else Vt("receive-notification",h)}i(Jr,"traceReceivedNotification");function Ii(h,N){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let L;if((ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?L=`Error data: ${bt(h.error.data)} + +`:h.result?L=`Result: ${bt(h.result)} + +`:h.error===void 0&&(L=`No result returned. + +`)),N){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";Ee.log(`Received response '${N.method} - (${h.id})' in ${Date.now()-N.timerStart}ms.${M}`,L)}else Ee.log(`Received response ${h.id} without active response promise.`,L)}else Vt("receive-response",h)}i(Ii,"traceReceivedResponse");function Vt(h,N){if(!Ee||ne===m.Off)return;const L={isLSPMessage:!0,type:h,message:N,timestamp:Date.now()};Ee.log(L)}i(Vt,"logLSPMessage");function cr(){if(ia())throw new I(w.Closed,"Connection is closed.");if(Wt())throw new I(w.Disposed,"Connection is disposed.")}i(cr,"throwIfClosedOrDisposed");function Ni(){if(aa())throw new I(w.AlreadyListening,"Connection is already listening")}i(Ni,"throwIfListening");function Pi(){if(!aa())throw new Error("Call listen() first.")}i(Pi,"throwIfNotListening");function fr(h){return h===void 0?null:h}i(fr,"undefinedToNull");function ua(h){if(h!==null)return h}i(ua,"nullToUndefined");function p(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}i(p,"isNamedParam");function ae(h,N){switch(h){case n.ParameterStructures.auto:return p(N)?ua(N):[fr(N)];case n.ParameterStructures.byName:if(!p(N))throw new Error("Received parameters by name but param is not an object literal.");return ua(N);case n.ParameterStructures.byPosition:return[fr(N)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}i(ae,"computeSingleParam");function Te(h,N){let L;const M=h.numberOfParams;switch(M){case 0:L=void 0;break;case 1:L=ae(h.parameterStructures,N[0]);break;default:L=[];for(let he=0;he{cr();let L,M;if(r.string(h)){L=h;const fe=N[0];let Ce=0,we=n.ParameterStructures.auto;n.ParameterStructures.is(fe)&&(Ce=1,we=fe);let te=N.length;const $e=te-Ce;switch($e){case 0:M=void 0;break;case 1:M=ae(we,N[Ce]);break;default:if(we===n.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);M=N.slice(Ce,te).map(le=>fr(le));break}}else{const fe=N;L=h.method,M=Te(h,fe)}const he={jsonrpc:G,method:L,params:M};return Si(he),E.write(he).catch(fe=>{throw _.error("Sending notification failed."),fe})},"sendNotification"),onNotification:i((h,N)=>{cr();let L;return r.func(h)?V=h:N&&(r.string(h)?(L=h,Pe.set(h,{type:void 0,handler:N})):(L=h.method,Pe.set(h.method,{type:h,handler:N}))),{dispose:i(()=>{L!==void 0?Pe.delete(L):V=void 0},"dispose")}},"onNotification"),onProgress:i((h,N,L)=>{if(oe.has(N))throw new Error(`Progress handler for token ${N} already registered`);return oe.set(N,L),{dispose:i(()=>{oe.delete(N)},"dispose")}},"onProgress"),sendProgress:i((h,N,L)=>q.sendNotification(c.type,{token:N,value:L}),"sendProgress"),onUnhandledProgress:pi.event,sendRequest:i((h,...N)=>{cr(),Pi();let L,M,he;if(r.string(h)){L=h;const te=N[0],$e=N[N.length-1];let le=0,xe=n.ParameterStructures.auto;n.ParameterStructures.is(te)&&(le=1,xe=te);let Qe=N.length;o.CancellationToken.is($e)&&(Qe=Qe-1,he=$e);const qt=Qe-le;switch(qt){case 0:M=void 0;break;case 1:M=ae(xe,N[le]);break;default:if(xe===n.ParameterStructures.byName)throw new Error(`Received ${qt} parameters for 'by Name' request parameter structure.`);M=N.slice(le,Qe).map($I=>fr($I));break}}else{const te=N;L=h.method,M=Te(h,te);const $e=h.numberOfParams;he=o.CancellationToken.is(te[$e])?te[$e]:void 0}const fe=O++;let Ce;he&&(Ce=he.onCancellationRequested(()=>{const te=Ot.sender.sendCancellation(q,fe);return te===void 0?(_.log(`Received no promise from cancellation strategy when cancelling id ${fe}`),Promise.resolve()):te.catch(()=>{_.log(`Sending cancellation messages for id ${fe} failed`)})}));const we={jsonrpc:G,id:fe,method:L,params:M};return _i(we),typeof Ot.sender.enableCancellation=="function"&&Ot.sender.enableCancellation(we),new Promise(async(te,$e)=>{const le=i(qt=>{te(qt),Ot.sender.cleanup(fe),Ce?.dispose()},"resolveWithCleanup"),xe=i(qt=>{$e(qt),Ot.sender.cleanup(fe),Ce?.dispose()},"rejectWithCleanup"),Qe={method:L,timerStart:Date.now(),resolve:le,reject:xe};try{await E.write(we),ke.set(fe,Qe)}catch(qt){throw _.error("Sending request failed."),Qe.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,qt.message?qt.message:"Unknown reason")),qt}})},"sendRequest"),onRequest:i((h,N)=>{cr();let L=null;return d.is(h)?(L=void 0,W=h):r.string(h)?(L=null,N!==void 0&&(L=h,Y.set(h,{handler:N,type:void 0}))):N!==void 0&&(L=h.method,Y.set(h.method,{type:h,handler:N})),{dispose:i(()=>{L!==null&&(L!==void 0?Y.delete(L):W=void 0)},"dispose")}},"onRequest"),hasPendingResponse:i(()=>ke.size>0,"hasPendingResponse"),trace:i(async(h,N,L)=>{let M=!1,he=v.Text;L!==void 0&&(r.boolean(L)?M=L:(M=L.sendNotification||!1,he=L.traceFormat||v.Text)),ne=h,Kt=he,ne===m.Off?Ee=void 0:Ee=N,M&&!ia()&&!Wt()&&await q.sendNotification(b.type,{value:m.toString(h)})},"trace"),onError:ra.event,onClose:fi.event,onUnhandledNotification:di.event,onDispose:mi.event,end:i(()=>{E.end()},"end"),dispose:i(()=>{if(Wt())return;kt=k.Disposed,mi.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const N of ke.values())N.reject(h);ke=new Map,Je=new Map,Ze=new Set,De=new a.LinkedMap,r.func(E.dispose)&&E.dispose(),r.func(y.dispose)&&y.dispose()},"dispose"),listen:i(()=>{cr(),Ni(),kt=k.Listening,y.listen(no)},"listen"),inspect:i(()=>{(0,t.default)().console.log("inspect")},"inspect")};return q.onNotification(S.type,h=>{if(ne===m.Off||!Ee)return;const N=ne===m.Verbose||ne===m.Compact;Ee.log(h.message,N?h.verbose:void 0)}),q.onNotification(c.type,h=>{const N=oe.get(h.token);N?N(h.value):pi.fire(h)}),q}i(C,"createMessageConnection"),e.createMessageConnection=C}}),Af=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=Bg();Object.defineProperty(e,"Message",{enumerable:!0,get:i(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:i(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:i(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:i(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:i(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:i(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:i(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:i(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:i(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:i(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:i(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:i(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:i(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:i(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:i(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:i(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:i(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:i(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:i(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:i(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:i(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:i(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:i(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:i(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:i(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:i(function(){return t.ParameterStructures},"get")});var r=Kg();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:i(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:i(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:i(function(){return r.Touch},"get")});var n=_I();Object.defineProperty(e,"Disposable",{enumerable:!0,get:i(function(){return n.Disposable},"get")});var a=ei();Object.defineProperty(e,"Event",{enumerable:!0,get:i(function(){return a.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:i(function(){return a.Emitter},"get")});var s=xl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:i(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:i(function(){return s.CancellationToken},"get")});var o=SI();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:i(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:i(function(){return o.SharedArrayReceiverStrategy},"get")});var l=wI();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:i(function(){return l.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:i(function(){return l.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:i(function(){return l.ReadableStreamMessageReader},"get")});var u=II();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:i(function(){return u.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:i(function(){return u.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:i(function(){return u.WriteableStreamMessageWriter},"get")});var c=NI();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:i(function(){return c.AbstractMessageBuffer},"get")});var f=PI();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:i(function(){return f.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:i(function(){return f.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:i(function(){return f.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:i(function(){return f.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:i(function(){return f.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:i(function(){return f.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:i(function(){return f.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:i(function(){return f.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:i(function(){return f.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:i(function(){return f.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:i(function(){return f.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:i(function(){return f.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:i(function(){return f.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:i(function(){return f.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:i(function(){return f.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:i(function(){return f.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:i(function(){return f.MessageStrategy},"get")});var d=Dn();e.RAL=d.default}}),kI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Af(),r=class qg extends t.AbstractMessageBuffer{static{i(this,"MessageBuffer")}constructor(c="utf-8"){super(c),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return qg.emptyBuffer}fromString(c,f){return new TextEncoder().encode(c)}toString(c,f){return f==="ascii"?this.asciiDecoder.decode(c):new TextDecoder(f).decode(c)}asNative(c,f){return f===void 0?c:c.slice(0,f)}allocNative(c){return new Uint8Array(c)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{i(this,"ReadableStreamWrapper")}constructor(u){this.socket=u,this._onData=new t.Emitter,this._messageListener=c=>{c.data.arrayBuffer().then(d=>{this._onData.fire(new Uint8Array(d))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}onData(u){return this._onData.event(u)}},a=class{static{i(this,"WritableStreamWrapper")}constructor(u){this.socket=u}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}write(u,c){if(typeof u=="string"){if(c!==void 0&&c!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c}`);this.socket.send(u)}else this.socket.send(u);return Promise.resolve()}end(){this.socket.close()}},s=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:i(u=>new r(u),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:i((u,c)=>{if(c.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c.charset}`);return Promise.resolve(s.encode(JSON.stringify(u,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:i((u,c)=>{if(!(u instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(c.charset).decode(u)))},"decode")})}),stream:Object.freeze({asReadableStream:i(u=>new n(u),"asReadableStream"),asWritableStream:i(u=>new a(u),"asWritableStream")}),console,timer:Object.freeze({setTimeout(u,c,...f){const d=setTimeout(u,c,...f);return{dispose:i(()=>clearTimeout(d),"dispose")}},setImmediate(u,...c){const f=setTimeout(u,0,...c);return{dispose:i(()=>clearTimeout(f),"dispose")}},setInterval(u,c,...f){const d=setInterval(u,c,...f);return{dispose:i(()=>clearInterval(d),"dispose")}}})});function l(){return o}i(l,"RIL"),(function(u){function c(){t.RAL.install(o)}i(c,"install"),u.install=c})(l||(l={})),e.default=l}}),ti=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(u,c,f,d){d===void 0&&(d=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:i(function(){return c[f]},"get")}),Object.defineProperty(u,d,m)}):(function(u,c,f,d){d===void 0&&(d=f),u[d]=c[f]})),r=e&&e.__exportStar||function(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&t(c,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=kI();n.default.install();var a=Af();r(Af(),e);var s=class extends a.AbstractMessageReader{static{i(this,"BrowserMessageReader")}constructor(u){super(),this._onData=new a.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},u.addEventListener("error",c=>this.fireError(c)),u.onmessage=this._messageListener}listen(u){return this._onData.event(u)}};e.BrowserMessageReader=s;var o=class extends a.AbstractMessageWriter{static{i(this,"BrowserMessageWriter")}constructor(u){super(),this.port=u,this.errorCount=0,u.addEventListener("error",c=>this.fireError(c))}write(u){try{return this.port.postMessage(u),Promise.resolve()}catch(c){return this.handleError(c,u),Promise.reject(c)}}handleError(u,c){this.errorCount++,this.fireError(u,c,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function l(u,c,f,d){return f===void 0&&(f=a.NullLogger),a.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,a.createMessageConnection)(u,c,f,d)}i(l,"createMessageConnection"),e.createMessageConnection=l}}),uh=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){t.exports=ti()}}),Ae=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=ti(),r;(function(u){u.clientToServer="clientToServer",u.serverToClient="serverToClient",u.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{i(this,"RegistrationType")}constructor(u){this.method=u}};e.RegistrationType=n;var a=class extends t.RequestType0{static{i(this,"ProtocolRequestType0")}constructor(u){super(u)}};e.ProtocolRequestType0=a;var s=class extends t.RequestType{static{i(this,"ProtocolRequestType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolRequestType=s;var o=class extends t.NotificationType0{static{i(this,"ProtocolNotificationType0")}constructor(u){super(u)}};e.ProtocolNotificationType0=o;var l=class extends t.NotificationType{static{i(this,"ProtocolNotificationType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolNotificationType=l}}),_d=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(f){return f===!0||f===!1}i(t,"boolean"),e.boolean=t;function r(f){return typeof f=="string"||f instanceof String}i(r,"string"),e.string=r;function n(f){return typeof f=="number"||f instanceof Number}i(n,"number"),e.number=n;function a(f){return f instanceof Error}i(a,"error"),e.error=a;function s(f){return typeof f=="function"}i(s,"func"),e.func=s;function o(f){return Array.isArray(f)}i(o,"array"),e.array=o;function l(f){return o(f)&&f.every(d=>r(d))}i(l,"stringArray"),e.stringArray=l;function u(f,d){return Array.isArray(f)&&f.every(d)}i(u,"typedArray"),e.typedArray=u;function c(f){return f!==null&&typeof f=="object"}i(c,"objectLiteral"),e.objectLiteral=c}}),OI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),LI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),DI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ae(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),xI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ae(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),MI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.ColorPresentationRequest=n={}))}}),GI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),FI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),zI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),jI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=ti(),r=Ae(),n;(function(o){o.type=new t.ProgressType;function l(u){return u===o.type}i(l,"is"),o.is=l})(n||(e.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(e.WorkDoneProgressCreateRequest=a={}));var s;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(s||(e.WorkDoneProgressCancelNotification=s={}))}}),BI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var a;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.CallHierarchyOutgoingCallsRequest=a={}))}}),UI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ae(),r;(function(u){u.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(u){u.method="textDocument/semanticTokens",u.type=new t.RegistrationType(u.method)})(n||(e.SemanticTokensRegistrationType=n={}));var a;(function(u){u.method="textDocument/semanticTokens/full",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(a||(e.SemanticTokensRequest=a={}));var s;(function(u){u.method="textDocument/semanticTokens/full/delta",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(s||(e.SemanticTokensDeltaRequest=s={}));var o;(function(u){u.method="textDocument/semanticTokens/range",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var l;(function(u){u.method="workspace/semanticTokens/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)})(l||(e.SemanticTokensRefreshRequest=l={}))}}),KI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ae(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),WI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),VI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(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=Ae(),r;(function(c){c.file="file",c.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(e.WillCreateFilesRequest=n={}));var a;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(a||(e.DidCreateFilesNotification=a={}));var s;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(s||(e.WillRenameFilesRequest=s={}));var o;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(e.DidRenameFilesNotification=o={}));var l;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(l||(e.DidDeleteFilesNotification=l={}));var u;(function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(u||(e.WillDeleteFilesRequest=u={}))}}),qI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ae(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(e.MonikerKind=n={}));var a;(function(s){s.method="textDocument/moniker",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.MonikerRequest=a={}))}}),HI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var a;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.TypeHierarchySubtypesRequest=a={}))}}),YI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),XI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.InlayHintResolveRequest=n={}));var a;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)})(a||(e.InlayHintRefreshRequest=a={}))}}),JI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=ti(),r=_d(),n=Ae(),a;(function(c){function f(d){const m=d;return m&&r.boolean(m.retriggerRequest)}i(f,"is"),c.is=f})(a||(e.DiagnosticServerCancellationData=a={}));var s;(function(c){c.Full="full",c.Unchanged="unchanged"})(s||(e.DocumentDiagnosticReportKind=s={}));var o;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var l;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(l||(e.WorkspaceDiagnosticRequest=l={}));var u;(function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(u||(e.DiagnosticRefreshRequest=u={}))}}),ZI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){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 t=(xs(),bd(Dl)),r=_d(),n=Ae(),a;(function(v){v.Markup=1,v.Code=2;function b(S){return S===1||S===2}i(b,"is"),v.is=b})(a||(e.NotebookCellKind=a={}));var s;(function(v){function b(I,R){const P={executionOrder:I};return(R===!0||R===!1)&&(P.success=R),P}i(b,"create"),v.create=b;function S(I){const R=I;return r.objectLiteral(R)&&t.uinteger.is(R.executionOrder)&&(R.success===void 0||r.boolean(R.success))}i(S,"is"),v.is=S;function w(I,R){return I===R?!0:I==null||R===null||R===void 0?!1:I.executionOrder===R.executionOrder&&I.success===R.success}i(w,"equals"),v.equals=w})(s||(e.ExecutionSummary=s={}));var o;(function(v){function b(R,P){return{kind:R,document:P}}i(b,"create"),v.create=b;function S(R){const P=R;return r.objectLiteral(P)&&a.is(P.kind)&&t.DocumentUri.is(P.document)&&(P.metadata===void 0||r.objectLiteral(P.metadata))}i(S,"is"),v.is=S;function w(R,P){const z=new Set;return R.document!==P.document&&z.add("document"),R.kind!==P.kind&&z.add("kind"),R.executionSummary!==P.executionSummary&&z.add("executionSummary"),(R.metadata!==void 0||P.metadata!==void 0)&&!I(R.metadata,P.metadata)&&z.add("metadata"),(R.executionSummary!==void 0||P.executionSummary!==void 0)&&!s.equals(R.executionSummary,P.executionSummary)&&z.add("executionSummary"),z}i(w,"diff"),v.diff=w;function I(R,P){if(R===P)return!0;if(R==null||P===null||P===void 0||typeof R!=typeof P||typeof R!="object")return!1;const z=Array.isArray(R),X=Array.isArray(P);if(z!==X)return!1;if(z&&X){if(R.length!==P.length)return!1;for(let Z=0;Z0}i(ae,"hasId"),p.hasId=ae})(O||(e.StaticRegistrationOptions=O={}));var x;(function(p){function ae(Te){const q=Te;return q&&(q.documentSelector===null||C.is(q.documentSelector))}i(ae,"is"),p.is=ae})(x||(e.TextDocumentRegistrationOptions=x={}));var D;(function(p){function ae(q){const h=q;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}i(ae,"is"),p.is=ae;function Te(q){const h=q;return h&&n.boolean(h.workDoneProgress)}i(Te,"hasWorkDoneProgress"),p.hasWorkDoneProgress=Te})(D||(e.WorkDoneProgressOptions=D={}));var G;(function(p){p.method="initialize",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(G||(e.InitializeRequest=G={}));var W;(function(p){p.unknownProtocolVersion=1})(W||(e.InitializeErrorCodes=W={}));var Y;(function(p){p.method="initialized",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Y||(e.InitializedNotification=Y={}));var V;(function(p){p.method="shutdown",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType0(p.method)})(V||(e.ShutdownRequest=V={}));var Pe;(function(p){p.method="exit",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType0(p.method)})(Pe||(e.ExitNotification=Pe={}));var oe;(function(p){p.method="workspace/didChangeConfiguration",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(oe||(e.DidChangeConfigurationNotification=oe={}));var Le;(function(p){p.Error=1,p.Warning=2,p.Info=3,p.Log=4,p.Debug=5})(Le||(e.MessageType=Le={}));var De;(function(p){p.method="window/showMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(De||(e.ShowMessageNotification=De={}));var ke;(function(p){p.method="window/showMessageRequest",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType(p.method)})(ke||(e.ShowMessageRequest=ke={}));var Ze;(function(p){p.method="window/logMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Ze||(e.LogMessageNotification=Ze={}));var Je;(function(p){p.method="telemetry/event",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Je||(e.TelemetryEventNotification=Je={}));var ne;(function(p){p.None=0,p.Full=1,p.Incremental=2})(ne||(e.TextDocumentSyncKind=ne={}));var Kt;(function(p){p.method="textDocument/didOpen",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Kt||(e.DidOpenTextDocumentNotification=Kt={}));var Ee;(function(p){function ae(q){let h=q;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}i(ae,"isIncremental"),p.isIncremental=ae;function Te(q){let h=q;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}i(Te,"isFull"),p.isFull=Te})(Ee||(e.TextDocumentContentChangeEvent=Ee={}));var kt;(function(p){p.method="textDocument/didChange",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(kt||(e.DidChangeTextDocumentNotification=kt={}));var ra;(function(p){p.method="textDocument/didClose",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ra||(e.DidCloseTextDocumentNotification=ra={}));var fi;(function(p){p.method="textDocument/didSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(fi||(e.DidSaveTextDocumentNotification=fi={}));var di;(function(p){p.Manual=1,p.AfterDelay=2,p.FocusOut=3})(di||(e.TextDocumentSaveReason=di={}));var pi;(function(p){p.method="textDocument/willSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(pi||(e.WillSaveTextDocumentNotification=pi={}));var mi;(function(p){p.method="textDocument/willSaveWaitUntil",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(mi||(e.WillSaveTextDocumentWaitUntilRequest=mi={}));var Ot;(function(p){p.method="workspace/didChangeWatchedFiles",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Ot||(e.DidChangeWatchedFilesNotification=Ot={}));var na;(function(p){p.Created=1,p.Changed=2,p.Deleted=3})(na||(e.FileChangeType=na={}));var hi;(function(p){function ae(Te){const q=Te;return n.objectLiteral(q)&&(r.URI.is(q.baseUri)||r.WorkspaceFolder.is(q.baseUri))&&n.string(q.pattern)}i(ae,"is"),p.is=ae})(hi||(e.RelativePattern=hi={}));var yi;(function(p){p.Create=1,p.Change=2,p.Delete=4})(yi||(e.WatchKind=yi={}));var gi;(function(p){p.method="textDocument/publishDiagnostics",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(gi||(e.PublishDiagnosticsNotification=gi={}));var vi;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.TriggerForIncompleteCompletions=3})(vi||(e.CompletionTriggerKind=vi={}));var aa;(function(p){p.method="textDocument/completion",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(aa||(e.CompletionRequest=aa={}));var ia;(function(p){p.method="completionItem/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ia||(e.CompletionResolveRequest=ia={}));var Wt;(function(p){p.method="textDocument/hover",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Wt||(e.HoverRequest=Wt={}));var sa;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.ContentChange=3})(sa||(e.SignatureHelpTriggerKind=sa={}));var Ti;(function(p){p.method="textDocument/signatureHelp",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ti||(e.SignatureHelpRequest=Ti={}));var $i;(function(p){p.method="textDocument/definition",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($i||(e.DefinitionRequest=$i={}));var oa;(function(p){p.method="textDocument/references",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(oa||(e.ReferencesRequest=oa={}));var la;(function(p){p.method="textDocument/documentHighlight",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(la||(e.DocumentHighlightRequest=la={}));var Ri;(function(p){p.method="textDocument/documentSymbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ri||(e.DocumentSymbolRequest=Ri={}));var no;(function(p){p.method="textDocument/codeAction",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(no||(e.CodeActionRequest=no={}));var Ai;(function(p){p.method="codeAction/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ai||(e.CodeActionResolveRequest=Ai={}));var Ei;(function(p){p.method="workspace/symbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ei||(e.WorkspaceSymbolRequest=Ei={}));var Ci;(function(p){p.method="workspaceSymbol/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ci||(e.WorkspaceSymbolResolveRequest=Ci={}));var bi;(function(p){p.method="textDocument/codeLens",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(bi||(e.CodeLensRequest=bi={}));var bt;(function(p){p.method="codeLens/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(bt||(e.CodeLensResolveRequest=bt={}));var _i;(function(p){p.method="workspace/codeLens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(_i||(e.CodeLensRefreshRequest=_i={}));var Si;(function(p){p.method="textDocument/documentLink",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Si||(e.DocumentLinkRequest=Si={}));var Lr;(function(p){p.method="documentLink/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Lr||(e.DocumentLinkResolveRequest=Lr={}));var wi;(function(p){p.method="textDocument/formatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(wi||(e.DocumentFormattingRequest=wi={}));var Jr;(function(p){p.method="textDocument/rangeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Jr||(e.DocumentRangeFormattingRequest=Jr={}));var Ii;(function(p){p.method="textDocument/rangesFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ii||(e.DocumentRangesFormattingRequest=Ii={}));var Vt;(function(p){p.method="textDocument/onTypeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Vt||(e.DocumentOnTypeFormattingRequest=Vt={}));var cr;(function(p){p.Identifier=1})(cr||(e.PrepareSupportDefaultBehavior=cr={}));var Ni;(function(p){p.method="textDocument/rename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ni||(e.RenameRequest=Ni={}));var Pi;(function(p){p.method="textDocument/prepareRename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Pi||(e.PrepareRenameRequest=Pi={}));var fr;(function(p){p.method="workspace/executeCommand",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(fr||(e.ExecuteCommandRequest=fr={}));var ua;(function(p){p.method="workspace/applyEdit",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType("workspace/applyEdit")})(ua||(e.ApplyWorkspaceEditRequest=ua={}))}}),tN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=ti();function r(n,a,s,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,a,s,o)}i(r,"createProtocolConnection"),e.createProtocolConnection=r}}),rN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(ti(),e),r((xs(),bd(Dl)),e),r(Ae(),e),r(eN(),e);var n=tN();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:i(function(){return n.createProtocolConnection},"get")});var a;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))}}),nN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=uh();r(uh(),e),r(rN(),e);function a(s,o,l,u){return(0,n.createMessageConnection)(s,o,l,u)}i(a,"createProtocolConnection"),e.createProtocolConnection=a}}),Hg={};Vr(Hg,{AbstractAstReflection:()=>Id,AbstractCstNode:()=>Pm,AbstractLangiumParser:()=>Om,AbstractParserErrorMessageProvider:()=>MS,AbstractThreadedAsyncParser:()=>SF,AstUtils:()=>Nd,BiMap:()=>Nl,Cancellation:()=>pe,CompositeCstNodeImpl:()=>ku,ContextCache:()=>Fu,CstNodeBuilder:()=>OS,CstUtils:()=>Sd,DEFAULT_TOKENIZE_OPTIONS:()=>Jm,DONE_RESULT:()=>tt,DatatypeSymbol:()=>_l,DefaultAstNodeDescriptionProvider:()=>pw,DefaultAstNodeLocator:()=>hw,DefaultAsyncParser:()=>Ow,DefaultCommentProvider:()=>kw,DefaultConfigurationProvider:()=>yw,DefaultDocumentBuilder:()=>gw,DefaultDocumentValidator:()=>dw,DefaultHydrator:()=>Dw,DefaultIndexManager:()=>vw,DefaultJsonSerializer:()=>lw,DefaultLangiumDocumentFactory:()=>QS,DefaultLangiumDocuments:()=>ew,DefaultLangiumProfiler:()=>kF,DefaultLexer:()=>Zm,DefaultLexerErrorMessageProvider:()=>$w,DefaultLinker:()=>tw,DefaultNameProvider:()=>rw,DefaultReferenceDescriptionProvider:()=>mw,DefaultReferences:()=>nw,DefaultScopeComputation:()=>aw,DefaultScopeProvider:()=>ow,DefaultServiceRegistry:()=>uw,DefaultTokenBuilder:()=>Du,DefaultValueConverter:()=>zm,DefaultWorkspaceLock:()=>Lw,DefaultWorkspaceManager:()=>Tw,Deferred:()=>wr,Disposable:()=>Nn,DisposableCache:()=>Gu,DocumentCache:()=>sw,DocumentState:()=>J,DocumentValidator:()=>_t,EMPTY_SCOPE:()=>EF,EMPTY_STREAM:()=>Ua,EmptyFileSystem:()=>Xe,EmptyFileSystemProvider:()=>Gw,ErrorWithLocation:()=>Wl,GrammarAST:()=>Jg,GrammarUtils:()=>sp,IndentationAwareLexer:()=>IF,IndentationAwareTokenBuilder:()=>Mw,JSDocDocumentationProvider:()=>Pw,LangiumCompletionParser:()=>GS,LangiumParser:()=>xS,LangiumParserErrorMessageProvider:()=>Lm,LeafCstNodeImpl:()=>bl,LexingMode:()=>wn,MapScope:()=>AF,Module:()=>nd,MultiMap:()=>Ir,MultiMapScope:()=>iw,OperationCancelled:()=>tr,ParserWorker:()=>wF,ProfilingTask:()=>zw,Reduction:()=>Ts,RefResolving:()=>un,RegExpUtils:()=>lp,RootCstNodeImpl:()=>km,SimpleCache:()=>Vm,StreamImpl:()=>er,StreamScope:()=>Qf,TextDocument:()=>wl,TreeStreamImpl:()=>Ka,URI:()=>Tt,UriTrie:()=>Km,UriUtils:()=>nt,VALIDATE_EACH_NODE:()=>fw,ValidationCategory:()=>Pl,ValidationRegistry:()=>cw,ValueConverter:()=>Zt,WorkspaceCache:()=>qm,assertCondition:()=>op,assertUnreachable:()=>qr,createCompletionParser:()=>Mm,createDefaultCoreModule:()=>je,createDefaultSharedCoreModule:()=>Be,createGrammarConfig:()=>_p,createLangiumParser:()=>Gm,createParser:()=>Ou,delayNextTick:()=>xu,diagnosticData:()=>Sn,eagerLoad:()=>ih,getDiagnosticRange:()=>Ym,indentationBuilderDefaultOptions:()=>id,inject:()=>ee,interruptAndCheck:()=>ze,isAstNode:()=>Oe,isAstNodeDescription:()=>wd,isAstNodeWithComment:()=>Hm,isCompositeCstNode:()=>$r,isIMultiModeLexerDefinition:()=>Bu,isJSDoc:()=>eh,isLeafCstNode:()=>xn,isLinkingError:()=>pn,isMultiReference:()=>rr,isNamed:()=>Wm,isOperationCancelled:()=>ta,isReference:()=>rt,isRootCstNode:()=>Ml,isTokenTypeArray:()=>ju,isTokenTypeDictionary:()=>kl,loadGrammarFromJson:()=>Ue,parseJSDoc:()=>Qm,prepareLangiumParser:()=>Fm,setInterruptionPeriod:()=>jm,startCancelableOperation:()=>Mu,stream:()=>ue,toDiagnosticData:()=>Xm,toDiagnosticSeverity:()=>gs});var Sd={};Vr(Sd,{DefaultNameRegexp:()=>tp,RangeComparison:()=>Qt,compareRange:()=>Qd,findCommentNode:()=>rp,findDeclarationNodeAtOffset:()=>yv,findLeafNodeAtOffset:()=>Kl,findLeafNodeBeforeOffset:()=>np,flattenCst:()=>hv,getDatatypeNode:()=>mv,getInteriorNodes:()=>Tv,getNextNode:()=>gv,getPreviousNode:()=>ip,getStartlineNode:()=>vv,inRange:()=>ep,isChildNode:()=>Zd,isCommentNode:()=>ul,streamCst:()=>Ha,toDocumentSegment:()=>Ya,tokenToRange:()=>$s});function Oe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}i(Oe,"isAstNode");function rt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}i(rt,"isReference");function rr(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}i(rr,"isMultiReference");function wd(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}i(wd,"isAstNodeDescription");function pn(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}i(pn,"isLinkingError");var Id=class{static{i(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Oe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const n=r[t];if(n!==void 0)return n;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),n=[];for(const a of r)this.isSubtype(a,e)&&n.push(a);return this.allSubtypes[e]=n,n}}};function $r(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}i($r,"isCompositeCstNode");function xn(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}i(xn,"isLeafCstNode");function Ml(e){return $r(e)&&typeof e.fullText=="string"}i(Ml,"isRootCstNode");var er=class hr{static{i(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){const t={state:this.startFn(),next:i(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const t=this.iterator();let r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){const t=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){const n=this.map(a=>[t?t(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(t){return new hr(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return tt})}join(t=","){const r=this.iterator();let n="",a,s=!1;do a=r.next(),a.done||(s&&(n+=t),n+=Yg(a.value)),s=!0;while(!a.done);return n}indexOf(t,r=0){const n=this.iterator();let a=0,s=n.next();for(;!s.done;){if(a>=r&&s.value===t)return a;s=n.next(),a++}return-1}every(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)t(a.value,n),a=r.next(),n++}map(t){return new hr(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?tt:{done:!1,value:t(a)}})}filter(t){return new hr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return tt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){const n=this.iterator();let a=r,s=n.next();for(;!s.done;)a===void 0?a=s.value:a=t(a,s.value),s=n.next();return a}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){const a=t.next();if(a.done)return n;const s=this.recursiveReduce(t,r,n);return s===void 0?a.value:r(s,a.value)}find(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(t(a.value))return n;a=r.next(),n++}return-1}includes(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new hr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:a}=this.nextFn(r.this);if(!n){const s=t(a);if(vs(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return tt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;const r=t>1?this.flat(t-1):this;return new hr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:s}=r.nextFn(n.this);if(!a)if(vs(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return tt})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new hr(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?tt:this.nextFn(r.state)))}distinct(t){return new hr(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=t?t(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return tt})}exclude(t,r){const n=new Set;for(const a of t){const s=r?r(a):a;n.add(s)}return this.filter(a=>{const s=r?r(a):a;return!n.has(s)})}};function Yg(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}i(Yg,"toString");function vs(e){return!!e&&typeof e[Symbol.iterator]=="function"}i(vs,"isIterable");var Ua=new er(()=>{},()=>tt),tt=Object.freeze({done:!0,value:void 0});function ue(...e){if(e.length===1){const t=e[0];if(t instanceof er)return t;if(vs(t))return new er(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new er(()=>({index:0}),r=>r.index1?new er(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){const s=n.iterators[n.iterators.length-1].next();if(s.done)n.iterators.pop();else return n.iterators.push(t(s.value)[Symbol.iterator]()),s}return tt})}iterator(){const e={state:this.startFn(),next:i(()=>this.nextFn(e.state),"next"),prune:i(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},Ts;(function(e){function t(s){return s.reduce((o,l)=>o+l,0)}i(t,"sum"),e.sum=t;function r(s){return s.reduce((o,l)=>o*l,0)}i(r,"product"),e.product=r;function n(s){return s.reduce((o,l)=>Math.min(o,l))}i(n,"min"),e.min=n;function a(s){return s.reduce((o,l)=>Math.max(o,l))}i(a,"max"),e.max=a})(Ts||(Ts={}));var Nd={};Vr(Nd,{assignMandatoryProperties:()=>Pd,copyAstNode:()=>Yo,findRootNode:()=>Fa,getContainerOfType:()=>Mn,getDocument:()=>Mt,getReferenceNodes:()=>qo,hasContainerOfType:()=>Xg,linkContentToContainer:()=>Wa,streamAllContents:()=>Nr,streamAst:()=>Gt,streamContents:()=>Gs,streamReferences:()=>Va});function Wa(e,t={}){for(const[r,n]of Object.entries(e))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,s)=>{Oe(a)&&(a.$container=e,a.$containerProperty=r,a.$containerIndex=s,t.deep&&Wa(a,t))}):Oe(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&Wa(n,t)))}i(Wa,"linkContentToContainer");function Mn(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}i(Mn,"getContainerOfType");function Xg(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}i(Xg,"hasContainerOfType");function Mt(e){const r=Fa(e).$document;if(!r)throw new Error("AST node has no document.");return r}i(Mt,"getDocument");function Fa(e){for(;e.$container;)e=e.$container;return e}i(Fa,"findRootNode");function qo(e){return rt(e)?e.ref?[e.ref]:[]:rr(e)?e.items.map(t=>t.ref):[]}i(qo,"getReferenceNodes");function Gs(e,t){if(!e)throw new Error("Node must be an AstNode.");const r=t?.range;return new er(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexGs(r,t))}i(Nr,"streamAllContents");function Gt(e,t){if(e){if(t?.range&&!Ho(e,t.range))return new Ka(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Ka(e,r=>Gs(r,t),{includeRoot:!0})}i(Gt,"streamAst");function Ho(e,t){if(!t)return!0;const r=e.$cstNode?.range;return r?ep(r,t):!1}i(Ho,"isAstNodeInRange");function Va(e){return new er(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexdt,AbstractParserRule:()=>ns,AbstractRule:()=>Pa,AbstractType:()=>vt,Action:()=>xr,Alternatives:()=>as,ArrayLiteral:()=>Xo,ArrayType:()=>Jo,Assignment:()=>Mr,BooleanLiteral:()=>Zo,CharacterRange:()=>Gr,Condition:()=>Fr,Conjunction:()=>is,CrossReference:()=>zr,Disjunction:()=>ss,EndOfFile:()=>Qo,Grammar:()=>gr,GrammarImport:()=>el,Group:()=>mn,InferredType:()=>tl,InfixRule:()=>Jt,InfixRuleOperatorList:()=>os,InfixRuleOperators:()=>rl,Interface:()=>ka,Keyword:()=>Oa,LangiumGrammarAstReflection:()=>Jd,LangiumGrammarTerminals:()=>aN,NamedArgument:()=>La,NegatedToken:()=>hn,Negation:()=>nl,NumberLiteral:()=>al,Parameter:()=>Da,ParameterReference:()=>il,ParserRule:()=>Lt,ReferenceType:()=>ls,RegexToken:()=>yn,ReturnType:()=>sl,RuleCall:()=>gn,SimpleType:()=>xa,StringLiteral:()=>ol,TerminalAlternatives:()=>vn,TerminalElement:()=>pt,TerminalGroup:()=>Tn,TerminalRule:()=>vr,TerminalRuleCall:()=>$n,Type:()=>us,TypeAttribute:()=>Rn,TypeDefinition:()=>An,UnionType:()=>ll,UnorderedGroup:()=>cs,UntilToken:()=>En,ValueLiteral:()=>Cn,Wildcard:()=>Ma,isAbstractElement:()=>Gl,isAbstractParserRule:()=>Gn,isAbstractRule:()=>Zg,isAbstractType:()=>Qg,isAction:()=>jr,isAlternatives:()=>Fl,isArrayLiteral:()=>ev,isArrayType:()=>Od,isAssignment:()=>Rr,isBooleanLiteral:()=>Ld,isCharacterRange:()=>Dd,isCondition:()=>tv,isConjunction:()=>xd,isCrossReference:()=>Fn,isDisjunction:()=>Md,isEndOfFile:()=>Gd,isGrammar:()=>rv,isGrammarImport:()=>nv,isGroup:()=>zn,isInferredType:()=>Fs,isInfixRule:()=>qa,isInfixRuleOperatorList:()=>av,isInfixRuleOperators:()=>iv,isInterface:()=>Fd,isKeyword:()=>Ar,isNamedArgument:()=>sv,isNegatedToken:()=>zd,isNegation:()=>jd,isNumberLiteral:()=>ov,isParameter:()=>lv,isParameterReference:()=>Bd,isParserRule:()=>it,isReferenceType:()=>Ud,isRegexToken:()=>Kd,isReturnType:()=>Wd,isRuleCall:()=>Er,isSimpleType:()=>zl,isStringLiteral:()=>uv,isTerminalAlternatives:()=>Vd,isTerminalElement:()=>cv,isTerminalGroup:()=>qd,isTerminalRule:()=>Nt,isTerminalRuleCall:()=>jl,isType:()=>Bl,isTypeAttribute:()=>fv,isTypeDefinition:()=>dv,isUnionType:()=>Hd,isUnorderedGroup:()=>Ul,isUntilToken:()=>Yd,isValueLiteral:()=>pv,isWildcard:()=>Xd,reflection:()=>j});var aN={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},dt={$type:"AbstractElement",cardinality:"cardinality"};function Gl(e){return j.isInstance(e,dt.$type)}i(Gl,"isAbstractElement");var ns={$type:"AbstractParserRule"};function Gn(e){return j.isInstance(e,ns.$type)}i(Gn,"isAbstractParserRule");var Pa={$type:"AbstractRule"};function Zg(e){return j.isInstance(e,Pa.$type)}i(Zg,"isAbstractRule");var vt={$type:"AbstractType"};function Qg(e){return j.isInstance(e,vt.$type)}i(Qg,"isAbstractType");var xr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function jr(e){return j.isInstance(e,xr.$type)}i(jr,"isAction");var as={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Fl(e){return j.isInstance(e,as.$type)}i(Fl,"isAlternatives");var Xo={$type:"ArrayLiteral",elements:"elements"};function ev(e){return j.isInstance(e,Xo.$type)}i(ev,"isArrayLiteral");var Jo={$type:"ArrayType",elementType:"elementType"};function Od(e){return j.isInstance(e,Jo.$type)}i(Od,"isArrayType");var Mr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Rr(e){return j.isInstance(e,Mr.$type)}i(Rr,"isAssignment");var Zo={$type:"BooleanLiteral",true:"true"};function Ld(e){return j.isInstance(e,Zo.$type)}i(Ld,"isBooleanLiteral");var Gr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Dd(e){return j.isInstance(e,Gr.$type)}i(Dd,"isCharacterRange");var Fr={$type:"Condition"};function tv(e){return j.isInstance(e,Fr.$type)}i(tv,"isCondition");var is={$type:"Conjunction",left:"left",right:"right"};function xd(e){return j.isInstance(e,is.$type)}i(xd,"isConjunction");var zr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Fn(e){return j.isInstance(e,zr.$type)}i(Fn,"isCrossReference");var ss={$type:"Disjunction",left:"left",right:"right"};function Md(e){return j.isInstance(e,ss.$type)}i(Md,"isDisjunction");var Qo={$type:"EndOfFile",cardinality:"cardinality"};function Gd(e){return j.isInstance(e,Qo.$type)}i(Gd,"isEndOfFile");var gr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function rv(e){return j.isInstance(e,gr.$type)}i(rv,"isGrammar");var el={$type:"GrammarImport",path:"path"};function nv(e){return j.isInstance(e,el.$type)}i(nv,"isGrammarImport");var mn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function zn(e){return j.isInstance(e,mn.$type)}i(zn,"isGroup");var tl={$type:"InferredType",name:"name"};function Fs(e){return j.isInstance(e,tl.$type)}i(Fs,"isInferredType");var Jt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qa(e){return j.isInstance(e,Jt.$type)}i(qa,"isInfixRule");var os={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function av(e){return j.isInstance(e,os.$type)}i(av,"isInfixRuleOperatorList");var rl={$type:"InfixRuleOperators",precedences:"precedences"};function iv(e){return j.isInstance(e,rl.$type)}i(iv,"isInfixRuleOperators");var ka={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Fd(e){return j.isInstance(e,ka.$type)}i(Fd,"isInterface");var Oa={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ar(e){return j.isInstance(e,Oa.$type)}i(Ar,"isKeyword");var La={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function sv(e){return j.isInstance(e,La.$type)}i(sv,"isNamedArgument");var hn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function zd(e){return j.isInstance(e,hn.$type)}i(zd,"isNegatedToken");var nl={$type:"Negation",value:"value"};function jd(e){return j.isInstance(e,nl.$type)}i(jd,"isNegation");var al={$type:"NumberLiteral",value:"value"};function ov(e){return j.isInstance(e,al.$type)}i(ov,"isNumberLiteral");var Da={$type:"Parameter",name:"name"};function lv(e){return j.isInstance(e,Da.$type)}i(lv,"isParameter");var il={$type:"ParameterReference",parameter:"parameter"};function Bd(e){return j.isInstance(e,il.$type)}i(Bd,"isParameterReference");var Lt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function it(e){return j.isInstance(e,Lt.$type)}i(it,"isParserRule");var ls={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Ud(e){return j.isInstance(e,ls.$type)}i(Ud,"isReferenceType");var yn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Kd(e){return j.isInstance(e,yn.$type)}i(Kd,"isRegexToken");var sl={$type:"ReturnType",name:"name"};function Wd(e){return j.isInstance(e,sl.$type)}i(Wd,"isReturnType");var gn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Er(e){return j.isInstance(e,gn.$type)}i(Er,"isRuleCall");var xa={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function zl(e){return j.isInstance(e,xa.$type)}i(zl,"isSimpleType");var ol={$type:"StringLiteral",value:"value"};function uv(e){return j.isInstance(e,ol.$type)}i(uv,"isStringLiteral");var vn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Vd(e){return j.isInstance(e,vn.$type)}i(Vd,"isTerminalAlternatives");var pt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function cv(e){return j.isInstance(e,pt.$type)}i(cv,"isTerminalElement");var Tn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qd(e){return j.isInstance(e,Tn.$type)}i(qd,"isTerminalGroup");var vr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Nt(e){return j.isInstance(e,vr.$type)}i(Nt,"isTerminalRule");var $n={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function jl(e){return j.isInstance(e,$n.$type)}i(jl,"isTerminalRuleCall");var us={$type:"Type",name:"name",type:"type"};function Bl(e){return j.isInstance(e,us.$type)}i(Bl,"isType");var Rn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function fv(e){return j.isInstance(e,Rn.$type)}i(fv,"isTypeAttribute");var An={$type:"TypeDefinition"};function dv(e){return j.isInstance(e,An.$type)}i(dv,"isTypeDefinition");var ll={$type:"UnionType",types:"types"};function Hd(e){return j.isInstance(e,ll.$type)}i(Hd,"isUnionType");var cs={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Ul(e){return j.isInstance(e,cs.$type)}i(Ul,"isUnorderedGroup");var En={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Yd(e){return j.isInstance(e,En.$type)}i(Yd,"isUntilToken");var Cn={$type:"ValueLiteral"};function pv(e){return j.isInstance(e,Cn.$type)}i(pv,"isValueLiteral");var Ma={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Xd(e){return j.isInstance(e,Ma.$type)}i(Xd,"isWildcard");var Jd=class extends Id{static{i(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:dt.$type,properties:{cardinality:{name:dt.cardinality}},superTypes:[]},AbstractParserRule:{name:ns.$type,properties:{},superTypes:[Pa.$type,vt.$type]},AbstractRule:{name:Pa.$type,properties:{},superTypes:[]},AbstractType:{name:vt.$type,properties:{},superTypes:[]},Action:{name:xr.$type,properties:{cardinality:{name:xr.cardinality},feature:{name:xr.feature},inferredType:{name:xr.inferredType},operator:{name:xr.operator},type:{name:xr.type,referenceType:vt.$type}},superTypes:[dt.$type]},Alternatives:{name:as.$type,properties:{cardinality:{name:as.cardinality},elements:{name:as.elements,defaultValue:[]}},superTypes:[dt.$type]},ArrayLiteral:{name:Xo.$type,properties:{elements:{name:Xo.elements,defaultValue:[]}},superTypes:[Cn.$type]},ArrayType:{name:Jo.$type,properties:{elementType:{name:Jo.elementType}},superTypes:[An.$type]},Assignment:{name:Mr.$type,properties:{cardinality:{name:Mr.cardinality},feature:{name:Mr.feature},operator:{name:Mr.operator},predicate:{name:Mr.predicate},terminal:{name:Mr.terminal}},superTypes:[dt.$type]},BooleanLiteral:{name:Zo.$type,properties:{true:{name:Zo.true,defaultValue:!1}},superTypes:[Fr.$type,Cn.$type]},CharacterRange:{name:Gr.$type,properties:{cardinality:{name:Gr.cardinality},left:{name:Gr.left},lookahead:{name:Gr.lookahead},parenthesized:{name:Gr.parenthesized,defaultValue:!1},right:{name:Gr.right}},superTypes:[pt.$type]},Condition:{name:Fr.$type,properties:{},superTypes:[]},Conjunction:{name:is.$type,properties:{left:{name:is.left},right:{name:is.right}},superTypes:[Fr.$type]},CrossReference:{name:zr.$type,properties:{cardinality:{name:zr.cardinality},deprecatedSyntax:{name:zr.deprecatedSyntax,defaultValue:!1},isMulti:{name:zr.isMulti,defaultValue:!1},terminal:{name:zr.terminal},type:{name:zr.type,referenceType:vt.$type}},superTypes:[dt.$type]},Disjunction:{name:ss.$type,properties:{left:{name:ss.left},right:{name:ss.right}},superTypes:[Fr.$type]},EndOfFile:{name:Qo.$type,properties:{cardinality:{name:Qo.cardinality}},superTypes:[dt.$type]},Grammar:{name:gr.$type,properties:{imports:{name:gr.imports,defaultValue:[]},interfaces:{name:gr.interfaces,defaultValue:[]},isDeclared:{name:gr.isDeclared,defaultValue:!1},name:{name:gr.name},rules:{name:gr.rules,defaultValue:[]},types:{name:gr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:el.$type,properties:{path:{name:el.path}},superTypes:[]},Group:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},elements:{name:mn.elements,defaultValue:[]},guardCondition:{name:mn.guardCondition},predicate:{name:mn.predicate}},superTypes:[dt.$type]},InferredType:{name:tl.$type,properties:{name:{name:tl.name}},superTypes:[vt.$type]},InfixRule:{name:Jt.$type,properties:{call:{name:Jt.call},dataType:{name:Jt.dataType},inferredType:{name:Jt.inferredType},name:{name:Jt.name},operators:{name:Jt.operators},parameters:{name:Jt.parameters,defaultValue:[]},returnType:{name:Jt.returnType,referenceType:vt.$type}},superTypes:[ns.$type]},InfixRuleOperatorList:{name:os.$type,properties:{associativity:{name:os.associativity},operators:{name:os.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:rl.$type,properties:{precedences:{name:rl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ka.$type,properties:{attributes:{name:ka.attributes,defaultValue:[]},name:{name:ka.name},superTypes:{name:ka.superTypes,defaultValue:[],referenceType:vt.$type}},superTypes:[vt.$type]},Keyword:{name:Oa.$type,properties:{cardinality:{name:Oa.cardinality},predicate:{name:Oa.predicate},value:{name:Oa.value}},superTypes:[dt.$type]},NamedArgument:{name:La.$type,properties:{calledByName:{name:La.calledByName,defaultValue:!1},parameter:{name:La.parameter,referenceType:Da.$type},value:{name:La.value}},superTypes:[]},NegatedToken:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},lookahead:{name:hn.lookahead},parenthesized:{name:hn.parenthesized,defaultValue:!1},terminal:{name:hn.terminal}},superTypes:[pt.$type]},Negation:{name:nl.$type,properties:{value:{name:nl.value}},superTypes:[Fr.$type]},NumberLiteral:{name:al.$type,properties:{value:{name:al.value}},superTypes:[Cn.$type]},Parameter:{name:Da.$type,properties:{name:{name:Da.name}},superTypes:[]},ParameterReference:{name:il.$type,properties:{parameter:{name:il.parameter,referenceType:Da.$type}},superTypes:[Fr.$type]},ParserRule:{name:Lt.$type,properties:{dataType:{name:Lt.dataType},definition:{name:Lt.definition},entry:{name:Lt.entry,defaultValue:!1},fragment:{name:Lt.fragment,defaultValue:!1},inferredType:{name:Lt.inferredType},name:{name:Lt.name},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:vt.$type}},superTypes:[ns.$type]},ReferenceType:{name:ls.$type,properties:{isMulti:{name:ls.isMulti,defaultValue:!1},referenceType:{name:ls.referenceType}},superTypes:[An.$type]},RegexToken:{name:yn.$type,properties:{cardinality:{name:yn.cardinality},lookahead:{name:yn.lookahead},parenthesized:{name:yn.parenthesized,defaultValue:!1},regex:{name:yn.regex}},superTypes:[pt.$type]},ReturnType:{name:sl.$type,properties:{name:{name:sl.name}},superTypes:[]},RuleCall:{name:gn.$type,properties:{arguments:{name:gn.arguments,defaultValue:[]},cardinality:{name:gn.cardinality},predicate:{name:gn.predicate},rule:{name:gn.rule,referenceType:Pa.$type}},superTypes:[dt.$type]},SimpleType:{name:xa.$type,properties:{primitiveType:{name:xa.primitiveType},stringType:{name:xa.stringType},typeRef:{name:xa.typeRef,referenceType:vt.$type}},superTypes:[An.$type]},StringLiteral:{name:ol.$type,properties:{value:{name:ol.value}},superTypes:[Cn.$type]},TerminalAlternatives:{name:vn.$type,properties:{cardinality:{name:vn.cardinality},elements:{name:vn.elements,defaultValue:[]},lookahead:{name:vn.lookahead},parenthesized:{name:vn.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalElement:{name:pt.$type,properties:{cardinality:{name:pt.cardinality},lookahead:{name:pt.lookahead},parenthesized:{name:pt.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalGroup:{name:Tn.$type,properties:{cardinality:{name:Tn.cardinality},elements:{name:Tn.elements,defaultValue:[]},lookahead:{name:Tn.lookahead},parenthesized:{name:Tn.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalRule:{name:vr.$type,properties:{definition:{name:vr.definition},fragment:{name:vr.fragment,defaultValue:!1},hidden:{name:vr.hidden,defaultValue:!1},name:{name:vr.name},type:{name:vr.type}},superTypes:[Pa.$type]},TerminalRuleCall:{name:$n.$type,properties:{cardinality:{name:$n.cardinality},lookahead:{name:$n.lookahead},parenthesized:{name:$n.parenthesized,defaultValue:!1},rule:{name:$n.rule,referenceType:vr.$type}},superTypes:[pt.$type]},Type:{name:us.$type,properties:{name:{name:us.name},type:{name:us.type}},superTypes:[vt.$type]},TypeAttribute:{name:Rn.$type,properties:{defaultValue:{name:Rn.defaultValue},isOptional:{name:Rn.isOptional,defaultValue:!1},name:{name:Rn.name},type:{name:Rn.type}},superTypes:[]},TypeDefinition:{name:An.$type,properties:{},superTypes:[]},UnionType:{name:ll.$type,properties:{types:{name:ll.types,defaultValue:[]}},superTypes:[An.$type]},UnorderedGroup:{name:cs.$type,properties:{cardinality:{name:cs.cardinality},elements:{name:cs.elements,defaultValue:[]}},superTypes:[dt.$type]},UntilToken:{name:En.$type,properties:{cardinality:{name:En.cardinality},lookahead:{name:En.lookahead},parenthesized:{name:En.parenthesized,defaultValue:!1},terminal:{name:En.terminal}},superTypes:[pt.$type]},ValueLiteral:{name:Cn.$type,properties:{},superTypes:[]},Wildcard:{name:Ma.$type,properties:{cardinality:{name:Ma.cardinality},lookahead:{name:Ma.lookahead},parenthesized:{name:Ma.parenthesized,defaultValue:!1}},superTypes:[pt.$type]}}}},j=new Jd;function mv(e){let t=e,r=!1;for(;t;){const n=Mn(t.grammarSource,it);if(n&&n.dataType)t=t.container,r=!0;else return r?t:void 0}}i(mv,"getDatatypeNode");function Ha(e){return new Ka(e,t=>$r(t)?t.content:[],{includeRoot:!0})}i(Ha,"streamCst");function hv(e){return Ha(e).filter(xn)}i(hv,"flattenCst");function Zd(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}i(Zd,"isChildNode");function $s(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}i($s,"tokenToRange");function Ya(e){if(!e)return;const{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}i(Ya,"toDocumentSegment");var Qt;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Qt||(Qt={}));function Qd(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Qt.After;const r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.lineQt.After}i(ep,"inRange");var tp=/^[\w\p{L}]$/u;function yv(e,t,r=tp){if(e){if(t>0){const n=t-e.offset,a=e.text.charAt(n);r.test(a)||t--}return Kl(e,t)}}i(yv,"findDeclarationNodeAtOffset");function rp(e,t){if(e){const r=ip(e,!0);if(r&&ul(r,t))return r;if(Ml(e)){const n=e.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const s=e.content[a];if(ul(s,t))return s}}}}i(rp,"findCommentNode");function ul(e,t){return xn(e)&&t.includes(e.tokenType.name)}i(ul,"isCommentNode");function Kl(e,t){if(xn(e))return e;if($r(e)){const r=ap(e,t,!1);if(r)return Kl(r,t)}}i(Kl,"findLeafNodeAtOffset");function np(e,t){if(xn(e))return e;if($r(e)){const r=ap(e,t,!0);if(r)return np(r,t)}}i(np,"findLeafNodeBeforeOffset");function ap(e,t,r){let n=0,a=e.content.length-1,s;for(;n<=a;){const o=Math.floor((n+a)/2),l=e.content[o];if(l.offset<=t&&l.end>t)return l;l.end<=t?(s=r?l:void 0,n=o+1):a=o-1}return s}i(ap,"binarySearch");function ip(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);for(;n>0;){n--;const a=r.content[n];if(t||!a.hidden)return a}e=r}}i(ip,"getPreviousNode");function gv(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);const a=r.content.length-1;for(;nTp,findNameAssignment:()=>Zl,findNodeForKeyword:()=>vp,findNodeForProperty:()=>Yl,findNodesForKeyword:()=>wv,findNodesForKeywordInternal:()=>Jl,findNodesForProperty:()=>gp,getActionAtElement:()=>Rp,getActionType:()=>Ep,getAllReachableRules:()=>Hl,getAllRulesUsedForCrossReferences:()=>Sv,getCrossReferenceTerminal:()=>hp,getEntryRule:()=>dp,getExplicitRuleType:()=>js,getHiddenRules:()=>pp,getRuleType:()=>Cp,getRuleTypeName:()=>Ov,getTypeName:()=>Pn,isArrayCardinality:()=>Nv,isArrayOperator:()=>Pv,isCommentTerminal:()=>yp,isDataType:()=>kv,isDataTypeRule:()=>zs,isOptionalCardinality:()=>Iv,terminalRegex:()=>Bs});var Wl=class extends Error{static{i(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function qr(e,t="Error: Got unexpected value."){throw new Error(t)}i(qr,"assertUnreachable");function op(e,t="Error: Condition is violated."){if(!e)throw new Error(t)}i(op,"assertCondition");var lp={};Vr(lp,{NEWLINE_REGEXP:()=>Ev,escapeRegExp:()=>ri,getTerminalParts:()=>bv,isMultilineComment:()=>up,isWhitespace:()=>ql,partialMatches:()=>cp,partialRegExp:()=>fp,whitespaceCharacters:()=>_v});function U(e){return e.charCodeAt(0)}i(U,"cc");function Po(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}i(Po,"insertToSet");function $a(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}i($a,"addFlag");function sn(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}i(sn,"ASSERT_EXISTS");function Rv(){throw Error("Internal Error - Should never get here!")}i(Rv,"ASSERT_NEVER_REACH_HERE");function Cf(e){return e.type==="Character"}i(Cf,"isCharacter");var cl=[];for(let e=U("0");e<=U("9");e++)cl.push(e);var fl=[U("_")].concat(cl);for(let e=U("a");e<=U("z");e++)fl.push(e);for(let e=U("A");e<=U("Z");e++)fl.push(e);var ch=[U(" "),U("\f"),U(` +`),U("\r"),U(" "),U("\v"),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U("\u2028"),U("\u2029"),U(" "),U(" "),U(" "),U("\uFEFF")],iN=/[0-9a-fA-F]/,ao=/[0-9]/,sN=/[1-9]/,Av=class{static{i(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":$a(r,"global");break;case"i":$a(r,"ignoreCase");break;case"m":$a(r,"multiLine");break;case"u":$a(r,"unicode");break;case"y":$a(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}sn(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return Rv()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:n,atMost:a}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;sn(t);break}if(!(e===!0&&t===void 0)&&sn(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),sn(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[U(` +`),U("\r"),U("\u2028"),U("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=cl;break;case"D":e=cl,t=!0;break;case"s":e=ch;break;case"S":e=ch,t=!0;break;case"w":e=fl;break;case"W":e=fl,t=!0;break}if(sn(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=U("\f");break;case"n":e=U(` +`);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(sn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:U("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:U(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:U(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,Cf(r)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,Cf(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Vl=class{static{i(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Ev=/\r?\n/gm,Cv=new Av,oN=class extends Vl{static{i(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=ri(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` +`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},bn=new oN;function bv(e){try{typeof e!="string"&&(e=e.source),e=`/${e}/`;const t=Cv.pattern(e),r=[];for(const n of t.value.value)bn.reset(e),bn.visit(n),r.push({start:bn.startRegexp,end:bn.endRegex});return r}catch{return[]}}i(bv,"getTerminalParts");function up(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),bn.reset(e),bn.visit(Cv.pattern(e)),bn.multiline}catch{return!1}}i(up,"isMultilineComment");var _v=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function ql(e){const t=typeof e=="string"?new RegExp(e):e;return _v.some(r=>t.test(r))}i(ql,"isWhitespace");function ri(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(ri,"escapeRegExp");function cp(e,t){const r=fp(e),n=t.match(r);return!!n&&n[0].length>0}i(cp,"partialMatches");function fp(e){typeof e=="string"&&(e=new RegExp(e));const t=e,r=e.source;let n=0;function a(){let s="",o;function l(c){s+=r.substr(n,c),n+=c}i(l,"appendRaw");function u(c){s+="(?:"+r.substr(n,c)+"|$)",n+=c}for(i(u,"appendOptional");n",n)-n+1);break;default:u(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],u(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?l(o[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=a()+"|$)";break;case"=":s+="(?=",n+=3,s+=a()+")";break;case"!":o=n,n+=3,a(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),s+=r.substr(o,n-o);break;default:l(r.indexOf(">",n)-n+1),s+=a()+"|$)";break}break}else l(1),s+=a()+"|$)";break;case")":return++n,s;default:u(1);break}return s}return i(a,"process"),new RegExp(a(),e.flags)}i(fp,"partialRegExp");function dp(e){return e.rules.find(t=>it(t)&&t.entry)}i(dp,"getEntryRule");function pp(e){return e.rules.filter(t=>Nt(t)&&t.hidden)}i(pp,"getHiddenRules");function Hl(e,t){const r=new Set,n=dp(e);if(!n)return new Set(e.rules);const a=[n].concat(pp(e));for(const o of a)mp(o,r,t);const s=new Set;for(const o of e.rules)(r.has(o.name)||Nt(o)&&o.hidden)&&s.add(o);return s}i(Hl,"getAllReachableRules");function mp(e,t,r){t.add(e.name),Nr(e).forEach(n=>{if(Er(n)||r&&jl(n)){const a=n.rule.ref;a&&!t.has(a.name)&&mp(a,t,r)}})}i(mp,"ruleDfs");function Sv(e){const t=new Set;return Nr(e).forEach(r=>{Fn(r)&&(it(r.type.ref)&&t.add(r.type.ref),Fs(r.type.ref)&&it(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}i(Sv,"getAllRulesUsedForCrossReferences");function hp(e){if(e.terminal)return e.terminal;if(e.type.ref)return Zl(e.type.ref)?.terminal}i(hp,"getCrossReferenceTerminal");function yp(e){return e.hidden&&!ql(Bs(e))}i(yp,"isCommentTerminal");function gp(e,t){return!e||!t?[]:Xl(e,t,e.astNode,!0)}i(gp,"findNodesForProperty");function Yl(e,t,r){if(!e||!t)return;const n=Xl(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Yl,"findNodeForProperty");function Xl(e,t,r,n){if(!n){const a=Mn(e.grammarSource,Rr);if(a&&a.feature===t)return[e]}return $r(e)&&e.astNode===r?e.content.flatMap(a=>Xl(a,t,r,!1)):[]}i(Xl,"findNodesForPropertyInternal");function wv(e,t){return e?Jl(e,t,e?.astNode):[]}i(wv,"findNodesForKeyword");function vp(e,t,r){if(!e)return;const n=Jl(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(vp,"findNodeForKeyword");function Jl(e,t,r){if(e.astNode!==r)return[];if(Ar(e.grammarSource)&&e.grammarSource.value===t)return[e];const n=Ha(e).iterator();let a;const s=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Ar(o.grammarSource)&&o.grammarSource.value===t&&s.push(o):n.prune()}while(!a.done);return s}i(Jl,"findNodesForKeywordInternal");function Tp(e){const t=e.astNode;for(;t===e.container?.astNode;){const r=Mn(e.grammarSource,Rr);if(r)return r;e=e.container}}i(Tp,"findAssignment");function Zl(e){let t=e;return Fs(t)&&(jr(t.$container)?t=t.$container.$container:Gn(t.$container)?t=t.$container:qr(t.$container)),$p(e,t,new Map)}i(Zl,"findNameAssignment");function $p(e,t,r){function n(a,s){let o;return Mn(a,Rr)||(o=$p(s,s,r)),r.set(e,o),o}if(i(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(const a of Nr(t)){if(Rr(a)&&a.feature.toLowerCase()==="name")return r.set(e,a),a;if(Er(a)&&it(a.rule.ref))return n(a,a.rule.ref);if(zl(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}i($p,"findNameAssignmentInternal");function Rp(e){const t=e.$container;if(zn(t)){const r=t.elements,n=r.indexOf(e);for(let a=n-1;a>=0;a--){const s=r[a];if(jr(s))return s;{const o=Nr(r[a]).find(jr);if(o)return o}}}if(Gl(t))return Rp(t)}i(Rp,"getActionAtElement");function Iv(e,t){return e==="?"||e==="*"||zn(t)&&!!t.guardCondition}i(Iv,"isOptionalCardinality");function Nv(e){return e==="*"||e==="+"}i(Nv,"isArrayCardinality");function Pv(e){return e==="+="}i(Pv,"isArrayOperator");function zs(e){return Ap(e,new Set)}i(zs,"isDataTypeRule");function Ap(e,t){if(t.has(e))return!0;t.add(e);for(const r of Nr(e))if(Er(r)){if(!r.rule.ref||it(r.rule.ref)&&!Ap(r.rule.ref,t)||qa(r.rule.ref))return!1}else{if(Rr(r))return!1;if(jr(r))return!1}return!!e.definition}i(Ap,"isDataTypeRuleInternal");function kv(e){return dl(e.type,new Set)}i(kv,"isDataType");function dl(e,t){if(t.has(e))return!0;if(t.add(e),Od(e))return!1;if(Ud(e))return!1;if(Hd(e))return e.types.every(r=>dl(r,t));if(zl(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){const r=e.typeRef.ref;return Bl(r)?dl(r.type,t):!1}else return!1}else return!1}i(dl,"isDataTypeInternal");function js(e){if(!Nt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t)return t.name}}}i(js,"getExplicitRuleType");function Pn(e){if(Gn(e))return it(e)&&zs(e)?e.name:js(e)??e.name;if(Fd(e)||Bl(e)||Wd(e))return e.name;if(jr(e)){const t=Ep(e);if(t)return t}else if(Fs(e))return e.name;throw new Error("Cannot get name of Unknown Type")}i(Pn,"getTypeName");function Ep(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return Pn(e.type.ref)}i(Ep,"getActionType");function Ov(e){return Nt(e)?e.type?.name??"string":it(e)&&zs(e)?e.name:js(e)??e.name}i(Ov,"getRuleTypeName");function Cp(e){return Nt(e)?e.type?.name??"string":js(e)??e.name}i(Cp,"getRuleType");function Bs(e){const t={s:!1,i:!1,u:!1},r=jn(e.definition,t),n=Object.entries(t).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}i(Bs,"terminalRegex");var bp=/[\s\S]/.source;function jn(e,t){if(Vd(e))return Lv(e);if(qd(e))return Dv(e);if(Dd(e))return Gv(e);if(jl(e)){const r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return nr(jn(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(zd(e))return Mv(e);if(Yd(e))return xv(e);if(Kd(e)){const r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),a=e.regex.substring(r+1);return t&&(t.i=a.includes("i"),t.s=a.includes("s"),t.u=a.includes("u")),nr(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(Xd(e))return nr(bp,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}i(jn,"abstractElementToRegex");function Lv(e){return nr(e.elements.map(t=>jn(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Lv,"terminalAlternativesToRegex");function Dv(e){return nr(e.elements.map(t=>jn(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Dv,"terminalGroupToRegex");function xv(e){return nr(`${bp}*?${jn(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(xv,"untilTokenToRegex");function Mv(e){return nr(`(?!${jn(e.terminal)})${bp}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Mv,"negateTokenToRegex");function Gv(e){return e.right?nr(`[${ko(e.left)}-${ko(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):nr(ko(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Gv,"characterRangeToRegex");function ko(e){return ri(e.value)}i(ko,"keywordToRegex");function nr(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}i(nr,"withCardinality");function _p(e){const t=[],r=e.Grammar;for(const n of r.rules)Nt(n)&&yp(n)&&up(Bs(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:tp}}i(_p,"createGrammarConfig");var lN=typeof global=="object"&&global&&global.Object===Object&&global,Fv=lN,uN=typeof self=="object"&&self&&self.Object===Object&&self,cN=Fv||uN||Function("return this")(),ir=cN,fN=ir.Symbol,wt=fN,zv=Object.prototype,dN=zv.hasOwnProperty,pN=zv.toString,Oi=wt?wt.toStringTag:void 0;function jv(e){var t=dN.call(e,Oi),r=e[Oi];try{e[Oi]=void 0;var n=!0}catch{}var a=pN.call(e);return n&&(t?e[Oi]=r:delete e[Oi]),a}i(jv,"getRawTag");var mN=jv,hN=Object.prototype,yN=hN.toString;function Bv(e){return yN.call(e)}i(Bv,"objectToString");var gN=Bv,vN="[object Null]",TN="[object Undefined]",fh=wt?wt.toStringTag:void 0;function Uv(e){return e==null?e===void 0?TN:vN:fh&&fh in Object(e)?mN(e):gN(e)}i(Uv,"baseGetTag");var Hr=Uv;function Kv(e){return e!=null&&typeof e=="object"}i(Kv,"isObjectLike");var jt=Kv,$N="[object Symbol]";function Wv(e){return typeof e=="symbol"||jt(e)&&Hr(e)==$N}i(Wv,"isSymbol");var Ql=Wv;function Vv(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r0){if(++t>=rP)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}i(uT,"shortOut");var iP=uT;function cT(e){return function(){return e}}i(cT,"constant");var sP=cT,oP=(function(){try{var e=Un(Object,"defineProperty");return e({},"",{}),e}catch{}})(),pl=oP,lP=pl?function(e,t){return pl(e,"toString",{configurable:!0,enumerable:!1,value:sP(t),writable:!0})}:Ws,uP=lP,cP=iP(uP),fP=cP;function fT(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}i(vT,"arrayIncludes");var TT=vT,mP=9007199254740991,hP=/^(?:0|[1-9]\d*)$/;function $T(e,t){var r=typeof e;return t=t??mP,!!t&&(r=="number"||r!="symbol"&&hP.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=TP}i(ST,"isLength");var Pp=ST;function wT(e){return e!=null&&Pp(e.length)&&!Pr(e)}i(wT,"isArrayLike");var sr=wT;function IT(e,t,r){if(!It(r))return!1;var n=typeof t;return(n=="number"?sr(r)&&eu(t,r.length):n=="string"&&t in r)?Vs(r[t],e):!1}i(IT,"isIterateeCall");var ru=IT;function NT(e){return Np(function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&ru(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n-1}i(s$,"listCacheHas");var Mk=s$;function o$(e,t){var r=this.__data__,n=iu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(o$,"listCacheSet");var Gk=o$;function Wn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(l)?t>1?xp(l,t-1,r,n,a):Dp(a,l):n||(a[a.length]=l)}return a}i(xp,"baseFlatten");var Mp=xp;function E$(e){var t=e==null?0:e.length;return t?Mp(e,1):[]}i(E$,"flatten");var Ft=E$,nO=UT(Object.getPrototypeOf,Object),C$=nO;function b$(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(a);++nl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&q0?new jp:void 0;for(s.set(e,t),s.set(t,e);++d2?t[2]:void 0;for(a&&ru(t[0],t[1],a)&&(n=1);++r=zL&&(s=Bp,o=!1,t=new jp(t));e:for(;++a-1?a[s?t[o]:o]:void 0}}i(sA,"createFind");var VL=sA,qL=Math.max;function oA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ks(r);return a<0&&(a=qL(n+a,0)),mT(e,or(t),a)}i(oA,"findIndex");var HL=oA,YL=VL(HL),Ja=YL;function lA(e){return e&&e.length?e[0]:void 0}i(lA,"head");var Bt=lA;function uA(e,t){var r=-1,n=sr(e)?Array(e.length):[];return Hn(e,function(a,s,o){n[++r]=t(a,s,o)}),n}i(uA,"baseMap");var XL=uA;function cA(e,t){var r=re(e)?Us:XL;return r(e,or(t))}i(cA,"map");var F=cA;function fA(e,t){return Mp(F(e,t),1)}i(fA,"flatMap");var St=fA,JL=Object.prototype,ZL=JL.hasOwnProperty,QL=ML(function(e,t,r){ZL.call(e,r)?e[r].push(t):Ip(e,r,[t])}),eD=QL,tD=Object.prototype,rD=tD.hasOwnProperty;function dA(e,t){return e!=null&&rD.call(e,t)}i(dA,"baseHas");var nD=dA;function pA(e,t){return e!=null&&PR(e,t,nD)}i(pA,"has");var B=pA,aD="[object String]";function mA(e){return typeof e=="string"||!re(e)&&jt(e)&&Hr(e)==aD}i(mA,"isString");var mt=mA;function hA(e,t){return Us(t,function(r){return e[r]})}i(hA,"baseValues");var iD=hA;function yA(e){return e==null?[]:iD(e,$t(e))}i(yA,"values");var Me=yA,sD=Math.max;function gA(e,t,r,n){e=sr(e)?e:Me(e),r=r&&!n?Ks(r):0;var a=e.length;return r<0&&(r=sD(a+r,0)),mt(e)?r<=a&&e.indexOf(t,r)>-1:!!a&&wp(e,t,r)>-1}i(gA,"includes");var ut=gA,oD=Math.max;function vA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ks(r);return a<0&&(a=oD(n+a,0)),wp(e,t,a)}i(vA,"indexOf");var Uh=vA,lD="[object Map]",uD="[object Set]",cD=Object.prototype,fD=cD.hasOwnProperty;function TA(e){if(e==null)return!0;if(sr(e)&&(re(e)||typeof e=="string"||typeof e.splice=="function"||Rs(e)||kp(e)||nu(e)))return!e.length;var t=Xa(e);if(t==lD||t==uD)return!e.size;if(Hs(e))return!WT(e).length;for(var r in e)if(fD.call(e,r))return!1;return!0}i(TA,"isEmpty");var me=TA,dD="[object RegExp]";function $A(e){return jt(e)&&Hr(e)==dD}i($A,"baseIsRegExp");var pD=$A,Kh=Br&&Br.isRegExp,mD=Kh?Ys(Kh):pD,Cr=mD;function RA(e){return e===void 0}i(RA,"isUndefined");var br=RA,hD="Expected a function";function AA(e){if(typeof e!="function")throw new TypeError(hD);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}i(AA,"negate");var yD=AA;function EA(e,t,r,n){if(!It(e))return e;t=cu(t,e);for(var a=-1,s=t.length,o=s-1,l=e;l!=null&&++a=CD){var c=t?null:ED(e);if(c)return Up(c);o=!1,a=Bp,u=new jp}else u=t?[]:l;e:for(;++n{t.accept(e)})}},st=class extends lr{static{i(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},ni=class extends lr{static{i(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Rt(this,Ut(e,t=>t!==void 0))}},ht=class extends lr{static{i(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Rt(this,Ut(e,t=>t!==void 0))}},He=class extends lr{static{i(this,"Option")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},Et=class extends lr{static{i(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},Ct=class extends lr{static{i(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},be=class extends lr{static{i(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},yt=class extends lr{static{i(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},gt=class extends lr{static{i(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Rt(this,Ut(e,t=>t!==void 0))}},ve=class{static{i(this,"Terminal")}constructor(e){this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}accept(e){e.visit(this)}};function xA(e){return F(e,ms)}i(xA,"serializeGrammar");function ms(e){function t(r){return F(r,ms)}if(i(t,"convertDefinition"),e instanceof st){const r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return mt(e.label)&&(r.label=e.label),r}else{if(e instanceof ht)return{type:"Alternative",definition:t(e.definition)};if(e instanceof He)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Et)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Ct)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ms(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof yt)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ms(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof be)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof gt)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ve){const r={type:"Terminal",name:e.terminalType.name,label:LA(e.terminalType),idx:e.idx};mt(e.label)&&(r.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=Cr(n)?n.source:n),r}else{if(e instanceof ni)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}i(ms,"serializeProduction");var ai=class{static{i(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case st:return this.visitNonTerminal(t);case ht:return this.visitAlternative(t);case He:return this.visitOption(t);case Et:return this.visitRepetitionMandatory(t);case Ct:return this.visitRepetitionMandatoryWithSeparator(t);case yt:return this.visitRepetitionWithSeparator(t);case be:return this.visitRepetition(t);case gt:return this.visitAlternation(t);case ve:return this.visitTerminal(t);case ni:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function MA(e){return e instanceof ht||e instanceof He||e instanceof be||e instanceof Et||e instanceof Ct||e instanceof yt||e instanceof ve||e instanceof ni}i(MA,"isSequenceProd");function _s(e,t=[]){return e instanceof He||e instanceof be||e instanceof yt?!0:e instanceof gt?PA(e.definition,n=>_s(n,t)):e instanceof st&&ut(t,e)?!1:e instanceof lr?(e instanceof st&&t.push(e),zt(e.definition,n=>_s(n,t))):!1}i(_s,"isOptionalProd");function GA(e){return e instanceof gt}i(GA,"isBranchingProd");function Dt(e){if(e instanceof st)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof gt)return"OR";if(e instanceof Et)return"AT_LEAST_ONE";if(e instanceof Ct)return"AT_LEAST_ONE_SEP";if(e instanceof yt)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(Dt,"getProductionDslName");var pu=class{static{i(this,"RestWalker")}walk(e,t=[]){K(e.definition,(r,n)=>{const a=qe(e.definition,n+1);if(r instanceof st)this.walkProdRef(r,a,t);else if(r instanceof ve)this.walkTerminal(r,a,t);else if(r instanceof ht)this.walkFlat(r,a,t);else if(r instanceof He)this.walkOption(r,a,t);else if(r instanceof Et)this.walkAtLeastOne(r,a,t);else if(r instanceof Ct)this.walkAtLeastOneSep(r,a,t);else if(r instanceof yt)this.walkManySep(r,a,t);else if(r instanceof be)this.walkMany(r,a,t);else if(r instanceof gt)this.walkOr(r,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=If(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=If(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);K(e.definition,a=>{const s=new ht({definition:[a]});this.walk(s,n)})}};function If(e,t,r){return[new He({definition:[new ve({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}i(If,"restForRepetitionWithSeparator");function ii(e){if(e instanceof st)return ii(e.referencedRule);if(e instanceof ve)return jA(e);if(MA(e))return FA(e);if(GA(e))return zA(e);throw Error("non exhaustive match")}i(ii,"first");function FA(e){let t=[];const r=e.definition;let n=0,a=r.length>n,s,o=!0;for(;a&&o;)s=r[n],o=_s(s),t=t.concat(ii(s)),n=n+1,a=r.length>n;return Vp(t)}i(FA,"firstForSequence");function zA(e){const t=F(e.definition,r=>ii(r));return Vp(Ft(t))}i(zA,"firstForBranching");function jA(e){return[e.terminalType]}i(jA,"firstForTerminal");var BA="_~IN~_",_D=class extends pu{static{i(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=KA(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(r),s=new ht({definition:a}),o=ii(s);this.follows[n]=o}};function UA(e){const t={};return K(e,r=>{const n=new _D(r).startWalking();Rt(t,n)}),t}i(UA,"computeAllProdsFollows");function KA(e,t){return e.name+t+BA}i(KA,"buildBetweenProdsFollowPrefix");var Oo={},SD=new Av;function Zs(e){const t=e.toString();if(Oo.hasOwnProperty(t))return Oo[t];{const r=SD.pattern(t);return Oo[t]=r,r}}i(Zs,"getRegExpAst");function WA(){Oo={}}i(WA,"clearRegExpParserCache");var VA="Complement Sets are not supported for first char optimization",yl=`Unable to use "first char" lexer optimizations: +`;function qA(e,t=!1){try{const r=Zs(e);return gl(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===VA)t&&qp(`${yl} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),hl(`${yl} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}i(qA,"getOptimizedStartCodesIndices");function gl(e,t,r){switch(e.type){case"Disjunction":for(let a=0;a{if(typeof u=="number")Ji(u,t,r);else{const c=u;if(r===!0)for(let f=c.from;f<=c.to;f++)Ji(f,t,r);else{for(let f=c.from;f<=c.to&&f=Qi){const f=c.from>=Qi?c.from:Qi,d=c.to,m=_r(f),g=_r(d);for(let v=m;v<=g;v++)t[v]=v}}}});break;case"Group":gl(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&vl(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return Me(t)}i(gl,"firstCharOptimizedIndices");function Ji(e,t,r){const n=_r(e);t[n]=n,r===!0&&HA(e,t)}i(Ji,"addOptimizedIdxToResult");function HA(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const a=_r(n.charCodeAt(0));t[a]=a}else{const a=r.toLowerCase();if(a!==r){const s=_r(a.charCodeAt(0));t[s]=s}}}i(HA,"handleIgnoreCase");function Nf(e,t){return Ja(e.value,r=>{if(typeof r=="number")return ut(t,r);{const n=r;return Ja(t,a=>n.from<=a&&a<=n.to)!==void 0}})}i(Nf,"findCode");function vl(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?re(e.value)?zt(e.value,vl):vl(e.value):!1}i(vl,"isWholeOptional");var wD=class extends Vl{static{i(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){ut(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Nf(e,this.targetCharCodes)===void 0&&(this.found=!0):Nf(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function mu(e,t){if(t instanceof RegExp){const r=Zs(t),n=new wD(e);return n.visit(r),n.found}else return Ja(t,r=>ut(e,r.charCodeAt(0)))!==void 0}i(mu,"canMatchCharCode");var On="PATTERN",Zi="defaultMode",so="modes";function YA(e,t){t=Wp(t,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:i((I,R)=>R(),"tracer")});const r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{yE()});let n;r("Reject Lexer.NA",()=>{n=du(e,I=>I[On]===at.NA)});let a=!1,s;r("Transform Patterns",()=>{a=!1,s=F(n,I=>{const R=I[On];if(Cr(R)){const P=R.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!R.ignoreCase?P:P.length===2&&P[0]==="\\"&&!ut(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])?P[1]:Pf(R)}else{if(Pr(R))return a=!0,{exec:R};if(typeof R=="object")return a=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const P=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),z=new RegExp(P);return Pf(z)}}else throw Error("non exhaustive match")}})});let o,l,u,c,f;r("misc mapping",()=>{o=F(n,I=>I.tokenTypeIdx),l=F(n,I=>{const R=I.GROUP;if(R!==at.SKIPPED){if(mt(R))return R;if(br(R))return!1;throw Error("non exhaustive match")}}),u=F(n,I=>{const R=I.LONGER_ALT;if(R)return re(R)?F(R,z=>Uh(n,z)):[Uh(n,R)]}),c=F(n,I=>I.PUSH_MODE),f=F(n,I=>B(I,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const I=Zp(t.lineTerminatorCharacters);d=F(n,R=>!1),t.positionTracking!=="onlyOffset"&&(d=F(n,R=>B(R,"LINE_BREAKS")?!!R.LINE_BREAKS:Jp(R,I)===!1&&mu(I,R.PATTERN)))});let m,g,v,b;r("Misc Mapping #2",()=>{m=F(n,Xp),g=F(s,mE),v=At(n,(I,R)=>{const P=R.GROUP;return mt(P)&&P!==at.SKIPPED&&(I[P]=[]),I},{}),b=F(s,(I,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:d[R],isCustom:m[R],short:g[R],group:l[R],push:c[R],pop:f[R],tokenTypeIdx:o[R],tokenType:n[R]}))});let S=!0,w=[];return t.safeMode||r("First Char Optimization",()=>{w=At(n,(I,R,P)=>{if(typeof R.PATTERN=="string"){const z=R.PATTERN.charCodeAt(0),X=_r(z);Lo(I,X,b[P])}else if(re(R.START_CHARS_HINT)){let z;K(R.START_CHARS_HINT,X=>{const Z=typeof X=="string"?X.charCodeAt(0):X,ce=_r(Z);z!==ce&&(z=ce,Lo(I,ce,b[P]))})}else if(Cr(R.PATTERN))if(R.PATTERN.unicode)S=!1,t.ensureOptimizations&&hl(`${yl} Unable to analyze < ${R.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const z=qA(R.PATTERN,t.ensureOptimizations);me(z)&&(S=!1),K(z,X=>{Lo(I,X,b[P])})}else t.ensureOptimizations&&hl(`${yl} TokenType: <${R.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),S=!1;return I},[])}),{emptyGroups:v,patternIdxToConfig:b,charCodeToPatternIdxToConfig:w,hasCustom:a,canBeOptimized:S}}i(YA,"analyzeTokenTypes");function XA(e,t){let r=[];const n=ZA(e);r=r.concat(n.errors);const a=QA(n.valid),s=a.valid;return r=r.concat(a.errors),r=r.concat(JA(s)),r=r.concat(iE(s)),r=r.concat(sE(s,t)),r=r.concat(oE(s)),r}i(XA,"validatePatterns");function JA(e){let t=[];const r=Pt(e,n=>Cr(n[On]));return t=t.concat(eE(r)),t=t.concat(rE(r)),t=t.concat(nE(r)),t=t.concat(aE(r)),t=t.concat(tE(r)),t}i(JA,"validateRegExpPattern");function ZA(e){const t=Pt(e,a=>!B(a,On)),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:_e.MISSING_PATTERN,tokenTypes:[a]})),n=fu(e,t);return{errors:r,valid:n}}i(ZA,"findMissingPatterns");function QA(e){const t=Pt(e,a=>{const s=a[On];return!Cr(s)&&!Pr(s)&&!B(s,"exec")&&!mt(s)}),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:_e.INVALID_PATTERN,tokenTypes:[a]})),n=fu(e,t);return{errors:r,valid:n}}i(QA,"findInvalidPatterns");var ID=/[^\\][$]/;function eE(e){class t extends Vl{static{i(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const r=Pt(e,a=>{const s=a.PATTERN;try{const o=Zs(s),l=new t;return l.visit(o),l.found}catch{return ID.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(eE,"findEndOfInputAnchor");function tE(e){const t=Pt(e,n=>n.PATTERN.test(""));return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:_e.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}i(tE,"findEmptyMatchRegExps");var ND=/[^\\[][\^]|^\^/;function rE(e){class t extends Vl{static{i(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const r=Pt(e,a=>{const s=a.PATTERN;try{const o=Zs(s),l=new t;return l.visit(o),l.found}catch{return ND.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(rE,"findStartOfInputAnchor");function nE(e){const t=Pt(e,n=>{const a=n[On];return a instanceof RegExp&&(a.multiline||a.global)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_e.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}i(nE,"findUnsupportedFlags");function aE(e){const t=[];let r=F(e,s=>At(e,(o,l)=>(s.PATTERN.source===l.PATTERN.source&&!ut(t,l)&&l.PATTERN!==at.NA&&(t.push(l),o.push(l)),o),[]));r=Js(r);const n=Pt(r,s=>s.length>1);return F(n,s=>{const o=F(s,u=>u.name);return{message:`The same RegExp pattern ->${Bt(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:_e.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}i(aE,"findDuplicatePatterns");function iE(e){const t=Pt(e,n=>{if(!B(n,"GROUP"))return!1;const a=n.GROUP;return a!==at.SKIPPED&&a!==at.NA&&!mt(a)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:_e.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}i(iE,"findInvalidGroupType");function sE(e,t){const r=Pt(e,a=>a.PUSH_MODE!==void 0&&!ut(t,a.PUSH_MODE));return F(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:_e.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}i(sE,"findModesThatDoNotExist");function oE(e){const t=[],r=At(e,(n,a,s)=>{const o=a.PATTERN;return o===at.NA||(mt(o)?n.push({str:o,idx:s,tokenType:a}):Cr(o)&&uE(o)&&n.push({str:o.source,idx:s,tokenType:a})),n},[]);return K(e,(n,a)=>{K(r,({str:s,idx:o,tokenType:l})=>{if(a${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:u,type:_e.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}i(oE,"findUnreachablePatterns");function lE(e,t){if(Cr(t)){if(cE(t))return!1;const r=t.exec(e);return r!==null&&r.index===0}else{if(Pr(t))return t(e,0,[],{});if(B(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}i(lE,"tryToMatchStrToPattern");function uE(e){return Ja([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}i(uE,"noMetaChar");function cE(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),B(e,so)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+so+`> property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),B(e,so)&&B(e,Zi)&&!B(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Zi}: <${e.defaultMode}>which does not exist +`,type:_e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),B(e,so)&&K(e.modes,(a,s)=>{K(a,(o,l)=>{if(br(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}> +`,type:_e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(B(o,"LONGER_ALT")){const u=re(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];K(u,c=>{!br(c)&&!ut(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${s}> +`,type:_e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}i(fE,"performRuntimeChecks");function dE(e,t,r){const n=[];let a=!1;const s=Js(Ft(Me(e.modes))),o=du(s,u=>u[On]===at.NA),l=Zp(r);return t&&K(o,u=>{const c=Jp(u,l);if(c!==!1){const d={message:hE(u,c),type:c.issue,tokenType:u};n.push(d)}else B(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(a=!0):mu(l,u.PATTERN)&&(a=!0)}),t&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:_e.NO_LINE_BREAKS_FLAGS}),n}i(dE,"performWarningRuntimeChecks");function pE(e){const t={},r=$t(e);return K(r,n=>{const a=e[n];if(re(a))t[n]=[];else throw Error("non exhaustive match")}),t}i(pE,"cloneEmptyGroups");function Xp(e){const t=e.PATTERN;if(Cr(t))return!1;if(Pr(t))return!0;if(B(t,"exec"))return!0;if(mt(t))return!1;throw Error("non exhaustive match")}i(Xp,"isCustomPattern");function mE(e){return mt(e)&&e.length===1?e.charCodeAt(0):!1}i(mE,"isShortPattern");var PD={test:i(function(e){const t=e.length;for(let r=this.lastIndex;r Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===_e.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}i(hE,"buildLineBreakIssueMessage");function Zp(e){return F(e,r=>mt(r)?r.charCodeAt(0):r)}i(Zp,"getCharCodes");function Lo(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Lo,"addToMapOfArrays");var Qi=256,Do=[];function _r(e){return e255?255+~~(e/255):e}}i(yE,"initCharCodeToOptimizedIndexMap");function si(e,t){const r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}i(si,"tokenStructuredMatcher");function Ss(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}i(Ss,"tokenStructuredMatcherNoCategories");var Wh=1,gE={};function oi(e){const t=vE(e);TE(t),RE(t),$E(t),K(t,r=>{r.isParent=r.categoryMatches.length>0})}i(oi,"augmentTokenTypes");function vE(e){let t=Ye(e),r=e,n=!0;for(;n;){r=Js(Ft(F(r,s=>s.CATEGORIES)));const a=fu(r,t);t=t.concat(a),me(a)?n=!1:r=a}return t}i(vE,"expandCategories");function TE(e){K(e,t=>{em(t)||(gE[Wh]=t,t.tokenTypeIdx=Wh++),kf(t)&&!re(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),kf(t)||(t.CATEGORIES=[]),AE(t)||(t.categoryMatches=[]),EE(t)||(t.categoryMatchesMap={})})}i(TE,"assignTokenDefaultProps");function $E(e){K(e,t=>{t.categoryMatches=[],K(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(gE[n].tokenTypeIdx)})})}i($E,"assignCategoriesTokensProp");function RE(e){K(e,t=>{Qp([],t)})}i(RE,"assignCategoriesMapProp");function Qp(e,t){K(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),K(t.CATEGORIES,r=>{const n=e.concat(t);ut(n,r)||Qp(n,r)})}i(Qp,"singleAssignCategoriesToksMap");function em(e){return B(e,"tokenTypeIdx")}i(em,"hasShortKeyProperty");function kf(e){return B(e,"CATEGORIES")}i(kf,"hasCategoriesProperty");function AE(e){return B(e,"categoryMatches")}i(AE,"hasExtendingTokensTypesProperty");function EE(e){return B(e,"categoryMatchesMap")}i(EE,"hasExtendingTokensTypesMapProperty");function CE(e){return B(e,"tokenTypeIdx")}i(CE,"isTokenType");var Of={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,a,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}},_e;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(_e||(_e={}));var es={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Of,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(es);var at=class{static{i(this,"Lexer")}constructor(e,t=es){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);const{time:o,value:l}=Hp(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=Rt({},es,t);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===es.lineTerminatorsPattern)this.config.lineTerminatorsPattern=PD;else if(this.config.lineTerminatorCharacters===es.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),re(e)?n={modes:{defaultMode:Ye(e)},defaultMode:Zi}:(a=!1,n=Ye(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(fE(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(dE(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},K(n.modes,(o,l)=>{n.modes[l]=du(o,u=>br(u))});const s=$t(n.modes);if(K(n.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(XA(o,s))}),me(this.lexerDefinitionErrors)){oi(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=YA(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Rt({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=n.defaultMode,!me(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=F(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}K(this.lexerDefinitionWarning,o=>{qp(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Fe),this.trackStartLines===!1&&(this.computeNewColumn=Ws),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Fe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=At(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(t.ensureOptimizations&&!me(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{WA()}),this.TRACE_INIT("toFastProperties",()=>{Yp(this)})})}tokenize(e,t=this.defaultMode){if(!me(this.lexerDefinitionErrors)){const n=F(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,a,s,o,l,u,c,f,d,m,g,v,b,S;const w=e,I=w.length;let R=0,P=0;const z=this.hasCustom?0:Math.floor(e.length/10),X=new Array(z),Z=[];let ce=this.trackStartLines?1:void 0,se=this.trackStartLines?1:void 0;const Se=pE(this.emptyGroups),k=this.trackStartLines,C=this.config.lineTerminatorsPattern;let y=0,E=[],T=[];const $=[],_=[];Object.freeze(_);let O=!1;const x=i(Y=>{if($.length===1&&Y.tokenType.PUSH_MODE===void 0){const V=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);Z.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:V})}else{$.pop();const V=kn($);E=this.patternIdxToConfig[V],T=this.charCodeToPatternIdxToConfig[V],y=E.length;const Pe=this.canModeBeOptimized[V]&&this.config.safeMode===!1;T&&Pe?O=!0:O=!1}},"pop_mode");function D(Y){$.push(Y),T=this.charCodeToPatternIdxToConfig[Y],E=this.patternIdxToConfig[Y],y=E.length,y=E.length;const V=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;T&&V?O=!0:O=!1}i(D,"push_mode"),D.call(this,t);let G;const W=this.config.recoveryEnabled;for(;Rl.length){l=s,f=s.length,u=c,G=ke;break}}}break}}if(f!==-1){if(d=G.group,d!==void 0&&(l=l!==null?l:e.substring(R,R+f),m=G.tokenTypeIdx,g=this.createTokenInstance(l,R,m,G.tokenType,ce,se,f),this.handlePayload(g,u),d===!1?P=this.addToken(X,P,g):Se[d].push(g)),k===!0&&G.canLineTerminator===!0){let oe=0,Le,De;C.lastIndex=0;do l=l!==null?l:e.substring(R,R+f),Le=C.test(l),Le===!0&&(De=C.lastIndex-1,oe++);while(Le===!0);oe!==0?(ce=ce+oe,se=f-De,this.updateTokenEndLineColumnLocation(g,d,De,oe,ce,se,f)):se=this.computeNewColumn(se,f)}else se=this.computeNewColumn(se,f);R=R+f,this.handleModes(G,x,D,g)}else{const oe=R,Le=ce,De=se;let ke=W===!1;for(;ke===!1&&R ${In(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:a}){const s="Expecting: ",l=` +but found: '`+Bt(t).image+"'";if(n)return s+n+l;{const u=At(e,(m,g)=>m.concat(g),[]),c=F(u,m=>`[${F(m,g=>In(g)).join(", ")}]`),d=`one of these possible Token sequences: +${F(c,(m,g)=>` ${g+1}. ${m}`).join(` +`)}`;return s+d+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+Bt(t).image+"'";if(r)return a+r+o;{const u=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${F(e,c=>`[${F(c,f=>In(f)).join(",")}]`).join(" ,")}>`;return a+u+o}}};Object.freeze(Ga);var OD={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- +inside top level rule: ->`+e.name+"<-"}},_n={buildDuplicateFoundError(e,t){function r(f){return f instanceof ve?f.terminalType.name:f instanceof st?f.nonTerminalName:""}i(r,"getExtraProductionArgument");const n=e.name,a=Bt(t),s=a.idx,o=Dt(a),l=r(a),u=s>0;let c=`->${o}${u?s:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` +`),c},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=F(e.prefixPath,a=>In(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(e){const t=e.alternation.idx===0?"":e.alternation.idx,r=e.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. +Only the last alternative may be empty. +`;else{const a=F(e.prefixPath,s=>In(s)).join(", ");n+=`<${a}> may appears as a prefix path in all these alternatives. +`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(e){let t=Dt(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name,r=F(e.leftRecursionPath,s=>s.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof ni?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function _E(e,t){const r=new LD(e,t);return r.resolveRefs(),r.errors}i(_E,"resolveGrammar");var LD=class extends ai{static{i(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){K(Me(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:ot.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},DD=class extends pu{static{i(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ye(this.path.ruleStack).reverse(),this.occurrenceStack=Ye(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){me(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},xD=class extends DD{static{i(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(r),a=new ht({definition:n});this.possibleTokTypes=ii(a),this.found=!0}}},hu=class extends pu{static{i(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},MD=class extends hu{static{i(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},ey=class extends hu{static{i(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},GD=class extends hu{static{i(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},ty=class extends hu{static{i(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};function Tl(e,t,r=[]){r=Ye(r);let n=[],a=0;function s(l){return l.concat(qe(e,a+1))}i(s,"remainingPathWith");function o(l){const u=Tl(s(l),t,r);return n.concat(u)}for(i(o,"getAlternativesForProd");r.length{me(u.definition)===!1&&(n=o(u.definition))}),n;if(l instanceof ve)r.push(l.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:qe(e,a)}),n}i(Tl,"possiblePathsFrom");function nm(e,t,r,n){const a="EXIT_NONE_TERMINAL",s=[a],o="EXIT_ALTERNATIVE";let l=!1;const u=t.length,c=u-n-1,f=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!me(d);){const m=d.pop();if(m===o){l&&kn(d).idx<=c&&d.pop();continue}const g=m.def,v=m.idx,b=m.ruleStack,S=m.occurrenceStack;if(me(g))continue;const w=g[0];if(w===a){const I={idx:v,def:qe(g),ruleStack:bs(b),occurrenceStack:bs(S)};d.push(I)}else if(w instanceof ve)if(v=0;I--){const R=w.definition[I],P={idx:v,def:R.definition.concat(qe(g)),ruleStack:b,occurrenceStack:S};d.push(P),d.push(o)}else if(w instanceof ht)d.push({idx:v,def:w.definition.concat(qe(g)),ruleStack:b,occurrenceStack:S});else if(w instanceof ni)d.push(SE(w,v,b,S));else throw Error("non exhaustive match")}return f}i(nm,"nextPossibleTokensAfter");function SE(e,t,r,n){const a=Ye(r);a.push(e.name);const s=Ye(n);return s.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:s}}i(SE,"expandTopLevelRule");var Re;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Re||(Re={}));function yu(e){if(e instanceof He||e==="Option")return Re.OPTION;if(e instanceof be||e==="Repetition")return Re.REPETITION;if(e instanceof Et||e==="RepetitionMandatory")return Re.REPETITION_MANDATORY;if(e instanceof Ct||e==="RepetitionMandatoryWithSeparator")return Re.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof yt||e==="RepetitionWithSeparator")return Re.REPETITION_WITH_SEPARATOR;if(e instanceof gt||e==="Alternation")return Re.ALTERNATION;throw Error("non exhaustive match")}i(yu,"getProdType");function Lf(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:a}=e,s=yu(n);return s===Re.ALTERNATION?eo(t,r,a):to(t,r,s,a)}i(Lf,"getLookaheadPaths");function wE(e,t,r,n,a,s){const o=eo(e,t,r),l=im(o)?Ss:si;return s(o,n,l,a)}i(wE,"buildLookaheadFuncForOr");function IE(e,t,r,n,a,s){const o=to(e,t,a,r),l=im(o)?Ss:si;return s(o[0],l,n)}i(IE,"buildLookaheadFuncForOptionalProd");function NE(e,t,r,n){const a=e.length,s=zt(e,o=>zt(o,l=>l.length===1));if(t)return function(o){const l=F(o,u=>u.GATE);for(let u=0;uFt(u)),l=At(o,(u,c,f)=>(K(c,d=>{B(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),K(d.categoryMatches,m=>{B(u,m)||(u[m]=f)})}),u),{});return function(){const u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let o=0;os.length===1),a=e.length;if(n&&!r){const s=Ft(e);if(s.length===1&&me(s[0].categoryMatches)){const l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{const o=At(s,(l,u,c)=>(l[u.tokenTypeIdx]=!0,K(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){const l=this.LA(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sTl([o],1)),n=Df(r.length),a=F(r,o=>{const l={};return K(o,u=>{const c=xo(u.partialPath);K(c,f=>{l[f]=!0})}),l});let s=r;for(let o=1;o<=t;o++){const l=s;s=Df(l.length);for(let u=0;u{const w=xo(S.partialPath);K(w,I=>{a[u][I]=!0})})}}}}return n}i(am,"lookAheadSequenceFromAlternatives");function eo(e,t,r,n){const a=new kE(e,Re.ALTERNATION,n);return t.accept(a),am(a.result,r)}i(eo,"getLookaheadPathsForOr");function to(e,t,r,n){const a=new kE(e,r);t.accept(a);const s=a.result,l=new FD(t,e,r).startWalking(),u=new ht({definition:s}),c=new ht({definition:l});return am([u,c],n)}i(to,"getLookaheadPathsForOptionalProd");function $l(e,t){e:for(let r=0;r{const a=t[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}i(LE,"isStrictPrefixOfPath");function im(e){return zt(e,t=>zt(t,r=>zt(r,n=>me(n.categoryMatches))))}i(im,"areTokenCategoriesNotUsed");function DE(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return F(t,r=>Object.assign({type:ot.CUSTOM_LOOKAHEAD_VALIDATION},r))}i(DE,"validateLookahead");function xE(e,t,r,n){const a=St(e,u=>ME(u,r)),s=qE(e,t,r),o=St(e,u=>UE(u,r)),l=St(e,u=>FE(u,e,n,r));return a.concat(s,o,l)}i(xE,"validateGrammar");function ME(e,t){const r=new zD;e.accept(r);const n=r.allProductions,a=eD(n,GE),s=Ut(a,l=>l.length>1);return F(Me(s),l=>{const u=Bt(l),c=t.buildDuplicateFoundError(e,l),f=Dt(u),d={message:c,type:ot.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:f,occurrence:u.idx},m=sm(u);return m&&(d.parameter=m),d})}i(ME,"validateDuplicateProductions");function GE(e){return`${Dt(e)}_#_${e.idx}_#_${sm(e)}`}i(GE,"identifyProductionForDuplicates");function sm(e){return e instanceof ve?e.terminalType.name:e instanceof st?e.nonTerminalName:""}i(sm,"getExtraProductionArgument");var zD=class extends ai{static{i(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function FE(e,t,r,n){const a=[];if(At(t,(o,l)=>l.name===e.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});a.push({message:o,type:ot.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}i(FE,"validateRuleDoesNotAlreadyExist");function zE(e,t,r){const n=[];let a;return ut(t,e)||(a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:ot.INVALID_RULE_OVERRIDE,ruleName:e})),n}i(zE,"validateRuleIsOverridden");function om(e,t,r,n=[]){const a=[],s=hs(t.definition);if(me(s))return[];{const o=e.name;ut(s,e)&&a.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:ot.LEFT_RECURSION,ruleName:o});const u=fu(s,n.concat([e])),c=St(u,f=>{const d=Ye(n);return d.push(f),om(e,f,r,d)});return a.concat(c)}}i(om,"validateNoLeftRecursion");function hs(e){let t=[];if(me(e))return t;const r=Bt(e);if(r instanceof st)t.push(r.referencedRule);else if(r instanceof ht||r instanceof He||r instanceof Et||r instanceof Ct||r instanceof yt||r instanceof be)t=t.concat(hs(r.definition));else if(r instanceof gt)t=Ft(F(r.definition,s=>hs(s.definition)));else if(!(r instanceof ve))throw Error("non exhaustive match");const n=_s(r),a=e.length>1;if(n&&a){const s=qe(e);return t.concat(hs(s))}else return t}i(hs,"getFirstNoneTerminal");var lm=class extends ai{static{i(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function jE(e,t){const r=new lm;e.accept(r);const n=r.alternations;return St(n,s=>{const o=bs(s.definition);return St(o,(l,u)=>{const c=nm([l],[],si,1);return me(c)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:u}),type:ot.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:u+1}]:[]})})}i(jE,"validateEmptyOrAlternative");function BE(e,t,r){const n=new lm;e.accept(n);let a=n.alternations;return a=du(a,o=>o.ignoreAmbiguities===!0),St(a,o=>{const l=o.idx,u=o.maxLookahead||t,c=eo(l,e,u,o),f=WE(c,o,e,r),d=VE(c,o,e,r);return f.concat(d)})}i(BE,"validateAmbiguousAlternationAlternatives");var jD=class extends ai{static{i(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function UE(e,t){const r=new lm;e.accept(r);const n=r.alternations;return St(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:ot.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}i(UE,"validateTooManyAlts");function KE(e,t,r){const n=[];return K(e,a=>{const s=new jD;a.accept(s);const o=s.allProductions;K(o,l=>{const u=yu(l),c=l.maxLookahead||t,f=l.idx,m=to(f,a,u,c)[0];if(me(Ft(m))){const g=r.buildEmptyRepetitionError({topLevelRule:a,repetition:l});n.push({message:g,type:ot.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}i(KE,"validateSomeNonEmptyLookaheadPath");function WE(e,t,r,n){const a=[],s=At(e,(l,u,c)=>(t.definition[c].ignoreAmbiguities===!0||K(u,f=>{const d=[c];K(e,(m,g)=>{c!==g&&$l(m,f)&&t.definition[g].ignoreAmbiguities!==!0&&d.push(g)}),d.length>1&&!$l(a,f)&&(a.push(f),l.push({alts:d,path:f}))}),l),[]);return F(s,l=>{const u=F(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:u,prefixPath:l.path}),type:ot.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:l.alts}})}i(WE,"checkAlternativesAmbiguities");function VE(e,t,r,n){const a=At(e,(o,l,u)=>{const c=F(l,f=>({idx:u,path:f}));return o.concat(c)},[]);return Js(St(a,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];const u=o.idx,c=o.path,f=Pt(a,m=>t.definition[m.idx].ignoreAmbiguities!==!0&&m.idx{const g=[m.idx+1,u+1],v=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:g,prefixPath:m.path}),type:ot.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:v,alternatives:g}})}))}i(VE,"checkPrefixAlternativesAmbiguities");function qE(e,t,r){const n=[],a=F(t,s=>s.name);return K(e,s=>{const o=s.name;if(ut(a,o)){const l=r.buildNamespaceConflictError(s);n.push({message:l,type:ot.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}i(qE,"checkTerminalAndNoneTerminalsNameSpace");function HE(e){const t=Wp(e,{errMsgProvider:OD}),r={};return K(e.rules,n=>{r[n.name]=n}),_E(r,t.errMsgProvider)}i(HE,"resolveGrammar");function YE(e){return e=Wp(e,{errMsgProvider:_n}),xE(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}i(YE,"validateGrammar");var XE="MismatchedTokenException",JE="NoViableAltException",ZE="EarlyExitException",QE="NotAllInputParsedException",eC=[XE,JE,ZE,QE];Object.freeze(eC);function ws(e){return ut(eC,e.name)}i(ws,"isRecognitionException");var gu=class extends Error{static{i(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},tC=class extends gu{static{i(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=XE}},BD=class extends gu{static{i(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=JE}},UD=class extends gu{static{i(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=QE}},KD=class extends gu{static{i(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=ZE}},Hu={},rC="InRuleRecoveryException",WD=class extends Error{static{i(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=rC}},VD=class{static{i(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=B(e,"recoveryEnabled")?e.recoveryEnabled:Sr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=nC)}getTokenToInsert(e){const t=Qs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=i(()=>{const d=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:d,ruleName:this.getCurrRuleFullName()}),g=new tC(m,u,this.LA(0));g.resyncedTokens=bs(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(c,n)){f();return}else if(r.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(c,a)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new WD("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||me(t))return!1;const r=this.LA(1);return Ja(t,a=>this.tokenMatcher(r,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return ut(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const n=Ja(e,a=>rm(t,a));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Hu;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return F(e,(r,n)=>n===0?Hu:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){const e=F(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return Ft(e)}getFollowSetFromFollowKey(e){if(e===Hu)return[Ur];const t=e.ruleName+e.idxInCallingRule+BA+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ur)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return bs(t)}attemptInRepetitionRecovery(e,t,r,n,a,s,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),n=Ye(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return F(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function nC(e,t,r,n,a,s,o){const l=this.getKeyForAutomaticLookahead(n,a);let u=this.firstAfterRepMap[l];if(u===void 0){const m=this.getCurrRuleFullName(),g=this.getGAstProductions()[m];u=new s(g,a).startWalking(),this.firstAfterRepMap[l]=u}let c=u.token,f=u.occurrence;const d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=Ur,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,o)&&this.tryInRepetitionRecovery(e,t,r,c)}i(nC,"attemptInRepetitionRecovery");var qD=4,Yr=8,aC=1<om(t,t,_n))}validateEmptyOrAlternatives(e){return St(e,t=>jE(t,_n))}validateAmbiguousAlternationAlternatives(e,t){return St(e,r=>BE(r,t,_n))}validateSomeNonEmptyLookaheadPath(e,t){return KE(e,t,_n)}buildLookaheadForAlternation(e){return wE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,NE)}buildLookaheadForOptional(e){return IE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,yu(e.prodType),PE)}},HD=class{static{i(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=B(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Sr.dynamicTokensEnabled,this.maxLookahead=B(e,"maxLookahead")?e.maxLookahead:Sr.maxLookahead,this.lookaheadStrategy=B(e,"lookaheadStrategy")?e.lookaheadStrategy:new um({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){K(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:n,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=sC(t);K(r,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${Dt(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:t,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Go(this.fullRuleNameToShort[t.name],aC,u.idx);this.setLaFuncCache(d,f)})}),K(n,u=>{this.computeLookaheadFunc(t,u.idx,xf,"Repetition",u.maxLookahead,Dt(u))}),K(a,u=>{this.computeLookaheadFunc(t,u.idx,iC,"Option",u.maxLookahead,Dt(u))}),K(s,u=>{this.computeLookaheadFunc(t,u.idx,Mf,"RepetitionMandatory",u.maxLookahead,Dt(u))}),K(o,u=>{this.computeLookaheadFunc(t,u.idx,Mo,"RepetitionMandatoryWithSeparator",u.maxLookahead,Dt(u))}),K(l,u=>{this.computeLookaheadFunc(t,u.idx,Gf,"RepetitionWithSeparator",u.maxLookahead,Dt(u))})})})}computeLookaheadFunc(e,t,r,n,a,s){this.TRACE_INIT(`${s}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),l=Go(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Go(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},YD=class extends ai{static{i(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},oo=new YD;function sC(e){oo.reset(),e.accept(oo);const t=oo.dslMethods;return oo.reset(),t}i(sC,"collectMethods");function Ff(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${s.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}i(cC,"createBaseSemanticVisitorConstructor");function fC(e,t,r){const n=i(function(){},"derivedConstructor");cm(n,e+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return K(t,s=>{a[s]=uC}),n.prototype=a,n.prototype.constructor=n,n}i(fC,"createBaseVisitorConstructorWithDefaults");var jf;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(jf||(jf={}));function dC(e,t){return pC(e,t)}i(dC,"validateVisitor");function pC(e,t){const r=Pt(t,a=>Pr(e[a])===!1),n=F(r,a=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:jf.MISSING_METHOD,methodName:a}));return Js(n)}i(pC,"validateMissingCstMethods");var JD=class{static{i(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=B(e,"nodeLocationTracking")?e.nodeLocationTracking:Sr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Fe,this.cstFinallyStateUpdate=Fe,this.cstPostTerminal=Fe,this.cstPostNonTerminal=Fe,this.cstPostRule=Fe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=zf,this.setNodeLocationFromNode=zf,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ff,this.setNodeLocationFromNode=Ff,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=Fe,this.setInitialNodeLocation=Fe;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];oC(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];lC(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(br(this.baseCstVisitorConstructor)){const e=cC(this.className,$t(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(br(this.baseCstVisitorWithDefaultsConstructor)){const e=fC(this.className,$t(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},ZD=class{static{i(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Rl}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Rl:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},QD=class{static{i(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,r=Al){if(ut(this.definedRulesNames,e)){const s={message:_n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ot.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=Al){const n=zE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const a=this.defineRule(e,t,r);return this[e]=a,a}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(ws(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return xA(Me(this.gastProductionsCache))}},ex=class{static{i(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Ss,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},B(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(re(e)){if(me(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(re(e))this.tokensMap=At(e,(a,s)=>(a[s.name]=s,a),{});else if(B(e,"modes")&&zt(Ft(Me(e.modes)),CE)){const a=Ft(Me(e.modes)),s=Vp(a);this.tokensMap=At(s,(o,l)=>(o[l.name]=l,o),{})}else if(It(e))this.tokensMap=Ye(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ur;const r=B(e,"modes")?Ft(Me(e.modes)):Me(e),n=zt(r,a=>me(a.categoryMatches));this.tokenMatcher=n?Ss:si,oi(Me(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=B(r,"resyncEnabled")?r.resyncEnabled:Al.resyncEnabled,a=B(r,"recoveryValueFunc")?r.recoveryValueFunc:Al.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(n.call(this)===!0)return a.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(Mf,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const s=t.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=t;if(n.call(this)===!0){let s=this.doSingleRepetition(a);for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,Mf,e,GD)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Mo,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,ty],o,Mo,e,ty)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(xf,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=i(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=t;let s=!0;for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,xf,e,MD,s)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Gf,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,ey],o,Gf,e,ey)}}repetitionSepSecondInternal(e,t,r,n,a){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,a],r,Mo,e,a)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(aC,t),n=re(e)?e:e.DEF,s=this.getLaFuncFromCache(r).call(this,n);if(s!==void 0)return n[s].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new UD(t,e))}}subruleInternal(e,t,r){let n;try{const a=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,a),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}}subruleInternalError(e,t,r){throw ws(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),n=a):this.consumeInternalError(e,a,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const a=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new tC(n,t,a))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(a){throw a.name===rC?r:a}}else throw r}saveRecogState(){const e=this.errors,t=Ye(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ur)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},tx=class{static{i(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=B(e,"errorMessageProvider")?e.errorMessageProvider:Sr.errorMessageProvider}SAVE_ERROR(e){if(ws(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ye(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ye(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],o=to(e,a,t,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new KD(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=eo(e,n,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new BD(l,this.LA(1),o))}},rx=class{static{i(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(br(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return nm([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Bt(e.ruleStack),n=this.getGAstProductions()[t];return new xD(n,e).startWalking()}},vu={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vu);var ry=!0,ny=Math.pow(2,Yr)-1,mC=ja({name:"RECORDING_PHASE_TOKEN",pattern:at.NA});oi([mC]);var hC=Qs(mC,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(hC);var nx={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},ax=class{static{i(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Rl}topLevelRuleRecord(e,t){try{const r=new ni({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return Ra.call(this,He,e,t)}atLeastOneInternalRecord(e,t){Ra.call(this,Et,t,e)}atLeastOneSepFirstInternalRecord(e,t){Ra.call(this,Ct,t,e,ry)}manyInternalRecord(e,t){Ra.call(this,be,t,e)}manySepFirstInternalRecord(e,t){Ra.call(this,yt,t,e,ry)}orInternalRecord(e,t){return yC.call(this,e,t)}subruleInternalRecord(e,t,r){if(Is(t),!e||B(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=kn(this.recordingProdStack),a=e.ruleName,s=new st({idx:t,nonTerminalName:a,label:r?.LABEL,referencedRule:void 0});return n.definition.push(s),this.outputCst?nx:vu}consumeInternalRecord(e,t,r){if(Is(t),!em(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const n=kn(this.recordingProdStack),a=new ve({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(a),hC}};function Ra(e,t,r,n=!1){Is(r);const a=kn(this.recordingProdStack),s=Pr(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),B(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),vu}i(Ra,"recordProd");function yC(e,t){Is(t);const r=kn(this.recordingProdStack),n=re(e)===!1,a=n===!1?e:e.DEF,s=new gt({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});B(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=PA(a,l=>Pr(l.GATE));return s.hasPredicates=o,r.definition.push(s),K(a,l=>{const u=new ht({definition:[]});s.definition.push(u),B(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:B(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),vu}i(yC,"recordOrProd");function Bf(e){return e===0?"":`${e}`}i(Bf,"getIdxSuffix");function Is(e){if(e<0||e>ny){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${ny+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}i(Is,"assertMethodIdxIsValid");var ix=class{static{i(this,"PerformanceTracer")}initPerformanceTracer(e){if(B(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Sr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:n,value:a}=Hp(t),s=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,a}else return t()}};function gC(e,t){t.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,a);s&&(s.get||s.set)?Object.defineProperty(e.prototype,a,s):e.prototype[a]=r.prototype[a]})})}i(gC,"applyMixins");var Rl=Qs(Ur,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Rl);var Sr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ga,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Al=Object.freeze({recoveryValueFunc:i(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ot;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ot||(ot={}));function Uf(e=void 0){return function(){return e}}i(Uf,"EMPTY_ALT");var fm=class vC{static{i(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Yp(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),K(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let l;this.TRACE_INIT(`${a} Rule`,()=>{l=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=HE({rules:Me(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(me(n)&&this.skipValidations===!1){const a=YE({rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),errMsgProvider:_n,grammarName:r}),s=DE({lookaheadStrategy:this.lookaheadStrategy,rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,s)}}),me(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=UA(Me(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,s;(s=(a=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(a,{rules:Me(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Me(this.gastProductionsCache))})),!vC.DEFER_DEFINITION_ERRORS_HANDLING&&!me(this.definitionErrors))throw t=F(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${t.join(` +------------------------------- +`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),B(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=B(r,"skipValidations")?r.skipValidations:Sr.skipValidations}};fm.DEFER_DEFINITION_ERRORS_HANDLING=!1;gC(fm,[VD,HD,JD,ZD,ex,QD,tx,rx,ax,ix]);var sx=class extends fm{static{i(this,"EmbeddedActionsParser")}constructor(e,t=Sr){const r=Ye(t);r.outputCst=!1,super(e,r)}};function TC(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r-1}i(SC,"listCacheHas");var dx=SC;function wC(e,t){var r=this.__data__,n=Tu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(wC,"listCacheSet");var px=wC;function Yn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&TM?new ob:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=e1}i(Nb,"isLength");var mm=Nb,t1="[object Arguments]",r1="[object Array]",n1="[object Boolean]",a1="[object Date]",i1="[object Error]",s1="[object Function]",o1="[object Map]",l1="[object Number]",u1="[object Object]",c1="[object RegExp]",f1="[object Set]",d1="[object String]",p1="[object WeakMap]",m1="[object ArrayBuffer]",h1="[object DataView]",y1="[object Float32Array]",g1="[object Float64Array]",v1="[object Int8Array]",T1="[object Int16Array]",$1="[object Int32Array]",R1="[object Uint8Array]",A1="[object Uint8ClampedArray]",E1="[object Uint16Array]",C1="[object Uint32Array]",ge={};ge[y1]=ge[g1]=ge[v1]=ge[T1]=ge[$1]=ge[R1]=ge[A1]=ge[E1]=ge[C1]=!0;ge[t1]=ge[r1]=ge[m1]=ge[n1]=ge[h1]=ge[a1]=ge[i1]=ge[s1]=ge[o1]=ge[l1]=ge[u1]=ge[c1]=ge[f1]=ge[d1]=ge[p1]=!1;function Pb(e){return Za(e)&&mm(e.length)&&!!ge[li(e)]}i(Pb,"baseIsTypedArray");var b1=Pb;function kb(e){return function(t){return e(t)}}i(kb,"baseUnary");var _1=kb,Ob=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ys=Ob&&typeof module=="object"&&module&&!module.nodeType&&module,S1=ys&&ys.exports===Ob,Ju=S1&&OC.process,w1=(function(){try{var e=ys&&ys.require&&ys.require("util").types;return e||Ju&&Ju.binding&&Ju.binding("util")}catch{}})(),py=w1,my=py&&py.isTypedArray,I1=my?_1(my):b1,hm=I1,N1=Object.prototype,P1=N1.hasOwnProperty;function Lb(e,t){var r=lt(e),n=!r&&Eu(e),a=!r&&!n&&El(e),s=!r&&!n&&!a&&hm(e),o=r||n||a||s,l=o?UM(e.length,String):[],u=l.length;for(var c in e)(t||P1.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ib(c,u)))&&l.push(c);return l}i(Lb,"arrayLikeKeys");var k1=Lb,O1=Object.prototype;function Db(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O1;return e===r}i(Db,"isPrototype");var xb=Db;function Mb(e,t){return function(r){return e(t(r))}}i(Mb,"overArg");var L1=Mb,D1=L1(Object.keys,Object),x1=D1,M1=Object.prototype,G1=M1.hasOwnProperty;function Gb(e){if(!xb(e))return x1(e);var t=[];for(var r in Object(e))G1.call(e,r)&&r!="constructor"&&t.push(r);return t}i(Gb,"baseKeys");var Fb=Gb;function zb(e){return e!=null&&mm(e.length)&&!zC(e)}i(zb,"isArrayLike");var Cu=zb;function jb(e){return Cu(e)?k1(e):Fb(e)}i(jb,"keys");var ym=jb;function Bb(e){return MM(e,ym,BM)}i(Bb,"getAllKeys");var hy=Bb,F1=1,z1=Object.prototype,j1=z1.hasOwnProperty;function Ub(e,t,r,n,a,s){var o=r&F1,l=hy(e),u=l.length,c=hy(t),f=c.length;if(u!=f&&!o)return!1;for(var d=u;d--;){var m=l[d];if(!(o?m in t:j1.call(t,m)))return!1}var g=s.get(e),v=s.get(t);if(g&&v)return g==t&&v==e;var b=!0;s.set(e,t),s.set(t,e);for(var S=o;++dCm(e,t,o));return ea(e,t,n,r,...a)}i(D_,"alternation");function x_(e,t,r){const n=Ge(e,t,r,{type:Kr});Or(e,n);const a=ea(e,t,n,r,Xr(e,t,r));return M_(e,t,r,a)}i(x_,"option");function Xr(e,t,r){const n=GG(Tr(r.definition,a=>Cm(e,t,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:F_(e,n)}i(Xr,"block");function bm(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:UG});Or(e,l);const u=Ge(e,t,r,{type:S_});return s.loopback=l,u.loopback=l,e.decisionMap[Ln(t,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Ie(o,l),a===void 0?(Ie(l,s),Ie(l,u)):(Ie(l,u),Ie(l,a.left),Ie(a.right,s)),{left:s,right:u}}i(bm,"plus");function _m(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:BG});Or(e,l);const u=Ge(e,t,r,{type:S_}),c=Ge(e,t,r,{type:jG});return l.loopback=c,u.loopback=c,Ie(l,s),Ie(l,u),Ie(o,c),a!==void 0?(Ie(c,u),Ie(c,a.left),Ie(a.right,s)):Ie(c,l),e.decisionMap[Ln(t,a?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}i(_m,"star");function M_(e,t,r,n){const a=n.left,s=n.right;return Ie(a,s),e.decisionMap[Ln(t,"Option",r.idx)]=a,n}i(M_,"optional");function Or(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}i(Or,"defineDecisionState");function ea(e,t,r,n,...a){const s=Ge(e,t,n,{type:zG,start:r});r.end=s;for(const l of a)l!==void 0?(Ie(r,l.left),Ie(l.right,s)):Ie(r,s);const o={left:r,right:s};return e.decisionMap[Ln(t,G_(n),n.idx)]=r,o}i(ea,"makeAlts");function G_(e){if(e instanceof gt)return"Alternation";if(e instanceof He)return"Option";if(e instanceof be)return"Repetition";if(e instanceof yt)return"RepetitionWithSeparator";if(e instanceof Et)return"RepetitionMandatory";if(e instanceof Ct)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}i(G_,"getProdType");function F_(e,t){const r=t.length;for(let s=0;se.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}};function Sm(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}i(Sm,"getATNConfigKey");function U_(e,t,r){for(var n=-1,a=e.length;++n0&&r(l)?t>1?wm(l,t-1,r,n,a):gb(a,l):n||(a[a.length]=l)}return a}i(wm,"baseFlatten");var q_=wm;function H_(e,t){return q_(Tr(e,t),1)}i(H_,"flatMap");var HG=H_;function Y_(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s-1}i(Q_,"arrayIncludes");var QG=Q_;function eS(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=iF){var c=t?null:aF(e);if(c)return pm(c);o=!1,a=cb,u=new ob}else u=t?[]:l;e:for(;++n{const a=n.toString();let s=r[a];return s!==void 0||(s={atnStartState:e,decision:t,states:{}},r[a]=s),s}}i(dS,"createDFACache");var pS=class{static{i(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=I_(e.rules),this.dfas=mS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Ln(r,"Alternation",t),c=this.atn.decisionMap[l].decision,f=Tr(Lf({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),d=>Tr(d,m=>m[0]));if(Yf(f,!1)&&!a){const d=Sy(f,(m,g,v)=>(Zu(g,b=>{b&&(m[b.tokenTypeIdx]=v,Zu(b.categoryMatches,S=>{m[S]=v}))}),m),{});return n?function(m){var g;const v=this.LA(1),b=d[v.tokenTypeIdx];if(m!==void 0&&b!==void 0){const S=(g=m[b])===null||g===void 0?void 0:g.GATE;if(S!==void 0&&S.call(this)===!1)return}return b}:function(){const m=this.LA(1);return d[m.tokenTypeIdx]}}else return n?function(d){const m=new pS,g=d===void 0?0:d.length;for(let b=0;bTr(d,m=>m[0]));if(Yf(f)&&f[0][0]&&!a){const d=f[0],m=lF(d);if(m.length===1&&hF(m[0].categoryMatches)){const v=m[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const g=Sy(m,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,Zu(b.categoryMatches,S=>{v[S]=!0})),v),{});return function(){const v=this.LA(1);return g[v.tokenTypeIdx]===!0}}}return function(){const d=zo.call(this,s,c,wy,o);return typeof d=="object"?!1:d===0}}};function Yf(e,t=!0){const r=new Set;for(const n of e){const a=new Set;for(const s of n){if(s===void 0){if(t)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const l of o)if(r.has(l)){if(!a.has(l))return!1}else r.add(l),a.add(l)}}return!0}i(Yf,"isLL1Sequence");function mS(e){const t=e.decisionStates.length,r=Array(t);for(let n=0;nIn(a)).join(", "),r=e.production.idx===0?"":e.production.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${TS(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}i(vS,"buildAmbiguityError");function TS(e){if(e instanceof st)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof gt)return"OR";if(e instanceof Et)return"AT_LEAST_ONE";if(e instanceof Ct)return"AT_LEAST_ONE_SEP";if(e instanceof yt)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(TS,"getProductionDslName");function $S(e,t,r){const n=HG(t.configs.elements,s=>s.state.transitions),a=oF(n.filter(s=>s instanceof Am).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:e}}i($S,"buildAdaptivePredictError");function RS(e,t){return e.edges[t.tokenTypeIdx]}i(RS,"getExistingTargetState");function AS(e,t,r){const n=new Hf,a=[];for(const o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===ro){a.push(o);continue}const l=o.state.transitions.length;for(let u=0;u0&&!SS(s))for(const o of a)s.add(o);return s}i(AS,"computeReachSet");function ES(e,t){if(e instanceof Am&&rm(t,e.tokenType))return e.target}i(ES,"getReachableTarget");function CS(e,t){let r;for(const n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}i(CS,"getUniqueAlt");function Im(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}i(Im,"newDFAState");function Xf(e,t,r,n){return n=Nm(e,n),t.edges[r.tokenTypeIdx]=n,n}i(Xf,"addDFAEdge");function Nm(e,t){if(t===Cl)return t;const r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}i(Nm,"addDFAState");function bS(e){const t=new Hf,r=e.transitions.length;for(let n=0;n0){const a=[...e.stack],o={state:a.pop(),alt:e.alt,stack:a};Os(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}i(PS,"hasConflictingAltSet");function kS(e){for(const t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}i(kS,"hasStateAssociatedWithOneAlt");xs();var OS=class{static{i(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new km(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new ku;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new bl(e.startOffset,e.image.length,$s(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const a of e){const s=new bl(a.startOffset,a.image.length,$s(a),a.tokenType,!0);s.root=this.rootNode,t.push(s)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const a=r.container.content.indexOf(r);if(a>0){r.container.content.splice(a,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},Pm=class{static{i(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},bl=class extends Pm{static{i(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,r,n,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},ku=class extends Pm{static{i(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new TF(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},TF=class LS extends Array{static{i(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,LS.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(const r of t)r.container=this.parent}},km=class extends ku{static{i(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},_l=Symbol("Datatype");function jo(e){return e.$type===_l}i(jo,"isDataTypeNode");var Iy="​",DS=i(e=>e.endsWith(Iy)?e:e+Iy,"withRuleSuffix"),Om=class{static{i(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new RF(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new FS(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},xS=class extends Om{static{i(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new OS,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e);let n;qa(e)&&(n=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(DS(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,a),it(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===_l?s.value="":t!==void 0&&(s.$infixName=t)}return r(n),a?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){const n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){const a=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:l}=this.getAssignment(r),u=this.current;if(o){const c=Ar(r)?n.image:this.converter.convert(n.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(jo(u)){let c=n.image;Ar(r)||(c=this.converter.convert(c,s).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,a){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,a)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,n,s))}}performSubruleAssignment(e,t,r){const{assignment:n,crossRef:a}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,a);else if(!n){const s=this.current;if(jo(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const a={$type:e};this.stack.push(a),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):jo(e)?this.converter.convert(e.value,e.$cstNode):(Pd(this.astReflection,e),e)}constructInfix(e,t){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let a=0,s=-1;for(let v=0;vs?(s=S.precedence,a=v):S.precedence===s&&(S.rightAssoc||(a=v))}const o=n.slice(0,a),l=n.slice(a+1),u=r.slice(0,a+1),c=r.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},m=this.constructInfix(f,t),g=this.constructInfix(d,t);return{$type:e.$type,$cstNode:e.$cstNode,left:m,operator:n[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=Mn(e,Rr);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Fn(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,a){const s=this.current;let o;switch(a==="single"&&typeof r=="string"?o=this.linker.buildReference(s,t,n,r):a==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(s,t,n,r):o=r,e){case"=":{s[t]=o;break}case"?=":{s[t]=!0;break}case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,a]of Object.entries(t)){const s=e[n];s===void 0?e[n]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[n]=a)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},MS=class{static{i(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return Ga.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ga.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ga.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ga.buildEarlyExitMessage(e)}},Lm=class extends MS{static{i(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},GS=class extends Om{static{i(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const r=this.wrapper.DEFINE_RULE(DS(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,a){this.before(n),this.wrapper.wrapSubrule(e,t,a),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},$F={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Lm},FS=class extends sx{static{i(this,"ChevrotainWrapper")}constructor(e,t){const r=t&&"maxLookahead"in t;super(e,{...$F,lookaheadStrategy:r?new um({maxLookahead:t.maxLookahead}):new vF({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},RF=class extends FS{static{i(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};function Ou(e,t,r){return zS({parser:t,tokens:r,ruleNames:new Map},e),t}i(Ou,"createParser");function zS(e,t){const r=Hl(t,!1),n=ue(t.rules).filter(it).filter(s=>r.has(s));for(const s of n){const o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(s,Wr(o,s.definition))}const a=ue(t.rules).filter(qa).filter(s=>r.has(s));for(const s of a)e.parser.rule(s,jS(e,s))}i(zS,"buildRules");function jS(e,t){const r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(Nt(r))throw new Error("Cannot use terminal rule in infix expression");const n=t.operators.precedences.flatMap(g=>g.operators),a={$type:"Group",elements:[]},s={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(s,o);const u={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...s,$container:o};o.elements.push(u,c);const d=n.map(g=>e.tokens[g.value]).map((g,v)=>({ALT:i(()=>e.parser.consume(v,g,u),"ALT")}));let m;return g=>{m??(m=Lu(e,r)),e.parser.subrule(0,m,!1,s,g),e.parser.many(0,{DEF:i(()=>{e.parser.alternatives(0,d),e.parser.subrule(1,m,!1,c,g)},"DEF")})}}i(jS,"buildInfixRule");function Wr(e,t,r=!1){let n;if(Ar(t))n=HS(e,t);else if(jr(t))n=BS(e,t);else if(Rr(t))n=Wr(e,t.terminal);else if(Fn(t))n=Dm(e,t);else if(Er(t))n=US(e,t);else if(Fl(t))n=WS(e,t);else if(Ul(t))n=VS(e,t);else if(zn(t))n=qS(e,t);else if(Gd(t)){const a=e.consume++;n=i(()=>e.parser.consume(a,Ur,t),"method")}else throw new Wl(t.$cstNode,`Unexpected element type: ${t.$type}`);return xm(e,r?void 0:Ls(t),n,t.cardinality)}i(Wr,"buildElement");function BS(e,t){const r=Pn(t);return()=>e.parser.action(r,t)}i(BS,"buildAction");function US(e,t){const r=t.rule.ref;if(Gn(r)){const n=e.subrule++,a=it(r)&&r.fragment,s=t.arguments.length>0?KS(r,t.arguments):()=>({});let o;return l=>{o??(o=Lu(e,r)),e.parser.subrule(n,o,a,t,s(l))}}else if(Nt(r)){const n=e.consume++,a=Sl(e,r.name);return()=>e.parser.consume(n,a,t)}else if(r)qr();else throw new Wl(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}i(US,"buildRuleCall");function KS(e,t){if(t.some(n=>n.calledByName)){const n=t.map(a=>({parameterName:a.parameter?.ref?.name,predicate:xt(a.value)}));return a=>{const s={};for(const{parameterName:o,predicate:l}of n)o&&(s[o]=l(a));return s}}else{const n=t.map(a=>xt(a.value));return a=>{const s={};for(let o=0;ot(n)||r(n)}else if(xd(e)){const t=xt(e.left),r=xt(e.right);return n=>t(n)&&r(n)}else if(jd(e)){const t=xt(e.value);return r=>!t(r)}else if(Bd(e)){const t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(Ld(e)){const t=!!e.true;return()=>t}qr()}i(xt,"buildPredicate");function WS(e,t){if(t.elements.length===1)return Wr(e,t.elements[0]);{const r=[];for(const a of t.elements){const s={ALT:Wr(e,a,!0)},o=Ls(a);o&&(s.GATE=xt(o)),r.push(s)}const n=e.or++;return a=>e.parser.alternatives(n,r.map(s=>{const o={ALT:i(()=>s.ALT(a),"ALT")},l=s.GATE;return l&&(o.GATE=()=>l(a)),o}))}}i(WS,"buildAlternatives");function VS(e,t){if(t.elements.length===1)return Wr(e,t.elements[0]);const r=[];for(const l of t.elements){const u={ALT:Wr(e,l,!0)},c=Ls(l);c&&(u.GATE=xt(c)),r.push(u)}const n=e.or++,a=i((l,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${l}_${c}`},"idFunc"),s=i(l=>e.parser.alternatives(n,r.map((u,c)=>{const f={ALT:i(()=>!0,"ALT")},d=e.parser;f.ALT=()=>{if(u.ALT(l),!d.isRecording()){const g=a(n,d);d.unorderedGroups.get(g)||d.unorderedGroups.set(g,[]);const v=d.unorderedGroups.get(g);typeof v?.[c]>"u"&&(v[c]=!0)}};const m=u.GATE;return m?f.GATE=()=>m(l):f.GATE=()=>!d.unorderedGroups.get(a(n,d))?.[c],f})),"alternatives"),o=xm(e,Ls(t),s,"*");return l=>{o(l),e.parser.isRecording()||e.parser.unorderedGroups.delete(a(n,e.parser))}}i(VS,"buildUnorderedGroup");function qS(e,t){const r=t.elements.map(n=>Wr(e,n));return n=>r.forEach(a=>a(n))}i(qS,"buildGroup");function Ls(e){if(zn(e))return e.guardCondition}i(Ls,"getGuardCondition");function Dm(e,t,r=t.terminal){if(r)if(Er(r)&&it(r.rule.ref)){const n=r.rule.ref,a=e.subrule++;let s;return o=>{s??(s=Lu(e,n)),e.parser.subrule(a,s,!1,t,o)}}else if(Er(r)&&Nt(r.rule.ref)){const n=e.consume++,a=Sl(e,r.rule.ref.name);return()=>e.parser.consume(n,a,t)}else if(Ar(r)){const n=e.consume++,a=Sl(e,r.value);return()=>e.parser.consume(n,a,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const a=Zl(t.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+Pn(t.type.ref));return Dm(e,t,a)}}i(Dm,"buildCrossReference");function HS(e,t){const r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}i(HS,"buildKeyword");function xm(e,t,r,n){const a=t&&xt(t);if(!n)if(a){const s=e.or++;return o=>e.parser.alternatives(s,[{ALT:i(()=>r(o),"ALT"),GATE:i(()=>a(o),"GATE")},{ALT:Uf(),GATE:i(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const s=e.many++;return o=>e.parser.many(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const s=e.many++;if(a){const o=e.or++;return l=>e.parser.alternatives(o,[{ALT:i(()=>e.parser.atLeastOne(s,{DEF:i(()=>r(l),"DEF")}),"ALT"),GATE:i(()=>a(l),"GATE")},{ALT:Uf(),GATE:i(()=>!a(l),"GATE")}])}else return o=>e.parser.atLeastOne(s,{DEF:i(()=>r(o),"DEF")})}else if(n==="?"){const s=e.optional++;return o=>e.parser.optional(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else qr()}i(xm,"wrap");function Lu(e,t){const r=YS(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}i(Lu,"getRule");function YS(e,t){if(Gn(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,a=t.$type;for(;!it(n);)(zn(n)||Fl(n)||Ul(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,e.ruleNames.set(t,a),a}}i(YS,"getRuleName");function Sl(e,t){const r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}i(Sl,"getToken");function Mm(e){const t=e.Grammar,r=e.parser.Lexer,n=new GS(e);return Ou(t,n,r.definition),n.finalize(),n}i(Mm,"createCompletionParser");function Gm(e){const t=Fm(e);return t.finalize(),t}i(Gm,"createLangiumParser");function Fm(e){const t=e.Grammar,r=e.parser.Lexer,n=new xS(e);return Ou(t,n,r.definition)}i(Fm,"prepareLangiumParser");var Du=class{static{i(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const r=ue(Hl(e,!1)),n=this.buildTerminalTokens(r),a=this.buildKeywordTokens(r,n,t);return a.push(...n),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Nt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Bs(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=ql(t)?at.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Gn).flatMap(n=>Nr(n).filter(Ar)).distinct(n=>n.value).toArray().sort((n,a)=>a.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){const n=this.buildKeywordPattern(e,r),a={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,t){return t?new RegExp(ri(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{const a=n?.PATTERN;return a?.source&&cp("^"+a.source+"$",e.value)&&r.push(n),r},[])}},zm=class{static{i(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(Fn(r)&&(r=hp(r)),Er(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Zt.convertInt(t);case"STRING":return Zt.convertString(t);case"ID":return Zt.convertID(t)}switch(Cp(e)?.toLowerCase()){case"number":return Zt.convertNumber(t);case"boolean":return Zt.convertBoolean(t);case"bigint":return Zt.convertBigint(t);case"date":return Zt.convertDate(t);default:return t}}},Zt;(function(e){function t(c){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}i(xu,"delayNextTick");var Bo=0,XS=10;function Mu(){return Bo=performance.now(),new pe.CancellationTokenSource}i(Mu,"startCancelableOperation");function jm(e){XS=e}i(jm,"setInterruptionPeriod");var tr=Symbol("OperationCancelled");function ta(e){return e===tr}i(ta,"isOperationCancelled");async function ze(e){if(e===pe.CancellationToken.None)return;const t=performance.now();if(t-Bo>=XS&&(Bo=t,await xu(),Bo=performance.now()),e.isCancellationRequested)throw tr}i(ze,"interruptAndCheck");var wr=class{static{i(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},Ny=class Jf{static{i(this,"FullTextDocument")}constructor(t,r,n,a){this._uri=t,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(const n of t)if(Jf.isIncremental(n)){const a=Um(n.range),s=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);const l=Math.max(a.start.line,0),u=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Zf(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;mt?a=o:n=o+1}const s=n-1;return t=this.ensureBeforeEOL(t,r[s]),{line:s,character:t-r[s]}}offsetAt(t){const r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;const n=r[t.line];if(t.character<=0)return n;const a=t.line+1r&&Bm(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},wl;(function(e){function t(a,s,o,l){return new Ny(a,s,o,l)}i(t,"create"),e.create=t;function r(a,s,o){if(a instanceof Ny)return a.update(s,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}i(r,"update"),e.update=r;function n(a,s){const o=a.getText(),l=Il(s.map(JS),(f,d)=>{const m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m});let u=0;const c=[];for(const f of l){const d=a.offsetAt(f.range.start);if(du&&c.push(o.substring(u,d)),f.newText.length&&c.push(f.newText),u=a.offsetAt(f.range.end)}return c.push(o.substr(u)),c.join("")}i(n,"applyEdits"),e.applyEdits=n})(wl||(wl={}));function Il(e,t){if(e.length<=1)return e;const r=e.length/2|0,n=e.slice(0,r),a=e.slice(r);Il(n,t),Il(a,t);let s=0,o=0,l=0;for(;sr.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}i(Um,"getWellformedRange");function JS(e){const t=Um(e.range);return t!==e.range?{newText:e.newText,range:t}:e}i(JS,"getWellformedEdit");var ZS;(()=>{var e={975:k=>{function C(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}i(C,"e");function y(T,$){for(var _,O="",x=0,D=-1,G=0,W=0;W<=T.length;++W){if(W2){var Y=O.lastIndexOf("/");if(Y!==O.length-1){Y===-1?(O="",x=0):x=(O=O.slice(0,Y)).length-1-O.lastIndexOf("/"),D=W,G=0;continue}}else if(O.length===2||O.length===1){O="",x=0,D=W,G=0;continue}}$&&(O.length>0?O+="/..":O="..",x=2)}else O.length>0?O+="/"+T.slice(D+1,W):O=T.slice(D+1,W),x=W-D-1;D=W,G=0}else _===46&&G!==-1?++G:G=-1}return O}i(y,"r");var E={resolve:i(function(){for(var T,$="",_=!1,O=arguments.length-1;O>=-1&&!_;O--){var x;O>=0?x=arguments[O]:(T===void 0&&(T=process.cwd()),x=T),C(x),x.length!==0&&($=x+"/"+$,_=x.charCodeAt(0)===47)}return $=y($,!_),_?$.length>0?"/"+$:"/":$.length>0?$:"."},"resolve"),normalize:i(function(T){if(C(T),T.length===0)return".";var $=T.charCodeAt(0)===47,_=T.charCodeAt(T.length-1)===47;return(T=y(T,!$)).length!==0||$||(T="."),T.length>0&&_&&(T+="/"),$?"/"+T:T},"normalize"),isAbsolute:i(function(T){return C(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:i(function(){if(arguments.length===0)return".";for(var T,$=0;$0&&(T===void 0?T=_:T+="/"+_)}return T===void 0?".":E.normalize(T)},"join"),relative:i(function(T,$){if(C(T),C($),T===$||(T=E.resolve(T))===($=E.resolve($)))return"";for(var _=1;_W){if($.charCodeAt(D+V)===47)return $.slice(D+V+1);if(V===0)return $.slice(D+V)}else x>W&&(T.charCodeAt(_+V)===47?Y=V:V===0&&(Y=0));break}var Pe=T.charCodeAt(_+V);if(Pe!==$.charCodeAt(D+V))break;Pe===47&&(Y=V)}var oe="";for(V=_+Y+1;V<=O;++V)V!==O&&T.charCodeAt(V)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+$.slice(D+Y):(D+=Y,$.charCodeAt(D)===47&&++D,$.slice(D))},"relative"),_makeLong:i(function(T){return T},"_makeLong"),dirname:i(function(T){if(C(T),T.length===0)return".";for(var $=T.charCodeAt(0),_=$===47,O=-1,x=!0,D=T.length-1;D>=1;--D)if(($=T.charCodeAt(D))===47){if(!x){O=D;break}}else x=!1;return O===-1?_?"/":".":_&&O===1?"//":T.slice(0,O)},"dirname"),basename:i(function(T,$){if($!==void 0&&typeof $!="string")throw new TypeError('"ext" argument must be a string');C(T);var _,O=0,x=-1,D=!0;if($!==void 0&&$.length>0&&$.length<=T.length){if($.length===T.length&&$===T)return"";var G=$.length-1,W=-1;for(_=T.length-1;_>=0;--_){var Y=T.charCodeAt(_);if(Y===47){if(!D){O=_+1;break}}else W===-1&&(D=!1,W=_+1),G>=0&&(Y===$.charCodeAt(G)?--G==-1&&(x=_):(G=-1,x=W))}return O===x?x=W:x===-1&&(x=T.length),T.slice(O,x)}for(_=T.length-1;_>=0;--_)if(T.charCodeAt(_)===47){if(!D){O=_+1;break}}else x===-1&&(D=!1,x=_+1);return x===-1?"":T.slice(O,x)},"basename"),extname:i(function(T){C(T);for(var $=-1,_=0,O=-1,x=!0,D=0,G=T.length-1;G>=0;--G){var W=T.charCodeAt(G);if(W!==47)O===-1&&(x=!1,O=G+1),W===46?$===-1?$=G:D!==1&&(D=1):$!==-1&&(D=-1);else if(!x){_=G+1;break}}return $===-1||O===-1||D===0||D===1&&$===O-1&&$===_+1?"":T.slice($,O)},"extname"),format:i(function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function($,_){var O=_.dir||_.root,x=_.base||(_.name||"")+(_.ext||"");return O?O===_.root?O+x:O+"/"+x:x})(0,T)},"format"),parse:i(function(T){C(T);var $={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return $;var _,O=T.charCodeAt(0),x=O===47;x?($.root="/",_=1):_=0;for(var D=-1,G=0,W=-1,Y=!0,V=T.length-1,Pe=0;V>=_;--V)if((O=T.charCodeAt(V))!==47)W===-1&&(Y=!1,W=V+1),O===46?D===-1?D=V:Pe!==1&&(Pe=1):D!==-1&&(Pe=-1);else if(!Y){G=V+1;break}return D===-1||W===-1||Pe===0||Pe===1&&D===W-1&&D===G+1?W!==-1&&($.base=$.name=G===0&&x?T.slice(1,W):T.slice(G,W)):(G===0&&x?($.name=T.slice(1,D),$.base=T.slice(1,W)):($.name=T.slice(G,D),$.base=T.slice(G,W)),$.ext=T.slice(D,W)),G>0?$.dir=T.slice(0,G-1):x&&($.dir="/"),$},"parse"),sep:"/",delimiter:":",win32:null,posix:null};E.posix=E,k.exports=E}},t={};function r(k){var C=t[k];if(C!==void 0)return C.exports;var y=t[k]={exports:{}};return e[k](y,y.exports,r),y.exports}i(r,"r"),r.d=(k,C)=>{for(var y in C)r.o(C,y)&&!r.o(k,y)&&Object.defineProperty(k,y,{enumerable:!0,get:C[y]})},r.o=(k,C)=>Object.prototype.hasOwnProperty.call(k,C),r.r=k=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:i(()=>m,"URI"),Utils:i(()=>Se,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,l=/^\/\//;function u(k,C){if(!k.scheme&&C)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!s.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!o.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}i(u,"a");const c="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{i(this,"l")}static isUri(C){return C instanceof m||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,y,E,T,$,_=!1){typeof C=="object"?(this.scheme=C.scheme||c,this.authority=C.authority||c,this.path=C.path||c,this.query=C.query||c,this.fragment=C.fragment||c):(this.scheme=(function(O,x){return O||x?O:"file"})(C,_),this.authority=y||c,this.path=(function(O,x){switch(O){case"https":case"http":case"file":x?x[0]!==f&&(x=f+x):x=f}return x})(this.scheme,E||c),this.query=T||c,this.fragment=$||c,u(this,_))}get fsPath(){return I(this,!1)}with(C){if(!C)return this;let{scheme:y,authority:E,path:T,query:$,fragment:_}=C;return y===void 0?y=this.scheme:y===null&&(y=c),E===void 0?E=this.authority:E===null&&(E=c),T===void 0?T=this.path:T===null&&(T=c),$===void 0?$=this.query:$===null&&($=c),_===void 0?_=this.fragment:_===null&&(_=c),y===this.scheme&&E===this.authority&&T===this.path&&$===this.query&&_===this.fragment?this:new v(y,E,T,$,_)}static parse(C,y=!1){const E=d.exec(C);return E?new v(E[2]||c,X(E[4]||c),X(E[5]||c),X(E[7]||c),X(E[9]||c),y):new v(c,c,c,c,c)}static file(C){let y=c;if(a&&(C=C.replace(/\\/g,f)),C[0]===f&&C[1]===f){const E=C.indexOf(f,2);E===-1?(y=C.substring(2),C=f):(y=C.substring(2,E),C=C.substring(E)||f)}return new v("file",y,C,c,c)}static from(C){const y=new v(C.scheme,C.authority,C.path,C.query,C.fragment);return u(y,!0),y}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof m)return C;{const y=new v(C);return y._formatted=C.external,y._fsPath=C._sep===g?C.fsPath:null,y}}return C}}const g=a?1:void 0;class v extends m{static{i(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=g),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}const b={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function S(k,C,y){let E,T=-1;for(let $=0;$=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===45||_===46||_===95||_===126||C&&_===47||y&&_===91||y&&_===93||y&&_===58)T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E!==void 0&&(E+=k.charAt($));else{E===void 0&&(E=k.substr(0,$));const O=b[_];O!==void 0?(T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E+=O):T===-1&&(T=$)}}return T!==-1&&(E+=encodeURIComponent(k.substring(T))),E!==void 0?E:k}i(S,"m");function w(k){let C;for(let y=0;y1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?C?k.path.substr(1):k.path[1].toLowerCase()+k.path.substr(2):k.path,a&&(y=y.replace(/\//g,"\\")),y}i(I,"v");function R(k,C){const y=C?w:S;let E="",{scheme:T,authority:$,path:_,query:O,fragment:x}=k;if(T&&(E+=T,E+=":"),($||T==="file")&&(E+=f,E+=f),$){let D=$.indexOf("@");if(D!==-1){const G=$.substr(0,D);$=$.substr(D+1),D=G.lastIndexOf(":"),D===-1?E+=y(G,!1,!1):(E+=y(G.substr(0,D),!1,!1),E+=":",E+=y(G.substr(D+1),!1,!0)),E+="@"}$=$.toLowerCase(),D=$.lastIndexOf(":"),D===-1?E+=y($,!1,!0):(E+=y($.substr(0,D),!1,!0),E+=$.substr(D))}if(_){if(_.length>=3&&_.charCodeAt(0)===47&&_.charCodeAt(2)===58){const D=_.charCodeAt(1);D>=65&&D<=90&&(_=`/${String.fromCharCode(D+32)}:${_.substr(3)}`)}else if(_.length>=2&&_.charCodeAt(1)===58){const D=_.charCodeAt(0);D>=65&&D<=90&&(_=`${String.fromCharCode(D+32)}:${_.substr(2)}`)}E+=y(_,!0,!1)}return O&&(E+="?",E+=y(O,!1,!1)),x&&(E+="#",E+=C?x:S(x,!1,!1)),E}i(R,"b");function P(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+P(k.substr(3)):k}}i(P,"C");const z=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function X(k){return k.match(z)?k.replace(z,(C=>P(C))):k}i(X,"w");var Z=r(975);const ce=Z.posix||Z,se="/";var Se;(function(k){k.joinPath=function(C,...y){return C.with({path:ce.join(C.path,...y)})},k.resolvePath=function(C,...y){let E=C.path,T=!1;E[0]!==se&&(E=se+E,T=!0);let $=ce.resolve(E,...y);return T&&$[0]===se&&!C.authority&&($=$.substring(1)),C.with({path:$})},k.dirname=function(C){if(C.path.length===0||C.path===se)return C;let y=ce.dirname(C.path);return y.length===1&&y.charCodeAt(0)===46&&(y=""),C.with({path:y})},k.basename=function(C){return ce.basename(C.path)},k.extname=function(C){return ce.extname(C.path)}})(Se||(Se={})),ZS=n})();var{URI:Tt,Utils:Di}=ZS,nt;(function(e){e.basename=Di.basename,e.dirname=Di.dirname,e.extname=Di.extname,e.joinPath=Di.joinPath,e.resolvePath=Di.resolvePath;const t=typeof process=="object"&&process?.platform==="win32";function r(o,l){return o?.toString()===l?.toString()}i(r,"equals"),e.equals=r;function n(o,l){const u=typeof o=="string"?Tt.parse(o).path:o.path,c=typeof l=="string"?Tt.parse(l).path:l.path,f=u.split("/").filter(b=>b.length>0),d=c.split("/").filter(b=>b.length>0);if(t){const b=/^[A-Z]:$/;if(f[0]&&b.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&b.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return c.substring(1)}let m=0;for(;m({name:n.name,uri:nt.joinPath(Tt.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(nt.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(const a of r){let s=n.children.get(a);if(!s)if(t)s={name:a,children:new Map,parent:n},n.children.set(a,s);else return;n=s}return n}collectValues(e){const t=[];e.element&&t.push(e.element);for(const r of e.children.values())t.push(...this.collectValues(r));return t}},J;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(J||(J={}));var QS=class{static{i(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=pe.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??Tt.parse(e.uri),pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){const n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{const n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{const n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let a;if(r)a={parseResult:e,uri:t,state:J.Parsed,references:[],textDocument:r};else{const s=this.createTextDocumentGetter(t,n);a={parseResult:e,uri:t,state:J.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,t){const r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),a=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return r!==a&&(e.parseResult=await this.parseAsync(e.uri,a,t),e.parseResult.value.$document=e),e.state=J.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let n;return()=>n??(n=wl.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},ew=class{static{i(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new Km,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ue(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,J.Changed),r}deleteDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=J.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){const t=e.toString(),r=this.documentTrie.findAll(t);for(const n of r)n.state=J.Changed;return this.documentTrie.delete(t),r}},un=Symbol("RefResolving"),tw=class{static{i(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=pe.CancellationToken.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const n of Gt(e.parseResult.value))await ze(t),Va(n).forEach(a=>{const s=`${n.$type}:${a.property}`;r.startSubTask(s);try{this.doLink(a,e)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(const r of Gt(e.parseResult.value))await ze(t),Va(r).forEach(n=>this.doLink(n,e))}doLink(e,t){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=un;try{const n=this.getCandidate(e);if(pn(n))r._ref=n;else{r._nodeDescription=n;const a=this.loadAstNode(n);r._ref=a??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);const a=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${a}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=un;try{const n=this.getCandidates(e),a=[];if(pn(n))r._linkingError=n;else for(const s of n){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}r._items=a}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(const t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){const a=this,s={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Oe(this._ref))return this._ref;if(wd(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=un;const o=Fa(e).$document,l=a.getLinkedNode({reference:s,container:e,property:t});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:t})}};return s}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(pn(t))return{error:t};const r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=Fa(e.container).$document;r&&r.stateFn(t)&&t.isMulti)}findDeclarations(e){if(e){const t=Tp(e),r=e.astNode;if(t&&r){const n=r[t.feature];if(rt(n)||rr(n))return qo(n);if(Array.isArray(n)){for(const a of n)if((rt(a)||rr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return qo(a)}}if(r){const n=this.nameProvider.getNameNode(r);if(n&&(n===e||Zd(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(const n of Va(r))if(rr(n.reference)&&n.reference.items.some(a=>a.ref===e))return n.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const t=this.findDeclarations(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n)??n.$cstNode;a&&r.push(a)}return r}findReferences(e,t){const r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(a=>nt.equals(a.sourceUri,t.documentUri))),r.push(...n),ue(r)}getSelfReferences(e){const t=this.getSelfNodes(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n);if(a){const s=Mt(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Ya(a),local:!0})}}return r}},Ir=class{static{i(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return Ts.sum(ue(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?ue(t):Ua}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ue(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return ue(this.map.keys())}values(){return ue(this.map.values()).flat()}entriesGroupedByKey(){return ue(this.map.entries())}},Nl=class{static{i(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},aw=class{static{i(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=Gs,n=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,t);for(const s of r(e))await ze(n),this.addExportedSymbol(s,a,t);return a}addExportedSymbol(e,t,r){const n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=pe.CancellationToken.None){const r=e.parseResult.value,n=new Ir;for(const a of Nr(r))await ze(t),this.addLocalSymbol(a,e,n);return n}addLocalSymbol(e,t,r){const n=e.$container;if(n){const a=this.nameProvider.getName(e);a&&r.add(n,this.descriptions.createDescription(e,a,t))}}},Qf=class{static{i(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},AF=class{static{i(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?ue(n).concat(this.outerScope.getElements(e)):ue(n)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},iw=class{static{i(this,"MultiMapScope")}constructor(e,t,r){this.elements=new Ir,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?ue(r).concat(this.outerScope.getElements(e)):ue(r)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},EF={getElement(){},getElements(){return Ua},getAllElements(){return Ua}},Gu=class{static{i(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Vm=class extends Gu{static{i(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Fu=class extends Gu{static{i(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){const a=r();return n.set(t,a),a}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},sw=class extends Fu{static{i(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(const a of n)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{const a=r.concat(n);for(const s of a)this.clear(s)}))}},qm=class extends Vm{static{i(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},ow=class{static{i(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new qm(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),n=Mt(e.container).localSymbols;if(n){let s=e.container;do n.has(s)&&t.push(n.getStream(s).filter(o=>this.reflection.isSubtype(o.type,r))),s=s.$container;while(s)}let a=this.getGlobalScope(r,e);for(let s=t.length-1;s>=0;s--)a=this.createScope(t[s],a);return a}createScope(e,t,r){return new Qf(ue(e),t,r)}createScopeForNodes(e,t,r){const n=ue(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Qf(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new iw(this.indexManager.allElements(e)))}};function Hm(e){return typeof e.$comment=="string"}i(Hm,"isAstNodeWithComment");function ed(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}i(ed,"isIntermediateReference");var lw=class{static{i(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const r=t??{},n=t?.replacer,a=i((o,l)=>this.replacer(o,l,r),"defaultReplacer"),s=n?(o,l)=>n(o,l,a):a;try{return this.currentDocument=Mt(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(rt(t)){const l=t.ref,u=r?t.$refText:void 0;if(l){const c=Mt(l);let f="";this.currentDocument&&this.currentDocument!==c&&(o?f=o(c.uri,l):f=c.uri.toString());const d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:u}}else return{$error:t.error?.message??"Could not resolve reference",$refText:u}}else if(rr(t)){const l=r?t.$refText:void 0,u=[];for(const c of t.items){const f=c.ref,d=Mt(c.ref);let m="";this.currentDocument&&this.currentDocument!==d&&(o?m=o(d.uri,f):m=d.uri.toString());const g=this.astNodeLocator.getAstNodePath(f);u.push(`${m}#${g}`)}return{$refs:u,$refText:l}}else if(Oe(t)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(l??(l={...t}),l.$sourceText=t.$cstNode?.text),s){l??(l={...t});const u=this.commentProvider.getComment(t);u&&(l.$comment=u.replace(/\r/g,""))}return l??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=i(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=gp(e.$cstNode,a).map(t);s.length!==0&&(n[a]=s)}),e}}linkNode(e,t,r,n,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c{await this.handleException(()=>e.call(t,r,n,a),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(a){if(ta(a))throw a;console.error(`${t}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);r("error",`${t}: ${s}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=ue(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(n,a,s,o)=>{await this.handleException(()=>e.call(r,n,a,s,o),t,a,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},fw=Object.freeze({validateNode:!0,validateChildren:!0}),dw=class{static{i(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=pe.CancellationToken.None){const n=e.parseResult,a=[];if(await ze(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,a,t),t.stopAfterLexingErrors&&a.some(s=>s.data?.code===_t.LexingError)||(this.processParsingErrors(n,a,t),t.stopAfterParsingErrors&&a.some(s=>s.data?.code===_t.ParsingError))||(this.processLinkingErrors(e,a,t),t.stopAfterLinkingErrors&&a.some(s=>s.data?.code===_t.LinkingError))))return a;try{a.push(...await this.validateAst(n.value,t,r))}catch(s){if(ta(s))throw s;console.error("An error occurred during validation:",s)}return await ze(r),a}processLexingErrors(e,t,r){const n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of n){const s=a.severity??"error",o={severity:gs(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Xm(s),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(const n of e.parserErrors){let a;if(isNaN(n.token.startOffset)){if("previousToken"in n){const s=n.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=$s(n.token);if(a){const s={severity:gs("error"),range:a,message:n.message,data:Sn(_t.ParsingError),source:this.getSource()};t.push(s)}}}processLinkingErrors(e,t,r){for(const n of e.references){const a=n.error;if(a){const s={node:a.info.container,range:n.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:_t.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};t.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,t,r=pe.CancellationToken.None){const n=[],a=i((s,o,l)=>{n.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,t,a,r),await this.validateAstNodes(e,t,a,r),await this.validateAstAfter(e,t,a,r),n}async validateAstBefore(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=pe.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=Gt(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,t);if(l.validateNode)try{const u=this.validationRegistry.getChecks(o.$type,t.categories);for(const c of u)await c(o,r,n)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=Gt(e).iterator();for(const s of a){await ze(n);const o=this.validateSingleNodeOptions(s,t);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,t.categories);for(const u of l)await u(s,r,n)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,t){return fw}async validateAstAfter(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:Ym(r),severity:gs(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Ym(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Yl(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=vp(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}i(Ym,"getDiagnosticRange");function gs(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}i(gs,"toDiagnosticSeverity");function Xm(e){switch(e){case"error":return Sn(_t.LexingError);case"warning":return Sn(_t.LexingWarning);case"info":return Sn(_t.LexingInfo);case"hint":return Sn(_t.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}i(Xm,"toDiagnosticData");var _t;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(_t||(_t={}));var pw=class{static{i(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const n=r??Mt(e);t??(t=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${a} has no name.`);let s;const o=i(()=>s??(s=Ya(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ya(e.$cstNode),type:e.$type,documentUri:n.uri,path:a}}},mw=class{static{i(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=pe.CancellationToken.None){const r=[],n=e.parseResult.value;for(const a of Gt(n))await ze(t),Va(a).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode)return[];let r=[];rt(t)&&t.$nodeDescription?r=[t.$nodeDescription]:rr(t)&&(r=t.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const n=Mt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Ya(t.$refNode);for(const l of r)s.push({sourceUri:n,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:nt.equals(l.documentUri,n)});return s}},hw=class{static{i(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,a)=>{if(!n||a.length===0)return n;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return n[o]?.[l]}return n[a]},e)}},zu={};Ll(zu,Cd(ei()));var yw=class{static{i(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new wr,this.onConfigurationSectionUpdateEmitter=new zu.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,a)=>{this.updateSectionConfiguration(n.section,r[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},uo=Cd(nN()),Nn;(function(e){function t(r){return{dispose:i(async()=>await r(),"dispose")}}i(t,"create"),e.create=t})(Nn||(Nn={}));var gw=class{static{i(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ir,this.documentPhaseListeners=new Ir,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=J.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=pe.CancellationToken.None){for(const n of e){const a=n.uri.toString();if(n.state===J.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,J.IndexedReferences);else if(typeof t.validation=="object"){const s=this.findMissingValidationCategories(n,t);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),n.state=J.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=J.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=pe.CancellationToken.None){this.currentState=J.Changed;const n=[];for(const l of t){const u=this.langiumDocuments.deleteDocuments(l);for(const c of u)n.push(c.uri),this.cleanUpDeleted(c)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=J.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,J.Changed)}const s=ue(a).concat(n).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,J.ComputedScopes)),await this.emitUpdate(a,n),await ze(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,t){const r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,s=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return ue(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Nn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case J.Changed:case J.Parsed:this.indexManager.removeContent(e.uri);case J.IndexedContent:e.localSymbols=void 0;case J.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case J.Linked:this.indexManager.removeReferences(e.uri);case J.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case J.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=J.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,J.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,J.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,J.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,r)});const n=e.filter(s=>this.shouldLink(s));await this.runCancelable(n,J.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(n,J.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,J.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(const r of e){const n=r.uri.toString(),a=this.buildState.get(n);(!a||a.completed)&&this.buildState.set(n,{completed:!1,options:t,result:a?.result})}}async runCancelable(e,t,r,n){for(const s of e)s.states.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Nn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Nn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=pe.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){const n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(tr);if(this.currentState>=e&&e>n.state)return Promise.reject(new uo.ResponseError(uo.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${J[n.state]}, requiring ${J[e]}, but workspace state is already ${J[this.currentState]}. Returning undefined.`))}else return Promise.reject(new uo.ResponseError(uo.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{nt.equals(u.uri,t)&&(o.dispose(),l.dispose(),a(u.uri))}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(tr)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(tr):new Promise((r,n)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),r()}),s=t.onCancellationRequested(()=>{a.dispose(),s.dispose(),n(tr)})})}async notifyDocumentPhase(e,t,r){const a=this.documentPhaseListeners.get(t).slice();for(const s of a)try{await ze(r),await s(e,r)}catch(o){if(!ta(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const a=this.buildPhaseListeners.get(t).slice();for(const s of a)await ze(r),await s(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),a=typeof n.validation=="object"?{...n.validation}:{};a.categories=this.findMissingValidationCategories(e,n);const s=await r.validateDocument(e,a,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=ue(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},vw=class{static{i(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Fu,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=Mt(e).uri,n=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{nt.equals(s.targetUri,r)&&s.targetPath===t&&n.push(s)})}),ue(n)}allElements(e,t){let r=ue(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),a=e.uri.toString();this.symbolIndex.set(a,n),this.symbolByTypeIndex.clear(a)}async updateReferences(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},Tw=class{static{i(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new wr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=pe.CancellationToken.None){const r=await this.performStartup(e);await ze(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=[],r=i(s=>{t.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,r);const n=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,n)));const a=ue(n).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{const n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return Tt.parse(e.uri)}async traverseFolder(e,t){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){const t=nt.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$w=class{static{i(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,a){return Of.buildUnexpectedCharactersMessage(e,t,r,n,a)}buildUnableToPopLexerModeMessage(e){return Of.buildUnableToPopLexerModeMessage(e)}},Jm={mode:"full"},Zm=class{static{i(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=kl(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new at(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Jm){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(kl(e))return e;const t=Bu(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};function ju(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}i(ju,"isTokenTypeArray");function Bu(e){return e&&"modes"in e&&"defaultMode"in e}i(Bu,"isIMultiModeLexerDefinition");function kl(e){return!ju(e)&&!Bu(e)}i(kl,"isTokenTypeDictionary");xs();function Qm(e,t,r){let n,a;typeof e=="string"?(a=t,n=r):(a=e.range.start,n=t),a||(a=ie.create(0,0));const s=th(e),o=Uu(n),l=Rw({lines:s,position:a,options:o});return Cw({index:0,tokens:l,position:a})}i(Qm,"parseJSDoc");function eh(e,t){const r=Uu(t),n=th(e);if(n.length===0)return!1;const a=n[0],s=n[n.length-1],o=r.start,l=r.end;return!!o?.exec(a)&&!!l?.exec(s)}i(eh,"isJSDoc");function th(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(Ev)}i(th,"getLines");var Py=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,CF=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Rw(e){const t=[];let r=e.position.line,n=e.position.character;for(let a=0;a=l.length){if(t.length>0){const f=ie.create(r,n);t.push({type:"break",content:"",range:Q.create(f,f)})}}else{Py.lastIndex=u;const f=Py.exec(l);if(f){const d=f[0],m=f[1],g=ie.create(r,n+u),v=ie.create(r,n+u+d.length);t.push({type:"tag",content:m,range:Q.create(g,v)}),u+=d.length,u=Ol(l,u)}if(u0&&t[t.length-1].type==="break"?t.slice(0,-1):t}i(Rw,"tokenize");function Aw(e,t,r,n){const a=[];if(e.length===0){const s=ie.create(r,n),o=ie.create(r,n+t.length);a.push({type:"text",content:t,range:Q.create(s,o)})}else{let s=0;for(const l of e){const u=l.index,c=t.substring(s,u);c.length>0&&a.push({type:"text",content:t.substring(s,u),range:Q.create(ie.create(r,s+n),ie.create(r,u+n))});let f=c.length+1;const d=l[1];if(a.push({type:"inline-tag",content:d,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;const m=l[3];a.push({type:"text",content:m,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+m.length+n))})}else a.push({type:"text",content:"",range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+n))});s=u+l[0].length}const o=t.substring(s);o.length>0&&a.push({type:"text",content:o,range:Q.create(ie.create(r,s+n),ie.create(r,s+n+o.length))})}return a}i(Aw,"buildInlineTokens");var bF=/\S/,_F=/\s*$/;function Ol(e,t){const r=e.substring(t).match(bF);return r?t+r.index:e.length}i(Ol,"skipWhitespace");function Ew(e){const t=e.match(_F);if(t&&typeof t.index=="number")return t.index}i(Ew,"lastCharacter");function Cw(e){const t=ie.create(e.position.line,e.position.character);if(e.tokens.length===0)return new ky([],Q.create(t,t));const r=[];for(;e.indext.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=rd(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const n=r.toMarkdown(e);t+=rd(t)+n}return t.trim()}},Qu=class{static{i(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} +${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const a=ww(this.name,t,e??{});if(typeof a=="string")return a}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} — ${t}`:this.content.inlines.length>1&&(n=`${n} +${t}`),this.inline?`{${n}}`:n}};function ww(e,t,r){if(e==="linkplain"||e==="linkcode"||e==="link"){const n=t.indexOf(" ");let a=t;if(n>0){const o=Ol(t,n);a=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(t,a)??Iw(t,a)}}i(ww,"renderInlineTag");function Iw(e,t){try{return Tt.parse(e,!0),`[${t}](${e})`}catch{return e}}i(Iw,"renderLinkDefault");var td=class{static{i(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` +`)}return t}},Nw=class{static{i(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function rd(e){return e.endsWith(` +`)?` +`:` + +`}i(rd,"fillNewlines");var Pw=class{static{i(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&eh(t))return Qm(t).toMarkdown({renderLink:i((n,a)=>this.documentationLinkRenderer(e,n,a),"renderLink"),renderTag:i(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){const n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){const a=n.nameSegment.range.start.line+1,s=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${a},${s}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){const n=Mt(e).localSymbols;if(!n)return;let a=e;do{const o=n.getStream(a).find(l=>l.name===t);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},kw=class{static{i(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Hm(e)?e.$comment:rp(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},Ow=class{static{i(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},SF=class{static{i(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){const r=await this.acquireParserWorker(t),n=new wr;let a;const s=t.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{const l=this.hydrator.hydrate(o);n.resolve(l)}).catch(o=>{n.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),n.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(const r of this.workerPool)if(r.ready)return r.lock(),r;const t=new wr;return e.onCancellationRequested(()=>{const r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(tr)}),this.queue.push(t),t.promise}},wF=class{static{i(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new zu.Emitter,this.deferred=new wr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),r(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(tr),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new wr,this.sendMessage(e),this.deferred.promise}},Lw=class{static{i(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=Mu();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=pe.CancellationToken.None){const n=new wr,a={action:t,deferred:n,cancellationToken:r};return e.push(a),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{const a=await Promise.resolve().then(()=>t(n));r.resolve(a)}catch(a){ta(a)?r.resolve(void 0):r.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Dw=class{static{i(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new Nl,this.tokenTypeIdMap=new Nl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const n of Gt(e))t.set(n,{});if(e.$cstNode)for(const n of Ha(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.dehydrateAstNode(o,t)):rt(o)?s.push(this.dehydrateReference(o,t)):s.push(o)}else Oe(a)?r[n]=this.dehydrateAstNode(a,t):rt(a)?r[n]=this.dehydrateReference(a,t):a!==void 0&&(r[n]=a);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return Ml(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),$r(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):xn(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const a of Gt(e))t.set(a,{});let n;if(e.$cstNode)for(const a of Ha(e.$cstNode)){let s;"fullText"in a?(s=new km(a.fullText),n=s):"content"in a?s=new ku:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(r.set(a,s),s.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.setParent(this.hydrateAstNode(o,t),r)):rt(o)?s.push(this.hydrateReference(o,r,n,t)):s.push(o)}else Oe(a)?r[n]=this.setParent(this.hydrateAstNode(a,t),r):rt(a)?r[n]=this.hydrateReference(a,r,n,t):a!==void 0&&(r[n]=a);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),$r(n))for(const a of e.content){const s=this.hydrateCstNode(a,t,r++);n.content.push(s)}return n}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new bl(r,n,{start:{line:a,character:s},end:{line:o,character:l}},t,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Gt(this.grammar))Gl(t)&&this.grammarElementIdMap.set(t,e++)}};function je(e){return{documentation:{CommentProvider:i(t=>new kw(t),"CommentProvider"),DocumentationProvider:i(t=>new Pw(t),"DocumentationProvider")},parser:{AsyncParser:i(t=>new Ow(t),"AsyncParser"),GrammarConfig:i(t=>_p(t),"GrammarConfig"),LangiumParser:i(t=>Gm(t),"LangiumParser"),CompletionParser:i(t=>Mm(t),"CompletionParser"),ValueConverter:i(()=>new zm,"ValueConverter"),TokenBuilder:i(()=>new Du,"TokenBuilder"),Lexer:i(t=>new Zm(t),"Lexer"),ParserErrorMessageProvider:i(()=>new Lm,"ParserErrorMessageProvider"),LexerErrorMessageProvider:i(()=>new $w,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:i(()=>new hw,"AstNodeLocator"),AstNodeDescriptionProvider:i(t=>new pw(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:i(t=>new mw(t),"ReferenceDescriptionProvider")},references:{Linker:i(t=>new tw(t),"Linker"),NameProvider:i(()=>new rw,"NameProvider"),ScopeProvider:i(t=>new ow(t),"ScopeProvider"),ScopeComputation:i(t=>new aw(t),"ScopeComputation"),References:i(t=>new nw(t),"References")},serializer:{Hydrator:i(t=>new Dw(t),"Hydrator"),JsonSerializer:i(t=>new lw(t),"JsonSerializer")},validation:{DocumentValidator:i(t=>new dw(t),"DocumentValidator"),ValidationRegistry:i(t=>new cw(t),"ValidationRegistry")},shared:i(()=>e.shared,"shared")}}i(je,"createDefaultCoreModule");function Be(e){return{ServiceRegistry:i(t=>new uw(t),"ServiceRegistry"),workspace:{LangiumDocuments:i(t=>new ew(t),"LangiumDocuments"),LangiumDocumentFactory:i(t=>new QS(t),"LangiumDocumentFactory"),DocumentBuilder:i(t=>new gw(t),"DocumentBuilder"),IndexManager:i(t=>new vw(t),"IndexManager"),WorkspaceManager:i(t=>new Tw(t),"WorkspaceManager"),FileSystemProvider:i(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:i(()=>new Lw,"WorkspaceLock"),ConfigurationProvider:i(t=>new yw(t),"ConfigurationProvider")},profilers:{}}}i(Be,"createDefaultSharedCoreModule");var nd;(function(e){e.merge=(t,r)=>Qa(Qa({},t),r)})(nd||(nd={}));function ee(e,t,r,n,a,s,o,l,u){const c=[e,t,r,n,a,s,o,l,u].reduce(Qa,{});return sh(c)}i(ee,"inject");var xw=Symbol("isProxy");function ih(e){if(e&&e[xw])for(const t of Object.values(e))ih(t);return e}i(ih,"eagerLoad");function sh(e,t){const r=new Proxy({},{deleteProperty:i(()=>!1,"deleteProperty"),set:i(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:i((n,a)=>a===xw?!0:ad(n,a,e,t||r),"get"),getOwnPropertyDescriptor:i((n,a)=>(ad(n,a,e,t||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:i((n,a)=>a in e,"has"),ownKeys:i(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}i(sh,"_inject");var Oy=Symbol();function ad(e,t,r,n){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===Oy)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){const a=r[t];e[t]=Oy;try{e[t]=typeof a=="function"?a(n):sh(a,n)}catch(s){throw e[t]=s instanceof Error?s:void 0,s}return e[t]}else return}i(ad,"_resolve");function Qa(e,t){if(t){for(const[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){const a=e[r];typeof a=="object"&&a!==null?e[r]=Qa(a,n):e[r]=Qa({},n)}else e[r]=n}return e}i(Qa,"_merge");var id={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},wn;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(wn||(wn={}));var Mw=class extends Du{static{i(this,"IndentationAwareTokenBuilder")}constructor(e=id){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...id,...e},this.indentTokenType=ja({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ja({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){const r=super.buildTokens(e,t);if(!ju(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,c;const f=[];for(const d of r){for(const[m,g]of o)d.name===m?d.PUSH_MODE=wn.IGNORE_INDENTATION:d.name===g&&(d.POP_MODE=!0);d.name===a?l=d:d.name===n?u=d:d.name===s?c=d:f.push(d)}if(!l||!u||!c)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[wn.REGULAR]:[l,u,...f,c],[wn.IGNORE_INDENTATION]:[...f,c]},defaultMode:wn.REGULAR}:[l,u,c,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r +`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:a?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,t,r,n){const a=this.getLineNumber(t,n);return Qs(e,r,n,n+r.length,a,a,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;const u=this.indentationStack.length-l-1,c=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},IF=class extends Zm{static{i(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof Mw)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=Jm){const r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],c=r.tokens.length-1;for(let f=0;f=0&&u.push(r.tokens[c]),r.tokens=u,r}},oh={};Vr(oh,{AstUtils:()=>Nd,BiMap:()=>Nl,Cancellation:()=>pe,ContextCache:()=>Fu,CstUtils:()=>Sd,DONE_RESULT:()=>tt,Deferred:()=>wr,Disposable:()=>Nn,DisposableCache:()=>Gu,DocumentCache:()=>sw,EMPTY_STREAM:()=>Ua,ErrorWithLocation:()=>Wl,GrammarUtils:()=>sp,MultiMap:()=>Ir,OperationCancelled:()=>tr,Reduction:()=>Ts,RegExpUtils:()=>lp,SimpleCache:()=>Vm,StreamImpl:()=>er,TreeStreamImpl:()=>Ka,URI:()=>Tt,UriTrie:()=>Km,UriUtils:()=>nt,WorkspaceCache:()=>qm,assertCondition:()=>op,assertUnreachable:()=>qr,delayNextTick:()=>xu,interruptAndCheck:()=>ze,isOperationCancelled:()=>ta,loadGrammarFromJson:()=>Ue,setInterruptionPeriod:()=>jm,startCancelableOperation:()=>Mu,stream:()=>ue});Ll(oh,zu);var Gw=class{static{i(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Xe={fileSystemProvider:i(()=>new Gw,"fileSystemProvider")},NF={Grammar:i(()=>{},"Grammar"),LanguageMetaData:i(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},PF={AstReflection:i(()=>new Jd,"AstReflection")};function Fw(){const e=ee(Be(Xe),PF),t=ee(je({shared:e}),NF);return e.ServiceRegistry.register(t),t}i(Fw,"createMinimalGrammarServices");function Ue(e){const t=Fw(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,Tt.parse(`memory:/${r.name??"grammar"}.langium`)),r}i(Ue,"loadGrammarFromJson");Ll(Hg,oh);var kF=class{static{i(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ir}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new zw(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const r=[];for(const s of t.entries.keys()){const o=t.entries.get(s),l=o.reduce((u,c)=>u+c);r.push({name:`${t.identifier}.${s}`,count:o.length,duration:l})}const n=t.duration-r.map(s=>s.duration).reduce((s,o)=>s+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return i(a,"Round"),console.table(r.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/t.duration),"Time (ms)":a(s.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},zw=class{static{i(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new Ir,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);const r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);const n=r-t.content;this.entries.add(e,n)}},sd;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(sd||(sd={}));var od;(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(od||(od={}));var ld;(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(ld||(ld={}));var ud;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(ud||(ud={}));var cd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cd||(cd={}));var fd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fd||(fd={}));var dd;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dd||(dd={}));var pd;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pd||(pd={}));var md;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(md||(md={}));var hd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(hd||(hd={}));var yd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(yd||(yd={}));var gd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(gd||(gd={}));var vd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(vd||(vd={}));var Td;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(Td||(Td={}));var $d;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})($d||($d={}));({...sd.Terminals,...od.Terminals,...ld.Terminals,...ud.Terminals,...cd.Terminals,...fd.Terminals,...dd.Terminals,...pd.Terminals,...md.Terminals,...hd.Terminals,...yd.Terminals,...gd.Terminals,...Td.Terminals,...vd.Terminals,...$d.Terminals});var Ly={$type:"AbnfAlternation",alternatives:"alternatives"},Dy={$type:"AbnfConcatenation",elements:"elements"},ec={$type:"AbnfElement",primary:"primary",repeat:"repeat"},xy={$type:"AbnfGroup",element:"element"},My={$type:"AbnfNumVal",value:"value"},Gy={$type:"AbnfOptionalGroup",element:"element"},ca={$type:"AbnfPrimary"},tc={$type:"AbnfRule",definition:"definition",name:"name"},Fy={$type:"AbnfRuleName",name:"name"},zy={$type:"AbnfStringLiteral",value:"value"},co={$type:"Accelerator",name:"name",x:"x",y:"y"},rc={$type:"Alignment",direction:"direction",members:"members"},fo={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},xi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},nc={$type:"Annotations",x:"x",y:"y"},Xt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function OF(e){return Ne.isInstance(e,Xt.$type)}i(OF,"isArchitecture");var po={$type:"Axis",label:"label",name:"name"},Ko={$type:"Branch",name:"name",order:"order"};function LF(e){return Ne.isInstance(e,Ko.$type)}i(LF,"isBranch");var jy={$type:"Checkout",branch:"branch"},mo={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},ac={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Aa={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function DF(e){return Ne.isInstance(e,Aa.$type)}i(DF,"isCommit");var ho={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Zr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},yo={$type:"Curve",entries:"entries",label:"label",name:"name"},cn={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function xF(e){return Ne.isInstance(e,cn.$type)}i(xF,"isCynefin");var go={$type:"Deaccelerator",name:"name",x:"x",y:"y"},By={$type:"Decorator",strategy:"strategy"},fa={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Wo={$type:"DomainBlock",domain:"domain",items:"items"};function MF(e){return Ne.isInstance(e,Wo.$type)}i(MF,"isDomainBlock");var Rd={$type:"DomainItem",label:"label"};function GF(e){return Ne.isInstance(e,Rd.$type)}i(GF,"isDomainItem");var Uy={$type:"EbnfChoice",alternatives:"alternatives"},Ky={$type:"EbnfExceptionPostfix",except:"except"},Wy={$type:"EbnfGroup",element:"element"},Vy={$type:"EbnfNonTerminal",name:"name"},qy={$type:"EbnfOneOrMorePostfix",operator:"operator"},Hy={$type:"EbnfOptional",element:"element"},Yy={$type:"EbnfOptionalPostfix",operator:"operator"},Mi={$type:"EbnfPostfix"},Qr={$type:"EbnfPrimary"},Xy={$type:"EbnfRepetition",element:"element"},ic={$type:"EbnfRule",definition:"definition",name:"name"},Jy={$type:"EbnfSequence",elements:"elements"},Zy={$type:"EbnfSpecial",text:"text"},sc={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Qy={$type:"EbnfTerminal",value:"value"},eg={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Ht={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},da={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},en={$type:"EmFrame"},Gi={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},tg={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},oc={$type:"EmModelEntity",name:"name"};function FF(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}i(FF,"isEmModelEntityType");var vo={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},yr={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function zF(e){return Ne.isInstance(e,yr.$type)}i(zF,"isEmResetFrame");var Dr={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},lc={$type:"Entry",axis:"axis",value:"value"},dr={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},rg={$type:"Evolution",stages:"stages"},To={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},uc={$type:"Evolve",component:"component",target:"target"},fn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function jF(e){return Ne.isInstance(e,fn.$type)}i(jF,"isGitGraph");var Fi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},ts={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function BF(e){return Ne.isInstance(e,ts.$type)}i(BF,"isInfo");var zi={$type:"Item",classSelector:"classSelector",name:"name"},cc={$type:"Junction",id:"id",in:"in"},ji={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},$o={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},tn={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Ea={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function UF(e){return Ne.isInstance(e,Ea.$type)}i(UF,"isMerge");var Ro={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},fc={$type:"Option",name:"name",value:"value"},Ca={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function KF(e){return Ne.isInstance(e,Ca.$type)}i(KF,"isPacket");var ba={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function WF(e){return Ne.isInstance(e,ba.$type)}i(WF,"isPacketBlock");var ng={$type:"PegAny",dot:"dot"},ag={$type:"PegGroup",element:"element"},ig={$type:"PegIdentifier",name:"name"},sg={$type:"PegLiteral",value:"value"},og={$type:"PegOrderedChoice",alternatives:"alternatives"},dc={$type:"PegPrefix",operator:"operator",suffix:"suffix"},Bi={$type:"PegPrimary"},pc={$type:"PegRule",definition:"definition",name:"name"},lg={$type:"PegSequence",elements:"elements"},mc={$type:"PegSuffix",operator:"operator",primary:"primary"},dn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function VF(e){return Ne.isInstance(e,dn.$type)}i(VF,"isPie");var Vo={$type:"PieSection",label:"label",value:"value"};function qF(e){return Ne.isInstance(e,Vo.$type)}i(qF,"isPieSection");var hc={$type:"Pipeline",components:"components",parent:"parent"},Ao={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},rn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},_a={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function HF(e){return Ne.isInstance(e,_a.$type)}i(HF,"isRailroad");var Sa={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function YF(e){return Ne.isInstance(e,Sa.$type)}i(YF,"isRailroadAbnf");var ug={$type:"RailroadChoiceExpr",alternatives:"alternatives"},wa={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function XF(e){return Ne.isInstance(e,wa.$type)}i(XF,"isRailroadEbnf");var pr={$type:"RailroadExpression"},cg={$type:"RailroadNonTerminalExpr",name:"name"},fg={$type:"RailroadOneOrMoreExpr",element:"element"},dg={$type:"RailroadOptionalExpr",element:"element"},Ia={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function JF(e){return Ne.isInstance(e,Ia.$type)}i(JF,"isRailroadPeg");var yc={$type:"RailroadRule",definition:"definition",name:"name"},pg={$type:"RailroadSequenceExpr",elements:"elements"},mg={$type:"RailroadSpecialExpr",text:"text"},hg={$type:"RailroadTerminalExpr",value:"value"},yg={$type:"RailroadZeroOrMoreExpr",element:"element"},gc={$type:"Section",classSelector:"classSelector",name:"name"},pa={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},vc={$type:"Size",height:"height",width:"width"},ma={$type:"Statement"},rs={$type:"Transition",from:"from",label:"label",to:"to"};function ZF(e){return Ne.isInstance(e,rs.$type)}i(ZF,"isTransition");var Na={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function QF(e){return Ne.isInstance(e,Na.$type)}i(QF,"isTreemap");var Tc={$type:"TreemapRow",indent:"indent",item:"item"},ha={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},Ui={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},We={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function ez(e){return Ne.isInstance(e,We.$type)}i(ez,"isWardley");var jw=class extends Id{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Ly.$type,properties:{alternatives:{name:Ly.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Dy.$type,properties:{elements:{name:Dy.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:ec.$type,properties:{primary:{name:ec.primary},repeat:{name:ec.repeat}},superTypes:[]},AbnfGroup:{name:xy.$type,properties:{element:{name:xy.element}},superTypes:[ca.$type]},AbnfNumVal:{name:My.$type,properties:{value:{name:My.value}},superTypes:[ca.$type]},AbnfOptionalGroup:{name:Gy.$type,properties:{element:{name:Gy.element}},superTypes:[ca.$type]},AbnfPrimary:{name:ca.$type,properties:{},superTypes:[]},AbnfRule:{name:tc.$type,properties:{definition:{name:tc.definition},name:{name:tc.name}},superTypes:[]},AbnfRuleName:{name:Fy.$type,properties:{name:{name:Fy.name}},superTypes:[ca.$type]},AbnfStringLiteral:{name:zy.$type,properties:{value:{name:zy.value}},superTypes:[ca.$type]},Accelerator:{name:co.$type,properties:{name:{name:co.name},x:{name:co.x},y:{name:co.y}},superTypes:[]},Alignment:{name:rc.$type,properties:{direction:{name:rc.direction},members:{name:rc.members,defaultValue:[]}},superTypes:[]},Anchor:{name:fo.$type,properties:{evolution:{name:fo.evolution},name:{name:fo.name},visibility:{name:fo.visibility}},superTypes:[]},Annotation:{name:xi.$type,properties:{number:{name:xi.number},text:{name:xi.text},x:{name:xi.x},y:{name:xi.y}},superTypes:[]},Annotations:{name:nc.$type,properties:{x:{name:nc.x},y:{name:nc.y}},superTypes:[]},Architecture:{name:Xt.$type,properties:{accDescr:{name:Xt.accDescr},accTitle:{name:Xt.accTitle},alignments:{name:Xt.alignments,defaultValue:[]},edges:{name:Xt.edges,defaultValue:[]},groups:{name:Xt.groups,defaultValue:[]},junctions:{name:Xt.junctions,defaultValue:[]},services:{name:Xt.services,defaultValue:[]},title:{name:Xt.title}},superTypes:[]},Axis:{name:po.$type,properties:{label:{name:po.label},name:{name:po.name}},superTypes:[]},Branch:{name:Ko.$type,properties:{name:{name:Ko.name},order:{name:Ko.order}},superTypes:[ma.$type]},Checkout:{name:jy.$type,properties:{branch:{name:jy.branch}},superTypes:[ma.$type]},CherryPicking:{name:mo.$type,properties:{id:{name:mo.id},parent:{name:mo.parent},tags:{name:mo.tags,defaultValue:[]}},superTypes:[ma.$type]},ClassDefStatement:{name:ac.$type,properties:{className:{name:ac.className},styleText:{name:ac.styleText}},superTypes:[]},Commit:{name:Aa.$type,properties:{id:{name:Aa.id},message:{name:Aa.message},tags:{name:Aa.tags,defaultValue:[]},type:{name:Aa.type}},superTypes:[ma.$type]},Common:{name:ho.$type,properties:{accDescr:{name:ho.accDescr},accTitle:{name:ho.accTitle},title:{name:ho.title}},superTypes:[]},Component:{name:Zr.$type,properties:{decorator:{name:Zr.decorator},evolution:{name:Zr.evolution},inertia:{name:Zr.inertia,defaultValue:!1},label:{name:Zr.label},name:{name:Zr.name},visibility:{name:Zr.visibility}},superTypes:[]},Curve:{name:yo.$type,properties:{entries:{name:yo.entries,defaultValue:[]},label:{name:yo.label},name:{name:yo.name}},superTypes:[]},Cynefin:{name:cn.$type,properties:{accDescr:{name:cn.accDescr},accTitle:{name:cn.accTitle},domains:{name:cn.domains,defaultValue:[]},title:{name:cn.title},transitions:{name:cn.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:go.$type,properties:{name:{name:go.name},x:{name:go.x},y:{name:go.y}},superTypes:[]},Decorator:{name:By.$type,properties:{strategy:{name:By.strategy}},superTypes:[]},Direction:{name:fa.$type,properties:{accDescr:{name:fa.accDescr},accTitle:{name:fa.accTitle},dir:{name:fa.dir},statements:{name:fa.statements,defaultValue:[]},title:{name:fa.title}},superTypes:[fn.$type]},DomainBlock:{name:Wo.$type,properties:{domain:{name:Wo.domain},items:{name:Wo.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:Rd.$type,properties:{label:{name:Rd.label}},superTypes:[]},EbnfChoice:{name:Uy.$type,properties:{alternatives:{name:Uy.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Ky.$type,properties:{except:{name:Ky.except}},superTypes:[Mi.$type]},EbnfGroup:{name:Wy.$type,properties:{element:{name:Wy.element}},superTypes:[Qr.$type]},EbnfNonTerminal:{name:Vy.$type,properties:{name:{name:Vy.name}},superTypes:[Qr.$type]},EbnfOneOrMorePostfix:{name:qy.$type,properties:{operator:{name:qy.operator}},superTypes:[Mi.$type]},EbnfOptional:{name:Hy.$type,properties:{element:{name:Hy.element}},superTypes:[Qr.$type]},EbnfOptionalPostfix:{name:Yy.$type,properties:{operator:{name:Yy.operator}},superTypes:[Mi.$type]},EbnfPostfix:{name:Mi.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Qr.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Xy.$type,properties:{element:{name:Xy.element}},superTypes:[Qr.$type]},EbnfRule:{name:ic.$type,properties:{definition:{name:ic.definition},name:{name:ic.name}},superTypes:[]},EbnfSequence:{name:Jy.$type,properties:{elements:{name:Jy.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Zy.$type,properties:{text:{name:Zy.text}},superTypes:[Qr.$type]},EbnfTerm:{name:sc.$type,properties:{base:{name:sc.base},postfixes:{name:sc.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Qy.$type,properties:{value:{name:Qy.value}},superTypes:[Qr.$type]},EbnfZeroOrMorePostfix:{name:eg.$type,properties:{operator:{name:eg.operator}},superTypes:[Mi.$type]},Edge:{name:Ht.$type,properties:{lhsDir:{name:Ht.lhsDir},lhsGroup:{name:Ht.lhsGroup,defaultValue:!1},lhsId:{name:Ht.lhsId},lhsInto:{name:Ht.lhsInto,defaultValue:!1},rhsDir:{name:Ht.rhsDir},rhsGroup:{name:Ht.rhsGroup,defaultValue:!1},rhsId:{name:Ht.rhsId},rhsInto:{name:Ht.rhsInto,defaultValue:!1},title:{name:Ht.title}},superTypes:[]},EmDataEntity:{name:da.$type,properties:{dataBlockValue:{name:da.dataBlockValue},dataType:{name:da.dataType},name:{name:da.name}},superTypes:[]},EmFrame:{name:en.$type,properties:{},superTypes:[]},EmGwt:{name:Gi.$type,properties:{givenStatements:{name:Gi.givenStatements,defaultValue:[]},sourceFrame:{name:Gi.sourceFrame,referenceType:en.$type},thenStatements:{name:Gi.thenStatements,defaultValue:[]},whenStatements:{name:Gi.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:tg.$type,properties:{entityIdentifier:{name:tg.entityIdentifier,referenceType:oc.$type}},superTypes:[]},EmModelEntity:{name:oc.$type,properties:{name:{name:oc.name}},superTypes:[]},EmNoteEntity:{name:vo.$type,properties:{dataBlockValue:{name:vo.dataBlockValue},dataType:{name:vo.dataType},sourceFrame:{name:vo.sourceFrame,referenceType:en.$type}},superTypes:[]},EmResetFrame:{name:yr.$type,properties:{dataInlineValue:{name:yr.dataInlineValue},dataReference:{name:yr.dataReference,referenceType:da.$type},dataType:{name:yr.dataType},entityIdentifier:{name:yr.entityIdentifier},modelEntityType:{name:yr.modelEntityType},name:{name:yr.name},sourceFrames:{name:yr.sourceFrames,defaultValue:[],referenceType:en.$type}},superTypes:[en.$type]},EmTimeFrame:{name:Dr.$type,properties:{dataInlineValue:{name:Dr.dataInlineValue},dataReference:{name:Dr.dataReference,referenceType:da.$type},dataType:{name:Dr.dataType},entityIdentifier:{name:Dr.entityIdentifier},modelEntityType:{name:Dr.modelEntityType},name:{name:Dr.name},sourceFrames:{name:Dr.sourceFrames,defaultValue:[],referenceType:en.$type}},superTypes:[en.$type]},Entry:{name:lc.$type,properties:{axis:{name:lc.axis,referenceType:po.$type},value:{name:lc.value}},superTypes:[]},EventModel:{name:dr.$type,properties:{accDescr:{name:dr.accDescr},accTitle:{name:dr.accTitle},dataEntities:{name:dr.dataEntities,defaultValue:[]},frames:{name:dr.frames,defaultValue:[]},gwtEntities:{name:dr.gwtEntities,defaultValue:[]},modelEntities:{name:dr.modelEntities,defaultValue:[]},noteEntities:{name:dr.noteEntities,defaultValue:[]},title:{name:dr.title}},superTypes:[]},Evolution:{name:rg.$type,properties:{stages:{name:rg.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:To.$type,properties:{boundary:{name:To.boundary},name:{name:To.name},secondName:{name:To.secondName}},superTypes:[]},Evolve:{name:uc.$type,properties:{component:{name:uc.component},target:{name:uc.target}},superTypes:[]},GitGraph:{name:fn.$type,properties:{accDescr:{name:fn.accDescr},accTitle:{name:fn.accTitle},statements:{name:fn.statements,defaultValue:[]},title:{name:fn.title}},superTypes:[]},Group:{name:Fi.$type,properties:{icon:{name:Fi.icon},id:{name:Fi.id},in:{name:Fi.in},title:{name:Fi.title}},superTypes:[]},Info:{name:ts.$type,properties:{accDescr:{name:ts.accDescr},accTitle:{name:ts.accTitle},title:{name:ts.title}},superTypes:[]},Item:{name:zi.$type,properties:{classSelector:{name:zi.classSelector},name:{name:zi.name}},superTypes:[]},Junction:{name:cc.$type,properties:{id:{name:cc.id},in:{name:cc.in}},superTypes:[]},Label:{name:ji.$type,properties:{negX:{name:ji.negX,defaultValue:!1},negY:{name:ji.negY,defaultValue:!1},offsetX:{name:ji.offsetX},offsetY:{name:ji.offsetY}},superTypes:[]},Leaf:{name:$o.$type,properties:{classSelector:{name:$o.classSelector},name:{name:$o.name},value:{name:$o.value}},superTypes:[zi.$type]},Link:{name:tn.$type,properties:{arrow:{name:tn.arrow},from:{name:tn.from},fromPort:{name:tn.fromPort},linkLabel:{name:tn.linkLabel},to:{name:tn.to},toPort:{name:tn.toPort}},superTypes:[]},Merge:{name:Ea.$type,properties:{branch:{name:Ea.branch},id:{name:Ea.id},tags:{name:Ea.tags,defaultValue:[]},type:{name:Ea.type}},superTypes:[ma.$type]},Note:{name:Ro.$type,properties:{evolution:{name:Ro.evolution},text:{name:Ro.text},visibility:{name:Ro.visibility}},superTypes:[]},Option:{name:fc.$type,properties:{name:{name:fc.name},value:{name:fc.value,defaultValue:!1}},superTypes:[]},Packet:{name:Ca.$type,properties:{accDescr:{name:Ca.accDescr},accTitle:{name:Ca.accTitle},blocks:{name:Ca.blocks,defaultValue:[]},title:{name:Ca.title}},superTypes:[]},PacketBlock:{name:ba.$type,properties:{bits:{name:ba.bits},end:{name:ba.end},label:{name:ba.label},start:{name:ba.start}},superTypes:[]},PegAny:{name:ng.$type,properties:{dot:{name:ng.dot}},superTypes:[Bi.$type]},PegGroup:{name:ag.$type,properties:{element:{name:ag.element}},superTypes:[Bi.$type]},PegIdentifier:{name:ig.$type,properties:{name:{name:ig.name}},superTypes:[Bi.$type]},PegLiteral:{name:sg.$type,properties:{value:{name:sg.value}},superTypes:[Bi.$type]},PegOrderedChoice:{name:og.$type,properties:{alternatives:{name:og.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:dc.$type,properties:{operator:{name:dc.operator},suffix:{name:dc.suffix}},superTypes:[]},PegPrimary:{name:Bi.$type,properties:{},superTypes:[]},PegRule:{name:pc.$type,properties:{definition:{name:pc.definition},name:{name:pc.name}},superTypes:[]},PegSequence:{name:lg.$type,properties:{elements:{name:lg.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:mc.$type,properties:{operator:{name:mc.operator},primary:{name:mc.primary}},superTypes:[]},Pie:{name:dn.$type,properties:{accDescr:{name:dn.accDescr},accTitle:{name:dn.accTitle},sections:{name:dn.sections,defaultValue:[]},showData:{name:dn.showData,defaultValue:!1},title:{name:dn.title}},superTypes:[]},PieSection:{name:Vo.$type,properties:{label:{name:Vo.label},value:{name:Vo.value}},superTypes:[]},Pipeline:{name:hc.$type,properties:{components:{name:hc.components,defaultValue:[]},parent:{name:hc.parent}},superTypes:[]},PipelineComponent:{name:Ao.$type,properties:{evolution:{name:Ao.evolution},label:{name:Ao.label},name:{name:Ao.name}},superTypes:[]},Radar:{name:rn.$type,properties:{accDescr:{name:rn.accDescr},accTitle:{name:rn.accTitle},axes:{name:rn.axes,defaultValue:[]},curves:{name:rn.curves,defaultValue:[]},options:{name:rn.options,defaultValue:[]},title:{name:rn.title}},superTypes:[]},Railroad:{name:_a.$type,properties:{accDescr:{name:_a.accDescr},accTitle:{name:_a.accTitle},rules:{name:_a.rules,defaultValue:[]},title:{name:_a.title}},superTypes:[]},RailroadAbnf:{name:Sa.$type,properties:{accDescr:{name:Sa.accDescr},accTitle:{name:Sa.accTitle},rules:{name:Sa.rules,defaultValue:[]},title:{name:Sa.title}},superTypes:[]},RailroadChoiceExpr:{name:ug.$type,properties:{alternatives:{name:ug.alternatives,defaultValue:[]}},superTypes:[pr.$type]},RailroadEbnf:{name:wa.$type,properties:{accDescr:{name:wa.accDescr},accTitle:{name:wa.accTitle},rules:{name:wa.rules,defaultValue:[]},title:{name:wa.title}},superTypes:[]},RailroadExpression:{name:pr.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:cg.$type,properties:{name:{name:cg.name}},superTypes:[pr.$type]},RailroadOneOrMoreExpr:{name:fg.$type,properties:{element:{name:fg.element}},superTypes:[pr.$type]},RailroadOptionalExpr:{name:dg.$type,properties:{element:{name:dg.element}},superTypes:[pr.$type]},RailroadPeg:{name:Ia.$type,properties:{accDescr:{name:Ia.accDescr},accTitle:{name:Ia.accTitle},rules:{name:Ia.rules,defaultValue:[]},title:{name:Ia.title}},superTypes:[]},RailroadRule:{name:yc.$type,properties:{definition:{name:yc.definition},name:{name:yc.name}},superTypes:[]},RailroadSequenceExpr:{name:pg.$type,properties:{elements:{name:pg.elements,defaultValue:[]}},superTypes:[pr.$type]},RailroadSpecialExpr:{name:mg.$type,properties:{text:{name:mg.text}},superTypes:[pr.$type]},RailroadTerminalExpr:{name:hg.$type,properties:{value:{name:hg.value}},superTypes:[pr.$type]},RailroadZeroOrMoreExpr:{name:yg.$type,properties:{element:{name:yg.element}},superTypes:[pr.$type]},Section:{name:gc.$type,properties:{classSelector:{name:gc.classSelector},name:{name:gc.name}},superTypes:[zi.$type]},Service:{name:pa.$type,properties:{icon:{name:pa.icon},iconText:{name:pa.iconText},id:{name:pa.id},in:{name:pa.in},title:{name:pa.title}},superTypes:[]},Size:{name:vc.$type,properties:{height:{name:vc.height},width:{name:vc.width}},superTypes:[]},Statement:{name:ma.$type,properties:{},superTypes:[]},Transition:{name:rs.$type,properties:{from:{name:rs.from},label:{name:rs.label},to:{name:rs.to}},superTypes:[]},TreeNode:{name:ha.$type,properties:{classAnnotation:{name:ha.classAnnotation},descAnnotation:{name:ha.descAnnotation},iconAnnotation:{name:ha.iconAnnotation},indent:{name:ha.indent},name:{name:ha.name}},superTypes:[]},TreeView:{name:Ui.$type,properties:{accDescr:{name:Ui.accDescr},accTitle:{name:Ui.accTitle},nodes:{name:Ui.nodes,defaultValue:[]},title:{name:Ui.title}},superTypes:[]},Treemap:{name:Na.$type,properties:{accDescr:{name:Na.accDescr},accTitle:{name:Na.accTitle},title:{name:Na.title},TreemapRows:{name:Na.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Tc.$type,properties:{indent:{name:Tc.indent},item:{name:Tc.item}},superTypes:[]},Wardley:{name:We.$type,properties:{accDescr:{name:We.accDescr},accelerators:{name:We.accelerators,defaultValue:[]},accTitle:{name:We.accTitle},anchors:{name:We.anchors,defaultValue:[]},annotation:{name:We.annotation,defaultValue:[]},annotations:{name:We.annotations,defaultValue:[]},components:{name:We.components,defaultValue:[]},deaccelerators:{name:We.deaccelerators,defaultValue:[]},evolution:{name:We.evolution},evolves:{name:We.evolves,defaultValue:[]},links:{name:We.links,defaultValue:[]},notes:{name:We.notes,defaultValue:[]},pipelines:{name:We.pipelines,defaultValue:[]},size:{name:We.size},title:{name:We.title}},superTypes:[]}}}static{i(this,"MermaidAstReflection")}},Ne=new jw,gg,tz=i(()=>gg??(gg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),vg,rz=i(()=>vg??(vg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),Tg,nz=i(()=>Tg??(Tg=Ue('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),$g,az=i(()=>$g??($g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Rg,iz=i(()=>Rg??(Rg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Ag,sz=i(()=>Ag??(Ag=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Eg,oz=i(()=>Eg??(Eg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Cg,lz=i(()=>Cg??(Cg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),bg,uz=i(()=>bg??(bg=Ue('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),_g,cz=i(()=>_g??(_g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Sg,fz=i(()=>Sg??(Sg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),wg,dz=i(()=>wg??(wg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),Ig,pz=i(()=>Ig??(Ig=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Ng,mz=i(()=>Ng??(Ng=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Pg,hz=i(()=>Pg??(Pg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),yz={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gz={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vz={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tz={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$z={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Rz={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Az={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ez={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Cz={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bz={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_z={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sz={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wz={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iz={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Nz={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ct={AstReflection:i(()=>new jw,"AstReflection")},Pz={Grammar:i(()=>tz(),"Grammar"),LanguageMetaData:i(()=>yz,"LanguageMetaData"),parser:{}},kz={Grammar:i(()=>rz(),"Grammar"),LanguageMetaData:i(()=>gz,"LanguageMetaData"),parser:{}},Oz={Grammar:i(()=>nz(),"Grammar"),LanguageMetaData:i(()=>vz,"LanguageMetaData"),parser:{}},Lz={Grammar:i(()=>az(),"Grammar"),LanguageMetaData:i(()=>Tz,"LanguageMetaData"),parser:{}},Dz={Grammar:i(()=>iz(),"Grammar"),LanguageMetaData:i(()=>$z,"LanguageMetaData"),parser:{}},xz={Grammar:i(()=>sz(),"Grammar"),LanguageMetaData:i(()=>Rz,"LanguageMetaData"),parser:{}},Mz={Grammar:i(()=>oz(),"Grammar"),LanguageMetaData:i(()=>Az,"LanguageMetaData"),parser:{}},Gz={Grammar:i(()=>lz(),"Grammar"),LanguageMetaData:i(()=>Ez,"LanguageMetaData"),parser:{}},Fz={Grammar:i(()=>uz(),"Grammar"),LanguageMetaData:i(()=>Cz,"LanguageMetaData"),parser:{}},zz={Grammar:i(()=>cz(),"Grammar"),LanguageMetaData:i(()=>bz,"LanguageMetaData"),parser:{}},jz={Grammar:i(()=>fz(),"Grammar"),LanguageMetaData:i(()=>_z,"LanguageMetaData"),parser:{}},Bz={Grammar:i(()=>dz(),"Grammar"),LanguageMetaData:i(()=>Sz,"LanguageMetaData"),parser:{}},Uz={Grammar:i(()=>pz(),"Grammar"),LanguageMetaData:i(()=>wz,"LanguageMetaData"),parser:{}},Kz={Grammar:i(()=>mz(),"Grammar"),LanguageMetaData:i(()=>Iz,"LanguageMetaData"),parser:{}},Wz={Grammar:i(()=>hz(),"Grammar"),LanguageMetaData:i(()=>Nz,"LanguageMetaData"),parser:{}},Vz=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,qz=/accTitle[\t ]*:([^\n\r]*)/,Hz=/title([\t ][^\n\r]*|)/,Yz={ACC_DESCR:Vz,ACC_TITLE:qz,TITLE:Hz},ur=class extends zm{static{i(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){const n=Yz[e.name];if(n===void 0)return;const a=n.exec(t);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},ci=class extends ur{static{i(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},ft=class extends Du{static{i(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const n=super.buildKeywordTokens(e,t,r);return n.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends ft{static{i(this,"CommonTokenBuilder")}});/*! Bundled license information: + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var Xz=class extends ft{static{i(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Bw={parser:{TokenBuilder:i(()=>new Xz,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function Uw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Gz,Bw);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}i(Uw,"createRadarServices");var Jz=class extends ft{static{i(this,"RailroadTokenBuilder")}constructor(){super(["railroad-beta"])}},kg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Jz,"TokenBuilder"),ValueConverter:i(()=>new Zz,"ValueConverter")}};function Ww(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),jz,Kw);return t.ServiceRegistry.register(r),{shared:t,Railroad:r}}i(Ww,"createRailroadServices");var Qz=class extends ft{static{i(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},Og=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Qz,"TokenBuilder"),ValueConverter:i(()=>new ej,"ValueConverter")}};function qw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),zz,Vw);return t.ServiceRegistry.register(r),{shared:t,RailroadEbnf:r}}i(qw,"createRailroadEbnfServices");var tj=class extends ft{static{i(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},rj=class extends ur{static{i(this,"RailroadAbnfValueConverter")}runConverter(e,t,r){const n=super.runConverter(e,t,r);if(e.name==="TITLE"&&typeof n=="string"){const a=n.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return n}runCustomConverter(e,t,r){if(e.name==="ABNF_STRING")return t.slice(1,-1)}},Hw={parser:{TokenBuilder:i(()=>new tj,"TokenBuilder"),ValueConverter:i(()=>new rj,"ValueConverter")}};function Yw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Fz,Hw);return t.ServiceRegistry.register(r),{shared:t,RailroadAbnf:r}}i(Yw,"createRailroadAbnfServices");var nj=class extends ft{static{i(this,"RailroadPegTokenBuilder")}constructor(){super(["railroad-peg-beta"])}},Lg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew nj,"TokenBuilder"),ValueConverter:i(()=>new aj,"ValueConverter")}};function Jw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Bz,Xw);return t.ServiceRegistry.register(r),{shared:t,RailroadPeg:r}}i(Jw,"createRailroadPegServices");var ij=class extends ft{static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},sj=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,oj=class extends ur{static{i(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;const n=sj.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function Zw(e){const t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){const n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}i(Zw,"registerValidationChecks");var lj=class{static{i(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(const n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},Qw={parser:{TokenBuilder:i(()=>new ij,"TokenBuilder"),ValueConverter:i(()=>new oj,"ValueConverter")},validation:{TreemapValidator:i(()=>new lj,"TreemapValidator")}};function eI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Uz,Qw);return t.ServiceRegistry.register(r),Zw(r),{shared:t,Treemap:r}}i(eI,"createTreemapServices");var uj=class extends ur{static{i(this,"WardleyValueConverter")}runCustomConverter(e,t,r){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return}}},tI={parser:{ValueConverter:i(()=>new uj,"ValueConverter")}};function rI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Wz,tI);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}i(rI,"createWardleyServices");var cj=class extends ft{static{i(this,"CynefinTokenBuilder")}constructor(){super(["cynefin-beta"])}},nI={parser:{TokenBuilder:i(()=>new cj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function aI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),kz,nI);return t.ServiceRegistry.register(r),{shared:t,Cynefin:r}}i(aI,"createCynefinServices");var fj=class extends ft{static{i(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},iI={parser:{TokenBuilder:i(()=>new fj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function sI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Lz,iI);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}i(sI,"createGitGraphServices");var dj=class extends ft{static{i(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},oI={parser:{TokenBuilder:i(()=>new dj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function lI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Dz,oI);return t.ServiceRegistry.register(r),{shared:t,Info:r}}i(lI,"createInfoServices");var pj=class extends ft{static{i(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},uI={parser:{TokenBuilder:i(()=>new pj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function cI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),xz,uI);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}i(cI,"createPacketServices");var mj=class extends ft{static{i(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},hj=class extends ur{static{i(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},fI={parser:{TokenBuilder:i(()=>new mj,"TokenBuilder"),ValueConverter:i(()=>new hj,"ValueConverter")}};function dI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Mz,fI);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}i(dI,"createPieServices");var yj=class extends ur{static{i(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="QUOTED_NAME")return t.substring(1,t.length-1);if(e.name==="BARE_NAME")return t.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return t.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const n=t.trim();return n.substring(5,n.length-1)}if(e.name==="DESC_ANNOTATION")return t.trim().substring(2).trim()}},gj=class extends ft{static{i(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},pI={parser:{TokenBuilder:i(()=>new gj,"TokenBuilder"),ValueConverter:i(()=>new yj,"ValueConverter")}};function mI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Kz,pI);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}i(mI,"createTreeViewServices");var vj=class extends ft{static{i(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Tj=class extends ur{static{i(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},hI={parser:{TokenBuilder:i(()=>new vj,"TokenBuilder"),ValueConverter:i(()=>new Tj,"ValueConverter")}};function yI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Pz,hI);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}i(yI,"createArchitectureServices");var $j=class extends ft{static{i(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},Dg=new Set(["cmd","command"]),xg=new Set(["evt","event"]),$c=new Set(["rmo","readmodel"]),Mg=new Set(["pcr","processor"]),Gg=new Set(["ui"]);function gI(e){const t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){const n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}i(gI,"registerValidationChecks");var Rj=class{static{i(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(Dg.has(e.modelEntityType)?this.validateSources(e,new Set([...Gg,...Mg]),"command","ui or processor",t):xg.has(e.modelEntityType)?this.validateSources(e,Dg,"event","command",t):$c.has(e.modelEntityType)?this.validateSources(e,xg,"read model","event",t):Mg.has(e.modelEntityType)?this.validateSources(e,$c,"processor","read model",t):Gg.has(e.modelEntityType)&&this.validateSources(e,$c,"ui","read model",t))}validateSources(e,t,r,n,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!t.has(o.modelEntityType)&&a("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},vI={parser:{TokenBuilder:i(()=>new $j,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")},validation:{EventModelingValidator:i(()=>new Rj,"EventModelingValidator")}};function TI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Oz,vI);return t.ServiceRegistry.register(r),gI(r),{shared:t,EventModel:r}}i(TI,"createEventModelingServices");var Ve={},Aj={info:i(async()=>{const{createInfoServices:e}=await et(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>bj);return{createInfoServices:r}},void 0),t=e().Info.parser.LangiumParser;Ve.info=t},"info"),packet:i(async()=>{const{createPacketServices:e}=await et(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>_j);return{createPacketServices:r}},void 0),t=e().Packet.parser.LangiumParser;Ve.packet=t},"packet"),pie:i(async()=>{const{createPieServices:e}=await et(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Sj);return{createPieServices:r}},void 0),t=e().Pie.parser.LangiumParser;Ve.pie=t},"pie"),treeView:i(async()=>{const{createTreeViewServices:e}=await et(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>wj);return{createTreeViewServices:r}},void 0),t=e().TreeView.parser.LangiumParser;Ve.treeView=t},"treeView"),architecture:i(async()=>{const{createArchitectureServices:e}=await et(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Ij);return{createArchitectureServices:r}},void 0),t=e().Architecture.parser.LangiumParser;Ve.architecture=t},"architecture"),gitGraph:i(async()=>{const{createGitGraphServices:e}=await et(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Nj);return{createGitGraphServices:r}},void 0),t=e().GitGraph.parser.LangiumParser;Ve.gitGraph=t},"gitGraph"),eventmodeling:i(async()=>{const{createEventModelingServices:e}=await et(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Pj);return{createEventModelingServices:r}},void 0),t=e().EventModel.parser.LangiumParser;Ve.eventmodeling=t},"eventmodeling"),radar:i(async()=>{const{createRadarServices:e}=await et(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>kj);return{createRadarServices:r}},void 0),t=e().Radar.parser.LangiumParser;Ve.radar=t},"radar"),railroad:i(async()=>{const{createRailroadServices:e}=await et(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>Oj);return{createRailroadServices:r}},void 0),t=e().Railroad.parser.LangiumParser;Ve.railroad=t},"railroad"),railroadEbnf:i(async()=>{const{createRailroadEbnfServices:e}=await et(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Lj);return{createRailroadEbnfServices:r}},void 0),t=e().RailroadEbnf.parser.LangiumParser;Ve.railroadEbnf=t},"railroadEbnf"),railroadAbnf:i(async()=>{const{createRailroadAbnfServices:e}=await et(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Dj);return{createRailroadAbnfServices:r}},void 0),t=e().RailroadAbnf.parser.LangiumParser;Ve.railroadAbnf=t},"railroadAbnf"),railroadPeg:i(async()=>{const{createRailroadPegServices:e}=await et(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>xj);return{createRailroadPegServices:r}},void 0),t=e().RailroadPeg.parser.LangiumParser;Ve.railroadPeg=t},"railroadPeg"),treemap:i(async()=>{const{createTreemapServices:e}=await et(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Mj);return{createTreemapServices:r}},void 0),t=e().Treemap.parser.LangiumParser;Ve.treemap=t},"treemap"),wardley:i(async()=>{const{createWardleyServices:e}=await et(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Gj);return{createWardleyServices:r}},void 0),t=e().Wardley.parser.LangiumParser;Ve.wardley=t},"wardley"),cynefin:i(async()=>{const{createCynefinServices:e}=await et(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Fj);return{createCynefinServices:r}},void 0),t=e().Cynefin.parser.LangiumParser;Ve.cynefin=t},"cynefin")};async function Ej(e,t){const r=Aj[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);Ve[e]||await r();const a=Ve[e].parse(t);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new Cj(a);return a.value}i(Ej,"parse");var Cj=class extends Error{constructor(e){const t=e.lexerErrors.map(n=>{const a=n.line!==void 0&&!isNaN(n.line)?n.line:"?",s=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${a}, column ${s}: ${n.message}`}).join(` +`),r=e.parserErrors.map(n=>{const a=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",s=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${n.message}`}).join(` +`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{i(this,"MermaidParseError")}};const bj=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:oI,createInfoServices:lI},Symbol.toStringTag,{value:"Module"})),_j=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:uI,createPacketServices:cI},Symbol.toStringTag,{value:"Module"})),Sj=Object.freeze(Object.defineProperty({__proto__:null,PieModule:fI,createPieServices:dI},Symbol.toStringTag,{value:"Module"})),wj=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:pI,createTreeViewServices:mI},Symbol.toStringTag,{value:"Module"})),Ij=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:hI,createArchitectureServices:yI},Symbol.toStringTag,{value:"Module"})),Nj=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:iI,createGitGraphServices:sI},Symbol.toStringTag,{value:"Module"})),Pj=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:vI,createEventModelingServices:TI},Symbol.toStringTag,{value:"Module"})),kj=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Bw,createRadarServices:Uw},Symbol.toStringTag,{value:"Module"})),Oj=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:Kw,createRailroadServices:Ww},Symbol.toStringTag,{value:"Module"})),Lj=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:Vw,createRailroadEbnfServices:qw},Symbol.toStringTag,{value:"Module"})),Dj=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Hw,createRailroadAbnfServices:Yw},Symbol.toStringTag,{value:"Module"})),xj=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Xw,createRailroadPegServices:Jw},Symbol.toStringTag,{value:"Module"})),Mj=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Qw,createTreemapServices:eI},Symbol.toStringTag,{value:"Module"})),Gj=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:tI,createWardleyServices:rI},Symbol.toStringTag,{value:"Module"})),Fj=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:nI,createCynefinServices:aI},Symbol.toStringTag,{value:"Module"}));export{Cj as M,qw as a,Yw as b,Ww as c,Jw as d,zF as i,Ej as p}; diff --git a/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CZChzy6K.js b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CZChzy6K.js new file mode 100644 index 000000000..a1ea90b44 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CZChzy6K.js @@ -0,0 +1,178 @@ +var $I=Object.create,Ls=Object.defineProperty,RI=Object.getOwnPropertyDescriptor,Rd=Object.getOwnPropertyNames,AI=Object.getPrototypeOf,EI=Object.prototype.hasOwnProperty,i=(e,t)=>Ls(e,"name",{value:t,configurable:!0}),CI=(e,t)=>function(){return e&&(t=(0,e[Rd(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Rd(e)[0]])((t={exports:{}}).exports,t),t.exports},Wr=(e,t)=>{for(var r in t)Ls(e,r,{get:t[r],enumerable:!0})},Ad=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Rd(t))!EI.call(e,a)&&a!==r&&Ls(e,a,{get:()=>t[a],enumerable:!(n=RI(t,a))||n.enumerable});return e},Ol=(e,t,r)=>(Ad(e,t,"default"),r),Ed=(e,t,r)=>(r=e!=null?$I(AI(e)):{},Ad(Ls(r,"default",{value:e,enumerable:!0}),e)),Cd=e=>Ad(Ls({},"__esModule",{value:!0}),e),Ll={};Wr(Ll,{AnnotatedTextEdit:()=>pr,ChangeAnnotation:()=>nn,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>Qc,CodeActionContext:()=>Zc,CodeActionKind:()=>Jc,CodeActionTriggerKind:()=>Yi,CodeDescription:()=>Ic,CodeLens:()=>ef,Color:()=>Eo,ColorInformation:()=>Ec,ColorPresentation:()=>Cc,Command:()=>rn,CompletionItem:()=>Fc,CompletionItemKind:()=>Oc,CompletionItemLabelDetails:()=>Gc,CompletionItemTag:()=>Dc,CompletionList:()=>zc,CreateFile:()=>ha,DeleteFile:()=>ga,Diagnostic:()=>Wi,DiagnosticRelatedInformation:()=>Co,DiagnosticSeverity:()=>Sc,DiagnosticTag:()=>wc,DocumentHighlight:()=>Wc,DocumentHighlightKind:()=>Kc,DocumentLink:()=>rf,DocumentSymbol:()=>Xc,DocumentUri:()=>$c,EOL:()=>Fg,FoldingRange:()=>_c,FoldingRangeKind:()=>bc,FormattingOptions:()=>tf,Hover:()=>jc,InlayHint:()=>df,InlayHintKind:()=>So,InlayHintLabelPart:()=>wo,InlineCompletionContext:()=>vf,InlineCompletionItem:()=>mf,InlineCompletionList:()=>hf,InlineCompletionTriggerKind:()=>yf,InlineValueContext:()=>ff,InlineValueEvaluatableExpression:()=>cf,InlineValueText:()=>lf,InlineValueVariableLookup:()=>uf,InsertReplaceEdit:()=>xc,InsertTextFormat:()=>Lc,InsertTextMode:()=>Mc,Location:()=>Ki,LocationLink:()=>Ac,MarkedString:()=>Hi,MarkupContent:()=>va,MarkupKind:()=>_o,OptionalVersionedTextDocumentIdentifier:()=>Vi,ParameterInformation:()=>Bc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ya,SelectedCompletionInfo:()=>gf,SelectionRange:()=>nf,SemanticTokenModifiers:()=>sf,SemanticTokenTypes:()=>af,SemanticTokens:()=>of,SignatureInformation:()=>Uc,StringValue:()=>pf,SymbolInformation:()=>Hc,SymbolKind:()=>qc,SymbolTag:()=>Vc,TextDocument:()=>$f,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Nc,TextDocumentItem:()=>kc,TextEdit:()=>Ht,URI:()=>Ao,VersionedTextDocumentIdentifier:()=>Pc,WorkspaceChange:()=>Gg,WorkspaceEdit:()=>bo,WorkspaceFolder:()=>Tf,WorkspaceSymbol:()=>Yc,integer:()=>Rc,uinteger:()=>Ui});var $c,Ao,Rc,Ui,ie,Q,Ki,Ac,Eo,Ec,Cc,bc,_c,Co,Sc,wc,Ic,Wi,rn,Ht,nn,Ke,pr,qi,ha,ya,ga,bo,Pi,Uu,Gg,Nc,Pc,Vi,kc,_o,va,Oc,Lc,Dc,xc,Mc,Gc,Fc,zc,Hi,jc,Bc,Uc,Kc,Wc,qc,Vc,Hc,Yc,Xc,Jc,Yi,Zc,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,So,wo,df,pf,mf,hf,yf,gf,vf,Tf,Fg,$f,oh,A,Ds=CI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})($c||($c={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Ao||(Ao={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ui||(Ui={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ui.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ui.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Ki||(Ki={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ac||(Ac={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Eo||(Eo={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Eo.is(a.color)}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Ht.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Ht.is))}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(bc||(bc={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(_c||(_c={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Ki.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Sc||(Sc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(wc||(wc={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Ic||(Ic={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,Co.is))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(rn||(rn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Ht||(Ht={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Ht.is(o)&&(nn.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(pr||(pr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Vi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ha||(ha={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ha.is(a)||ya.is(a)||ga.is(a):qi.is(a)))}i(t,"is"),e.is=t})(bo||(bo={})),Pi=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Ht.insert(e,t):Ke.is(r)?(a=r,n=pr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=pr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Ht.replace(e,t):Ke.is(r)?(a=r,n=pr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=pr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Ht.del(e):Ke.is(t)?(n=t,r=pr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=pr.del(e,n)),this.edits.push(r),n!==void 0)return n}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 new Error("Text edit change is not configured to manage change annotations.")}},Uu=class{static{i(this,"ChangeAnnotations")}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 r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Gg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Uu(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new Pi(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new Pi(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}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(Vi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new Pi(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new Pi(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Uu,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,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;nn.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ha.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ha.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;nn.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ya.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ya.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;nn.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ga.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ga.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Nc||(Nc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(_o||(_o={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&_o.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(va||(va={})),(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})(Oc||(Oc={})),(function(e){e.PlainText=1,e.Snippet=2})(Lc||(Lc={})),(function(e){e.Deprecated=1})(Dc||(Dc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(xc||(xc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Mc||(Mc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Gc||(Gc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(Fc||(Fc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(va.is(n.contents)||Hi.is(n.contents)||A.typedArray(n.contents,Hi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(jc||(jc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Bc||(Bc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Kc||(Kc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Wc||(Wc={})),(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})(qc||(qc={})),(function(e){e.Deprecated=1})(Vc||(Vc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Hc||(Hc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Xc||(Xc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Jc||(Jc={})),(function(e){e.Invoked=1,e.Automatic=2})(Yi||(Yi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Wi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Yi.Invoked||a.triggerKind===Yi.Automatic)}i(r,"is"),e.is=r})(Zc||(Zc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):rn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Wi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||rn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||bo.is(a.edit))}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||rn.is(a.command))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(nf||(nf={})),(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"})(af||(af={})),(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"})(sf||(sf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(of||(of={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(lf||(lf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||va.is(a.tooltip))&&(a.location===void 0||Ki.is(a.location))&&(a.command===void 0||rn.is(a.command))}i(r,"is"),e.is=r})(wo||(wo={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,wo.is))&&(a.kind===void 0||So.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Ht.is)&&(a.tooltip===void 0||A.string(a.tooltip)||va.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(df||(df={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(pf||(pf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(mf||(mf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){e.Invoked=0,e.Automatic=1})(yf||(yf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(gf||(gf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Ao.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})(Tf||(Tf={})),Fg=[` +`,`\r +`,"\r"],(function(e){function t(s,o,l,u){return new oh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f0&&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(),r=0,n=t.length;if(n===0)return ie.create(0,e);for(;re?n=s:r=s+1}let a=r-1;return ie.create(a,e-t[a])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1"u"}i(n,"undefined"),e.undefined=n;function a(g){return g===!0||g===!1}i(a,"boolean"),e.boolean=a;function s(g){return t.call(g)==="[object String]"}i(s,"string"),e.string=s;function o(g){return t.call(g)==="[object Number]"}i(o,"number"),e.number=o;function l(g,v,b){return t.call(g)==="[object Number]"&&v<=g&&g<=b}i(l,"numberRange"),e.numberRange=l;function u(g){return t.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}i(u,"integer"),e.integer=u;function c(g){return t.call(g)==="[object Number]"&&0<=g&&g<=2147483647}i(c,"uinteger"),e.uinteger=c;function f(g){return t.call(g)==="[object Function]"}i(f,"func"),e.func=f;function d(g){return g!==null&&typeof g=="object"}i(d,"objectLiteral"),e.objectLiteral=d;function m(g,v){return Array.isArray(g)&&g.every(v)}i(m,"typedArray"),e.typedArray=m})(A||(A={}))}}),Ln=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}i(r,"RAL"),(function(n){function a(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");t=s}i(a,"install"),n.install=a})(r||(r={})),e.default=r}}),xs=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(u){return u===!0||u===!1}i(t,"boolean"),e.boolean=t;function r(u){return typeof u=="string"||u instanceof String}i(r,"string"),e.string=r;function n(u){return typeof u=="number"||u instanceof Number}i(n,"number"),e.number=n;function a(u){return u instanceof Error}i(a,"error"),e.error=a;function s(u){return typeof u=="function"}i(s,"func"),e.func=s;function o(u){return Array.isArray(u)}i(o,"array"),e.array=o;function l(u){return o(u)&&u.every(c=>r(c))}i(l,"stringArray"),e.stringArray=l}}),Qa=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=Ln(),r;(function(s){const o={dispose(){}};s.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{i(this,"CallbackList")}add(s,o=null,l){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(l)&&l.push({dispose:i(()=>this.remove(s,o),"dispose")})}remove(s,o=null){if(!this._callbacks)return;let l=!1;for(let u=0,c=this._callbacks.length;u{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,l);const c={dispose:i(()=>{this._callbacks&&(this._callbacks.remove(o,l),c.dispose=zg._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(u)&&u.push(c),c}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=a,a._noop=function(){}}}),Dl=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=Ln(),r=xs(),n=Qa(),a;(function(u){u.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),u.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(f){const d=f;return d&&(d===u.None||d===u.Cancelled||r.boolean(d.isCancellationRequested)&&!!d.onCancellationRequested)}i(c,"is"),u.is=c})(a||(e.CancellationToken=a={}));var s=Object.freeze(function(u,c){const f=(0,t.default)().timer.setTimeout(u.bind(c),0);return{dispose(){f.dispose()}}}),o=class{static{i(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{i(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}};e.CancellationTokenSource=l}}),jg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){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 t=xs(),r;(function(y){y.ParseError=-32700,y.InvalidRequest=-32600,y.MethodNotFound=-32601,y.InvalidParams=-32602,y.InternalError=-32603,y.jsonrpcReservedErrorRangeStart=-32099,y.serverErrorStart=-32099,y.MessageWriteError=-32099,y.MessageReadError=-32098,y.PendingResponseRejected=-32097,y.ConnectionInactive=-32096,y.ServerNotInitialized=-32002,y.UnknownErrorCode=-32001,y.jsonrpcReservedErrorRangeEnd=-32e3,y.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class Bg extends Error{static{i(this,"ResponseError")}constructor(E,T,$){super(T),this.code=t.number(E)?E:r.UnknownErrorCode,this.data=$,Object.setPrototypeOf(this,Bg.prototype)}toJson(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),E}};e.ResponseError=n;var a=class Io{static{i(this,"ParameterStructures")}constructor(E){this.kind=E}static is(E){return E===Io.auto||E===Io.byName||E===Io.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{static{i(this,"AbstractMessageSignature")}constructor(y,E){this.method=y,this.numberOfParams=E}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s;var o=class extends s{static{i(this,"RequestType0")}constructor(y){super(y,0)}};e.RequestType0=o;var l=class extends s{static{i(this,"RequestType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType=l;var u=class extends s{static{i(this,"RequestType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType1=u;var c=class extends s{static{i(this,"RequestType2")}constructor(y){super(y,2)}};e.RequestType2=c;var f=class extends s{static{i(this,"RequestType3")}constructor(y){super(y,3)}};e.RequestType3=f;var d=class extends s{static{i(this,"RequestType4")}constructor(y){super(y,4)}};e.RequestType4=d;var m=class extends s{static{i(this,"RequestType5")}constructor(y){super(y,5)}};e.RequestType5=m;var g=class extends s{static{i(this,"RequestType6")}constructor(y){super(y,6)}};e.RequestType6=g;var v=class extends s{static{i(this,"RequestType7")}constructor(y){super(y,7)}};e.RequestType7=v;var b=class extends s{static{i(this,"RequestType8")}constructor(y){super(y,8)}};e.RequestType8=b;var S=class extends s{static{i(this,"RequestType9")}constructor(y){super(y,9)}};e.RequestType9=S;var w=class extends s{static{i(this,"NotificationType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType=w;var I=class extends s{static{i(this,"NotificationType0")}constructor(y){super(y,0)}};e.NotificationType0=I;var R=class extends s{static{i(this,"NotificationType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=R;var P=class extends s{static{i(this,"NotificationType2")}constructor(y){super(y,2)}};e.NotificationType2=P;var z=class extends s{static{i(this,"NotificationType3")}constructor(y){super(y,3)}};e.NotificationType3=z;var X=class extends s{static{i(this,"NotificationType4")}constructor(y){super(y,4)}};e.NotificationType4=X;var Z=class extends s{static{i(this,"NotificationType5")}constructor(y){super(y,5)}};e.NotificationType5=Z;var ce=class extends s{static{i(this,"NotificationType6")}constructor(y){super(y,6)}};e.NotificationType6=ce;var se=class extends s{static{i(this,"NotificationType7")}constructor(y){super(y,7)}};e.NotificationType7=se;var Se=class extends s{static{i(this,"NotificationType8")}constructor(y){super(y,8)}};e.NotificationType8=Se;var k=class extends s{static{i(this,"NotificationType9")}constructor(y){super(y,9)}};e.NotificationType9=k;var C;(function(y){function E(_){const O=_;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}i(E,"isRequest"),y.isRequest=E;function T(_){const O=_;return O&&t.string(O.method)&&_.id===void 0}i(T,"isNotification"),y.isNotification=T;function $(_){const O=_;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}i($,"isResponse"),y.isResponse=$})(C||(e.Message=C={}))}}),Ug=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(r||(e.Touch=r={}));var n=class{static{i(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=r.None){const l=this._map.get(s);if(l)return o!==r.None&&this.touch(l,o),l.value}set(s,o,l=r.None){let u=this._map.get(s);if(u)u.value=o,l!==r.None&&this.touch(u,l);else{switch(u={key:s,value:o,next:void 0,previous:void 0},l){case r.None:this.addItemLast(u);break;case r.First:this.addItemFirst(u);break;case r.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const l=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==l)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}values(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}entries(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,l=this.size;for(;o&&l>s;)this._map.delete(o.key),o=o.next,l--;this._head=o,this._size=l,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,l=s.previous;if(!o||!l)throw new Error("Invalid list");o.previous=l,l.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(s===this._head)return;const l=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(l.previous=u,u.next=l),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===r.Last){if(s===this._tail)return;const l=s.next,u=s.previous;s===this._head?(l.previous=void 0,this._head=l):(l.previous=u,u.next=l),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,l)=>{s.push([l,o])}),s}fromJSON(s){this.clear();for(const[o,l]of s)this.set(o,l)}};e.LinkedMap=n;var a=class extends n{static{i(this,"LRUCache")}constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=r.AsNew){return super.get(s,o)}peek(s){return super.get(s,r.None)}set(s,o){return super.set(s,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=a}}),bI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(a){return{dispose:a}}i(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),_I=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Dl(),r;(function(l){l.Continue=0,l.Cancelled=1})(r||(r={}));var n=class{static{i(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=r.Continue,this.buffers.set(l.id,u),l.$cancellationData=u}async sendCancellation(l,u){const c=this.buffers.get(u);if(c===void 0)return;const f=new Int32Array(c,0,1);Atomics.store(f,0,r.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var a=class{static{i(this,"SharedArrayBufferCancellationToken")}constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{static{i(this,"SharedArrayBufferCancellationTokenSource")}constructor(l){this.token=new a(l)}cancel(){}dispose(){}},o=class{static{i(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(l){const u=l.$cancellationData;return u===void 0?new t.CancellationTokenSource:new s(u)}};e.SharedArrayReceiverStrategy=o}}),Kg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=Ln(),r=class{static{i(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((a,s)=>{this._waiting.push({thunk:n,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=n.thunk();a instanceof Promise?a.then(s=>{this._active--,n.resolve(s),this.runNext()},s=>{this._active--,n.reject(s),this.runNext()}):(this._active--,n.resolve(a),this.runNext())}catch(a){this._active--,n.reject(a),this.runNext()}}};e.Semaphore=r}}),SI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=Ln(),r=xs(),n=Qa(),a=Kg(),s;(function(c){function f(d){let m=d;return m&&r.func(m.listen)&&r.func(m.dispose)&&r.func(m.onError)&&r.func(m.onClose)&&r.func(m.onPartialMessage)}i(f,"is"),c.is=f})(s||(e.MessageReader=s={}));var o=class{static{i(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${r.string(c.message)?c.message:"unknown"}`)}};e.AbstractMessageReader=o;var l;(function(c){function f(d){let m,g;const v=new Map;let b;const S=new Map;if(d===void 0||typeof d=="string")m=d??"utf-8";else{if(m=d.charset??"utf-8",d.contentDecoder!==void 0&&(g=d.contentDecoder,v.set(g.name,g)),d.contentDecoders!==void 0)for(const w of d.contentDecoders)v.set(w.name,w);if(d.contentTypeDecoder!==void 0&&(b=d.contentTypeDecoder,S.set(b.name,b)),d.contentTypeDecoders!==void 0)for(const w of d.contentTypeDecoders)S.set(w.name,w)}return b===void 0&&(b=(0,t.default)().applicationJson.decoder,S.set(b.name,b)),{charset:m,contentDecoder:g,contentDecoders:v,contentTypeDecoder:b,contentTypeDecoders:S}}i(f,"fromOptions"),c.fromOptions=f})(l||(l={}));var u=class extends o{static{i(this,"ReadableStreamMessageReader")}constructor(c,f){super(),this.readable=c,this.options=l.fromOptions(f),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const f=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),f}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const m=d.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(d))}`));return}const g=parseInt(m);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=g}const f=this.buffer.tryReadBody(this.nextMessageLength);if(f===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(f):f,m=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(m)}).catch(d=>{this.fireError(d)})}}catch(f){this.fireError(f)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,f)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:f}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=u}}),wI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=Ln(),r=xs(),n=Kg(),a=Qa(),s="Content-Length: ",o=`\r +`,l;(function(d){function m(g){let v=g;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}i(m,"is"),d.is=m})(l||(e.MessageWriter=l={}));var u=class{static{i(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,m,g){this.errorEmitter.fire([this.asError(d),m,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${r.string(d.message)?d.message:"unknown"}`)}};e.AbstractMessageWriter=u;var c;(function(d){function m(g){return g===void 0||typeof g=="string"?{charset:g??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:g.charset??"utf-8",contentEncoder:g.contentEncoder,contentTypeEncoder:g.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}i(m,"fromOptions"),d.fromOptions=m})(c||(c={}));var f=class extends u{static{i(this,"WriteableStreamMessageWriter")}constructor(d,m){super(),this.writable=d,this.options=c.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const v=[];return v.push(s,g.byteLength.toString(),o),v.push(o),this.doWrite(d,v,g)},g=>{throw this.fireError(g),g}))}async doWrite(d,m,g){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(g)}catch(v){return this.handleError(v,d),Promise.reject(v)}}handleError(d,m){this.errorCount++,this.fireError(d,m,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=f}}),II=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r +`,a=class{static{i(this,"AbstractMessageBuffer")}constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,l=0,u=0,c=0;e:for(;lthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],f=this.asNative(c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,f}const o=this.allocNative(s);let l=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const f=c.slice(0,s);o.set(f,l),l+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else o.set(c,l),l+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return o}};e.AbstractMessageBuffer=a}}),NI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=Ln(),r=xs(),n=jg(),a=Ug(),s=Qa(),o=Dl(),l;(function(y){y.type=new n.NotificationType("$/cancelRequest")})(l||(l={}));var u;(function(y){function E(T){return typeof T=="string"||typeof T=="number"}i(E,"is"),y.is=E})(u||(e.ProgressToken=u={}));var c;(function(y){y.type=new n.NotificationType("$/progress")})(c||(c={}));var f=class{static{i(this,"ProgressType")}constructor(){}};e.ProgressType=f;var d;(function(y){function E(T){return r.func(T)}i(E,"is"),y.is=E})(d||(d={})),e.NullLogger=Object.freeze({error:i(()=>{},"error"),warn:i(()=>{},"warn"),info:i(()=>{},"info"),log:i(()=>{},"log")});var m;(function(y){y[y.Off=0]="Off",y[y.Messages=1]="Messages",y[y.Compact=2]="Compact",y[y.Verbose=3]="Verbose"})(m||(e.Trace=m={}));var g;(function(y){y.Off="off",y.Messages="messages",y.Compact="compact",y.Verbose="verbose"})(g||(e.TraceValues=g={})),(function(y){function E($){if(!r.string($))return y.Off;switch($=$.toLowerCase(),$){case"off":return y.Off;case"messages":return y.Messages;case"compact":return y.Compact;case"verbose":return y.Verbose;default:return y.Off}}i(E,"fromString"),y.fromString=E;function T($){switch($){case y.Off:return"off";case y.Messages:return"messages";case y.Compact:return"compact";case y.Verbose:return"verbose";default:return"off"}}i(T,"toString"),y.toString=T})(m||(e.Trace=m={}));var v;(function(y){y.Text="text",y.JSON="json"})(v||(e.TraceFormat=v={})),(function(y){function E(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?y.JSON:y.Text):y.Text}i(E,"fromString"),y.fromString=E})(v||(e.TraceFormat=v={}));var b;(function(y){y.type=new n.NotificationType("$/setTrace")})(b||(e.SetTraceNotification=b={}));var S;(function(y){y.type=new n.NotificationType("$/logTrace")})(S||(e.LogTraceNotification=S={}));var w;(function(y){y[y.Closed=1]="Closed",y[y.Disposed=2]="Disposed",y[y.AlreadyListening=3]="AlreadyListening"})(w||(e.ConnectionErrors=w={}));var I=class Wg extends Error{static{i(this,"ConnectionError")}constructor(E,T){super(T),this.code=E,Object.setPrototypeOf(this,Wg.prototype)}};e.ConnectionError=I;var R;(function(y){function E(T){const $=T;return $&&r.func($.cancelUndispatched)}i(E,"is"),y.is=E})(R||(e.ConnectionStrategy=R={}));var P;(function(y){function E(T){const $=T;return $&&($.kind===void 0||$.kind==="id")&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(P||(e.IdCancellationReceiverStrategy=P={}));var z;(function(y){function E(T){const $=T;return $&&$.kind==="request"&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(z||(e.RequestCancellationReceiverStrategy=z={}));var X;(function(y){y.Message=Object.freeze({createCancellationTokenSource(T){return new o.CancellationTokenSource}});function E(T){return P.is(T)||z.is(T)}i(E,"is"),y.is=E})(X||(e.CancellationReceiverStrategy=X={}));var Z;(function(y){y.Message=Object.freeze({sendCancellation(T,$){return T.sendNotification(l.type,{id:$})},cleanup(T){}});function E(T){const $=T;return $&&r.func($.sendCancellation)&&r.func($.cleanup)}i(E,"is"),y.is=E})(Z||(e.CancellationSenderStrategy=Z={}));var ce;(function(y){y.Message=Object.freeze({receiver:X.Message,sender:Z.Message});function E(T){const $=T;return $&&X.is($.receiver)&&Z.is($.sender)}i(E,"is"),y.is=E})(ce||(e.CancellationStrategy=ce={}));var se;(function(y){function E(T){const $=T;return $&&r.func($.handleMessage)}i(E,"is"),y.is=E})(se||(e.MessageStrategy=se={}));var Se;(function(y){function E(T){const $=T;return $&&(ce.is($.cancellationStrategy)||R.is($.connectionStrategy)||se.is($.messageStrategy))}i(E,"is"),y.is=E})(Se||(e.ConnectionOptions=Se={}));var k;(function(y){y[y.New=1]="New",y[y.Listening=2]="Listening",y[y.Closed=3]="Closed",y[y.Disposed=4]="Disposed"})(k||(k={}));function C(y,E,T,$){const _=T!==void 0?T:e.NullLogger;let O=0,x=0,D=0;const G="2.0";let W;const Y=new Map;let q;const Pe=new Map,oe=new Map;let Le,De=new a.LinkedMap,ke=new Map,Ze=new Set,Je=new Map,ne=m.Off,Ut=v.Text,Ee,Pt=k.New;const ta=new s.Emitter,ci=new s.Emitter,fi=new s.Emitter,di=new s.Emitter,pi=new s.Emitter,kt=$&&$.cancellationStrategy?$.cancellationStrategy:ce.Message;function ra(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}i(ra,"createRequestQueueKey");function mi(h){return h===null?"res-unknown-"+(++D).toString():"res-"+h.toString()}i(mi,"createResponseQueueKey");function hi(){return"not-"+(++x).toString()}i(hi,"createNotificationQueueKey");function yi(h,N){n.Message.isRequest(N)?h.set(ra(N.id),N):n.Message.isResponse(N)?h.set(mi(N.id),N):h.set(hi(),N)}i(yi,"addMessageToQueue");function gi(h){}i(gi,"cancelUndispatched");function na(){return Pt===k.Listening}i(na,"isListening");function aa(){return Pt===k.Closed}i(aa,"isClosed");function Kt(){return Pt===k.Disposed}i(Kt,"isDisposed");function ia(){(Pt===k.New||Pt===k.Listening)&&(Pt=k.Closed,ci.fire(void 0))}i(ia,"closeHandler");function vi(h){ta.fire([h,void 0,void 0])}i(vi,"readErrorHandler");function Ti(h){ta.fire(h)}i(Ti,"writeErrorHandler"),y.onClose(ia),y.onError(vi),E.onClose(ia),E.onError(Ti);function sa(){Le||De.size===0||(Le=(0,t.default)().timer.setImmediate(()=>{Le=void 0,$i()}))}i(sa,"triggerMessageQueue");function oa(h){n.Message.isRequest(h)?Ri(h):n.Message.isNotification(h)?Ei(h):n.Message.isResponse(h)?Ai(h):Ci(h)}i(oa,"handleMessage");function $i(){if(De.size===0)return;const h=De.shift();try{const N=$?.messageStrategy;se.is(N)?N.handleMessage(h,oa):oa(h)}finally{sa()}}i($i,"processMessageQueue");const ro=i(h=>{try{if(n.Message.isNotification(h)&&h.method===l.type.method){const N=h.params.id,L=ra(N),M=De.get(L);if(n.Message.isRequest(M)){const fe=$?.connectionStrategy,Ce=fe&&fe.cancelUndispatched?fe.cancelUndispatched(M,gi):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){De.delete(L),Je.delete(N),Ce.id=M.id,Or(Ce,h.method,Date.now()),E.write(Ce).catch(()=>_.error("Sending response for canceled message failed."));return}}const he=Je.get(N);if(he!==void 0){he.cancel(),Xr(h);return}else Ze.add(N)}yi(De,h)}finally{sa()}},"callback");function Ri(h){if(Kt())return;function N(te,$e,le){const xe={jsonrpc:G,id:h.id};te instanceof n.ResponseError?xe.error=te.toJson():xe.result=te===void 0?null:te,Or(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(N,"reply");function L(te,$e,le){const xe={jsonrpc:G,id:h.id,error:te.toJson()};Or(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(L,"replyError");function M(te,$e,le){te===void 0&&(te=null);const xe={jsonrpc:G,id:h.id,result:te};Or(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(M,"replySuccess"),Si(h);const he=Y.get(h.method);let fe,Ce;he&&(fe=he.type,Ce=he.handler);const we=Date.now();if(Ce||W){const te=h.id??String(Date.now()),$e=P.is(kt.receiver)?kt.receiver.createCancellationTokenSource(te):kt.receiver.createCancellationTokenSource(h);h.id!==null&&Ze.has(h.id)&&$e.cancel(),h.id!==null&&Je.set(te,$e);try{let le;if(Ce)if(h.params===void 0){if(fe!==void 0&&fe.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines ${fe.numberOfParams} params but received none.`),h.method,we);return}le=Ce($e.token)}else if(Array.isArray(h.params)){if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,we);return}le=Ce(...h.params,$e.token)}else{if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,we);return}le=Ce(h.params,$e.token)}else W&&(le=W(h.method,h.params,$e.token));const xe=le;le?xe.then?xe.then(Qe=>{Je.delete(te),N(Qe,h.method,we)},Qe=>{Je.delete(te),Qe instanceof n.ResponseError?L(Qe,h.method,we):Qe&&r.string(Qe.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${Qe.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}):(Je.delete(te),N(le,h.method,we)):(Je.delete(te),M(le,h.method,we))}catch(le){Je.delete(te),le instanceof n.ResponseError?N(le,h.method,we):le&&r.string(le.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${le.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,we)}i(Ri,"handleRequest");function Ai(h){if(!Kt())if(h.id===null)h.error?_.error(`Received response message without id: Error is: +${JSON.stringify(h.error,void 0,4)}`):_.error("Received response message without id. No further error information provided.");else{const N=h.id,L=ke.get(N);if(wi(h,L),L!==void 0){ke.delete(N);try{if(h.error){const M=h.error;L.reject(new n.ResponseError(M.code,M.message,M.data))}else if(h.result!==void 0)L.resolve(h.result);else throw new Error("Should never happen.")}catch(M){M.message?_.error(`Response handler '${L.method}' failed with message: ${M.message}`):_.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}i(Ai,"handleResponse");function Ei(h){if(Kt())return;let N,L;if(h.method===l.type.method){const M=h.params.id;Ze.delete(M),Xr(h);return}else{const M=Pe.get(h.method);M&&(L=M.handler,N=M.type)}if(L||q)try{if(Xr(h),L)if(h.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received none.`),L();else if(Array.isArray(h.params)){const M=h.params;h.method===c.type.method&&M.length===2&&u.is(M[0])?L({token:M[0],value:M[1]}):(N!==void 0&&(N.parameterStructures===n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines parameters by name but received parameters by position`),N.numberOfParams!==h.params.length&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received ${M.length} arguments`)),L(...M))}else N!==void 0&&N.parameterStructures===n.ParameterStructures.byPosition&&_.error(`Notification ${h.method} defines parameters by position but received parameters by name`),L(h.params);else q&&q(h.method,h.params)}catch(M){M.message?_.error(`Notification handler '${h.method}' failed with message: ${M.message}`):_.error(`Notification handler '${h.method}' failed unexpectedly.`)}else fi.fire(h)}i(Ei,"handleNotification");function Ci(h){if(!h){_.error("Received empty message.");return}_.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(h,null,4)}`);const N=h;if(r.string(N.id)||r.number(N.id)){const L=N.id,M=ke.get(L);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}i(Ci,"handleInvalidMessage");function Ct(h){if(h!=null)switch(ne){case m.Verbose:return JSON.stringify(h,null,4);case m.Compact:return JSON.stringify(h);default:return}}i(Ct,"stringifyTrace");function bi(h){if(!(ne===m.Off||!Ee))if(Ut===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${Ct(h.params)} + +`),Ee.log(`Sending request '${h.method} - (${h.id})'.`,N)}else Wt("send-request",h)}i(bi,"traceSendingRequest");function _i(h){if(!(ne===m.Off||!Ee))if(Ut===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${Ct(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Sending notification '${h.method}'.`,N)}else Wt("send-notification",h)}i(_i,"traceSendingNotification");function Or(h,N,L){if(!(ne===m.Off||!Ee))if(Ut===v.Text){let M;(ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?M=`Error data: ${Ct(h.error.data)} + +`:h.result?M=`Result: ${Ct(h.result)} + +`:h.error===void 0&&(M=`No result returned. + +`)),Ee.log(`Sending response '${N} - (${h.id})'. Processing request took ${Date.now()-L}ms`,M)}else Wt("send-response",h)}i(Or,"traceSendingResponse");function Si(h){if(!(ne===m.Off||!Ee))if(Ut===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${Ct(h.params)} + +`),Ee.log(`Received request '${h.method} - (${h.id})'.`,N)}else Wt("receive-request",h)}i(Si,"traceReceivedRequest");function Xr(h){if(!(ne===m.Off||!Ee||h.method===S.type.method))if(Ut===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${Ct(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Received notification '${h.method}'.`,N)}else Wt("receive-notification",h)}i(Xr,"traceReceivedNotification");function wi(h,N){if(!(ne===m.Off||!Ee))if(Ut===v.Text){let L;if((ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?L=`Error data: ${Ct(h.error.data)} + +`:h.result?L=`Result: ${Ct(h.result)} + +`:h.error===void 0&&(L=`No result returned. + +`)),N){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";Ee.log(`Received response '${N.method} - (${h.id})' in ${Date.now()-N.timerStart}ms.${M}`,L)}else Ee.log(`Received response ${h.id} without active response promise.`,L)}else Wt("receive-response",h)}i(wi,"traceReceivedResponse");function Wt(h,N){if(!Ee||ne===m.Off)return;const L={isLSPMessage:!0,type:h,message:N,timestamp:Date.now()};Ee.log(L)}i(Wt,"logLSPMessage");function ur(){if(aa())throw new I(w.Closed,"Connection is closed.");if(Kt())throw new I(w.Disposed,"Connection is disposed.")}i(ur,"throwIfClosedOrDisposed");function Ii(){if(na())throw new I(w.AlreadyListening,"Connection is already listening")}i(Ii,"throwIfListening");function Ni(){if(!na())throw new Error("Call listen() first.")}i(Ni,"throwIfNotListening");function cr(h){return h===void 0?null:h}i(cr,"undefinedToNull");function la(h){if(h!==null)return h}i(la,"nullToUndefined");function p(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}i(p,"isNamedParam");function ae(h,N){switch(h){case n.ParameterStructures.auto:return p(N)?la(N):[cr(N)];case n.ParameterStructures.byName:if(!p(N))throw new Error("Received parameters by name but param is not an object literal.");return la(N);case n.ParameterStructures.byPosition:return[cr(N)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}i(ae,"computeSingleParam");function Te(h,N){let L;const M=h.numberOfParams;switch(M){case 0:L=void 0;break;case 1:L=ae(h.parameterStructures,N[0]);break;default:L=[];for(let he=0;he{ur();let L,M;if(r.string(h)){L=h;const fe=N[0];let Ce=0,we=n.ParameterStructures.auto;n.ParameterStructures.is(fe)&&(Ce=1,we=fe);let te=N.length;const $e=te-Ce;switch($e){case 0:M=void 0;break;case 1:M=ae(we,N[Ce]);break;default:if(we===n.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);M=N.slice(Ce,te).map(le=>cr(le));break}}else{const fe=N;L=h.method,M=Te(h,fe)}const he={jsonrpc:G,method:L,params:M};return _i(he),E.write(he).catch(fe=>{throw _.error("Sending notification failed."),fe})},"sendNotification"),onNotification:i((h,N)=>{ur();let L;return r.func(h)?q=h:N&&(r.string(h)?(L=h,Pe.set(h,{type:void 0,handler:N})):(L=h.method,Pe.set(h.method,{type:h,handler:N}))),{dispose:i(()=>{L!==void 0?Pe.delete(L):q=void 0},"dispose")}},"onNotification"),onProgress:i((h,N,L)=>{if(oe.has(N))throw new Error(`Progress handler for token ${N} already registered`);return oe.set(N,L),{dispose:i(()=>{oe.delete(N)},"dispose")}},"onProgress"),sendProgress:i((h,N,L)=>V.sendNotification(c.type,{token:N,value:L}),"sendProgress"),onUnhandledProgress:di.event,sendRequest:i((h,...N)=>{ur(),Ni();let L,M,he;if(r.string(h)){L=h;const te=N[0],$e=N[N.length-1];let le=0,xe=n.ParameterStructures.auto;n.ParameterStructures.is(te)&&(le=1,xe=te);let Qe=N.length;o.CancellationToken.is($e)&&(Qe=Qe-1,he=$e);const qt=Qe-le;switch(qt){case 0:M=void 0;break;case 1:M=ae(xe,N[le]);break;default:if(xe===n.ParameterStructures.byName)throw new Error(`Received ${qt} parameters for 'by Name' request parameter structure.`);M=N.slice(le,Qe).map(TI=>cr(TI));break}}else{const te=N;L=h.method,M=Te(h,te);const $e=h.numberOfParams;he=o.CancellationToken.is(te[$e])?te[$e]:void 0}const fe=O++;let Ce;he&&(Ce=he.onCancellationRequested(()=>{const te=kt.sender.sendCancellation(V,fe);return te===void 0?(_.log(`Received no promise from cancellation strategy when cancelling id ${fe}`),Promise.resolve()):te.catch(()=>{_.log(`Sending cancellation messages for id ${fe} failed`)})}));const we={jsonrpc:G,id:fe,method:L,params:M};return bi(we),typeof kt.sender.enableCancellation=="function"&&kt.sender.enableCancellation(we),new Promise(async(te,$e)=>{const le=i(qt=>{te(qt),kt.sender.cleanup(fe),Ce?.dispose()},"resolveWithCleanup"),xe=i(qt=>{$e(qt),kt.sender.cleanup(fe),Ce?.dispose()},"rejectWithCleanup"),Qe={method:L,timerStart:Date.now(),resolve:le,reject:xe};try{await E.write(we),ke.set(fe,Qe)}catch(qt){throw _.error("Sending request failed."),Qe.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,qt.message?qt.message:"Unknown reason")),qt}})},"sendRequest"),onRequest:i((h,N)=>{ur();let L=null;return d.is(h)?(L=void 0,W=h):r.string(h)?(L=null,N!==void 0&&(L=h,Y.set(h,{handler:N,type:void 0}))):N!==void 0&&(L=h.method,Y.set(h.method,{type:h,handler:N})),{dispose:i(()=>{L!==null&&(L!==void 0?Y.delete(L):W=void 0)},"dispose")}},"onRequest"),hasPendingResponse:i(()=>ke.size>0,"hasPendingResponse"),trace:i(async(h,N,L)=>{let M=!1,he=v.Text;L!==void 0&&(r.boolean(L)?M=L:(M=L.sendNotification||!1,he=L.traceFormat||v.Text)),ne=h,Ut=he,ne===m.Off?Ee=void 0:Ee=N,M&&!aa()&&!Kt()&&await V.sendNotification(b.type,{value:m.toString(h)})},"trace"),onError:ta.event,onClose:ci.event,onUnhandledNotification:fi.event,onDispose:pi.event,end:i(()=>{E.end()},"end"),dispose:i(()=>{if(Kt())return;Pt=k.Disposed,pi.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const N of ke.values())N.reject(h);ke=new Map,Je=new Map,Ze=new Set,De=new a.LinkedMap,r.func(E.dispose)&&E.dispose(),r.func(y.dispose)&&y.dispose()},"dispose"),listen:i(()=>{ur(),Ii(),Pt=k.Listening,y.listen(ro)},"listen"),inspect:i(()=>{(0,t.default)().console.log("inspect")},"inspect")};return V.onNotification(S.type,h=>{if(ne===m.Off||!Ee)return;const N=ne===m.Verbose||ne===m.Compact;Ee.log(h.message,N?h.verbose:void 0)}),V.onNotification(c.type,h=>{const N=oe.get(h.token);N?N(h.value):di.fire(h)}),V}i(C,"createMessageConnection"),e.createMessageConnection=C}}),Rf=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=jg();Object.defineProperty(e,"Message",{enumerable:!0,get:i(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:i(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:i(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:i(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:i(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:i(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:i(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:i(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:i(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:i(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:i(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:i(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:i(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:i(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:i(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:i(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:i(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:i(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:i(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:i(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:i(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:i(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:i(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:i(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:i(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:i(function(){return t.ParameterStructures},"get")});var r=Ug();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:i(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:i(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:i(function(){return r.Touch},"get")});var n=bI();Object.defineProperty(e,"Disposable",{enumerable:!0,get:i(function(){return n.Disposable},"get")});var a=Qa();Object.defineProperty(e,"Event",{enumerable:!0,get:i(function(){return a.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:i(function(){return a.Emitter},"get")});var s=Dl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:i(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:i(function(){return s.CancellationToken},"get")});var o=_I();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:i(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:i(function(){return o.SharedArrayReceiverStrategy},"get")});var l=SI();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:i(function(){return l.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:i(function(){return l.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:i(function(){return l.ReadableStreamMessageReader},"get")});var u=wI();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:i(function(){return u.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:i(function(){return u.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:i(function(){return u.WriteableStreamMessageWriter},"get")});var c=II();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:i(function(){return c.AbstractMessageBuffer},"get")});var f=NI();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:i(function(){return f.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:i(function(){return f.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:i(function(){return f.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:i(function(){return f.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:i(function(){return f.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:i(function(){return f.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:i(function(){return f.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:i(function(){return f.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:i(function(){return f.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:i(function(){return f.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:i(function(){return f.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:i(function(){return f.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:i(function(){return f.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:i(function(){return f.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:i(function(){return f.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:i(function(){return f.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:i(function(){return f.MessageStrategy},"get")});var d=Ln();e.RAL=d.default}}),PI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Rf(),r=class qg extends t.AbstractMessageBuffer{static{i(this,"MessageBuffer")}constructor(c="utf-8"){super(c),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return qg.emptyBuffer}fromString(c,f){return new TextEncoder().encode(c)}toString(c,f){return f==="ascii"?this.asciiDecoder.decode(c):new TextDecoder(f).decode(c)}asNative(c,f){return f===void 0?c:c.slice(0,f)}allocNative(c){return new Uint8Array(c)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{i(this,"ReadableStreamWrapper")}constructor(u){this.socket=u,this._onData=new t.Emitter,this._messageListener=c=>{c.data.arrayBuffer().then(d=>{this._onData.fire(new Uint8Array(d))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}onData(u){return this._onData.event(u)}},a=class{static{i(this,"WritableStreamWrapper")}constructor(u){this.socket=u}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}write(u,c){if(typeof u=="string"){if(c!==void 0&&c!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c}`);this.socket.send(u)}else this.socket.send(u);return Promise.resolve()}end(){this.socket.close()}},s=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:i(u=>new r(u),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:i((u,c)=>{if(c.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c.charset}`);return Promise.resolve(s.encode(JSON.stringify(u,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:i((u,c)=>{if(!(u instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(c.charset).decode(u)))},"decode")})}),stream:Object.freeze({asReadableStream:i(u=>new n(u),"asReadableStream"),asWritableStream:i(u=>new a(u),"asWritableStream")}),console,timer:Object.freeze({setTimeout(u,c,...f){const d=setTimeout(u,c,...f);return{dispose:i(()=>clearTimeout(d),"dispose")}},setImmediate(u,...c){const f=setTimeout(u,0,...c);return{dispose:i(()=>clearTimeout(f),"dispose")}},setInterval(u,c,...f){const d=setInterval(u,c,...f);return{dispose:i(()=>clearInterval(d),"dispose")}}})});function l(){return o}i(l,"RIL"),(function(u){function c(){t.RAL.install(o)}i(c,"install"),u.install=c})(l||(l={})),e.default=l}}),ei=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(u,c,f,d){d===void 0&&(d=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:i(function(){return c[f]},"get")}),Object.defineProperty(u,d,m)}):(function(u,c,f,d){d===void 0&&(d=f),u[d]=c[f]})),r=e&&e.__exportStar||function(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&t(c,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=PI();n.default.install();var a=Rf();r(Rf(),e);var s=class extends a.AbstractMessageReader{static{i(this,"BrowserMessageReader")}constructor(u){super(),this._onData=new a.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},u.addEventListener("error",c=>this.fireError(c)),u.onmessage=this._messageListener}listen(u){return this._onData.event(u)}};e.BrowserMessageReader=s;var o=class extends a.AbstractMessageWriter{static{i(this,"BrowserMessageWriter")}constructor(u){super(),this.port=u,this.errorCount=0,u.addEventListener("error",c=>this.fireError(c))}write(u){try{return this.port.postMessage(u),Promise.resolve()}catch(c){return this.handleError(c,u),Promise.reject(c)}}handleError(u,c){this.errorCount++,this.fireError(u,c,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function l(u,c,f,d){return f===void 0&&(f=a.NullLogger),a.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,a.createMessageConnection)(u,c,f,d)}i(l,"createMessageConnection"),e.createMessageConnection=l}}),lh=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){t.exports=ei()}}),Ae=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=ei(),r;(function(u){u.clientToServer="clientToServer",u.serverToClient="serverToClient",u.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{i(this,"RegistrationType")}constructor(u){this.method=u}};e.RegistrationType=n;var a=class extends t.RequestType0{static{i(this,"ProtocolRequestType0")}constructor(u){super(u)}};e.ProtocolRequestType0=a;var s=class extends t.RequestType{static{i(this,"ProtocolRequestType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolRequestType=s;var o=class extends t.NotificationType0{static{i(this,"ProtocolNotificationType0")}constructor(u){super(u)}};e.ProtocolNotificationType0=o;var l=class extends t.NotificationType{static{i(this,"ProtocolNotificationType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolNotificationType=l}}),bd=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(f){return f===!0||f===!1}i(t,"boolean"),e.boolean=t;function r(f){return typeof f=="string"||f instanceof String}i(r,"string"),e.string=r;function n(f){return typeof f=="number"||f instanceof Number}i(n,"number"),e.number=n;function a(f){return f instanceof Error}i(a,"error"),e.error=a;function s(f){return typeof f=="function"}i(s,"func"),e.func=s;function o(f){return Array.isArray(f)}i(o,"array"),e.array=o;function l(f){return o(f)&&f.every(d=>r(d))}i(l,"stringArray"),e.stringArray=l;function u(f,d){return Array.isArray(f)&&f.every(d)}i(u,"typedArray"),e.typedArray=u;function c(f){return f!==null&&typeof f=="object"}i(c,"objectLiteral"),e.objectLiteral=c}}),kI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),OI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),LI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ae(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),DI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ae(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),xI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.ColorPresentationRequest=n={}))}}),MI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),GI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),FI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),zI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=ei(),r=Ae(),n;(function(o){o.type=new t.ProgressType;function l(u){return u===o.type}i(l,"is"),o.is=l})(n||(e.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(e.WorkDoneProgressCreateRequest=a={}));var s;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(s||(e.WorkDoneProgressCancelNotification=s={}))}}),jI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var a;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.CallHierarchyOutgoingCallsRequest=a={}))}}),BI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ae(),r;(function(u){u.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(u){u.method="textDocument/semanticTokens",u.type=new t.RegistrationType(u.method)})(n||(e.SemanticTokensRegistrationType=n={}));var a;(function(u){u.method="textDocument/semanticTokens/full",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(a||(e.SemanticTokensRequest=a={}));var s;(function(u){u.method="textDocument/semanticTokens/full/delta",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(s||(e.SemanticTokensDeltaRequest=s={}));var o;(function(u){u.method="textDocument/semanticTokens/range",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var l;(function(u){u.method="workspace/semanticTokens/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)})(l||(e.SemanticTokensRefreshRequest=l={}))}}),UI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ae(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),KI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),WI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(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=Ae(),r;(function(c){c.file="file",c.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(e.WillCreateFilesRequest=n={}));var a;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(a||(e.DidCreateFilesNotification=a={}));var s;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(s||(e.WillRenameFilesRequest=s={}));var o;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(e.DidRenameFilesNotification=o={}));var l;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(l||(e.DidDeleteFilesNotification=l={}));var u;(function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(u||(e.WillDeleteFilesRequest=u={}))}}),qI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ae(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(e.MonikerKind=n={}));var a;(function(s){s.method="textDocument/moniker",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.MonikerRequest=a={}))}}),VI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var a;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.TypeHierarchySubtypesRequest=a={}))}}),HI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),YI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.InlayHintResolveRequest=n={}));var a;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)})(a||(e.InlayHintRefreshRequest=a={}))}}),XI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=ei(),r=bd(),n=Ae(),a;(function(c){function f(d){const m=d;return m&&r.boolean(m.retriggerRequest)}i(f,"is"),c.is=f})(a||(e.DiagnosticServerCancellationData=a={}));var s;(function(c){c.Full="full",c.Unchanged="unchanged"})(s||(e.DocumentDiagnosticReportKind=s={}));var o;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var l;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(l||(e.WorkspaceDiagnosticRequest=l={}));var u;(function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(u||(e.DiagnosticRefreshRequest=u={}))}}),JI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){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 t=(Ds(),Cd(Ll)),r=bd(),n=Ae(),a;(function(v){v.Markup=1,v.Code=2;function b(S){return S===1||S===2}i(b,"is"),v.is=b})(a||(e.NotebookCellKind=a={}));var s;(function(v){function b(I,R){const P={executionOrder:I};return(R===!0||R===!1)&&(P.success=R),P}i(b,"create"),v.create=b;function S(I){const R=I;return r.objectLiteral(R)&&t.uinteger.is(R.executionOrder)&&(R.success===void 0||r.boolean(R.success))}i(S,"is"),v.is=S;function w(I,R){return I===R?!0:I==null||R===null||R===void 0?!1:I.executionOrder===R.executionOrder&&I.success===R.success}i(w,"equals"),v.equals=w})(s||(e.ExecutionSummary=s={}));var o;(function(v){function b(R,P){return{kind:R,document:P}}i(b,"create"),v.create=b;function S(R){const P=R;return r.objectLiteral(P)&&a.is(P.kind)&&t.DocumentUri.is(P.document)&&(P.metadata===void 0||r.objectLiteral(P.metadata))}i(S,"is"),v.is=S;function w(R,P){const z=new Set;return R.document!==P.document&&z.add("document"),R.kind!==P.kind&&z.add("kind"),R.executionSummary!==P.executionSummary&&z.add("executionSummary"),(R.metadata!==void 0||P.metadata!==void 0)&&!I(R.metadata,P.metadata)&&z.add("metadata"),(R.executionSummary!==void 0||P.executionSummary!==void 0)&&!s.equals(R.executionSummary,P.executionSummary)&&z.add("executionSummary"),z}i(w,"diff"),v.diff=w;function I(R,P){if(R===P)return!0;if(R==null||P===null||P===void 0||typeof R!=typeof P||typeof R!="object")return!1;const z=Array.isArray(R),X=Array.isArray(P);if(z!==X)return!1;if(z&&X){if(R.length!==P.length)return!1;for(let Z=0;Z0}i(ae,"hasId"),p.hasId=ae})(O||(e.StaticRegistrationOptions=O={}));var x;(function(p){function ae(Te){const V=Te;return V&&(V.documentSelector===null||C.is(V.documentSelector))}i(ae,"is"),p.is=ae})(x||(e.TextDocumentRegistrationOptions=x={}));var D;(function(p){function ae(V){const h=V;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}i(ae,"is"),p.is=ae;function Te(V){const h=V;return h&&n.boolean(h.workDoneProgress)}i(Te,"hasWorkDoneProgress"),p.hasWorkDoneProgress=Te})(D||(e.WorkDoneProgressOptions=D={}));var G;(function(p){p.method="initialize",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(G||(e.InitializeRequest=G={}));var W;(function(p){p.unknownProtocolVersion=1})(W||(e.InitializeErrorCodes=W={}));var Y;(function(p){p.method="initialized",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Y||(e.InitializedNotification=Y={}));var q;(function(p){p.method="shutdown",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType0(p.method)})(q||(e.ShutdownRequest=q={}));var Pe;(function(p){p.method="exit",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType0(p.method)})(Pe||(e.ExitNotification=Pe={}));var oe;(function(p){p.method="workspace/didChangeConfiguration",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(oe||(e.DidChangeConfigurationNotification=oe={}));var Le;(function(p){p.Error=1,p.Warning=2,p.Info=3,p.Log=4,p.Debug=5})(Le||(e.MessageType=Le={}));var De;(function(p){p.method="window/showMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(De||(e.ShowMessageNotification=De={}));var ke;(function(p){p.method="window/showMessageRequest",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType(p.method)})(ke||(e.ShowMessageRequest=ke={}));var Ze;(function(p){p.method="window/logMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Ze||(e.LogMessageNotification=Ze={}));var Je;(function(p){p.method="telemetry/event",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Je||(e.TelemetryEventNotification=Je={}));var ne;(function(p){p.None=0,p.Full=1,p.Incremental=2})(ne||(e.TextDocumentSyncKind=ne={}));var Ut;(function(p){p.method="textDocument/didOpen",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Ut||(e.DidOpenTextDocumentNotification=Ut={}));var Ee;(function(p){function ae(V){let h=V;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}i(ae,"isIncremental"),p.isIncremental=ae;function Te(V){let h=V;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}i(Te,"isFull"),p.isFull=Te})(Ee||(e.TextDocumentContentChangeEvent=Ee={}));var Pt;(function(p){p.method="textDocument/didChange",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Pt||(e.DidChangeTextDocumentNotification=Pt={}));var ta;(function(p){p.method="textDocument/didClose",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ta||(e.DidCloseTextDocumentNotification=ta={}));var ci;(function(p){p.method="textDocument/didSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ci||(e.DidSaveTextDocumentNotification=ci={}));var fi;(function(p){p.Manual=1,p.AfterDelay=2,p.FocusOut=3})(fi||(e.TextDocumentSaveReason=fi={}));var di;(function(p){p.method="textDocument/willSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(di||(e.WillSaveTextDocumentNotification=di={}));var pi;(function(p){p.method="textDocument/willSaveWaitUntil",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(pi||(e.WillSaveTextDocumentWaitUntilRequest=pi={}));var kt;(function(p){p.method="workspace/didChangeWatchedFiles",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(kt||(e.DidChangeWatchedFilesNotification=kt={}));var ra;(function(p){p.Created=1,p.Changed=2,p.Deleted=3})(ra||(e.FileChangeType=ra={}));var mi;(function(p){function ae(Te){const V=Te;return n.objectLiteral(V)&&(r.URI.is(V.baseUri)||r.WorkspaceFolder.is(V.baseUri))&&n.string(V.pattern)}i(ae,"is"),p.is=ae})(mi||(e.RelativePattern=mi={}));var hi;(function(p){p.Create=1,p.Change=2,p.Delete=4})(hi||(e.WatchKind=hi={}));var yi;(function(p){p.method="textDocument/publishDiagnostics",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(yi||(e.PublishDiagnosticsNotification=yi={}));var gi;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.TriggerForIncompleteCompletions=3})(gi||(e.CompletionTriggerKind=gi={}));var na;(function(p){p.method="textDocument/completion",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(na||(e.CompletionRequest=na={}));var aa;(function(p){p.method="completionItem/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(aa||(e.CompletionResolveRequest=aa={}));var Kt;(function(p){p.method="textDocument/hover",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Kt||(e.HoverRequest=Kt={}));var ia;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.ContentChange=3})(ia||(e.SignatureHelpTriggerKind=ia={}));var vi;(function(p){p.method="textDocument/signatureHelp",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(vi||(e.SignatureHelpRequest=vi={}));var Ti;(function(p){p.method="textDocument/definition",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ti||(e.DefinitionRequest=Ti={}));var sa;(function(p){p.method="textDocument/references",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(sa||(e.ReferencesRequest=sa={}));var oa;(function(p){p.method="textDocument/documentHighlight",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(oa||(e.DocumentHighlightRequest=oa={}));var $i;(function(p){p.method="textDocument/documentSymbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($i||(e.DocumentSymbolRequest=$i={}));var ro;(function(p){p.method="textDocument/codeAction",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ro||(e.CodeActionRequest=ro={}));var Ri;(function(p){p.method="codeAction/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ri||(e.CodeActionResolveRequest=Ri={}));var Ai;(function(p){p.method="workspace/symbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ai||(e.WorkspaceSymbolRequest=Ai={}));var Ei;(function(p){p.method="workspaceSymbol/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ei||(e.WorkspaceSymbolResolveRequest=Ei={}));var Ci;(function(p){p.method="textDocument/codeLens",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ci||(e.CodeLensRequest=Ci={}));var Ct;(function(p){p.method="codeLens/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ct||(e.CodeLensResolveRequest=Ct={}));var bi;(function(p){p.method="workspace/codeLens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(bi||(e.CodeLensRefreshRequest=bi={}));var _i;(function(p){p.method="textDocument/documentLink",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(_i||(e.DocumentLinkRequest=_i={}));var Or;(function(p){p.method="documentLink/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Or||(e.DocumentLinkResolveRequest=Or={}));var Si;(function(p){p.method="textDocument/formatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Si||(e.DocumentFormattingRequest=Si={}));var Xr;(function(p){p.method="textDocument/rangeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Xr||(e.DocumentRangeFormattingRequest=Xr={}));var wi;(function(p){p.method="textDocument/rangesFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(wi||(e.DocumentRangesFormattingRequest=wi={}));var Wt;(function(p){p.method="textDocument/onTypeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Wt||(e.DocumentOnTypeFormattingRequest=Wt={}));var ur;(function(p){p.Identifier=1})(ur||(e.PrepareSupportDefaultBehavior=ur={}));var Ii;(function(p){p.method="textDocument/rename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ii||(e.RenameRequest=Ii={}));var Ni;(function(p){p.method="textDocument/prepareRename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ni||(e.PrepareRenameRequest=Ni={}));var cr;(function(p){p.method="workspace/executeCommand",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(cr||(e.ExecuteCommandRequest=cr={}));var la;(function(p){p.method="workspace/applyEdit",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType("workspace/applyEdit")})(la||(e.ApplyWorkspaceEditRequest=la={}))}}),eN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=ei();function r(n,a,s,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,a,s,o)}i(r,"createProtocolConnection"),e.createProtocolConnection=r}}),tN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(ei(),e),r((Ds(),Cd(Ll)),e),r(Ae(),e),r(QI(),e);var n=eN();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:i(function(){return n.createProtocolConnection},"get")});var a;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))}}),rN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=lh();r(lh(),e),r(tN(),e);function a(s,o,l,u){return(0,n.createMessageConnection)(s,o,l,u)}i(a,"createProtocolConnection"),e.createProtocolConnection=a}}),Vg={};Wr(Vg,{AbstractAstReflection:()=>wd,AbstractCstNode:()=>Nm,AbstractLangiumParser:()=>km,AbstractParserErrorMessageProvider:()=>xS,AbstractThreadedAsyncParser:()=>_F,AstUtils:()=>Id,BiMap:()=>Il,Cancellation:()=>pe,CompositeCstNodeImpl:()=>Pu,ContextCache:()=>Gu,CstNodeBuilder:()=>kS,CstUtils:()=>_d,DEFAULT_TOKENIZE_OPTIONS:()=>Xm,DONE_RESULT:()=>et,DatatypeSymbol:()=>bl,DefaultAstNodeDescriptionProvider:()=>dw,DefaultAstNodeLocator:()=>mw,DefaultAsyncParser:()=>kw,DefaultCommentProvider:()=>Pw,DefaultConfigurationProvider:()=>hw,DefaultDocumentBuilder:()=>yw,DefaultDocumentValidator:()=>fw,DefaultHydrator:()=>Lw,DefaultIndexManager:()=>gw,DefaultJsonSerializer:()=>ow,DefaultLangiumDocumentFactory:()=>ZS,DefaultLangiumDocuments:()=>QS,DefaultLangiumProfiler:()=>PF,DefaultLexer:()=>Jm,DefaultLexerErrorMessageProvider:()=>Tw,DefaultLinker:()=>ew,DefaultNameProvider:()=>tw,DefaultReferenceDescriptionProvider:()=>pw,DefaultReferences:()=>rw,DefaultScopeComputation:()=>nw,DefaultScopeProvider:()=>sw,DefaultServiceRegistry:()=>lw,DefaultTokenBuilder:()=>Lu,DefaultValueConverter:()=>Fm,DefaultWorkspaceLock:()=>Ow,DefaultWorkspaceManager:()=>vw,Deferred:()=>Sr,Disposable:()=>In,DisposableCache:()=>Mu,DocumentCache:()=>iw,DocumentState:()=>J,DocumentValidator:()=>bt,EMPTY_SCOPE:()=>AF,EMPTY_STREAM:()=>Ba,EmptyFileSystem:()=>Xe,EmptyFileSystemProvider:()=>Mw,ErrorWithLocation:()=>Kl,GrammarAST:()=>Xg,GrammarUtils:()=>ip,IndentationAwareLexer:()=>wF,IndentationAwareTokenBuilder:()=>xw,JSDocDocumentationProvider:()=>Nw,LangiumCompletionParser:()=>MS,LangiumParser:()=>DS,LangiumParserErrorMessageProvider:()=>Om,LeafCstNodeImpl:()=>Cl,LexingMode:()=>Sn,MapScope:()=>RF,Module:()=>rd,MultiMap:()=>wr,MultiMapScope:()=>aw,OperationCancelled:()=>er,ParserWorker:()=>SF,ProfilingTask:()=>Fw,Reduction:()=>vs,RefResolving:()=>ln,RegExpUtils:()=>op,RootCstNodeImpl:()=>Pm,SimpleCache:()=>Wm,StreamImpl:()=>Qt,StreamScope:()=>Zf,TextDocument:()=>Sl,TreeStreamImpl:()=>Ua,URI:()=>vt,UriTrie:()=>Um,UriUtils:()=>rt,VALIDATE_EACH_NODE:()=>cw,ValidationCategory:()=>Nl,ValidationRegistry:()=>uw,ValueConverter:()=>Jt,WorkspaceCache:()=>qm,assertCondition:()=>sp,assertUnreachable:()=>qr,createCompletionParser:()=>xm,createDefaultCoreModule:()=>je,createDefaultSharedCoreModule:()=>Be,createGrammarConfig:()=>bp,createLangiumParser:()=>Mm,createParser:()=>ku,delayNextTick:()=>Du,diagnosticData:()=>_n,eagerLoad:()=>ah,getDiagnosticRange:()=>Hm,indentationBuilderDefaultOptions:()=>ad,inject:()=>ee,interruptAndCheck:()=>ze,isAstNode:()=>Oe,isAstNodeDescription:()=>Sd,isAstNodeWithComment:()=>Vm,isCompositeCstNode:()=>Tr,isIMultiModeLexerDefinition:()=>ju,isJSDoc:()=>Qm,isLeafCstNode:()=>Dn,isLinkingError:()=>dn,isMultiReference:()=>tr,isNamed:()=>Km,isOperationCancelled:()=>ea,isReference:()=>tt,isRootCstNode:()=>xl,isTokenTypeArray:()=>zu,isTokenTypeDictionary:()=>Pl,loadGrammarFromJson:()=>Ue,parseJSDoc:()=>Zm,prepareLangiumParser:()=>Gm,setInterruptionPeriod:()=>zm,startCancelableOperation:()=>xu,stream:()=>ue,toDiagnosticData:()=>Ym,toDiagnosticSeverity:()=>ys});var _d={};Wr(_d,{DefaultNameRegexp:()=>ep,RangeComparison:()=>Zt,compareRange:()=>Zd,findCommentNode:()=>tp,findDeclarationNodeAtOffset:()=>hv,findLeafNodeAtOffset:()=>Ul,findLeafNodeBeforeOffset:()=>rp,flattenCst:()=>mv,getDatatypeNode:()=>pv,getInteriorNodes:()=>vv,getNextNode:()=>yv,getPreviousNode:()=>ap,getStartlineNode:()=>gv,inRange:()=>Qd,isChildNode:()=>Jd,isCommentNode:()=>ll,streamCst:()=>Va,toDocumentSegment:()=>Ha,tokenToRange:()=>Ts});function Oe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}i(Oe,"isAstNode");function tt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}i(tt,"isReference");function tr(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}i(tr,"isMultiReference");function Sd(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}i(Sd,"isAstNodeDescription");function dn(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}i(dn,"isLinkingError");var wd=class{static{i(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Oe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const n=r[t];if(n!==void 0)return n;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),n=[];for(const a of r)this.isSubtype(a,e)&&n.push(a);return this.allSubtypes[e]=n,n}}};function Tr(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}i(Tr,"isCompositeCstNode");function Dn(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}i(Dn,"isLeafCstNode");function xl(e){return Tr(e)&&typeof e.fullText=="string"}i(xl,"isRootCstNode");var Qt=class mr{static{i(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){const t={state:this.startFn(),next:i(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const t=this.iterator();let r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){const t=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){const n=this.map(a=>[t?t(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(t){return new mr(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return et})}join(t=","){const r=this.iterator();let n="",a,s=!1;do a=r.next(),a.done||(s&&(n+=t),n+=Hg(a.value)),s=!0;while(!a.done);return n}indexOf(t,r=0){const n=this.iterator();let a=0,s=n.next();for(;!s.done;){if(a>=r&&s.value===t)return a;s=n.next(),a++}return-1}every(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)t(a.value,n),a=r.next(),n++}map(t){return new mr(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?et:{done:!1,value:t(a)}})}filter(t){return new mr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return et})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){const n=this.iterator();let a=r,s=n.next();for(;!s.done;)a===void 0?a=s.value:a=t(a,s.value),s=n.next();return a}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){const a=t.next();if(a.done)return n;const s=this.recursiveReduce(t,r,n);return s===void 0?a.value:r(s,a.value)}find(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(t(a.value))return n;a=r.next(),n++}return-1}includes(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new mr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:a}=this.nextFn(r.this);if(!n){const s=t(a);if(gs(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return et})}flat(t){if(t===void 0&&(t=1),t<=0)return this;const r=t>1?this.flat(t-1):this;return new mr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:s}=r.nextFn(n.this);if(!a)if(gs(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return et})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new mr(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?et:this.nextFn(r.state)))}distinct(t){return new mr(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=t?t(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return et})}exclude(t,r){const n=new Set;for(const a of t){const s=r?r(a):a;n.add(s)}return this.filter(a=>{const s=r?r(a):a;return!n.has(s)})}};function Hg(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}i(Hg,"toString");function gs(e){return!!e&&typeof e[Symbol.iterator]=="function"}i(gs,"isIterable");var Ba=new Qt(()=>{},()=>et),et=Object.freeze({done:!0,value:void 0});function ue(...e){if(e.length===1){const t=e[0];if(t instanceof Qt)return t;if(gs(t))return new Qt(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new Qt(()=>({index:0}),r=>r.index1?new Qt(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){const s=n.iterators[n.iterators.length-1].next();if(s.done)n.iterators.pop();else return n.iterators.push(t(s.value)[Symbol.iterator]()),s}return et})}iterator(){const e={state:this.startFn(),next:i(()=>this.nextFn(e.state),"next"),prune:i(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},vs;(function(e){function t(s){return s.reduce((o,l)=>o+l,0)}i(t,"sum"),e.sum=t;function r(s){return s.reduce((o,l)=>o*l,0)}i(r,"product"),e.product=r;function n(s){return s.reduce((o,l)=>Math.min(o,l))}i(n,"min"),e.min=n;function a(s){return s.reduce((o,l)=>Math.max(o,l))}i(a,"max"),e.max=a})(vs||(vs={}));var Id={};Wr(Id,{assignMandatoryProperties:()=>Nd,copyAstNode:()=>Ho,findRootNode:()=>Ga,getContainerOfType:()=>xn,getDocument:()=>xt,getReferenceNodes:()=>qo,hasContainerOfType:()=>Yg,linkContentToContainer:()=>Ka,streamAllContents:()=>Ir,streamAst:()=>Mt,streamContents:()=>Ms,streamReferences:()=>Wa});function Ka(e,t={}){for(const[r,n]of Object.entries(e))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,s)=>{Oe(a)&&(a.$container=e,a.$containerProperty=r,a.$containerIndex=s,t.deep&&Ka(a,t))}):Oe(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&Ka(n,t)))}i(Ka,"linkContentToContainer");function xn(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}i(xn,"getContainerOfType");function Yg(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}i(Yg,"hasContainerOfType");function xt(e){const r=Ga(e).$document;if(!r)throw new Error("AST node has no document.");return r}i(xt,"getDocument");function Ga(e){for(;e.$container;)e=e.$container;return e}i(Ga,"findRootNode");function qo(e){return tt(e)?e.ref?[e.ref]:[]:tr(e)?e.items.map(t=>t.ref):[]}i(qo,"getReferenceNodes");function Ms(e,t){if(!e)throw new Error("Node must be an AstNode.");const r=t?.range;return new Qt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexMs(r,t))}i(Ir,"streamAllContents");function Mt(e,t){if(e){if(t?.range&&!Vo(e,t.range))return new Ua(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Ua(e,r=>Ms(r,t),{includeRoot:!0})}i(Mt,"streamAst");function Vo(e,t){if(!t)return!0;const r=e.$cstNode?.range;return r?Qd(r,t):!1}i(Vo,"isAstNodeInRange");function Wa(e){return new Qt(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexft,AbstractParserRule:()=>rs,AbstractRule:()=>Na,AbstractType:()=>gt,Action:()=>Dr,Alternatives:()=>ns,ArrayLiteral:()=>Yo,ArrayType:()=>Xo,Assignment:()=>xr,BooleanLiteral:()=>Jo,CharacterRange:()=>Mr,Condition:()=>Gr,Conjunction:()=>as,CrossReference:()=>Fr,Disjunction:()=>is,EndOfFile:()=>Zo,Grammar:()=>yr,GrammarImport:()=>Qo,Group:()=>pn,InferredType:()=>el,InfixRule:()=>Xt,InfixRuleOperatorList:()=>ss,InfixRuleOperators:()=>tl,Interface:()=>Pa,Keyword:()=>ka,LangiumGrammarAstReflection:()=>Xd,LangiumGrammarTerminals:()=>nN,NamedArgument:()=>Oa,NegatedToken:()=>mn,Negation:()=>rl,NumberLiteral:()=>nl,Parameter:()=>La,ParameterReference:()=>al,ParserRule:()=>Ot,ReferenceType:()=>os,RegexToken:()=>hn,ReturnType:()=>il,RuleCall:()=>yn,SimpleType:()=>Da,StringLiteral:()=>sl,TerminalAlternatives:()=>gn,TerminalElement:()=>dt,TerminalGroup:()=>vn,TerminalRule:()=>gr,TerminalRuleCall:()=>Tn,Type:()=>ls,TypeAttribute:()=>$n,TypeDefinition:()=>Rn,UnionType:()=>ol,UnorderedGroup:()=>us,UntilToken:()=>An,ValueLiteral:()=>En,Wildcard:()=>xa,isAbstractElement:()=>Ml,isAbstractParserRule:()=>Mn,isAbstractRule:()=>Jg,isAbstractType:()=>Zg,isAction:()=>zr,isAlternatives:()=>Gl,isArrayLiteral:()=>Qg,isArrayType:()=>kd,isAssignment:()=>$r,isBooleanLiteral:()=>Od,isCharacterRange:()=>Ld,isCondition:()=>ev,isConjunction:()=>Dd,isCrossReference:()=>Gn,isDisjunction:()=>xd,isEndOfFile:()=>Md,isGrammar:()=>tv,isGrammarImport:()=>rv,isGroup:()=>Fn,isInferredType:()=>Gs,isInfixRule:()=>qa,isInfixRuleOperatorList:()=>nv,isInfixRuleOperators:()=>av,isInterface:()=>Gd,isKeyword:()=>Rr,isNamedArgument:()=>iv,isNegatedToken:()=>Fd,isNegation:()=>zd,isNumberLiteral:()=>sv,isParameter:()=>ov,isParameterReference:()=>jd,isParserRule:()=>at,isReferenceType:()=>Bd,isRegexToken:()=>Ud,isReturnType:()=>Kd,isRuleCall:()=>Ar,isSimpleType:()=>Fl,isStringLiteral:()=>lv,isTerminalAlternatives:()=>Wd,isTerminalElement:()=>uv,isTerminalGroup:()=>qd,isTerminalRule:()=>It,isTerminalRuleCall:()=>zl,isType:()=>jl,isTypeAttribute:()=>cv,isTypeDefinition:()=>fv,isUnionType:()=>Vd,isUnorderedGroup:()=>Bl,isUntilToken:()=>Hd,isValueLiteral:()=>dv,isWildcard:()=>Yd,reflection:()=>j});var nN={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ft={$type:"AbstractElement",cardinality:"cardinality"};function Ml(e){return j.isInstance(e,ft.$type)}i(Ml,"isAbstractElement");var rs={$type:"AbstractParserRule"};function Mn(e){return j.isInstance(e,rs.$type)}i(Mn,"isAbstractParserRule");var Na={$type:"AbstractRule"};function Jg(e){return j.isInstance(e,Na.$type)}i(Jg,"isAbstractRule");var gt={$type:"AbstractType"};function Zg(e){return j.isInstance(e,gt.$type)}i(Zg,"isAbstractType");var Dr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function zr(e){return j.isInstance(e,Dr.$type)}i(zr,"isAction");var ns={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Gl(e){return j.isInstance(e,ns.$type)}i(Gl,"isAlternatives");var Yo={$type:"ArrayLiteral",elements:"elements"};function Qg(e){return j.isInstance(e,Yo.$type)}i(Qg,"isArrayLiteral");var Xo={$type:"ArrayType",elementType:"elementType"};function kd(e){return j.isInstance(e,Xo.$type)}i(kd,"isArrayType");var xr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function $r(e){return j.isInstance(e,xr.$type)}i($r,"isAssignment");var Jo={$type:"BooleanLiteral",true:"true"};function Od(e){return j.isInstance(e,Jo.$type)}i(Od,"isBooleanLiteral");var Mr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Ld(e){return j.isInstance(e,Mr.$type)}i(Ld,"isCharacterRange");var Gr={$type:"Condition"};function ev(e){return j.isInstance(e,Gr.$type)}i(ev,"isCondition");var as={$type:"Conjunction",left:"left",right:"right"};function Dd(e){return j.isInstance(e,as.$type)}i(Dd,"isConjunction");var Fr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Gn(e){return j.isInstance(e,Fr.$type)}i(Gn,"isCrossReference");var is={$type:"Disjunction",left:"left",right:"right"};function xd(e){return j.isInstance(e,is.$type)}i(xd,"isDisjunction");var Zo={$type:"EndOfFile",cardinality:"cardinality"};function Md(e){return j.isInstance(e,Zo.$type)}i(Md,"isEndOfFile");var yr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function tv(e){return j.isInstance(e,yr.$type)}i(tv,"isGrammar");var Qo={$type:"GrammarImport",path:"path"};function rv(e){return j.isInstance(e,Qo.$type)}i(rv,"isGrammarImport");var pn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Fn(e){return j.isInstance(e,pn.$type)}i(Fn,"isGroup");var el={$type:"InferredType",name:"name"};function Gs(e){return j.isInstance(e,el.$type)}i(Gs,"isInferredType");var Xt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qa(e){return j.isInstance(e,Xt.$type)}i(qa,"isInfixRule");var ss={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function nv(e){return j.isInstance(e,ss.$type)}i(nv,"isInfixRuleOperatorList");var tl={$type:"InfixRuleOperators",precedences:"precedences"};function av(e){return j.isInstance(e,tl.$type)}i(av,"isInfixRuleOperators");var Pa={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Gd(e){return j.isInstance(e,Pa.$type)}i(Gd,"isInterface");var ka={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Rr(e){return j.isInstance(e,ka.$type)}i(Rr,"isKeyword");var Oa={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function iv(e){return j.isInstance(e,Oa.$type)}i(iv,"isNamedArgument");var mn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Fd(e){return j.isInstance(e,mn.$type)}i(Fd,"isNegatedToken");var rl={$type:"Negation",value:"value"};function zd(e){return j.isInstance(e,rl.$type)}i(zd,"isNegation");var nl={$type:"NumberLiteral",value:"value"};function sv(e){return j.isInstance(e,nl.$type)}i(sv,"isNumberLiteral");var La={$type:"Parameter",name:"name"};function ov(e){return j.isInstance(e,La.$type)}i(ov,"isParameter");var al={$type:"ParameterReference",parameter:"parameter"};function jd(e){return j.isInstance(e,al.$type)}i(jd,"isParameterReference");var Ot={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function at(e){return j.isInstance(e,Ot.$type)}i(at,"isParserRule");var os={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Bd(e){return j.isInstance(e,os.$type)}i(Bd,"isReferenceType");var hn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Ud(e){return j.isInstance(e,hn.$type)}i(Ud,"isRegexToken");var il={$type:"ReturnType",name:"name"};function Kd(e){return j.isInstance(e,il.$type)}i(Kd,"isReturnType");var yn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Ar(e){return j.isInstance(e,yn.$type)}i(Ar,"isRuleCall");var Da={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Fl(e){return j.isInstance(e,Da.$type)}i(Fl,"isSimpleType");var sl={$type:"StringLiteral",value:"value"};function lv(e){return j.isInstance(e,sl.$type)}i(lv,"isStringLiteral");var gn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Wd(e){return j.isInstance(e,gn.$type)}i(Wd,"isTerminalAlternatives");var dt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function uv(e){return j.isInstance(e,dt.$type)}i(uv,"isTerminalElement");var vn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qd(e){return j.isInstance(e,vn.$type)}i(qd,"isTerminalGroup");var gr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function It(e){return j.isInstance(e,gr.$type)}i(It,"isTerminalRule");var Tn={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function zl(e){return j.isInstance(e,Tn.$type)}i(zl,"isTerminalRuleCall");var ls={$type:"Type",name:"name",type:"type"};function jl(e){return j.isInstance(e,ls.$type)}i(jl,"isType");var $n={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function cv(e){return j.isInstance(e,$n.$type)}i(cv,"isTypeAttribute");var Rn={$type:"TypeDefinition"};function fv(e){return j.isInstance(e,Rn.$type)}i(fv,"isTypeDefinition");var ol={$type:"UnionType",types:"types"};function Vd(e){return j.isInstance(e,ol.$type)}i(Vd,"isUnionType");var us={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Bl(e){return j.isInstance(e,us.$type)}i(Bl,"isUnorderedGroup");var An={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Hd(e){return j.isInstance(e,An.$type)}i(Hd,"isUntilToken");var En={$type:"ValueLiteral"};function dv(e){return j.isInstance(e,En.$type)}i(dv,"isValueLiteral");var xa={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Yd(e){return j.isInstance(e,xa.$type)}i(Yd,"isWildcard");var Xd=class extends wd{static{i(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:ft.$type,properties:{cardinality:{name:ft.cardinality}},superTypes:[]},AbstractParserRule:{name:rs.$type,properties:{},superTypes:[Na.$type,gt.$type]},AbstractRule:{name:Na.$type,properties:{},superTypes:[]},AbstractType:{name:gt.$type,properties:{},superTypes:[]},Action:{name:Dr.$type,properties:{cardinality:{name:Dr.cardinality},feature:{name:Dr.feature},inferredType:{name:Dr.inferredType},operator:{name:Dr.operator},type:{name:Dr.type,referenceType:gt.$type}},superTypes:[ft.$type]},Alternatives:{name:ns.$type,properties:{cardinality:{name:ns.cardinality},elements:{name:ns.elements,defaultValue:[]}},superTypes:[ft.$type]},ArrayLiteral:{name:Yo.$type,properties:{elements:{name:Yo.elements,defaultValue:[]}},superTypes:[En.$type]},ArrayType:{name:Xo.$type,properties:{elementType:{name:Xo.elementType}},superTypes:[Rn.$type]},Assignment:{name:xr.$type,properties:{cardinality:{name:xr.cardinality},feature:{name:xr.feature},operator:{name:xr.operator},predicate:{name:xr.predicate},terminal:{name:xr.terminal}},superTypes:[ft.$type]},BooleanLiteral:{name:Jo.$type,properties:{true:{name:Jo.true,defaultValue:!1}},superTypes:[Gr.$type,En.$type]},CharacterRange:{name:Mr.$type,properties:{cardinality:{name:Mr.cardinality},left:{name:Mr.left},lookahead:{name:Mr.lookahead},parenthesized:{name:Mr.parenthesized,defaultValue:!1},right:{name:Mr.right}},superTypes:[dt.$type]},Condition:{name:Gr.$type,properties:{},superTypes:[]},Conjunction:{name:as.$type,properties:{left:{name:as.left},right:{name:as.right}},superTypes:[Gr.$type]},CrossReference:{name:Fr.$type,properties:{cardinality:{name:Fr.cardinality},deprecatedSyntax:{name:Fr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Fr.isMulti,defaultValue:!1},terminal:{name:Fr.terminal},type:{name:Fr.type,referenceType:gt.$type}},superTypes:[ft.$type]},Disjunction:{name:is.$type,properties:{left:{name:is.left},right:{name:is.right}},superTypes:[Gr.$type]},EndOfFile:{name:Zo.$type,properties:{cardinality:{name:Zo.cardinality}},superTypes:[ft.$type]},Grammar:{name:yr.$type,properties:{imports:{name:yr.imports,defaultValue:[]},interfaces:{name:yr.interfaces,defaultValue:[]},isDeclared:{name:yr.isDeclared,defaultValue:!1},name:{name:yr.name},rules:{name:yr.rules,defaultValue:[]},types:{name:yr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Qo.$type,properties:{path:{name:Qo.path}},superTypes:[]},Group:{name:pn.$type,properties:{cardinality:{name:pn.cardinality},elements:{name:pn.elements,defaultValue:[]},guardCondition:{name:pn.guardCondition},predicate:{name:pn.predicate}},superTypes:[ft.$type]},InferredType:{name:el.$type,properties:{name:{name:el.name}},superTypes:[gt.$type]},InfixRule:{name:Xt.$type,properties:{call:{name:Xt.call},dataType:{name:Xt.dataType},inferredType:{name:Xt.inferredType},name:{name:Xt.name},operators:{name:Xt.operators},parameters:{name:Xt.parameters,defaultValue:[]},returnType:{name:Xt.returnType,referenceType:gt.$type}},superTypes:[rs.$type]},InfixRuleOperatorList:{name:ss.$type,properties:{associativity:{name:ss.associativity},operators:{name:ss.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:tl.$type,properties:{precedences:{name:tl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Pa.$type,properties:{attributes:{name:Pa.attributes,defaultValue:[]},name:{name:Pa.name},superTypes:{name:Pa.superTypes,defaultValue:[],referenceType:gt.$type}},superTypes:[gt.$type]},Keyword:{name:ka.$type,properties:{cardinality:{name:ka.cardinality},predicate:{name:ka.predicate},value:{name:ka.value}},superTypes:[ft.$type]},NamedArgument:{name:Oa.$type,properties:{calledByName:{name:Oa.calledByName,defaultValue:!1},parameter:{name:Oa.parameter,referenceType:La.$type},value:{name:Oa.value}},superTypes:[]},NegatedToken:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},lookahead:{name:mn.lookahead},parenthesized:{name:mn.parenthesized,defaultValue:!1},terminal:{name:mn.terminal}},superTypes:[dt.$type]},Negation:{name:rl.$type,properties:{value:{name:rl.value}},superTypes:[Gr.$type]},NumberLiteral:{name:nl.$type,properties:{value:{name:nl.value}},superTypes:[En.$type]},Parameter:{name:La.$type,properties:{name:{name:La.name}},superTypes:[]},ParameterReference:{name:al.$type,properties:{parameter:{name:al.parameter,referenceType:La.$type}},superTypes:[Gr.$type]},ParserRule:{name:Ot.$type,properties:{dataType:{name:Ot.dataType},definition:{name:Ot.definition},entry:{name:Ot.entry,defaultValue:!1},fragment:{name:Ot.fragment,defaultValue:!1},inferredType:{name:Ot.inferredType},name:{name:Ot.name},parameters:{name:Ot.parameters,defaultValue:[]},returnType:{name:Ot.returnType,referenceType:gt.$type}},superTypes:[rs.$type]},ReferenceType:{name:os.$type,properties:{isMulti:{name:os.isMulti,defaultValue:!1},referenceType:{name:os.referenceType}},superTypes:[Rn.$type]},RegexToken:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},lookahead:{name:hn.lookahead},parenthesized:{name:hn.parenthesized,defaultValue:!1},regex:{name:hn.regex}},superTypes:[dt.$type]},ReturnType:{name:il.$type,properties:{name:{name:il.name}},superTypes:[]},RuleCall:{name:yn.$type,properties:{arguments:{name:yn.arguments,defaultValue:[]},cardinality:{name:yn.cardinality},predicate:{name:yn.predicate},rule:{name:yn.rule,referenceType:Na.$type}},superTypes:[ft.$type]},SimpleType:{name:Da.$type,properties:{primitiveType:{name:Da.primitiveType},stringType:{name:Da.stringType},typeRef:{name:Da.typeRef,referenceType:gt.$type}},superTypes:[Rn.$type]},StringLiteral:{name:sl.$type,properties:{value:{name:sl.value}},superTypes:[En.$type]},TerminalAlternatives:{name:gn.$type,properties:{cardinality:{name:gn.cardinality},elements:{name:gn.elements,defaultValue:[]},lookahead:{name:gn.lookahead},parenthesized:{name:gn.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalElement:{name:dt.$type,properties:{cardinality:{name:dt.cardinality},lookahead:{name:dt.lookahead},parenthesized:{name:dt.parenthesized,defaultValue:!1}},superTypes:[ft.$type]},TerminalGroup:{name:vn.$type,properties:{cardinality:{name:vn.cardinality},elements:{name:vn.elements,defaultValue:[]},lookahead:{name:vn.lookahead},parenthesized:{name:vn.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalRule:{name:gr.$type,properties:{definition:{name:gr.definition},fragment:{name:gr.fragment,defaultValue:!1},hidden:{name:gr.hidden,defaultValue:!1},name:{name:gr.name},type:{name:gr.type}},superTypes:[Na.$type]},TerminalRuleCall:{name:Tn.$type,properties:{cardinality:{name:Tn.cardinality},lookahead:{name:Tn.lookahead},parenthesized:{name:Tn.parenthesized,defaultValue:!1},rule:{name:Tn.rule,referenceType:gr.$type}},superTypes:[dt.$type]},Type:{name:ls.$type,properties:{name:{name:ls.name},type:{name:ls.type}},superTypes:[gt.$type]},TypeAttribute:{name:$n.$type,properties:{defaultValue:{name:$n.defaultValue},isOptional:{name:$n.isOptional,defaultValue:!1},name:{name:$n.name},type:{name:$n.type}},superTypes:[]},TypeDefinition:{name:Rn.$type,properties:{},superTypes:[]},UnionType:{name:ol.$type,properties:{types:{name:ol.types,defaultValue:[]}},superTypes:[Rn.$type]},UnorderedGroup:{name:us.$type,properties:{cardinality:{name:us.cardinality},elements:{name:us.elements,defaultValue:[]}},superTypes:[ft.$type]},UntilToken:{name:An.$type,properties:{cardinality:{name:An.cardinality},lookahead:{name:An.lookahead},parenthesized:{name:An.parenthesized,defaultValue:!1},terminal:{name:An.terminal}},superTypes:[dt.$type]},ValueLiteral:{name:En.$type,properties:{},superTypes:[]},Wildcard:{name:xa.$type,properties:{cardinality:{name:xa.cardinality},lookahead:{name:xa.lookahead},parenthesized:{name:xa.parenthesized,defaultValue:!1}},superTypes:[dt.$type]}}}},j=new Xd;function pv(e){let t=e,r=!1;for(;t;){const n=xn(t.grammarSource,at);if(n&&n.dataType)t=t.container,r=!0;else return r?t:void 0}}i(pv,"getDatatypeNode");function Va(e){return new Ua(e,t=>Tr(t)?t.content:[],{includeRoot:!0})}i(Va,"streamCst");function mv(e){return Va(e).filter(Dn)}i(mv,"flattenCst");function Jd(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}i(Jd,"isChildNode");function Ts(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}i(Ts,"tokenToRange");function Ha(e){if(!e)return;const{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}i(Ha,"toDocumentSegment");var Zt;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Zt||(Zt={}));function Zd(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Zt.After;const r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.lineZt.After}i(Qd,"inRange");var ep=/^[\w\p{L}]$/u;function hv(e,t,r=ep){if(e){if(t>0){const n=t-e.offset,a=e.text.charAt(n);r.test(a)||t--}return Ul(e,t)}}i(hv,"findDeclarationNodeAtOffset");function tp(e,t){if(e){const r=ap(e,!0);if(r&&ll(r,t))return r;if(xl(e)){const n=e.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const s=e.content[a];if(ll(s,t))return s}}}}i(tp,"findCommentNode");function ll(e,t){return Dn(e)&&t.includes(e.tokenType.name)}i(ll,"isCommentNode");function Ul(e,t){if(Dn(e))return e;if(Tr(e)){const r=np(e,t,!1);if(r)return Ul(r,t)}}i(Ul,"findLeafNodeAtOffset");function rp(e,t){if(Dn(e))return e;if(Tr(e)){const r=np(e,t,!0);if(r)return rp(r,t)}}i(rp,"findLeafNodeBeforeOffset");function np(e,t,r){let n=0,a=e.content.length-1,s;for(;n<=a;){const o=Math.floor((n+a)/2),l=e.content[o];if(l.offset<=t&&l.end>t)return l;l.end<=t?(s=r?l:void 0,n=o+1):a=o-1}return s}i(np,"binarySearch");function ap(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);for(;n>0;){n--;const a=r.content[n];if(t||!a.hidden)return a}e=r}}i(ap,"getPreviousNode");function yv(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);const a=r.content.length-1;for(;nvp,findNameAssignment:()=>Jl,findNodeForKeyword:()=>gp,findNodeForProperty:()=>Hl,findNodesForKeyword:()=>Sv,findNodesForKeywordInternal:()=>Xl,findNodesForProperty:()=>yp,getActionAtElement:()=>$p,getActionType:()=>Ap,getAllReachableRules:()=>Vl,getAllRulesUsedForCrossReferences:()=>_v,getCrossReferenceTerminal:()=>mp,getEntryRule:()=>fp,getExplicitRuleType:()=>zs,getHiddenRules:()=>dp,getRuleType:()=>Ep,getRuleTypeName:()=>kv,getTypeName:()=>Nn,isArrayCardinality:()=>Iv,isArrayOperator:()=>Nv,isCommentTerminal:()=>hp,isDataType:()=>Pv,isDataTypeRule:()=>Fs,isOptionalCardinality:()=>wv,terminalRegex:()=>js});var Kl=class extends Error{static{i(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function qr(e,t="Error: Got unexpected value."){throw new Error(t)}i(qr,"assertUnreachable");function sp(e,t="Error: Condition is violated."){if(!e)throw new Error(t)}i(sp,"assertCondition");var op={};Wr(op,{NEWLINE_REGEXP:()=>Av,escapeRegExp:()=>ti,getTerminalParts:()=>Cv,isMultilineComment:()=>lp,isWhitespace:()=>ql,partialMatches:()=>up,partialRegExp:()=>cp,whitespaceCharacters:()=>bv});function U(e){return e.charCodeAt(0)}i(U,"cc");function No(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}i(No,"insertToSet");function Ta(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}i(Ta,"addFlag");function an(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}i(an,"ASSERT_EXISTS");function $v(){throw Error("Internal Error - Should never get here!")}i($v,"ASSERT_NEVER_REACH_HERE");function Ef(e){return e.type==="Character"}i(Ef,"isCharacter");var ul=[];for(let e=U("0");e<=U("9");e++)ul.push(e);var cl=[U("_")].concat(ul);for(let e=U("a");e<=U("z");e++)cl.push(e);for(let e=U("A");e<=U("Z");e++)cl.push(e);var uh=[U(" "),U("\f"),U(` +`),U("\r"),U(" "),U("\v"),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U("\u2028"),U("\u2029"),U(" "),U(" "),U(" "),U("\uFEFF")],aN=/[0-9a-fA-F]/,no=/[0-9]/,iN=/[1-9]/,Rv=class{static{i(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(r,"global");break;case"i":Ta(r,"ignoreCase");break;case"m":Ta(r,"multiLine");break;case"u":Ta(r,"unicode");break;case"y":Ta(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}an(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return $v()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:n,atMost:a}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;an(t);break}if(!(e===!0&&t===void 0)&&an(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),an(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[U(` +`),U("\r"),U("\u2028"),U("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=ul;break;case"D":e=ul,t=!0;break;case"s":e=uh;break;case"S":e=uh,t=!0;break;case"w":e=cl;break;case"W":e=cl,t=!0;break}if(an(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=U("\f");break;case"n":e=U(` +`);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(an(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:U("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:U(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:U(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,Ef(r)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,Ef(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Wl=class{static{i(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Av=/\r?\n/gm,Ev=new Rv,sN=class extends Wl{static{i(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=ti(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` +`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},Cn=new sN;function Cv(e){try{typeof e!="string"&&(e=e.source),e=`/${e}/`;const t=Ev.pattern(e),r=[];for(const n of t.value.value)Cn.reset(e),Cn.visit(n),r.push({start:Cn.startRegexp,end:Cn.endRegex});return r}catch{return[]}}i(Cv,"getTerminalParts");function lp(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),Cn.reset(e),Cn.visit(Ev.pattern(e)),Cn.multiline}catch{return!1}}i(lp,"isMultilineComment");var bv=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function ql(e){const t=typeof e=="string"?new RegExp(e):e;return bv.some(r=>t.test(r))}i(ql,"isWhitespace");function ti(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(ti,"escapeRegExp");function up(e,t){const r=cp(e),n=t.match(r);return!!n&&n[0].length>0}i(up,"partialMatches");function cp(e){typeof e=="string"&&(e=new RegExp(e));const t=e,r=e.source;let n=0;function a(){let s="",o;function l(c){s+=r.substr(n,c),n+=c}i(l,"appendRaw");function u(c){s+="(?:"+r.substr(n,c)+"|$)",n+=c}for(i(u,"appendOptional");n",n)-n+1);break;default:u(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],u(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?l(o[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=a()+"|$)";break;case"=":s+="(?=",n+=3,s+=a()+")";break;case"!":o=n,n+=3,a(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),s+=r.substr(o,n-o);break;default:l(r.indexOf(">",n)-n+1),s+=a()+"|$)";break}break}else l(1),s+=a()+"|$)";break;case")":return++n,s;default:u(1);break}return s}return i(a,"process"),new RegExp(a(),e.flags)}i(cp,"partialRegExp");function fp(e){return e.rules.find(t=>at(t)&&t.entry)}i(fp,"getEntryRule");function dp(e){return e.rules.filter(t=>It(t)&&t.hidden)}i(dp,"getHiddenRules");function Vl(e,t){const r=new Set,n=fp(e);if(!n)return new Set(e.rules);const a=[n].concat(dp(e));for(const o of a)pp(o,r,t);const s=new Set;for(const o of e.rules)(r.has(o.name)||It(o)&&o.hidden)&&s.add(o);return s}i(Vl,"getAllReachableRules");function pp(e,t,r){t.add(e.name),Ir(e).forEach(n=>{if(Ar(n)||r&&zl(n)){const a=n.rule.ref;a&&!t.has(a.name)&&pp(a,t,r)}})}i(pp,"ruleDfs");function _v(e){const t=new Set;return Ir(e).forEach(r=>{Gn(r)&&(at(r.type.ref)&&t.add(r.type.ref),Gs(r.type.ref)&&at(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}i(_v,"getAllRulesUsedForCrossReferences");function mp(e){if(e.terminal)return e.terminal;if(e.type.ref)return Jl(e.type.ref)?.terminal}i(mp,"getCrossReferenceTerminal");function hp(e){return e.hidden&&!ql(js(e))}i(hp,"isCommentTerminal");function yp(e,t){return!e||!t?[]:Yl(e,t,e.astNode,!0)}i(yp,"findNodesForProperty");function Hl(e,t,r){if(!e||!t)return;const n=Yl(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Hl,"findNodeForProperty");function Yl(e,t,r,n){if(!n){const a=xn(e.grammarSource,$r);if(a&&a.feature===t)return[e]}return Tr(e)&&e.astNode===r?e.content.flatMap(a=>Yl(a,t,r,!1)):[]}i(Yl,"findNodesForPropertyInternal");function Sv(e,t){return e?Xl(e,t,e?.astNode):[]}i(Sv,"findNodesForKeyword");function gp(e,t,r){if(!e)return;const n=Xl(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(gp,"findNodeForKeyword");function Xl(e,t,r){if(e.astNode!==r)return[];if(Rr(e.grammarSource)&&e.grammarSource.value===t)return[e];const n=Va(e).iterator();let a;const s=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Rr(o.grammarSource)&&o.grammarSource.value===t&&s.push(o):n.prune()}while(!a.done);return s}i(Xl,"findNodesForKeywordInternal");function vp(e){const t=e.astNode;for(;t===e.container?.astNode;){const r=xn(e.grammarSource,$r);if(r)return r;e=e.container}}i(vp,"findAssignment");function Jl(e){let t=e;return Gs(t)&&(zr(t.$container)?t=t.$container.$container:Mn(t.$container)?t=t.$container:qr(t.$container)),Tp(e,t,new Map)}i(Jl,"findNameAssignment");function Tp(e,t,r){function n(a,s){let o;return xn(a,$r)||(o=Tp(s,s,r)),r.set(e,o),o}if(i(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(const a of Ir(t)){if($r(a)&&a.feature.toLowerCase()==="name")return r.set(e,a),a;if(Ar(a)&&at(a.rule.ref))return n(a,a.rule.ref);if(Fl(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}i(Tp,"findNameAssignmentInternal");function $p(e){const t=e.$container;if(Fn(t)){const r=t.elements,n=r.indexOf(e);for(let a=n-1;a>=0;a--){const s=r[a];if(zr(s))return s;{const o=Ir(r[a]).find(zr);if(o)return o}}}if(Ml(t))return $p(t)}i($p,"getActionAtElement");function wv(e,t){return e==="?"||e==="*"||Fn(t)&&!!t.guardCondition}i(wv,"isOptionalCardinality");function Iv(e){return e==="*"||e==="+"}i(Iv,"isArrayCardinality");function Nv(e){return e==="+="}i(Nv,"isArrayOperator");function Fs(e){return Rp(e,new Set)}i(Fs,"isDataTypeRule");function Rp(e,t){if(t.has(e))return!0;t.add(e);for(const r of Ir(e))if(Ar(r)){if(!r.rule.ref||at(r.rule.ref)&&!Rp(r.rule.ref,t)||qa(r.rule.ref))return!1}else{if($r(r))return!1;if(zr(r))return!1}return!!e.definition}i(Rp,"isDataTypeRuleInternal");function Pv(e){return fl(e.type,new Set)}i(Pv,"isDataType");function fl(e,t){if(t.has(e))return!0;if(t.add(e),kd(e))return!1;if(Bd(e))return!1;if(Vd(e))return e.types.every(r=>fl(r,t));if(Fl(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){const r=e.typeRef.ref;return jl(r)?fl(r.type,t):!1}else return!1}else return!1}i(fl,"isDataTypeInternal");function zs(e){if(!It(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t)return t.name}}}i(zs,"getExplicitRuleType");function Nn(e){if(Mn(e))return at(e)&&Fs(e)?e.name:zs(e)??e.name;if(Gd(e)||jl(e)||Kd(e))return e.name;if(zr(e)){const t=Ap(e);if(t)return t}else if(Gs(e))return e.name;throw new Error("Cannot get name of Unknown Type")}i(Nn,"getTypeName");function Ap(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return Nn(e.type.ref)}i(Ap,"getActionType");function kv(e){return It(e)?e.type?.name??"string":at(e)&&Fs(e)?e.name:zs(e)??e.name}i(kv,"getRuleTypeName");function Ep(e){return It(e)?e.type?.name??"string":zs(e)??e.name}i(Ep,"getRuleType");function js(e){const t={s:!1,i:!1,u:!1},r=zn(e.definition,t),n=Object.entries(t).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}i(js,"terminalRegex");var Cp=/[\s\S]/.source;function zn(e,t){if(Wd(e))return Ov(e);if(qd(e))return Lv(e);if(Ld(e))return Mv(e);if(zl(e)){const r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return rr(zn(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(Fd(e))return xv(e);if(Hd(e))return Dv(e);if(Ud(e)){const r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),a=e.regex.substring(r+1);return t&&(t.i=a.includes("i"),t.s=a.includes("s"),t.u=a.includes("u")),rr(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(Yd(e))return rr(Cp,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}i(zn,"abstractElementToRegex");function Ov(e){return rr(e.elements.map(t=>zn(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Ov,"terminalAlternativesToRegex");function Lv(e){return rr(e.elements.map(t=>zn(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Lv,"terminalGroupToRegex");function Dv(e){return rr(`${Cp}*?${zn(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Dv,"untilTokenToRegex");function xv(e){return rr(`(?!${zn(e.terminal)})${Cp}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(xv,"negateTokenToRegex");function Mv(e){return e.right?rr(`[${Po(e.left)}-${Po(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):rr(Po(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Mv,"characterRangeToRegex");function Po(e){return ti(e.value)}i(Po,"keywordToRegex");function rr(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}i(rr,"withCardinality");function bp(e){const t=[],r=e.Grammar;for(const n of r.rules)It(n)&&hp(n)&&lp(js(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:ep}}i(bp,"createGrammarConfig");var oN=typeof global=="object"&&global&&global.Object===Object&&global,Gv=oN,lN=typeof self=="object"&&self&&self.Object===Object&&self,uN=Gv||lN||Function("return this")(),ar=uN,cN=ar.Symbol,St=cN,Fv=Object.prototype,fN=Fv.hasOwnProperty,dN=Fv.toString,ki=St?St.toStringTag:void 0;function zv(e){var t=fN.call(e,ki),r=e[ki];try{e[ki]=void 0;var n=!0}catch{}var a=dN.call(e);return n&&(t?e[ki]=r:delete e[ki]),a}i(zv,"getRawTag");var pN=zv,mN=Object.prototype,hN=mN.toString;function jv(e){return hN.call(e)}i(jv,"objectToString");var yN=jv,gN="[object Null]",vN="[object Undefined]",ch=St?St.toStringTag:void 0;function Bv(e){return e==null?e===void 0?vN:gN:ch&&ch in Object(e)?pN(e):yN(e)}i(Bv,"baseGetTag");var Vr=Bv;function Uv(e){return e!=null&&typeof e=="object"}i(Uv,"isObjectLike");var zt=Uv,TN="[object Symbol]";function Kv(e){return typeof e=="symbol"||zt(e)&&Vr(e)==TN}i(Kv,"isSymbol");var Zl=Kv;function Wv(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r0){if(++t>=tP)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}i(lT,"shortOut");var aP=lT;function uT(e){return function(){return e}}i(uT,"constant");var iP=uT,sP=(function(){try{var e=Bn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),dl=sP,oP=dl?function(e,t){return dl(e,"toString",{configurable:!0,enumerable:!1,value:iP(t),writable:!0})}:Ks,lP=oP,uP=aP(lP),cP=uP;function cT(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}i(gT,"arrayIncludes");var vT=gT,pP=9007199254740991,mP=/^(?:0|[1-9]\d*)$/;function TT(e,t){var r=typeof e;return t=t??pP,!!t&&(r=="number"||r!="symbol"&&mP.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=vP}i(_T,"isLength");var Np=_T;function ST(e){return e!=null&&Np(e.length)&&!Nr(e)}i(ST,"isArrayLike");var ir=ST;function wT(e,t,r){if(!wt(r))return!1;var n=typeof t;return(n=="number"?ir(r)&&Ql(t,r.length):n=="string"&&t in r)?Ws(r[t],e):!1}i(wT,"isIterateeCall");var tu=wT;function IT(e){return Ip(function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&tu(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n-1}i(i$,"listCacheHas");var xk=i$;function s$(e,t){var r=this.__data__,n=au(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(s$,"listCacheSet");var Mk=s$;function Kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(l)?t>1?Dp(l,t-1,r,n,a):Lp(a,l):n||(a[a.length]=l)}return a}i(Dp,"baseFlatten");var xp=Dp;function A$(e){var t=e==null?0:e.length;return t?xp(e,1):[]}i(A$,"flatten");var Gt=A$,rO=BT(Object.getPrototypeOf,Object),E$=rO;function C$(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(a);++nl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&q0?new zp:void 0;for(s.set(e,t),s.set(t,e);++d2?t[2]:void 0;for(a&&tu(t[0],t[1],a)&&(n=1);++r=FL&&(s=jp,o=!1,t=new zp(t));e:for(;++a-1?a[s?t[o]:o]:void 0}}i(iA,"createFind");var WL=iA,qL=Math.max;function sA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Us(r);return a<0&&(a=qL(n+a,0)),pT(e,sr(t),a)}i(sA,"findIndex");var VL=sA,HL=WL(VL),Xa=HL;function oA(e){return e&&e.length?e[0]:void 0}i(oA,"head");var jt=oA;function lA(e,t){var r=-1,n=ir(e)?Array(e.length):[];return Vn(e,function(a,s,o){n[++r]=t(a,s,o)}),n}i(lA,"baseMap");var YL=lA;function uA(e,t){var r=re(e)?Bs:YL;return r(e,sr(t))}i(uA,"map");var F=uA;function cA(e,t){return xp(F(e,t),1)}i(cA,"flatMap");var _t=cA,XL=Object.prototype,JL=XL.hasOwnProperty,ZL=xL(function(e,t,r){JL.call(e,r)?e[r].push(t):wp(e,r,[t])}),QL=ZL,eD=Object.prototype,tD=eD.hasOwnProperty;function fA(e,t){return e!=null&&tD.call(e,t)}i(fA,"baseHas");var rD=fA;function dA(e,t){return e!=null&&NR(e,t,rD)}i(dA,"has");var B=dA,nD="[object String]";function pA(e){return typeof e=="string"||!re(e)&&zt(e)&&Vr(e)==nD}i(pA,"isString");var pt=pA;function mA(e,t){return Bs(t,function(r){return e[r]})}i(mA,"baseValues");var aD=mA;function hA(e){return e==null?[]:aD(e,Tt(e))}i(hA,"values");var Me=hA,iD=Math.max;function yA(e,t,r,n){e=ir(e)?e:Me(e),r=r&&!n?Us(r):0;var a=e.length;return r<0&&(r=iD(a+r,0)),pt(e)?r<=a&&e.indexOf(t,r)>-1:!!a&&Sp(e,t,r)>-1}i(yA,"includes");var lt=yA,sD=Math.max;function gA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Us(r);return a<0&&(a=sD(n+a,0)),Sp(e,t,a)}i(gA,"indexOf");var Bh=gA,oD="[object Map]",lD="[object Set]",uD=Object.prototype,cD=uD.hasOwnProperty;function vA(e){if(e==null)return!0;if(ir(e)&&(re(e)||typeof e=="string"||typeof e.splice=="function"||$s(e)||Pp(e)||ru(e)))return!e.length;var t=Ya(e);if(t==oD||t==lD)return!e.size;if(Vs(e))return!KT(e).length;for(var r in e)if(cD.call(e,r))return!1;return!0}i(vA,"isEmpty");var me=vA,fD="[object RegExp]";function TA(e){return zt(e)&&Vr(e)==fD}i(TA,"baseIsRegExp");var dD=TA,Uh=jr&&jr.isRegExp,pD=Uh?Hs(Uh):dD,Er=pD;function $A(e){return e===void 0}i($A,"isUndefined");var Cr=$A,mD="Expected a function";function RA(e){if(typeof e!="function")throw new TypeError(mD);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}i(RA,"negate");var hD=RA;function AA(e,t,r,n){if(!wt(e))return e;t=uu(t,e);for(var a=-1,s=t.length,o=s-1,l=e;l!=null&&++a=ED){var c=t?null:AD(e);if(c)return Bp(c);o=!1,a=jp,u=new zp}else u=t?[]:l;e:for(;++n{t.accept(e)})}},it=class extends or{static{i(this,"NonTerminal")}constructor(e){super([]),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},ri=class extends or{static{i(this,"Rule")}constructor(e){super(e.definition),this.orgText="",$t(this,Bt(e,t=>t!==void 0))}},mt=class extends or{static{i(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,$t(this,Bt(e,t=>t!==void 0))}},He=class extends or{static{i(this,"Option")}constructor(e){super(e.definition),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}},At=class extends or{static{i(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}},Et=class extends or{static{i(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}},be=class extends or{static{i(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}},ht=class extends or{static{i(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,$t(this,Bt(e,t=>t!==void 0))}},yt=class extends or{static{i(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,$t(this,Bt(e,t=>t!==void 0))}},ve=class{static{i(this,"Terminal")}constructor(e){this.idx=1,$t(this,Bt(e,t=>t!==void 0))}accept(e){e.visit(this)}};function DA(e){return F(e,ps)}i(DA,"serializeGrammar");function ps(e){function t(r){return F(r,ps)}if(i(t,"convertDefinition"),e instanceof it){const r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return pt(e.label)&&(r.label=e.label),r}else{if(e instanceof mt)return{type:"Alternative",definition:t(e.definition)};if(e instanceof He)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof At)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Et)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ps(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ht)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ps(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof be)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof yt)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ve){const r={type:"Terminal",name:e.terminalType.name,label:OA(e.terminalType),idx:e.idx};pt(e.label)&&(r.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=Er(n)?n.source:n),r}else{if(e instanceof ri)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}i(ps,"serializeProduction");var ni=class{static{i(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case it:return this.visitNonTerminal(t);case mt:return this.visitAlternative(t);case He:return this.visitOption(t);case At:return this.visitRepetitionMandatory(t);case Et:return this.visitRepetitionMandatoryWithSeparator(t);case ht:return this.visitRepetitionWithSeparator(t);case be:return this.visitRepetition(t);case yt:return this.visitAlternation(t);case ve:return this.visitTerminal(t);case ri:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function xA(e){return e instanceof mt||e instanceof He||e instanceof be||e instanceof At||e instanceof Et||e instanceof ht||e instanceof ve||e instanceof ri}i(xA,"isSequenceProd");function bs(e,t=[]){return e instanceof He||e instanceof be||e instanceof ht?!0:e instanceof yt?NA(e.definition,n=>bs(n,t)):e instanceof it&<(t,e)?!1:e instanceof or?(e instanceof it&&t.push(e),Ft(e.definition,n=>bs(n,t))):!1}i(bs,"isOptionalProd");function MA(e){return e instanceof yt}i(MA,"isBranchingProd");function Lt(e){if(e instanceof it)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof yt)return"OR";if(e instanceof At)return"AT_LEAST_ONE";if(e instanceof Et)return"AT_LEAST_ONE_SEP";if(e instanceof ht)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(Lt,"getProductionDslName");var du=class{static{i(this,"RestWalker")}walk(e,t=[]){K(e.definition,(r,n)=>{const a=Ve(e.definition,n+1);if(r instanceof it)this.walkProdRef(r,a,t);else if(r instanceof ve)this.walkTerminal(r,a,t);else if(r instanceof mt)this.walkFlat(r,a,t);else if(r instanceof He)this.walkOption(r,a,t);else if(r instanceof At)this.walkAtLeastOne(r,a,t);else if(r instanceof Et)this.walkAtLeastOneSep(r,a,t);else if(r instanceof ht)this.walkManySep(r,a,t);else if(r instanceof be)this.walkMany(r,a,t);else if(r instanceof yt)this.walkOr(r,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=wf(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=wf(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);K(e.definition,a=>{const s=new mt({definition:[a]});this.walk(s,n)})}};function wf(e,t,r){return[new He({definition:[new ve({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}i(wf,"restForRepetitionWithSeparator");function ai(e){if(e instanceof it)return ai(e.referencedRule);if(e instanceof ve)return zA(e);if(xA(e))return GA(e);if(MA(e))return FA(e);throw Error("non exhaustive match")}i(ai,"first");function GA(e){let t=[];const r=e.definition;let n=0,a=r.length>n,s,o=!0;for(;a&&o;)s=r[n],o=bs(s),t=t.concat(ai(s)),n=n+1,a=r.length>n;return Wp(t)}i(GA,"firstForSequence");function FA(e){const t=F(e.definition,r=>ai(r));return Wp(Gt(t))}i(FA,"firstForBranching");function zA(e){return[e.terminalType]}i(zA,"firstForTerminal");var jA="_~IN~_",bD=class extends du{static{i(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=UA(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(r),s=new mt({definition:a}),o=ai(s);this.follows[n]=o}};function BA(e){const t={};return K(e,r=>{const n=new bD(r).startWalking();$t(t,n)}),t}i(BA,"computeAllProdsFollows");function UA(e,t){return e.name+t+jA}i(UA,"buildBetweenProdsFollowPrefix");var ko={},_D=new Rv;function Js(e){const t=e.toString();if(ko.hasOwnProperty(t))return ko[t];{const r=_D.pattern(t);return ko[t]=r,r}}i(Js,"getRegExpAst");function KA(){ko={}}i(KA,"clearRegExpParserCache");var WA="Complement Sets are not supported for first char optimization",hl=`Unable to use "first char" lexer optimizations: +`;function qA(e,t=!1){try{const r=Js(e);return yl(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===WA)t&&qp(`${hl} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),ml(`${hl} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}i(qA,"getOptimizedStartCodesIndices");function yl(e,t,r){switch(e.type){case"Disjunction":for(let a=0;a{if(typeof u=="number")Xi(u,t,r);else{const c=u;if(r===!0)for(let f=c.from;f<=c.to;f++)Xi(f,t,r);else{for(let f=c.from;f<=c.to&&f=Zi){const f=c.from>=Zi?c.from:Zi,d=c.to,m=br(f),g=br(d);for(let v=m;v<=g;v++)t[v]=v}}}});break;case"Group":yl(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&gl(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return Me(t)}i(yl,"firstCharOptimizedIndices");function Xi(e,t,r){const n=br(e);t[n]=n,r===!0&&VA(e,t)}i(Xi,"addOptimizedIdxToResult");function VA(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const a=br(n.charCodeAt(0));t[a]=a}else{const a=r.toLowerCase();if(a!==r){const s=br(a.charCodeAt(0));t[s]=s}}}i(VA,"handleIgnoreCase");function If(e,t){return Xa(e.value,r=>{if(typeof r=="number")return lt(t,r);{const n=r;return Xa(t,a=>n.from<=a&&a<=n.to)!==void 0}})}i(If,"findCode");function gl(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?re(e.value)?Ft(e.value,gl):gl(e.value):!1}i(gl,"isWholeOptional");var SD=class extends Wl{static{i(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){lt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?If(e,this.targetCharCodes)===void 0&&(this.found=!0):If(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function pu(e,t){if(t instanceof RegExp){const r=Js(t),n=new SD(e);return n.visit(r),n.found}else return Xa(t,r=>lt(e,r.charCodeAt(0)))!==void 0}i(pu,"canMatchCharCode");var kn="PATTERN",Ji="defaultMode",io="modes";function HA(e,t){t=Kp(t,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:i((I,R)=>R(),"tracer")});const r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{hE()});let n;r("Reject Lexer.NA",()=>{n=fu(e,I=>I[kn]===nt.NA)});let a=!1,s;r("Transform Patterns",()=>{a=!1,s=F(n,I=>{const R=I[kn];if(Er(R)){const P=R.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!R.ignoreCase?P:P.length===2&&P[0]==="\\"&&!lt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])?P[1]:Nf(R)}else{if(Nr(R))return a=!0,{exec:R};if(typeof R=="object")return a=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const P=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),z=new RegExp(P);return Nf(z)}}else throw Error("non exhaustive match")}})});let o,l,u,c,f;r("misc mapping",()=>{o=F(n,I=>I.tokenTypeIdx),l=F(n,I=>{const R=I.GROUP;if(R!==nt.SKIPPED){if(pt(R))return R;if(Cr(R))return!1;throw Error("non exhaustive match")}}),u=F(n,I=>{const R=I.LONGER_ALT;if(R)return re(R)?F(R,z=>Bh(n,z)):[Bh(n,R)]}),c=F(n,I=>I.PUSH_MODE),f=F(n,I=>B(I,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const I=Jp(t.lineTerminatorCharacters);d=F(n,R=>!1),t.positionTracking!=="onlyOffset"&&(d=F(n,R=>B(R,"LINE_BREAKS")?!!R.LINE_BREAKS:Xp(R,I)===!1&&pu(I,R.PATTERN)))});let m,g,v,b;r("Misc Mapping #2",()=>{m=F(n,Yp),g=F(s,pE),v=Rt(n,(I,R)=>{const P=R.GROUP;return pt(P)&&P!==nt.SKIPPED&&(I[P]=[]),I},{}),b=F(s,(I,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:d[R],isCustom:m[R],short:g[R],group:l[R],push:c[R],pop:f[R],tokenTypeIdx:o[R],tokenType:n[R]}))});let S=!0,w=[];return t.safeMode||r("First Char Optimization",()=>{w=Rt(n,(I,R,P)=>{if(typeof R.PATTERN=="string"){const z=R.PATTERN.charCodeAt(0),X=br(z);Oo(I,X,b[P])}else if(re(R.START_CHARS_HINT)){let z;K(R.START_CHARS_HINT,X=>{const Z=typeof X=="string"?X.charCodeAt(0):X,ce=br(Z);z!==ce&&(z=ce,Oo(I,ce,b[P]))})}else if(Er(R.PATTERN))if(R.PATTERN.unicode)S=!1,t.ensureOptimizations&&ml(`${hl} Unable to analyze < ${R.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const z=qA(R.PATTERN,t.ensureOptimizations);me(z)&&(S=!1),K(z,X=>{Oo(I,X,b[P])})}else t.ensureOptimizations&&ml(`${hl} TokenType: <${R.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),S=!1;return I},[])}),{emptyGroups:v,patternIdxToConfig:b,charCodeToPatternIdxToConfig:w,hasCustom:a,canBeOptimized:S}}i(HA,"analyzeTokenTypes");function YA(e,t){let r=[];const n=JA(e);r=r.concat(n.errors);const a=ZA(n.valid),s=a.valid;return r=r.concat(a.errors),r=r.concat(XA(s)),r=r.concat(aE(s)),r=r.concat(iE(s,t)),r=r.concat(sE(s)),r}i(YA,"validatePatterns");function XA(e){let t=[];const r=Nt(e,n=>Er(n[kn]));return t=t.concat(QA(r)),t=t.concat(tE(r)),t=t.concat(rE(r)),t=t.concat(nE(r)),t=t.concat(eE(r)),t}i(XA,"validateRegExpPattern");function JA(e){const t=Nt(e,a=>!B(a,kn)),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:_e.MISSING_PATTERN,tokenTypes:[a]})),n=cu(e,t);return{errors:r,valid:n}}i(JA,"findMissingPatterns");function ZA(e){const t=Nt(e,a=>{const s=a[kn];return!Er(s)&&!Nr(s)&&!B(s,"exec")&&!pt(s)}),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:_e.INVALID_PATTERN,tokenTypes:[a]})),n=cu(e,t);return{errors:r,valid:n}}i(ZA,"findInvalidPatterns");var wD=/[^\\][$]/;function QA(e){class t extends Wl{static{i(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const r=Nt(e,a=>{const s=a.PATTERN;try{const o=Js(s),l=new t;return l.visit(o),l.found}catch{return wD.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(QA,"findEndOfInputAnchor");function eE(e){const t=Nt(e,n=>n.PATTERN.test(""));return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:_e.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}i(eE,"findEmptyMatchRegExps");var ID=/[^\\[][\^]|^\^/;function tE(e){class t extends Wl{static{i(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const r=Nt(e,a=>{const s=a.PATTERN;try{const o=Js(s),l=new t;return l.visit(o),l.found}catch{return ID.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(tE,"findStartOfInputAnchor");function rE(e){const t=Nt(e,n=>{const a=n[kn];return a instanceof RegExp&&(a.multiline||a.global)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_e.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}i(rE,"findUnsupportedFlags");function nE(e){const t=[];let r=F(e,s=>Rt(e,(o,l)=>(s.PATTERN.source===l.PATTERN.source&&!lt(t,l)&&l.PATTERN!==nt.NA&&(t.push(l),o.push(l)),o),[]));r=Xs(r);const n=Nt(r,s=>s.length>1);return F(n,s=>{const o=F(s,u=>u.name);return{message:`The same RegExp pattern ->${jt(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:_e.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}i(nE,"findDuplicatePatterns");function aE(e){const t=Nt(e,n=>{if(!B(n,"GROUP"))return!1;const a=n.GROUP;return a!==nt.SKIPPED&&a!==nt.NA&&!pt(a)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:_e.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}i(aE,"findInvalidGroupType");function iE(e,t){const r=Nt(e,a=>a.PUSH_MODE!==void 0&&!lt(t,a.PUSH_MODE));return F(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:_e.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}i(iE,"findModesThatDoNotExist");function sE(e){const t=[],r=Rt(e,(n,a,s)=>{const o=a.PATTERN;return o===nt.NA||(pt(o)?n.push({str:o,idx:s,tokenType:a}):Er(o)&&lE(o)&&n.push({str:o.source,idx:s,tokenType:a})),n},[]);return K(e,(n,a)=>{K(r,({str:s,idx:o,tokenType:l})=>{if(a${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:u,type:_e.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}i(sE,"findUnreachablePatterns");function oE(e,t){if(Er(t)){if(uE(t))return!1;const r=t.exec(e);return r!==null&&r.index===0}else{if(Nr(t))return t(e,0,[],{});if(B(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}i(oE,"tryToMatchStrToPattern");function lE(e){return Xa([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}i(lE,"noMetaChar");function uE(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),B(e,io)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+io+`> property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),B(e,io)&&B(e,Ji)&&!B(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Ji}: <${e.defaultMode}>which does not exist +`,type:_e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),B(e,io)&&K(e.modes,(a,s)=>{K(a,(o,l)=>{if(Cr(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}> +`,type:_e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(B(o,"LONGER_ALT")){const u=re(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];K(u,c=>{!Cr(c)&&!lt(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${s}> +`,type:_e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}i(cE,"performRuntimeChecks");function fE(e,t,r){const n=[];let a=!1;const s=Xs(Gt(Me(e.modes))),o=fu(s,u=>u[kn]===nt.NA),l=Jp(r);return t&&K(o,u=>{const c=Xp(u,l);if(c!==!1){const d={message:mE(u,c),type:c.issue,tokenType:u};n.push(d)}else B(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(a=!0):pu(l,u.PATTERN)&&(a=!0)}),t&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:_e.NO_LINE_BREAKS_FLAGS}),n}i(fE,"performWarningRuntimeChecks");function dE(e){const t={},r=Tt(e);return K(r,n=>{const a=e[n];if(re(a))t[n]=[];else throw Error("non exhaustive match")}),t}i(dE,"cloneEmptyGroups");function Yp(e){const t=e.PATTERN;if(Er(t))return!1;if(Nr(t))return!0;if(B(t,"exec"))return!0;if(pt(t))return!1;throw Error("non exhaustive match")}i(Yp,"isCustomPattern");function pE(e){return pt(e)&&e.length===1?e.charCodeAt(0):!1}i(pE,"isShortPattern");var ND={test:i(function(e){const t=e.length;for(let r=this.lastIndex;r Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===_e.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}i(mE,"buildLineBreakIssueMessage");function Jp(e){return F(e,r=>pt(r)?r.charCodeAt(0):r)}i(Jp,"getCharCodes");function Oo(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Oo,"addToMapOfArrays");var Zi=256,Lo=[];function br(e){return e255?255+~~(e/255):e}}i(hE,"initCharCodeToOptimizedIndexMap");function ii(e,t){const r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}i(ii,"tokenStructuredMatcher");function _s(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}i(_s,"tokenStructuredMatcherNoCategories");var Kh=1,yE={};function si(e){const t=gE(e);vE(t),$E(t),TE(t),K(t,r=>{r.isParent=r.categoryMatches.length>0})}i(si,"augmentTokenTypes");function gE(e){let t=Ye(e),r=e,n=!0;for(;n;){r=Xs(Gt(F(r,s=>s.CATEGORIES)));const a=cu(r,t);t=t.concat(a),me(a)?n=!1:r=a}return t}i(gE,"expandCategories");function vE(e){K(e,t=>{Qp(t)||(yE[Kh]=t,t.tokenTypeIdx=Kh++),Pf(t)&&!re(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),Pf(t)||(t.CATEGORIES=[]),RE(t)||(t.categoryMatches=[]),AE(t)||(t.categoryMatchesMap={})})}i(vE,"assignTokenDefaultProps");function TE(e){K(e,t=>{t.categoryMatches=[],K(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(yE[n].tokenTypeIdx)})})}i(TE,"assignCategoriesTokensProp");function $E(e){K(e,t=>{Zp([],t)})}i($E,"assignCategoriesMapProp");function Zp(e,t){K(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),K(t.CATEGORIES,r=>{const n=e.concat(t);lt(n,r)||Zp(n,r)})}i(Zp,"singleAssignCategoriesToksMap");function Qp(e){return B(e,"tokenTypeIdx")}i(Qp,"hasShortKeyProperty");function Pf(e){return B(e,"CATEGORIES")}i(Pf,"hasCategoriesProperty");function RE(e){return B(e,"categoryMatches")}i(RE,"hasExtendingTokensTypesProperty");function AE(e){return B(e,"categoryMatchesMap")}i(AE,"hasExtendingTokensTypesMapProperty");function EE(e){return B(e,"tokenTypeIdx")}i(EE,"isTokenType");var kf={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,a,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}},_e;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(_e||(_e={}));var Qi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:kf,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Qi);var nt=class{static{i(this,"Lexer")}constructor(e,t=Qi){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);const{time:o,value:l}=Vp(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=$t({},Qi,t);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Qi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=ND;else if(this.config.lineTerminatorCharacters===Qi.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),re(e)?n={modes:{defaultMode:Ye(e)},defaultMode:Ji}:(a=!1,n=Ye(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(cE(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(fE(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},K(n.modes,(o,l)=>{n.modes[l]=fu(o,u=>Cr(u))});const s=Tt(n.modes);if(K(n.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(YA(o,s))}),me(this.lexerDefinitionErrors)){si(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=HA(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=$t({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=n.defaultMode,!me(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=F(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}K(this.lexerDefinitionWarning,o=>{qp(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Fe),this.trackStartLines===!1&&(this.computeNewColumn=Ks),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Fe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Rt(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(t.ensureOptimizations&&!me(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{KA()}),this.TRACE_INIT("toFastProperties",()=>{Hp(this)})})}tokenize(e,t=this.defaultMode){if(!me(this.lexerDefinitionErrors)){const n=F(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,a,s,o,l,u,c,f,d,m,g,v,b,S;const w=e,I=w.length;let R=0,P=0;const z=this.hasCustom?0:Math.floor(e.length/10),X=new Array(z),Z=[];let ce=this.trackStartLines?1:void 0,se=this.trackStartLines?1:void 0;const Se=dE(this.emptyGroups),k=this.trackStartLines,C=this.config.lineTerminatorsPattern;let y=0,E=[],T=[];const $=[],_=[];Object.freeze(_);let O=!1;const x=i(Y=>{if($.length===1&&Y.tokenType.PUSH_MODE===void 0){const q=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);Z.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:q})}else{$.pop();const q=Pn($);E=this.patternIdxToConfig[q],T=this.charCodeToPatternIdxToConfig[q],y=E.length;const Pe=this.canModeBeOptimized[q]&&this.config.safeMode===!1;T&&Pe?O=!0:O=!1}},"pop_mode");function D(Y){$.push(Y),T=this.charCodeToPatternIdxToConfig[Y],E=this.patternIdxToConfig[Y],y=E.length,y=E.length;const q=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;T&&q?O=!0:O=!1}i(D,"push_mode"),D.call(this,t);let G;const W=this.config.recoveryEnabled;for(;Rl.length){l=s,f=s.length,u=c,G=ke;break}}}break}}if(f!==-1){if(d=G.group,d!==void 0&&(l=l!==null?l:e.substring(R,R+f),m=G.tokenTypeIdx,g=this.createTokenInstance(l,R,m,G.tokenType,ce,se,f),this.handlePayload(g,u),d===!1?P=this.addToken(X,P,g):Se[d].push(g)),k===!0&&G.canLineTerminator===!0){let oe=0,Le,De;C.lastIndex=0;do l=l!==null?l:e.substring(R,R+f),Le=C.test(l),Le===!0&&(De=C.lastIndex-1,oe++);while(Le===!0);oe!==0?(ce=ce+oe,se=f-De,this.updateTokenEndLineColumnLocation(g,d,De,oe,ce,se,f)):se=this.computeNewColumn(se,f)}else se=this.computeNewColumn(se,f);R=R+f,this.handleModes(G,x,D,g)}else{const oe=R,Le=ce,De=se;let ke=W===!1;for(;ke===!1&&R ${wn(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:a}){const s="Expecting: ",l=` +but found: '`+jt(t).image+"'";if(n)return s+n+l;{const u=Rt(e,(m,g)=>m.concat(g),[]),c=F(u,m=>`[${F(m,g=>wn(g)).join(", ")}]`),d=`one of these possible Token sequences: +${F(c,(m,g)=>` ${g+1}. ${m}`).join(` +`)}`;return s+d+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+jt(t).image+"'";if(r)return a+r+o;{const u=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${F(e,c=>`[${F(c,f=>wn(f)).join(",")}]`).join(" ,")}>`;return a+u+o}}};Object.freeze(Ma);var kD={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- +inside top level rule: ->`+e.name+"<-"}},bn={buildDuplicateFoundError(e,t){function r(f){return f instanceof ve?f.terminalType.name:f instanceof it?f.nonTerminalName:""}i(r,"getExtraProductionArgument");const n=e.name,a=jt(t),s=a.idx,o=Lt(a),l=r(a),u=s>0;let c=`->${o}${u?s:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` +`),c},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=F(e.prefixPath,a=>wn(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(e){const t=e.alternation.idx===0?"":e.alternation.idx,r=e.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. +Only the last alternative may be empty. +`;else{const a=F(e.prefixPath,s=>wn(s)).join(", ");n+=`<${a}> may appears as a prefix path in all these alternatives. +`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(e){let t=Lt(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name,r=F(e.leftRecursionPath,s=>s.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof ri?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function bE(e,t){const r=new OD(e,t);return r.resolveRefs(),r.errors}i(bE,"resolveGrammar");var OD=class extends ni{static{i(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){K(Me(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:st.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},LD=class extends du{static{i(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ye(this.path.ruleStack).reverse(),this.occurrenceStack=Ye(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){me(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},DD=class extends LD{static{i(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(r),a=new mt({definition:n});this.possibleTokTypes=ai(a),this.found=!0}}},mu=class extends du{static{i(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},xD=class extends mu{static{i(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},Qh=class extends mu{static{i(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},MD=class extends mu{static{i(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},ey=class extends mu{static{i(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const n=jt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};function vl(e,t,r=[]){r=Ye(r);let n=[],a=0;function s(l){return l.concat(Ve(e,a+1))}i(s,"remainingPathWith");function o(l){const u=vl(s(l),t,r);return n.concat(u)}for(i(o,"getAlternativesForProd");r.length{me(u.definition)===!1&&(n=o(u.definition))}),n;if(l instanceof ve)r.push(l.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:Ve(e,a)}),n}i(vl,"possiblePathsFrom");function rm(e,t,r,n){const a="EXIT_NONE_TERMINAL",s=[a],o="EXIT_ALTERNATIVE";let l=!1;const u=t.length,c=u-n-1,f=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!me(d);){const m=d.pop();if(m===o){l&&Pn(d).idx<=c&&d.pop();continue}const g=m.def,v=m.idx,b=m.ruleStack,S=m.occurrenceStack;if(me(g))continue;const w=g[0];if(w===a){const I={idx:v,def:Ve(g),ruleStack:Cs(b),occurrenceStack:Cs(S)};d.push(I)}else if(w instanceof ve)if(v=0;I--){const R=w.definition[I],P={idx:v,def:R.definition.concat(Ve(g)),ruleStack:b,occurrenceStack:S};d.push(P),d.push(o)}else if(w instanceof mt)d.push({idx:v,def:w.definition.concat(Ve(g)),ruleStack:b,occurrenceStack:S});else if(w instanceof ri)d.push(_E(w,v,b,S));else throw Error("non exhaustive match")}return f}i(rm,"nextPossibleTokensAfter");function _E(e,t,r,n){const a=Ye(r);a.push(e.name);const s=Ye(n);return s.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:s}}i(_E,"expandTopLevelRule");var Re;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Re||(Re={}));function hu(e){if(e instanceof He||e==="Option")return Re.OPTION;if(e instanceof be||e==="Repetition")return Re.REPETITION;if(e instanceof At||e==="RepetitionMandatory")return Re.REPETITION_MANDATORY;if(e instanceof Et||e==="RepetitionMandatoryWithSeparator")return Re.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ht||e==="RepetitionWithSeparator")return Re.REPETITION_WITH_SEPARATOR;if(e instanceof yt||e==="Alternation")return Re.ALTERNATION;throw Error("non exhaustive match")}i(hu,"getProdType");function Of(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:a}=e,s=hu(n);return s===Re.ALTERNATION?Qs(t,r,a):eo(t,r,s,a)}i(Of,"getLookaheadPaths");function SE(e,t,r,n,a,s){const o=Qs(e,t,r),l=am(o)?_s:ii;return s(o,n,l,a)}i(SE,"buildLookaheadFuncForOr");function wE(e,t,r,n,a,s){const o=eo(e,t,a,r),l=am(o)?_s:ii;return s(o[0],l,n)}i(wE,"buildLookaheadFuncForOptionalProd");function IE(e,t,r,n){const a=e.length,s=Ft(e,o=>Ft(o,l=>l.length===1));if(t)return function(o){const l=F(o,u=>u.GATE);for(let u=0;uGt(u)),l=Rt(o,(u,c,f)=>(K(c,d=>{B(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),K(d.categoryMatches,m=>{B(u,m)||(u[m]=f)})}),u),{});return function(){const u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let o=0;os.length===1),a=e.length;if(n&&!r){const s=Gt(e);if(s.length===1&&me(s[0].categoryMatches)){const l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{const o=Rt(s,(l,u,c)=>(l[u.tokenTypeIdx]=!0,K(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){const l=this.LA(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;svl([o],1)),n=Lf(r.length),a=F(r,o=>{const l={};return K(o,u=>{const c=Do(u.partialPath);K(c,f=>{l[f]=!0})}),l});let s=r;for(let o=1;o<=t;o++){const l=s;s=Lf(l.length);for(let u=0;u{const w=Do(S.partialPath);K(w,I=>{a[u][I]=!0})})}}}}return n}i(nm,"lookAheadSequenceFromAlternatives");function Qs(e,t,r,n){const a=new PE(e,Re.ALTERNATION,n);return t.accept(a),nm(a.result,r)}i(Qs,"getLookaheadPathsForOr");function eo(e,t,r,n){const a=new PE(e,r);t.accept(a);const s=a.result,l=new GD(t,e,r).startWalking(),u=new mt({definition:s}),c=new mt({definition:l});return nm([u,c],n)}i(eo,"getLookaheadPathsForOptionalProd");function Tl(e,t){e:for(let r=0;r{const a=t[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}i(OE,"isStrictPrefixOfPath");function am(e){return Ft(e,t=>Ft(t,r=>Ft(r,n=>me(n.categoryMatches))))}i(am,"areTokenCategoriesNotUsed");function LE(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return F(t,r=>Object.assign({type:st.CUSTOM_LOOKAHEAD_VALIDATION},r))}i(LE,"validateLookahead");function DE(e,t,r,n){const a=_t(e,u=>xE(u,r)),s=qE(e,t,r),o=_t(e,u=>BE(u,r)),l=_t(e,u=>GE(u,e,n,r));return a.concat(s,o,l)}i(DE,"validateGrammar");function xE(e,t){const r=new FD;e.accept(r);const n=r.allProductions,a=QL(n,ME),s=Bt(a,l=>l.length>1);return F(Me(s),l=>{const u=jt(l),c=t.buildDuplicateFoundError(e,l),f=Lt(u),d={message:c,type:st.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:f,occurrence:u.idx},m=im(u);return m&&(d.parameter=m),d})}i(xE,"validateDuplicateProductions");function ME(e){return`${Lt(e)}_#_${e.idx}_#_${im(e)}`}i(ME,"identifyProductionForDuplicates");function im(e){return e instanceof ve?e.terminalType.name:e instanceof it?e.nonTerminalName:""}i(im,"getExtraProductionArgument");var FD=class extends ni{static{i(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function GE(e,t,r,n){const a=[];if(Rt(t,(o,l)=>l.name===e.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});a.push({message:o,type:st.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}i(GE,"validateRuleDoesNotAlreadyExist");function FE(e,t,r){const n=[];let a;return lt(t,e)||(a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:st.INVALID_RULE_OVERRIDE,ruleName:e})),n}i(FE,"validateRuleIsOverridden");function sm(e,t,r,n=[]){const a=[],s=ms(t.definition);if(me(s))return[];{const o=e.name;lt(s,e)&&a.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:st.LEFT_RECURSION,ruleName:o});const u=cu(s,n.concat([e])),c=_t(u,f=>{const d=Ye(n);return d.push(f),sm(e,f,r,d)});return a.concat(c)}}i(sm,"validateNoLeftRecursion");function ms(e){let t=[];if(me(e))return t;const r=jt(e);if(r instanceof it)t.push(r.referencedRule);else if(r instanceof mt||r instanceof He||r instanceof At||r instanceof Et||r instanceof ht||r instanceof be)t=t.concat(ms(r.definition));else if(r instanceof yt)t=Gt(F(r.definition,s=>ms(s.definition)));else if(!(r instanceof ve))throw Error("non exhaustive match");const n=bs(r),a=e.length>1;if(n&&a){const s=Ve(e);return t.concat(ms(s))}else return t}i(ms,"getFirstNoneTerminal");var om=class extends ni{static{i(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function zE(e,t){const r=new om;e.accept(r);const n=r.alternations;return _t(n,s=>{const o=Cs(s.definition);return _t(o,(l,u)=>{const c=rm([l],[],ii,1);return me(c)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:u}),type:st.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:u+1}]:[]})})}i(zE,"validateEmptyOrAlternative");function jE(e,t,r){const n=new om;e.accept(n);let a=n.alternations;return a=fu(a,o=>o.ignoreAmbiguities===!0),_t(a,o=>{const l=o.idx,u=o.maxLookahead||t,c=Qs(l,e,u,o),f=KE(c,o,e,r),d=WE(c,o,e,r);return f.concat(d)})}i(jE,"validateAmbiguousAlternationAlternatives");var zD=class extends ni{static{i(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function BE(e,t){const r=new om;e.accept(r);const n=r.alternations;return _t(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:st.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}i(BE,"validateTooManyAlts");function UE(e,t,r){const n=[];return K(e,a=>{const s=new zD;a.accept(s);const o=s.allProductions;K(o,l=>{const u=hu(l),c=l.maxLookahead||t,f=l.idx,m=eo(f,a,u,c)[0];if(me(Gt(m))){const g=r.buildEmptyRepetitionError({topLevelRule:a,repetition:l});n.push({message:g,type:st.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}i(UE,"validateSomeNonEmptyLookaheadPath");function KE(e,t,r,n){const a=[],s=Rt(e,(l,u,c)=>(t.definition[c].ignoreAmbiguities===!0||K(u,f=>{const d=[c];K(e,(m,g)=>{c!==g&&Tl(m,f)&&t.definition[g].ignoreAmbiguities!==!0&&d.push(g)}),d.length>1&&!Tl(a,f)&&(a.push(f),l.push({alts:d,path:f}))}),l),[]);return F(s,l=>{const u=F(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:u,prefixPath:l.path}),type:st.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:l.alts}})}i(KE,"checkAlternativesAmbiguities");function WE(e,t,r,n){const a=Rt(e,(o,l,u)=>{const c=F(l,f=>({idx:u,path:f}));return o.concat(c)},[]);return Xs(_t(a,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];const u=o.idx,c=o.path,f=Nt(a,m=>t.definition[m.idx].ignoreAmbiguities!==!0&&m.idx{const g=[m.idx+1,u+1],v=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:g,prefixPath:m.path}),type:st.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:v,alternatives:g}})}))}i(WE,"checkPrefixAlternativesAmbiguities");function qE(e,t,r){const n=[],a=F(t,s=>s.name);return K(e,s=>{const o=s.name;if(lt(a,o)){const l=r.buildNamespaceConflictError(s);n.push({message:l,type:st.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}i(qE,"checkTerminalAndNoneTerminalsNameSpace");function VE(e){const t=Kp(e,{errMsgProvider:kD}),r={};return K(e.rules,n=>{r[n.name]=n}),bE(r,t.errMsgProvider)}i(VE,"resolveGrammar");function HE(e){return e=Kp(e,{errMsgProvider:bn}),DE(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}i(HE,"validateGrammar");var YE="MismatchedTokenException",XE="NoViableAltException",JE="EarlyExitException",ZE="NotAllInputParsedException",QE=[YE,XE,JE,ZE];Object.freeze(QE);function Ss(e){return lt(QE,e.name)}i(Ss,"isRecognitionException");var yu=class extends Error{static{i(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},eC=class extends yu{static{i(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=YE}},jD=class extends yu{static{i(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=XE}},BD=class extends yu{static{i(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=ZE}},UD=class extends yu{static{i(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=JE}},Vu={},tC="InRuleRecoveryException",KD=class extends Error{static{i(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=tC}},WD=class{static{i(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=B(e,"recoveryEnabled")?e.recoveryEnabled:_r.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=rC)}getTokenToInsert(e){const t=Zs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=i(()=>{const d=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:d,ruleName:this.getCurrRuleFullName()}),g=new eC(m,u,this.LA(0));g.resyncedTokens=Cs(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(c,n)){f();return}else if(r.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(c,a)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new KD("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||me(t))return!1;const r=this.LA(1);return Xa(t,a=>this.tokenMatcher(r,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return lt(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const n=Xa(e,a=>tm(t,a));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Vu;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return F(e,(r,n)=>n===0?Vu:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){const e=F(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return Gt(e)}getFollowSetFromFollowKey(e){if(e===Vu)return[Br];const t=e.ruleName+e.idxInCallingRule+jA+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Br)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return Cs(t)}attemptInRepetitionRecovery(e,t,r,n,a,s,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),n=Ye(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return F(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function rC(e,t,r,n,a,s,o){const l=this.getKeyForAutomaticLookahead(n,a);let u=this.firstAfterRepMap[l];if(u===void 0){const m=this.getCurrRuleFullName(),g=this.getGAstProductions()[m];u=new s(g,a).startWalking(),this.firstAfterRepMap[l]=u}let c=u.token,f=u.occurrence;const d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=Br,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,o)&&this.tryInRepetitionRecovery(e,t,r,c)}i(rC,"attemptInRepetitionRecovery");var qD=4,Hr=8,nC=1<sm(t,t,bn))}validateEmptyOrAlternatives(e){return _t(e,t=>zE(t,bn))}validateAmbiguousAlternationAlternatives(e,t){return _t(e,r=>jE(r,t,bn))}validateSomeNonEmptyLookaheadPath(e,t){return UE(e,t,bn)}buildLookaheadForAlternation(e){return SE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,IE)}buildLookaheadForOptional(e){return wE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,hu(e.prodType),NE)}},VD=class{static{i(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=B(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:_r.dynamicTokensEnabled,this.maxLookahead=B(e,"maxLookahead")?e.maxLookahead:_r.maxLookahead,this.lookaheadStrategy=B(e,"lookaheadStrategy")?e.lookaheadStrategy:new lm({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){K(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:n,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=iC(t);K(r,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${Lt(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:t,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Mo(this.fullRuleNameToShort[t.name],nC,u.idx);this.setLaFuncCache(d,f)})}),K(n,u=>{this.computeLookaheadFunc(t,u.idx,Df,"Repetition",u.maxLookahead,Lt(u))}),K(a,u=>{this.computeLookaheadFunc(t,u.idx,aC,"Option",u.maxLookahead,Lt(u))}),K(s,u=>{this.computeLookaheadFunc(t,u.idx,xf,"RepetitionMandatory",u.maxLookahead,Lt(u))}),K(o,u=>{this.computeLookaheadFunc(t,u.idx,xo,"RepetitionMandatoryWithSeparator",u.maxLookahead,Lt(u))}),K(l,u=>{this.computeLookaheadFunc(t,u.idx,Mf,"RepetitionWithSeparator",u.maxLookahead,Lt(u))})})})}computeLookaheadFunc(e,t,r,n,a,s){this.TRACE_INIT(`${s}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),l=Mo(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Mo(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},HD=class extends ni{static{i(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},so=new HD;function iC(e){so.reset(),e.accept(so);const t=so.dslMethods;return so.reset(),t}i(iC,"collectMethods");function Gf(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${s.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}i(uC,"createBaseSemanticVisitorConstructor");function cC(e,t,r){const n=i(function(){},"derivedConstructor");um(n,e+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return K(t,s=>{a[s]=lC}),n.prototype=a,n.prototype.constructor=n,n}i(cC,"createBaseVisitorConstructorWithDefaults");var zf;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(zf||(zf={}));function fC(e,t){return dC(e,t)}i(fC,"validateVisitor");function dC(e,t){const r=Nt(t,a=>Nr(e[a])===!1),n=F(r,a=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:zf.MISSING_METHOD,methodName:a}));return Xs(n)}i(dC,"validateMissingCstMethods");var XD=class{static{i(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=B(e,"nodeLocationTracking")?e.nodeLocationTracking:_r.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Fe,this.cstFinallyStateUpdate=Fe,this.cstPostTerminal=Fe,this.cstPostNonTerminal=Fe,this.cstPostRule=Fe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ff,this.setNodeLocationFromNode=Ff,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Gf,this.setNodeLocationFromNode=Gf,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=Fe,this.setInitialNodeLocation=Fe;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];sC(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];oC(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(Cr(this.baseCstVisitorConstructor)){const e=uC(this.className,Tt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Cr(this.baseCstVisitorWithDefaultsConstructor)){const e=cC(this.className,Tt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},JD=class{static{i(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):$l}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?$l:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},ZD=class{static{i(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,r=Rl){if(lt(this.definedRulesNames,e)){const s={message:bn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:st.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=Rl){const n=FE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const a=this.defineRule(e,t,r);return this[e]=a,a}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(Ss(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return DA(Me(this.gastProductionsCache))}},QD=class{static{i(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=_s,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},B(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(re(e)){if(me(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(re(e))this.tokensMap=Rt(e,(a,s)=>(a[s.name]=s,a),{});else if(B(e,"modes")&&Ft(Gt(Me(e.modes)),EE)){const a=Gt(Me(e.modes)),s=Wp(a);this.tokensMap=Rt(s,(o,l)=>(o[l.name]=l,o),{})}else if(wt(e))this.tokensMap=Ye(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Br;const r=B(e,"modes")?Gt(Me(e.modes)):Me(e),n=Ft(r,a=>me(a.categoryMatches));this.tokenMatcher=n?_s:ii,si(Me(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=B(r,"resyncEnabled")?r.resyncEnabled:Rl.resyncEnabled,a=B(r,"recoveryValueFunc")?r.recoveryValueFunc:Rl.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(n.call(this)===!0)return a.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(xf,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const s=t.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=t;if(n.call(this)===!0){let s=this.doSingleRepetition(a);for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,xf,e,MD)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(xo,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,ey],o,xo,e,ey)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(Df,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=i(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=t;let s=!0;for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,Df,e,xD,s)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Mf,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,Qh],o,Mf,e,Qh)}}repetitionSepSecondInternal(e,t,r,n,a){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,a],r,xo,e,a)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(nC,t),n=re(e)?e:e.DEF,s=this.getLaFuncFromCache(r).call(this,n);if(s!==void 0)return n[s].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new BD(t,e))}}subruleInternal(e,t,r){let n;try{const a=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,a),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}}subruleInternalError(e,t,r){throw Ss(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),n=a):this.consumeInternalError(e,a,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const a=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new eC(n,t,a))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(a){throw a.name===tC?r:a}}else throw r}saveRecogState(){const e=this.errors,t=Ye(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Br)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},ex=class{static{i(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=B(e,"errorMessageProvider")?e.errorMessageProvider:_r.errorMessageProvider}SAVE_ERROR(e){if(Ss(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ye(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ye(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],o=eo(e,a,t,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new UD(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=Qs(e,n,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new jD(l,this.LA(1),o))}},tx=class{static{i(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(Cr(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return rm([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=jt(e.ruleStack),n=this.getGAstProductions()[t];return new DD(n,e).startWalking()}},gu={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(gu);var ty=!0,ry=Math.pow(2,Hr)-1,pC=za({name:"RECORDING_PHASE_TOKEN",pattern:nt.NA});si([pC]);var mC=Zs(pC,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(mC);var rx={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},nx=class{static{i(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return $l}topLevelRuleRecord(e,t){try{const r=new ri({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return $a.call(this,He,e,t)}atLeastOneInternalRecord(e,t){$a.call(this,At,t,e)}atLeastOneSepFirstInternalRecord(e,t){$a.call(this,Et,t,e,ty)}manyInternalRecord(e,t){$a.call(this,be,t,e)}manySepFirstInternalRecord(e,t){$a.call(this,ht,t,e,ty)}orInternalRecord(e,t){return hC.call(this,e,t)}subruleInternalRecord(e,t,r){if(ws(t),!e||B(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=Pn(this.recordingProdStack),a=e.ruleName,s=new it({idx:t,nonTerminalName:a,label:r?.LABEL,referencedRule:void 0});return n.definition.push(s),this.outputCst?rx:gu}consumeInternalRecord(e,t,r){if(ws(t),!Qp(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const n=Pn(this.recordingProdStack),a=new ve({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(a),mC}};function $a(e,t,r,n=!1){ws(r);const a=Pn(this.recordingProdStack),s=Nr(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),B(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),gu}i($a,"recordProd");function hC(e,t){ws(t);const r=Pn(this.recordingProdStack),n=re(e)===!1,a=n===!1?e:e.DEF,s=new yt({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});B(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=NA(a,l=>Nr(l.GATE));return s.hasPredicates=o,r.definition.push(s),K(a,l=>{const u=new mt({definition:[]});s.definition.push(u),B(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:B(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),gu}i(hC,"recordOrProd");function jf(e){return e===0?"":`${e}`}i(jf,"getIdxSuffix");function ws(e){if(e<0||e>ry){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${ry+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}i(ws,"assertMethodIdxIsValid");var ax=class{static{i(this,"PerformanceTracer")}initPerformanceTracer(e){if(B(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=_r.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:n,value:a}=Vp(t),s=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,a}else return t()}};function yC(e,t){t.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,a);s&&(s.get||s.set)?Object.defineProperty(e.prototype,a,s):e.prototype[a]=r.prototype[a]})})}i(yC,"applyMixins");var $l=Zs(Br,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze($l);var _r=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ma,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Rl=Object.freeze({recoveryValueFunc:i(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),st;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(st||(st={}));function Bf(e=void 0){return function(){return e}}i(Bf,"EMPTY_ALT");var cm=class gC{static{i(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Hp(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),K(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let l;this.TRACE_INIT(`${a} Rule`,()=>{l=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=VE({rules:Me(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(me(n)&&this.skipValidations===!1){const a=HE({rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),errMsgProvider:bn,grammarName:r}),s=LE({lookaheadStrategy:this.lookaheadStrategy,rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,s)}}),me(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=BA(Me(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,s;(s=(a=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(a,{rules:Me(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Me(this.gastProductionsCache))})),!gC.DEFER_DEFINITION_ERRORS_HANDLING&&!me(this.definitionErrors))throw t=F(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${t.join(` +------------------------------- +`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),B(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=B(r,"skipValidations")?r.skipValidations:_r.skipValidations}};cm.DEFER_DEFINITION_ERRORS_HANDLING=!1;yC(cm,[WD,VD,XD,JD,QD,ZD,ex,tx,nx,ax]);var ix=class extends cm{static{i(this,"EmbeddedActionsParser")}constructor(e,t=_r){const r=Ye(t);r.outputCst=!1,super(e,r)}};function vC(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r-1}i(_C,"listCacheHas");var fx=_C;function SC(e,t){var r=this.__data__,n=vu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(SC,"listCacheSet");var dx=SC;function Hn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&vM?new sb:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=QM}i(Ib,"isLength");var pm=Ib,e1="[object Arguments]",t1="[object Array]",r1="[object Boolean]",n1="[object Date]",a1="[object Error]",i1="[object Function]",s1="[object Map]",o1="[object Number]",l1="[object Object]",u1="[object RegExp]",c1="[object Set]",f1="[object String]",d1="[object WeakMap]",p1="[object ArrayBuffer]",m1="[object DataView]",h1="[object Float32Array]",y1="[object Float64Array]",g1="[object Int8Array]",v1="[object Int16Array]",T1="[object Int32Array]",$1="[object Uint8Array]",R1="[object Uint8ClampedArray]",A1="[object Uint16Array]",E1="[object Uint32Array]",ge={};ge[h1]=ge[y1]=ge[g1]=ge[v1]=ge[T1]=ge[$1]=ge[R1]=ge[A1]=ge[E1]=!0;ge[e1]=ge[t1]=ge[p1]=ge[r1]=ge[m1]=ge[n1]=ge[a1]=ge[i1]=ge[s1]=ge[o1]=ge[l1]=ge[u1]=ge[c1]=ge[f1]=ge[d1]=!1;function Nb(e){return Ja(e)&&pm(e.length)&&!!ge[oi(e)]}i(Nb,"baseIsTypedArray");var C1=Nb;function Pb(e){return function(t){return e(t)}}i(Pb,"baseUnary");var b1=Pb,kb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hs=kb&&typeof module=="object"&&module&&!module.nodeType&&module,_1=hs&&hs.exports===kb,Xu=_1&&kC.process,S1=(function(){try{var e=hs&&hs.require&&hs.require("util").types;return e||Xu&&Xu.binding&&Xu.binding("util")}catch{}})(),dy=S1,py=dy&&dy.isTypedArray,w1=py?b1(py):C1,mm=w1,I1=Object.prototype,N1=I1.hasOwnProperty;function Ob(e,t){var r=ot(e),n=!r&&Au(e),a=!r&&!n&&Al(e),s=!r&&!n&&!a&&mm(e),o=r||n||a||s,l=o?BM(e.length,String):[],u=l.length;for(var c in e)(t||N1.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wb(c,u)))&&l.push(c);return l}i(Ob,"arrayLikeKeys");var P1=Ob,k1=Object.prototype;function Lb(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||k1;return e===r}i(Lb,"isPrototype");var Db=Lb;function xb(e,t){return function(r){return e(t(r))}}i(xb,"overArg");var O1=xb,L1=O1(Object.keys,Object),D1=L1,x1=Object.prototype,M1=x1.hasOwnProperty;function Mb(e){if(!Db(e))return D1(e);var t=[];for(var r in Object(e))M1.call(e,r)&&r!="constructor"&&t.push(r);return t}i(Mb,"baseKeys");var Gb=Mb;function Fb(e){return e!=null&&pm(e.length)&&!FC(e)}i(Fb,"isArrayLike");var Eu=Fb;function zb(e){return Eu(e)?P1(e):Gb(e)}i(zb,"keys");var hm=zb;function jb(e){return xM(e,hm,jM)}i(jb,"getAllKeys");var my=jb,G1=1,F1=Object.prototype,z1=F1.hasOwnProperty;function Bb(e,t,r,n,a,s){var o=r&G1,l=my(e),u=l.length,c=my(t),f=c.length;if(u!=f&&!o)return!1;for(var d=u;d--;){var m=l[d];if(!(o?m in t:z1.call(t,m)))return!1}var g=s.get(e),v=s.get(t);if(g&&v)return g==t&&v==e;var b=!0;s.set(e,t),s.set(t,e);for(var S=o;++dEm(e,t,o));return Qn(e,t,n,r,...a)}i(L_,"alternation");function D_(e,t,r){const n=Ge(e,t,r,{type:Ur});kr(e,n);const a=Qn(e,t,n,r,Yr(e,t,r));return x_(e,t,r,a)}i(D_,"option");function Yr(e,t,r){const n=MG(vr(r.definition,a=>Em(e,t,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:G_(e,n)}i(Yr,"block");function Cm(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:BG});kr(e,l);const u=Ge(e,t,r,{type:__});return s.loopback=l,u.loopback=l,e.decisionMap[On(t,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Ie(o,l),a===void 0?(Ie(l,s),Ie(l,u)):(Ie(l,u),Ie(l,a.left),Ie(a.right,s)),{left:s,right:u}}i(Cm,"plus");function bm(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:jG});kr(e,l);const u=Ge(e,t,r,{type:__}),c=Ge(e,t,r,{type:zG});return l.loopback=c,u.loopback=c,Ie(l,s),Ie(l,u),Ie(o,c),a!==void 0?(Ie(c,u),Ie(c,a.left),Ie(a.right,s)):Ie(c,l),e.decisionMap[On(t,a?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}i(bm,"star");function x_(e,t,r,n){const a=n.left,s=n.right;return Ie(a,s),e.decisionMap[On(t,"Option",r.idx)]=a,n}i(x_,"optional");function kr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}i(kr,"defineDecisionState");function Qn(e,t,r,n,...a){const s=Ge(e,t,n,{type:FG,start:r});r.end=s;for(const l of a)l!==void 0?(Ie(r,l.left),Ie(l.right,s)):Ie(r,s);const o={left:r,right:s};return e.decisionMap[On(t,M_(n),n.idx)]=r,o}i(Qn,"makeAlts");function M_(e){if(e instanceof yt)return"Alternation";if(e instanceof He)return"Option";if(e instanceof be)return"Repetition";if(e instanceof ht)return"RepetitionWithSeparator";if(e instanceof At)return"RepetitionMandatory";if(e instanceof Et)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}i(M_,"getProdType");function G_(e,t){const r=t.length;for(let s=0;se.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}};function _m(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}i(_m,"getATNConfigKey");function B_(e,t,r){for(var n=-1,a=e.length;++n0&&r(l)?t>1?Sm(l,t-1,r,n,a):yb(a,l):n||(a[a.length]=l)}return a}i(Sm,"baseFlatten");var q_=Sm;function V_(e,t){return q_(vr(e,t),1)}i(V_,"flatMap");var VG=V_;function H_(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s-1}i(Z_,"arrayIncludes");var ZG=Z_;function Q_(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=aF){var c=t?null:nF(e);if(c)return dm(c);o=!1,a=ub,u=new sb}else u=t?[]:l;e:for(;++n{const a=n.toString();let s=r[a];return s!==void 0||(s={atnStartState:e,decision:t,states:{}},r[a]=s),s}}i(fS,"createDFACache");var dS=class{static{i(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=w_(e.rules),this.dfas=pS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=On(r,"Alternation",t),c=this.atn.decisionMap[l].decision,f=vr(Of({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),d=>vr(d,m=>m[0]));if(Hf(f,!1)&&!a){const d=_y(f,(m,g,v)=>(Ju(g,b=>{b&&(m[b.tokenTypeIdx]=v,Ju(b.categoryMatches,S=>{m[S]=v}))}),m),{});return n?function(m){var g;const v=this.LA(1),b=d[v.tokenTypeIdx];if(m!==void 0&&b!==void 0){const S=(g=m[b])===null||g===void 0?void 0:g.GATE;if(S!==void 0&&S.call(this)===!1)return}return b}:function(){const m=this.LA(1);return d[m.tokenTypeIdx]}}else return n?function(d){const m=new dS,g=d===void 0?0:d.length;for(let b=0;bvr(d,m=>m[0]));if(Hf(f)&&f[0][0]&&!a){const d=f[0],m=oF(d);if(m.length===1&&mF(m[0].categoryMatches)){const v=m[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const g=_y(m,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,Ju(b.categoryMatches,S=>{v[S]=!0})),v),{});return function(){const v=this.LA(1);return g[v.tokenTypeIdx]===!0}}}return function(){const d=Fo.call(this,s,c,Sy,o);return typeof d=="object"?!1:d===0}}};function Hf(e,t=!0){const r=new Set;for(const n of e){const a=new Set;for(const s of n){if(s===void 0){if(t)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const l of o)if(r.has(l)){if(!a.has(l))return!1}else r.add(l),a.add(l)}}return!0}i(Hf,"isLL1Sequence");function pS(e){const t=e.decisionStates.length,r=Array(t);for(let n=0;nwn(a)).join(", "),r=e.production.idx===0?"":e.production.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${vS(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}i(gS,"buildAmbiguityError");function vS(e){if(e instanceof it)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof yt)return"OR";if(e instanceof At)return"AT_LEAST_ONE";if(e instanceof Et)return"AT_LEAST_ONE_SEP";if(e instanceof ht)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(vS,"getProductionDslName");function TS(e,t,r){const n=VG(t.configs.elements,s=>s.state.transitions),a=sF(n.filter(s=>s instanceof Rm).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:e}}i(TS,"buildAdaptivePredictError");function $S(e,t){return e.edges[t.tokenTypeIdx]}i($S,"getExistingTargetState");function RS(e,t,r){const n=new Vf,a=[];for(const o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===to){a.push(o);continue}const l=o.state.transitions.length;for(let u=0;u0&&!_S(s))for(const o of a)s.add(o);return s}i(RS,"computeReachSet");function AS(e,t){if(e instanceof Rm&&tm(t,e.tokenType))return e.target}i(AS,"getReachableTarget");function ES(e,t){let r;for(const n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}i(ES,"getUniqueAlt");function wm(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}i(wm,"newDFAState");function Yf(e,t,r,n){return n=Im(e,n),t.edges[r.tokenTypeIdx]=n,n}i(Yf,"addDFAEdge");function Im(e,t){if(t===El)return t;const r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}i(Im,"addDFAState");function CS(e){const t=new Vf,r=e.transitions.length;for(let n=0;n0){const a=[...e.stack],o={state:a.pop(),alt:e.alt,stack:a};ks(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}i(NS,"hasConflictingAltSet");function PS(e){for(const t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}i(PS,"hasStateAssociatedWithOneAlt");Ds();var kS=class{static{i(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Pm(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new Pu;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new Cl(e.startOffset,e.image.length,Ts(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const a of e){const s=new Cl(a.startOffset,a.image.length,Ts(a),a.tokenType,!0);s.root=this.rootNode,t.push(s)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const a=r.container.content.indexOf(r);if(a>0){r.container.content.splice(a,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},Nm=class{static{i(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},Cl=class extends Nm{static{i(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,r,n,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},Pu=class extends Nm{static{i(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new vF(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},vF=class OS extends Array{static{i(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,OS.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(const r of t)r.container=this.parent}},Pm=class extends Pu{static{i(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},bl=Symbol("Datatype");function zo(e){return e.$type===bl}i(zo,"isDataTypeNode");var wy="​",LS=i(e=>e.endsWith(wy)?e:e+wy,"withRuleSuffix"),km=class{static{i(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new $F(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new GS(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},DS=class extends km{static{i(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new kS,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e);let n;qa(e)&&(n=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(LS(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,a),at(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===bl?s.value="":t!==void 0&&(s.$infixName=t)}return r(n),a?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){const n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){const a=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:l}=this.getAssignment(r),u=this.current;if(o){const c=Rr(r)?n.image:this.converter.convert(n.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(zo(u)){let c=n.image;Rr(r)||(c=this.converter.convert(c,s).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,a){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,a)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,n,s))}}performSubruleAssignment(e,t,r){const{assignment:n,crossRef:a}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,a);else if(!n){const s=this.current;if(zo(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const a={$type:e};this.stack.push(a),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):zo(e)?this.converter.convert(e.value,e.$cstNode):(Nd(this.astReflection,e),e)}constructInfix(e,t){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let a=0,s=-1;for(let v=0;vs?(s=S.precedence,a=v):S.precedence===s&&(S.rightAssoc||(a=v))}const o=n.slice(0,a),l=n.slice(a+1),u=r.slice(0,a+1),c=r.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},m=this.constructInfix(f,t),g=this.constructInfix(d,t);return{$type:e.$type,$cstNode:e.$cstNode,left:m,operator:n[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=xn(e,$r);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Gn(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,a){const s=this.current;let o;switch(a==="single"&&typeof r=="string"?o=this.linker.buildReference(s,t,n,r):a==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(s,t,n,r):o=r,e){case"=":{s[t]=o;break}case"?=":{s[t]=!0;break}case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,a]of Object.entries(t)){const s=e[n];s===void 0?e[n]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[n]=a)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},xS=class{static{i(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return Ma.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ma.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ma.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ma.buildEarlyExitMessage(e)}},Om=class extends xS{static{i(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},MS=class extends km{static{i(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const r=this.wrapper.DEFINE_RULE(LS(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,a){this.before(n),this.wrapper.wrapSubrule(e,t,a),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},TF={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Om},GS=class extends ix{static{i(this,"ChevrotainWrapper")}constructor(e,t){const r=t&&"maxLookahead"in t;super(e,{...TF,lookaheadStrategy:r?new lm({maxLookahead:t.maxLookahead}):new gF({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},$F=class extends GS{static{i(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};function ku(e,t,r){return FS({parser:t,tokens:r,ruleNames:new Map},e),t}i(ku,"createParser");function FS(e,t){const r=Vl(t,!1),n=ue(t.rules).filter(at).filter(s=>r.has(s));for(const s of n){const o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(s,Kr(o,s.definition))}const a=ue(t.rules).filter(qa).filter(s=>r.has(s));for(const s of a)e.parser.rule(s,zS(e,s))}i(FS,"buildRules");function zS(e,t){const r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(It(r))throw new Error("Cannot use terminal rule in infix expression");const n=t.operators.precedences.flatMap(g=>g.operators),a={$type:"Group",elements:[]},s={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(s,o);const u={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...s,$container:o};o.elements.push(u,c);const d=n.map(g=>e.tokens[g.value]).map((g,v)=>({ALT:i(()=>e.parser.consume(v,g,u),"ALT")}));let m;return g=>{m??(m=Ou(e,r)),e.parser.subrule(0,m,!1,s,g),e.parser.many(0,{DEF:i(()=>{e.parser.alternatives(0,d),e.parser.subrule(1,m,!1,c,g)},"DEF")})}}i(zS,"buildInfixRule");function Kr(e,t,r=!1){let n;if(Rr(t))n=VS(e,t);else if(zr(t))n=jS(e,t);else if($r(t))n=Kr(e,t.terminal);else if(Gn(t))n=Lm(e,t);else if(Ar(t))n=BS(e,t);else if(Gl(t))n=KS(e,t);else if(Bl(t))n=WS(e,t);else if(Fn(t))n=qS(e,t);else if(Md(t)){const a=e.consume++;n=i(()=>e.parser.consume(a,Br,t),"method")}else throw new Kl(t.$cstNode,`Unexpected element type: ${t.$type}`);return Dm(e,r?void 0:Os(t),n,t.cardinality)}i(Kr,"buildElement");function jS(e,t){const r=Nn(t);return()=>e.parser.action(r,t)}i(jS,"buildAction");function BS(e,t){const r=t.rule.ref;if(Mn(r)){const n=e.subrule++,a=at(r)&&r.fragment,s=t.arguments.length>0?US(r,t.arguments):()=>({});let o;return l=>{o??(o=Ou(e,r)),e.parser.subrule(n,o,a,t,s(l))}}else if(It(r)){const n=e.consume++,a=_l(e,r.name);return()=>e.parser.consume(n,a,t)}else if(r)qr();else throw new Kl(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}i(BS,"buildRuleCall");function US(e,t){if(t.some(n=>n.calledByName)){const n=t.map(a=>({parameterName:a.parameter?.ref?.name,predicate:Dt(a.value)}));return a=>{const s={};for(const{parameterName:o,predicate:l}of n)o&&(s[o]=l(a));return s}}else{const n=t.map(a=>Dt(a.value));return a=>{const s={};for(let o=0;ot(n)||r(n)}else if(Dd(e)){const t=Dt(e.left),r=Dt(e.right);return n=>t(n)&&r(n)}else if(zd(e)){const t=Dt(e.value);return r=>!t(r)}else if(jd(e)){const t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(Od(e)){const t=!!e.true;return()=>t}qr()}i(Dt,"buildPredicate");function KS(e,t){if(t.elements.length===1)return Kr(e,t.elements[0]);{const r=[];for(const a of t.elements){const s={ALT:Kr(e,a,!0)},o=Os(a);o&&(s.GATE=Dt(o)),r.push(s)}const n=e.or++;return a=>e.parser.alternatives(n,r.map(s=>{const o={ALT:i(()=>s.ALT(a),"ALT")},l=s.GATE;return l&&(o.GATE=()=>l(a)),o}))}}i(KS,"buildAlternatives");function WS(e,t){if(t.elements.length===1)return Kr(e,t.elements[0]);const r=[];for(const l of t.elements){const u={ALT:Kr(e,l,!0)},c=Os(l);c&&(u.GATE=Dt(c)),r.push(u)}const n=e.or++,a=i((l,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${l}_${c}`},"idFunc"),s=i(l=>e.parser.alternatives(n,r.map((u,c)=>{const f={ALT:i(()=>!0,"ALT")},d=e.parser;f.ALT=()=>{if(u.ALT(l),!d.isRecording()){const g=a(n,d);d.unorderedGroups.get(g)||d.unorderedGroups.set(g,[]);const v=d.unorderedGroups.get(g);typeof v?.[c]>"u"&&(v[c]=!0)}};const m=u.GATE;return m?f.GATE=()=>m(l):f.GATE=()=>!d.unorderedGroups.get(a(n,d))?.[c],f})),"alternatives"),o=Dm(e,Os(t),s,"*");return l=>{o(l),e.parser.isRecording()||e.parser.unorderedGroups.delete(a(n,e.parser))}}i(WS,"buildUnorderedGroup");function qS(e,t){const r=t.elements.map(n=>Kr(e,n));return n=>r.forEach(a=>a(n))}i(qS,"buildGroup");function Os(e){if(Fn(e))return e.guardCondition}i(Os,"getGuardCondition");function Lm(e,t,r=t.terminal){if(r)if(Ar(r)&&at(r.rule.ref)){const n=r.rule.ref,a=e.subrule++;let s;return o=>{s??(s=Ou(e,n)),e.parser.subrule(a,s,!1,t,o)}}else if(Ar(r)&&It(r.rule.ref)){const n=e.consume++,a=_l(e,r.rule.ref.name);return()=>e.parser.consume(n,a,t)}else if(Rr(r)){const n=e.consume++,a=_l(e,r.value);return()=>e.parser.consume(n,a,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const a=Jl(t.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+Nn(t.type.ref));return Lm(e,t,a)}}i(Lm,"buildCrossReference");function VS(e,t){const r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}i(VS,"buildKeyword");function Dm(e,t,r,n){const a=t&&Dt(t);if(!n)if(a){const s=e.or++;return o=>e.parser.alternatives(s,[{ALT:i(()=>r(o),"ALT"),GATE:i(()=>a(o),"GATE")},{ALT:Bf(),GATE:i(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const s=e.many++;return o=>e.parser.many(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const s=e.many++;if(a){const o=e.or++;return l=>e.parser.alternatives(o,[{ALT:i(()=>e.parser.atLeastOne(s,{DEF:i(()=>r(l),"DEF")}),"ALT"),GATE:i(()=>a(l),"GATE")},{ALT:Bf(),GATE:i(()=>!a(l),"GATE")}])}else return o=>e.parser.atLeastOne(s,{DEF:i(()=>r(o),"DEF")})}else if(n==="?"){const s=e.optional++;return o=>e.parser.optional(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else qr()}i(Dm,"wrap");function Ou(e,t){const r=HS(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}i(Ou,"getRule");function HS(e,t){if(Mn(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,a=t.$type;for(;!at(n);)(Fn(n)||Gl(n)||Bl(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,e.ruleNames.set(t,a),a}}i(HS,"getRuleName");function _l(e,t){const r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}i(_l,"getToken");function xm(e){const t=e.Grammar,r=e.parser.Lexer,n=new MS(e);return ku(t,n,r.definition),n.finalize(),n}i(xm,"createCompletionParser");function Mm(e){const t=Gm(e);return t.finalize(),t}i(Mm,"createLangiumParser");function Gm(e){const t=e.Grammar,r=e.parser.Lexer,n=new DS(e);return ku(t,n,r.definition)}i(Gm,"prepareLangiumParser");var Lu=class{static{i(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const r=ue(Vl(e,!1)),n=this.buildTerminalTokens(r),a=this.buildKeywordTokens(r,n,t);return a.push(...n),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(It).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=js(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=ql(t)?nt.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Mn).flatMap(n=>Ir(n).filter(Rr)).distinct(n=>n.value).toArray().sort((n,a)=>a.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){const n=this.buildKeywordPattern(e,r),a={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,t){return t?new RegExp(ti(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{const a=n?.PATTERN;return a?.source&&up("^"+a.source+"$",e.value)&&r.push(n),r},[])}},Fm=class{static{i(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(Gn(r)&&(r=mp(r)),Ar(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Jt.convertInt(t);case"STRING":return Jt.convertString(t);case"ID":return Jt.convertID(t)}switch(Ep(e)?.toLowerCase()){case"number":return Jt.convertNumber(t);case"boolean":return Jt.convertBoolean(t);case"bigint":return Jt.convertBigint(t);case"date":return Jt.convertDate(t);default:return t}}},Jt;(function(e){function t(c){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}i(Du,"delayNextTick");var jo=0,YS=10;function xu(){return jo=performance.now(),new pe.CancellationTokenSource}i(xu,"startCancelableOperation");function zm(e){YS=e}i(zm,"setInterruptionPeriod");var er=Symbol("OperationCancelled");function ea(e){return e===er}i(ea,"isOperationCancelled");async function ze(e){if(e===pe.CancellationToken.None)return;const t=performance.now();if(t-jo>=YS&&(jo=t,await Du(),jo=performance.now()),e.isCancellationRequested)throw er}i(ze,"interruptAndCheck");var Sr=class{static{i(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},Iy=class Xf{static{i(this,"FullTextDocument")}constructor(t,r,n,a){this._uri=t,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(const n of t)if(Xf.isIncremental(n)){const a=Bm(n.range),s=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);const l=Math.max(a.start.line,0),u=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Jf(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;mt?a=o:n=o+1}const s=n-1;return t=this.ensureBeforeEOL(t,r[s]),{line:s,character:t-r[s]}}offsetAt(t){const r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;const n=r[t.line];if(t.character<=0)return n;const a=t.line+1r&&jm(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},Sl;(function(e){function t(a,s,o,l){return new Iy(a,s,o,l)}i(t,"create"),e.create=t;function r(a,s,o){if(a instanceof Iy)return a.update(s,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}i(r,"update"),e.update=r;function n(a,s){const o=a.getText(),l=wl(s.map(XS),(f,d)=>{const m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m});let u=0;const c=[];for(const f of l){const d=a.offsetAt(f.range.start);if(du&&c.push(o.substring(u,d)),f.newText.length&&c.push(f.newText),u=a.offsetAt(f.range.end)}return c.push(o.substr(u)),c.join("")}i(n,"applyEdits"),e.applyEdits=n})(Sl||(Sl={}));function wl(e,t){if(e.length<=1)return e;const r=e.length/2|0,n=e.slice(0,r),a=e.slice(r);wl(n,t),wl(a,t);let s=0,o=0,l=0;for(;sr.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}i(Bm,"getWellformedRange");function XS(e){const t=Bm(e.range);return t!==e.range?{newText:e.newText,range:t}:e}i(XS,"getWellformedEdit");var JS;(()=>{var e={975:k=>{function C(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}i(C,"e");function y(T,$){for(var _,O="",x=0,D=-1,G=0,W=0;W<=T.length;++W){if(W2){var Y=O.lastIndexOf("/");if(Y!==O.length-1){Y===-1?(O="",x=0):x=(O=O.slice(0,Y)).length-1-O.lastIndexOf("/"),D=W,G=0;continue}}else if(O.length===2||O.length===1){O="",x=0,D=W,G=0;continue}}$&&(O.length>0?O+="/..":O="..",x=2)}else O.length>0?O+="/"+T.slice(D+1,W):O=T.slice(D+1,W),x=W-D-1;D=W,G=0}else _===46&&G!==-1?++G:G=-1}return O}i(y,"r");var E={resolve:i(function(){for(var T,$="",_=!1,O=arguments.length-1;O>=-1&&!_;O--){var x;O>=0?x=arguments[O]:(T===void 0&&(T=process.cwd()),x=T),C(x),x.length!==0&&($=x+"/"+$,_=x.charCodeAt(0)===47)}return $=y($,!_),_?$.length>0?"/"+$:"/":$.length>0?$:"."},"resolve"),normalize:i(function(T){if(C(T),T.length===0)return".";var $=T.charCodeAt(0)===47,_=T.charCodeAt(T.length-1)===47;return(T=y(T,!$)).length!==0||$||(T="."),T.length>0&&_&&(T+="/"),$?"/"+T:T},"normalize"),isAbsolute:i(function(T){return C(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:i(function(){if(arguments.length===0)return".";for(var T,$=0;$0&&(T===void 0?T=_:T+="/"+_)}return T===void 0?".":E.normalize(T)},"join"),relative:i(function(T,$){if(C(T),C($),T===$||(T=E.resolve(T))===($=E.resolve($)))return"";for(var _=1;_W){if($.charCodeAt(D+q)===47)return $.slice(D+q+1);if(q===0)return $.slice(D+q)}else x>W&&(T.charCodeAt(_+q)===47?Y=q:q===0&&(Y=0));break}var Pe=T.charCodeAt(_+q);if(Pe!==$.charCodeAt(D+q))break;Pe===47&&(Y=q)}var oe="";for(q=_+Y+1;q<=O;++q)q!==O&&T.charCodeAt(q)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+$.slice(D+Y):(D+=Y,$.charCodeAt(D)===47&&++D,$.slice(D))},"relative"),_makeLong:i(function(T){return T},"_makeLong"),dirname:i(function(T){if(C(T),T.length===0)return".";for(var $=T.charCodeAt(0),_=$===47,O=-1,x=!0,D=T.length-1;D>=1;--D)if(($=T.charCodeAt(D))===47){if(!x){O=D;break}}else x=!1;return O===-1?_?"/":".":_&&O===1?"//":T.slice(0,O)},"dirname"),basename:i(function(T,$){if($!==void 0&&typeof $!="string")throw new TypeError('"ext" argument must be a string');C(T);var _,O=0,x=-1,D=!0;if($!==void 0&&$.length>0&&$.length<=T.length){if($.length===T.length&&$===T)return"";var G=$.length-1,W=-1;for(_=T.length-1;_>=0;--_){var Y=T.charCodeAt(_);if(Y===47){if(!D){O=_+1;break}}else W===-1&&(D=!1,W=_+1),G>=0&&(Y===$.charCodeAt(G)?--G==-1&&(x=_):(G=-1,x=W))}return O===x?x=W:x===-1&&(x=T.length),T.slice(O,x)}for(_=T.length-1;_>=0;--_)if(T.charCodeAt(_)===47){if(!D){O=_+1;break}}else x===-1&&(D=!1,x=_+1);return x===-1?"":T.slice(O,x)},"basename"),extname:i(function(T){C(T);for(var $=-1,_=0,O=-1,x=!0,D=0,G=T.length-1;G>=0;--G){var W=T.charCodeAt(G);if(W!==47)O===-1&&(x=!1,O=G+1),W===46?$===-1?$=G:D!==1&&(D=1):$!==-1&&(D=-1);else if(!x){_=G+1;break}}return $===-1||O===-1||D===0||D===1&&$===O-1&&$===_+1?"":T.slice($,O)},"extname"),format:i(function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function($,_){var O=_.dir||_.root,x=_.base||(_.name||"")+(_.ext||"");return O?O===_.root?O+x:O+"/"+x:x})(0,T)},"format"),parse:i(function(T){C(T);var $={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return $;var _,O=T.charCodeAt(0),x=O===47;x?($.root="/",_=1):_=0;for(var D=-1,G=0,W=-1,Y=!0,q=T.length-1,Pe=0;q>=_;--q)if((O=T.charCodeAt(q))!==47)W===-1&&(Y=!1,W=q+1),O===46?D===-1?D=q:Pe!==1&&(Pe=1):D!==-1&&(Pe=-1);else if(!Y){G=q+1;break}return D===-1||W===-1||Pe===0||Pe===1&&D===W-1&&D===G+1?W!==-1&&($.base=$.name=G===0&&x?T.slice(1,W):T.slice(G,W)):(G===0&&x?($.name=T.slice(1,D),$.base=T.slice(1,W)):($.name=T.slice(G,D),$.base=T.slice(G,W)),$.ext=T.slice(D,W)),G>0?$.dir=T.slice(0,G-1):x&&($.dir="/"),$},"parse"),sep:"/",delimiter:":",win32:null,posix:null};E.posix=E,k.exports=E}},t={};function r(k){var C=t[k];if(C!==void 0)return C.exports;var y=t[k]={exports:{}};return e[k](y,y.exports,r),y.exports}i(r,"r"),r.d=(k,C)=>{for(var y in C)r.o(C,y)&&!r.o(k,y)&&Object.defineProperty(k,y,{enumerable:!0,get:C[y]})},r.o=(k,C)=>Object.prototype.hasOwnProperty.call(k,C),r.r=k=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:i(()=>m,"URI"),Utils:i(()=>Se,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,l=/^\/\//;function u(k,C){if(!k.scheme&&C)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!s.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!o.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}i(u,"a");const c="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{i(this,"l")}static isUri(C){return C instanceof m||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,y,E,T,$,_=!1){typeof C=="object"?(this.scheme=C.scheme||c,this.authority=C.authority||c,this.path=C.path||c,this.query=C.query||c,this.fragment=C.fragment||c):(this.scheme=(function(O,x){return O||x?O:"file"})(C,_),this.authority=y||c,this.path=(function(O,x){switch(O){case"https":case"http":case"file":x?x[0]!==f&&(x=f+x):x=f}return x})(this.scheme,E||c),this.query=T||c,this.fragment=$||c,u(this,_))}get fsPath(){return I(this,!1)}with(C){if(!C)return this;let{scheme:y,authority:E,path:T,query:$,fragment:_}=C;return y===void 0?y=this.scheme:y===null&&(y=c),E===void 0?E=this.authority:E===null&&(E=c),T===void 0?T=this.path:T===null&&(T=c),$===void 0?$=this.query:$===null&&($=c),_===void 0?_=this.fragment:_===null&&(_=c),y===this.scheme&&E===this.authority&&T===this.path&&$===this.query&&_===this.fragment?this:new v(y,E,T,$,_)}static parse(C,y=!1){const E=d.exec(C);return E?new v(E[2]||c,X(E[4]||c),X(E[5]||c),X(E[7]||c),X(E[9]||c),y):new v(c,c,c,c,c)}static file(C){let y=c;if(a&&(C=C.replace(/\\/g,f)),C[0]===f&&C[1]===f){const E=C.indexOf(f,2);E===-1?(y=C.substring(2),C=f):(y=C.substring(2,E),C=C.substring(E)||f)}return new v("file",y,C,c,c)}static from(C){const y=new v(C.scheme,C.authority,C.path,C.query,C.fragment);return u(y,!0),y}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof m)return C;{const y=new v(C);return y._formatted=C.external,y._fsPath=C._sep===g?C.fsPath:null,y}}return C}}const g=a?1:void 0;class v extends m{static{i(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=g),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}const b={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function S(k,C,y){let E,T=-1;for(let $=0;$=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===45||_===46||_===95||_===126||C&&_===47||y&&_===91||y&&_===93||y&&_===58)T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E!==void 0&&(E+=k.charAt($));else{E===void 0&&(E=k.substr(0,$));const O=b[_];O!==void 0?(T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E+=O):T===-1&&(T=$)}}return T!==-1&&(E+=encodeURIComponent(k.substring(T))),E!==void 0?E:k}i(S,"m");function w(k){let C;for(let y=0;y1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?C?k.path.substr(1):k.path[1].toLowerCase()+k.path.substr(2):k.path,a&&(y=y.replace(/\//g,"\\")),y}i(I,"v");function R(k,C){const y=C?w:S;let E="",{scheme:T,authority:$,path:_,query:O,fragment:x}=k;if(T&&(E+=T,E+=":"),($||T==="file")&&(E+=f,E+=f),$){let D=$.indexOf("@");if(D!==-1){const G=$.substr(0,D);$=$.substr(D+1),D=G.lastIndexOf(":"),D===-1?E+=y(G,!1,!1):(E+=y(G.substr(0,D),!1,!1),E+=":",E+=y(G.substr(D+1),!1,!0)),E+="@"}$=$.toLowerCase(),D=$.lastIndexOf(":"),D===-1?E+=y($,!1,!0):(E+=y($.substr(0,D),!1,!0),E+=$.substr(D))}if(_){if(_.length>=3&&_.charCodeAt(0)===47&&_.charCodeAt(2)===58){const D=_.charCodeAt(1);D>=65&&D<=90&&(_=`/${String.fromCharCode(D+32)}:${_.substr(3)}`)}else if(_.length>=2&&_.charCodeAt(1)===58){const D=_.charCodeAt(0);D>=65&&D<=90&&(_=`${String.fromCharCode(D+32)}:${_.substr(2)}`)}E+=y(_,!0,!1)}return O&&(E+="?",E+=y(O,!1,!1)),x&&(E+="#",E+=C?x:S(x,!1,!1)),E}i(R,"b");function P(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+P(k.substr(3)):k}}i(P,"C");const z=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function X(k){return k.match(z)?k.replace(z,(C=>P(C))):k}i(X,"w");var Z=r(975);const ce=Z.posix||Z,se="/";var Se;(function(k){k.joinPath=function(C,...y){return C.with({path:ce.join(C.path,...y)})},k.resolvePath=function(C,...y){let E=C.path,T=!1;E[0]!==se&&(E=se+E,T=!0);let $=ce.resolve(E,...y);return T&&$[0]===se&&!C.authority&&($=$.substring(1)),C.with({path:$})},k.dirname=function(C){if(C.path.length===0||C.path===se)return C;let y=ce.dirname(C.path);return y.length===1&&y.charCodeAt(0)===46&&(y=""),C.with({path:y})},k.basename=function(C){return ce.basename(C.path)},k.extname=function(C){return ce.extname(C.path)}})(Se||(Se={})),JS=n})();var{URI:vt,Utils:Li}=JS,rt;(function(e){e.basename=Li.basename,e.dirname=Li.dirname,e.extname=Li.extname,e.joinPath=Li.joinPath,e.resolvePath=Li.resolvePath;const t=typeof process=="object"&&process?.platform==="win32";function r(o,l){return o?.toString()===l?.toString()}i(r,"equals"),e.equals=r;function n(o,l){const u=typeof o=="string"?vt.parse(o).path:o.path,c=typeof l=="string"?vt.parse(l).path:l.path,f=u.split("/").filter(b=>b.length>0),d=c.split("/").filter(b=>b.length>0);if(t){const b=/^[A-Z]:$/;if(f[0]&&b.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&b.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return c.substring(1)}let m=0;for(;m({name:n.name,uri:rt.joinPath(vt.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(rt.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(const a of r){let s=n.children.get(a);if(!s)if(t)s={name:a,children:new Map,parent:n},n.children.set(a,s);else return;n=s}return n}collectValues(e){const t=[];e.element&&t.push(e.element);for(const r of e.children.values())t.push(...this.collectValues(r));return t}},J;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(J||(J={}));var ZS=class{static{i(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=pe.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??vt.parse(e.uri),pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){const n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{const n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{const n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let a;if(r)a={parseResult:e,uri:t,state:J.Parsed,references:[],textDocument:r};else{const s=this.createTextDocumentGetter(t,n);a={parseResult:e,uri:t,state:J.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,t){const r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),a=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return r!==a&&(e.parseResult=await this.parseAsync(e.uri,a,t),e.parseResult.value.$document=e),e.state=J.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let n;return()=>n??(n=Sl.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},QS=class{static{i(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new Um,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ue(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,J.Changed),r}deleteDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=J.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){const t=e.toString(),r=this.documentTrie.findAll(t);for(const n of r)n.state=J.Changed;return this.documentTrie.delete(t),r}},ln=Symbol("RefResolving"),ew=class{static{i(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=pe.CancellationToken.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const n of Mt(e.parseResult.value))await ze(t),Wa(n).forEach(a=>{const s=`${n.$type}:${a.property}`;r.startSubTask(s);try{this.doLink(a,e)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(const r of Mt(e.parseResult.value))await ze(t),Wa(r).forEach(n=>this.doLink(n,e))}doLink(e,t){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=ln;try{const n=this.getCandidate(e);if(dn(n))r._ref=n;else{r._nodeDescription=n;const a=this.loadAstNode(n);r._ref=a??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);const a=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${a}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=ln;try{const n=this.getCandidates(e),a=[];if(dn(n))r._linkingError=n;else for(const s of n){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}r._items=a}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(const t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){const a=this,s={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Oe(this._ref))return this._ref;if(Sd(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=ln;const o=Ga(e).$document,l=a.getLinkedNode({reference:s,container:e,property:t});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:t})}};return s}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(dn(t))return{error:t};const r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=Ga(e.container).$document;r&&r.stateGn(t)&&t.isMulti)}findDeclarations(e){if(e){const t=vp(e),r=e.astNode;if(t&&r){const n=r[t.feature];if(tt(n)||tr(n))return qo(n);if(Array.isArray(n)){for(const a of n)if((tt(a)||tr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return qo(a)}}if(r){const n=this.nameProvider.getNameNode(r);if(n&&(n===e||Jd(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(const n of Wa(r))if(tr(n.reference)&&n.reference.items.some(a=>a.ref===e))return n.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const t=this.findDeclarations(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n)??n.$cstNode;a&&r.push(a)}return r}findReferences(e,t){const r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(a=>rt.equals(a.sourceUri,t.documentUri))),r.push(...n),ue(r)}getSelfReferences(e){const t=this.getSelfNodes(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n);if(a){const s=xt(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Ha(a),local:!0})}}return r}},wr=class{static{i(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return vs.sum(ue(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?ue(t):Ba}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ue(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return ue(this.map.keys())}values(){return ue(this.map.values()).flat()}entriesGroupedByKey(){return ue(this.map.entries())}},Il=class{static{i(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},nw=class{static{i(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=Ms,n=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,t);for(const s of r(e))await ze(n),this.addExportedSymbol(s,a,t);return a}addExportedSymbol(e,t,r){const n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=pe.CancellationToken.None){const r=e.parseResult.value,n=new wr;for(const a of Ir(r))await ze(t),this.addLocalSymbol(a,e,n);return n}addLocalSymbol(e,t,r){const n=e.$container;if(n){const a=this.nameProvider.getName(e);a&&r.add(n,this.descriptions.createDescription(e,a,t))}}},Zf=class{static{i(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},RF=class{static{i(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?ue(n).concat(this.outerScope.getElements(e)):ue(n)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},aw=class{static{i(this,"MultiMapScope")}constructor(e,t,r){this.elements=new wr,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?ue(r).concat(this.outerScope.getElements(e)):ue(r)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},AF={getElement(){},getElements(){return Ba},getAllElements(){return Ba}},Mu=class{static{i(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Wm=class extends Mu{static{i(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Gu=class extends Mu{static{i(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){const a=r();return n.set(t,a),a}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},iw=class extends Gu{static{i(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(const a of n)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{const a=r.concat(n);for(const s of a)this.clear(s)}))}},qm=class extends Wm{static{i(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},sw=class{static{i(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new qm(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),n=xt(e.container).localSymbols;if(n){let s=e.container;do n.has(s)&&t.push(n.getStream(s).filter(o=>this.reflection.isSubtype(o.type,r))),s=s.$container;while(s)}let a=this.getGlobalScope(r,e);for(let s=t.length-1;s>=0;s--)a=this.createScope(t[s],a);return a}createScope(e,t,r){return new Zf(ue(e),t,r)}createScopeForNodes(e,t,r){const n=ue(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Zf(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new aw(this.indexManager.allElements(e)))}};function Vm(e){return typeof e.$comment=="string"}i(Vm,"isAstNodeWithComment");function Qf(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}i(Qf,"isIntermediateReference");var ow=class{static{i(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const r=t??{},n=t?.replacer,a=i((o,l)=>this.replacer(o,l,r),"defaultReplacer"),s=n?(o,l)=>n(o,l,a):a;try{return this.currentDocument=xt(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(tt(t)){const l=t.ref,u=r?t.$refText:void 0;if(l){const c=xt(l);let f="";this.currentDocument&&this.currentDocument!==c&&(o?f=o(c.uri,l):f=c.uri.toString());const d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:u}}else return{$error:t.error?.message??"Could not resolve reference",$refText:u}}else if(tr(t)){const l=r?t.$refText:void 0,u=[];for(const c of t.items){const f=c.ref,d=xt(c.ref);let m="";this.currentDocument&&this.currentDocument!==d&&(o?m=o(d.uri,f):m=d.uri.toString());const g=this.astNodeLocator.getAstNodePath(f);u.push(`${m}#${g}`)}return{$refs:u,$refText:l}}else if(Oe(t)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(l??(l={...t}),l.$sourceText=t.$cstNode?.text),s){l??(l={...t});const u=this.commentProvider.getComment(t);u&&(l.$comment=u.replace(/\r/g,""))}return l??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=i(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=yp(e.$cstNode,a).map(t);s.length!==0&&(n[a]=s)}),e}}linkNode(e,t,r,n,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c{await this.handleException(()=>e.call(t,r,n,a),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(a){if(ea(a))throw a;console.error(`${t}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);r("error",`${t}: ${s}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=ue(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(n,a,s,o)=>{await this.handleException(()=>e.call(r,n,a,s,o),t,a,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},cw=Object.freeze({validateNode:!0,validateChildren:!0}),fw=class{static{i(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=pe.CancellationToken.None){const n=e.parseResult,a=[];if(await ze(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,a,t),t.stopAfterLexingErrors&&a.some(s=>s.data?.code===bt.LexingError)||(this.processParsingErrors(n,a,t),t.stopAfterParsingErrors&&a.some(s=>s.data?.code===bt.ParsingError))||(this.processLinkingErrors(e,a,t),t.stopAfterLinkingErrors&&a.some(s=>s.data?.code===bt.LinkingError))))return a;try{a.push(...await this.validateAst(n.value,t,r))}catch(s){if(ea(s))throw s;console.error("An error occurred during validation:",s)}return await ze(r),a}processLexingErrors(e,t,r){const n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of n){const s=a.severity??"error",o={severity:ys(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Ym(s),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(const n of e.parserErrors){let a;if(isNaN(n.token.startOffset)){if("previousToken"in n){const s=n.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Ts(n.token);if(a){const s={severity:ys("error"),range:a,message:n.message,data:_n(bt.ParsingError),source:this.getSource()};t.push(s)}}}processLinkingErrors(e,t,r){for(const n of e.references){const a=n.error;if(a){const s={node:a.info.container,range:n.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:bt.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};t.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,t,r=pe.CancellationToken.None){const n=[],a=i((s,o,l)=>{n.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,t,a,r),await this.validateAstNodes(e,t,a,r),await this.validateAstAfter(e,t,a,r),n}async validateAstBefore(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=pe.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=Mt(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,t);if(l.validateNode)try{const u=this.validationRegistry.getChecks(o.$type,t.categories);for(const c of u)await c(o,r,n)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=Mt(e).iterator();for(const s of a){await ze(n);const o=this.validateSingleNodeOptions(s,t);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,t.categories);for(const u of l)await u(s,r,n)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,t){return cw}async validateAstAfter(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:Hm(r),severity:ys(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Hm(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Hl(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=gp(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}i(Hm,"getDiagnosticRange");function ys(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}i(ys,"toDiagnosticSeverity");function Ym(e){switch(e){case"error":return _n(bt.LexingError);case"warning":return _n(bt.LexingWarning);case"info":return _n(bt.LexingInfo);case"hint":return _n(bt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}i(Ym,"toDiagnosticData");var bt;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(bt||(bt={}));var dw=class{static{i(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const n=r??xt(e);t??(t=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${a} has no name.`);let s;const o=i(()=>s??(s=Ha(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ha(e.$cstNode),type:e.$type,documentUri:n.uri,path:a}}},pw=class{static{i(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=pe.CancellationToken.None){const r=[],n=e.parseResult.value;for(const a of Mt(n))await ze(t),Wa(a).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode)return[];let r=[];tt(t)&&t.$nodeDescription?r=[t.$nodeDescription]:tr(t)&&(r=t.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const n=xt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Ha(t.$refNode);for(const l of r)s.push({sourceUri:n,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:rt.equals(l.documentUri,n)});return s}},mw=class{static{i(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,a)=>{if(!n||a.length===0)return n;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return n[o]?.[l]}return n[a]},e)}},Fu={};Ol(Fu,Ed(Qa()));var hw=class{static{i(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new Sr,this.onConfigurationSectionUpdateEmitter=new Fu.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,a)=>{this.updateSectionConfiguration(n.section,r[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},lo=Ed(rN()),In;(function(e){function t(r){return{dispose:i(async()=>await r(),"dispose")}}i(t,"create"),e.create=t})(In||(In={}));var yw=class{static{i(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new wr,this.documentPhaseListeners=new wr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=J.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=pe.CancellationToken.None){for(const n of e){const a=n.uri.toString();if(n.state===J.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,J.IndexedReferences);else if(typeof t.validation=="object"){const s=this.findMissingValidationCategories(n,t);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),n.state=J.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=J.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=pe.CancellationToken.None){this.currentState=J.Changed;const n=[];for(const l of t){const u=this.langiumDocuments.deleteDocuments(l);for(const c of u)n.push(c.uri),this.cleanUpDeleted(c)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=J.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,J.Changed)}const s=ue(a).concat(n).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,J.ComputedScopes)),await this.emitUpdate(a,n),await ze(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,t){const r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,s=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return ue(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),In.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case J.Changed:case J.Parsed:this.indexManager.removeContent(e.uri);case J.IndexedContent:e.localSymbols=void 0;case J.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case J.Linked:this.indexManager.removeReferences(e.uri);case J.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case J.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=J.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,J.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,J.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,J.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,r)});const n=e.filter(s=>this.shouldLink(s));await this.runCancelable(n,J.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(n,J.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,J.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(const r of e){const n=r.uri.toString(),a=this.buildState.get(n);(!a||a.completed)&&this.buildState.set(n,{completed:!1,options:t,result:a?.result})}}async runCancelable(e,t,r,n){for(const s of e)s.states.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),In.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),In.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=pe.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){const n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(er);if(this.currentState>=e&&e>n.state)return Promise.reject(new lo.ResponseError(lo.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${J[n.state]}, requiring ${J[e]}, but workspace state is already ${J[this.currentState]}. Returning undefined.`))}else return Promise.reject(new lo.ResponseError(lo.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{rt.equals(u.uri,t)&&(o.dispose(),l.dispose(),a(u.uri))}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(er)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(er):new Promise((r,n)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),r()}),s=t.onCancellationRequested(()=>{a.dispose(),s.dispose(),n(er)})})}async notifyDocumentPhase(e,t,r){const a=this.documentPhaseListeners.get(t).slice();for(const s of a)try{await ze(r),await s(e,r)}catch(o){if(!ea(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const a=this.buildPhaseListeners.get(t).slice();for(const s of a)await ze(r),await s(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),a=typeof n.validation=="object"?{...n.validation}:{};a.categories=this.findMissingValidationCategories(e,n);const s=await r.validateDocument(e,a,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=ue(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},gw=class{static{i(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Gu,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=xt(e).uri,n=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{rt.equals(s.targetUri,r)&&s.targetPath===t&&n.push(s)})}),ue(n)}allElements(e,t){let r=ue(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),a=e.uri.toString();this.symbolIndex.set(a,n),this.symbolByTypeIndex.clear(a)}async updateReferences(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},vw=class{static{i(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new Sr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=pe.CancellationToken.None){const r=await this.performStartup(e);await ze(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=[],r=i(s=>{t.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,r);const n=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,n)));const a=ue(n).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{const n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return vt.parse(e.uri)}async traverseFolder(e,t){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){const t=rt.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},Tw=class{static{i(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,a){return kf.buildUnexpectedCharactersMessage(e,t,r,n,a)}buildUnableToPopLexerModeMessage(e){return kf.buildUnableToPopLexerModeMessage(e)}},Xm={mode:"full"},Jm=class{static{i(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=Pl(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new nt(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Xm){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Pl(e))return e;const t=ju(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};function zu(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}i(zu,"isTokenTypeArray");function ju(e){return e&&"modes"in e&&"defaultMode"in e}i(ju,"isIMultiModeLexerDefinition");function Pl(e){return!zu(e)&&!ju(e)}i(Pl,"isTokenTypeDictionary");Ds();function Zm(e,t,r){let n,a;typeof e=="string"?(a=t,n=r):(a=e.range.start,n=t),a||(a=ie.create(0,0));const s=eh(e),o=Bu(n),l=$w({lines:s,position:a,options:o});return Ew({index:0,tokens:l,position:a})}i(Zm,"parseJSDoc");function Qm(e,t){const r=Bu(t),n=eh(e);if(n.length===0)return!1;const a=n[0],s=n[n.length-1],o=r.start,l=r.end;return!!o?.exec(a)&&!!l?.exec(s)}i(Qm,"isJSDoc");function eh(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(Av)}i(eh,"getLines");var Ny=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,EF=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function $w(e){const t=[];let r=e.position.line,n=e.position.character;for(let a=0;a=l.length){if(t.length>0){const f=ie.create(r,n);t.push({type:"break",content:"",range:Q.create(f,f)})}}else{Ny.lastIndex=u;const f=Ny.exec(l);if(f){const d=f[0],m=f[1],g=ie.create(r,n+u),v=ie.create(r,n+u+d.length);t.push({type:"tag",content:m,range:Q.create(g,v)}),u+=d.length,u=kl(l,u)}if(u0&&t[t.length-1].type==="break"?t.slice(0,-1):t}i($w,"tokenize");function Rw(e,t,r,n){const a=[];if(e.length===0){const s=ie.create(r,n),o=ie.create(r,n+t.length);a.push({type:"text",content:t,range:Q.create(s,o)})}else{let s=0;for(const l of e){const u=l.index,c=t.substring(s,u);c.length>0&&a.push({type:"text",content:t.substring(s,u),range:Q.create(ie.create(r,s+n),ie.create(r,u+n))});let f=c.length+1;const d=l[1];if(a.push({type:"inline-tag",content:d,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;const m=l[3];a.push({type:"text",content:m,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+m.length+n))})}else a.push({type:"text",content:"",range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+n))});s=u+l[0].length}const o=t.substring(s);o.length>0&&a.push({type:"text",content:o,range:Q.create(ie.create(r,s+n),ie.create(r,s+n+o.length))})}return a}i(Rw,"buildInlineTokens");var CF=/\S/,bF=/\s*$/;function kl(e,t){const r=e.substring(t).match(CF);return r?t+r.index:e.length}i(kl,"skipWhitespace");function Aw(e){const t=e.match(bF);if(t&&typeof t.index=="number")return t.index}i(Aw,"lastCharacter");function Ew(e){const t=ie.create(e.position.line,e.position.character);if(e.tokens.length===0)return new Py([],Q.create(t,t));const r=[];for(;e.indext.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=td(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const n=r.toMarkdown(e);t+=td(t)+n}return t.trim()}},Zu=class{static{i(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} +${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const a=Sw(this.name,t,e??{});if(typeof a=="string")return a}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} — ${t}`:this.content.inlines.length>1&&(n=`${n} +${t}`),this.inline?`{${n}}`:n}};function Sw(e,t,r){if(e==="linkplain"||e==="linkcode"||e==="link"){const n=t.indexOf(" ");let a=t;if(n>0){const o=kl(t,n);a=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(t,a)??ww(t,a)}}i(Sw,"renderInlineTag");function ww(e,t){try{return vt.parse(e,!0),`[${t}](${e})`}catch{return e}}i(ww,"renderLinkDefault");var ed=class{static{i(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` +`)}return t}},Iw=class{static{i(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function td(e){return e.endsWith(` +`)?` +`:` + +`}i(td,"fillNewlines");var Nw=class{static{i(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&Qm(t))return Zm(t).toMarkdown({renderLink:i((n,a)=>this.documentationLinkRenderer(e,n,a),"renderLink"),renderTag:i(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){const n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){const a=n.nameSegment.range.start.line+1,s=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${a},${s}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){const n=xt(e).localSymbols;if(!n)return;let a=e;do{const o=n.getStream(a).find(l=>l.name===t);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},Pw=class{static{i(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Vm(e)?e.$comment:tp(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},kw=class{static{i(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},_F=class{static{i(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){const r=await this.acquireParserWorker(t),n=new Sr;let a;const s=t.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{const l=this.hydrator.hydrate(o);n.resolve(l)}).catch(o=>{n.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),n.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(const r of this.workerPool)if(r.ready)return r.lock(),r;const t=new Sr;return e.onCancellationRequested(()=>{const r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(er)}),this.queue.push(t),t.promise}},SF=class{static{i(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new Fu.Emitter,this.deferred=new Sr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),r(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(er),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Sr,this.sendMessage(e),this.deferred.promise}},Ow=class{static{i(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=xu();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=pe.CancellationToken.None){const n=new Sr,a={action:t,deferred:n,cancellationToken:r};return e.push(a),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{const a=await Promise.resolve().then(()=>t(n));r.resolve(a)}catch(a){ea(a)?r.resolve(void 0):r.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Lw=class{static{i(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new Il,this.tokenTypeIdMap=new Il,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const n of Mt(e))t.set(n,{});if(e.$cstNode)for(const n of Va(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.dehydrateAstNode(o,t)):tt(o)?s.push(this.dehydrateReference(o,t)):s.push(o)}else Oe(a)?r[n]=this.dehydrateAstNode(a,t):tt(a)?r[n]=this.dehydrateReference(a,t):a!==void 0&&(r[n]=a);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return xl(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),Tr(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):Dn(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const a of Mt(e))t.set(a,{});let n;if(e.$cstNode)for(const a of Va(e.$cstNode)){let s;"fullText"in a?(s=new Pm(a.fullText),n=s):"content"in a?s=new Pu:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(r.set(a,s),s.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.setParent(this.hydrateAstNode(o,t),r)):tt(o)?s.push(this.hydrateReference(o,r,n,t)):s.push(o)}else Oe(a)?r[n]=this.setParent(this.hydrateAstNode(a,t),r):tt(a)?r[n]=this.hydrateReference(a,r,n,t):a!==void 0&&(r[n]=a);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),Tr(n))for(const a of e.content){const s=this.hydrateCstNode(a,t,r++);n.content.push(s)}return n}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new Cl(r,n,{start:{line:a,character:s},end:{line:o,character:l}},t,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Mt(this.grammar))Ml(t)&&this.grammarElementIdMap.set(t,e++)}};function je(e){return{documentation:{CommentProvider:i(t=>new Pw(t),"CommentProvider"),DocumentationProvider:i(t=>new Nw(t),"DocumentationProvider")},parser:{AsyncParser:i(t=>new kw(t),"AsyncParser"),GrammarConfig:i(t=>bp(t),"GrammarConfig"),LangiumParser:i(t=>Mm(t),"LangiumParser"),CompletionParser:i(t=>xm(t),"CompletionParser"),ValueConverter:i(()=>new Fm,"ValueConverter"),TokenBuilder:i(()=>new Lu,"TokenBuilder"),Lexer:i(t=>new Jm(t),"Lexer"),ParserErrorMessageProvider:i(()=>new Om,"ParserErrorMessageProvider"),LexerErrorMessageProvider:i(()=>new Tw,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:i(()=>new mw,"AstNodeLocator"),AstNodeDescriptionProvider:i(t=>new dw(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:i(t=>new pw(t),"ReferenceDescriptionProvider")},references:{Linker:i(t=>new ew(t),"Linker"),NameProvider:i(()=>new tw,"NameProvider"),ScopeProvider:i(t=>new sw(t),"ScopeProvider"),ScopeComputation:i(t=>new nw(t),"ScopeComputation"),References:i(t=>new rw(t),"References")},serializer:{Hydrator:i(t=>new Lw(t),"Hydrator"),JsonSerializer:i(t=>new ow(t),"JsonSerializer")},validation:{DocumentValidator:i(t=>new fw(t),"DocumentValidator"),ValidationRegistry:i(t=>new uw(t),"ValidationRegistry")},shared:i(()=>e.shared,"shared")}}i(je,"createDefaultCoreModule");function Be(e){return{ServiceRegistry:i(t=>new lw(t),"ServiceRegistry"),workspace:{LangiumDocuments:i(t=>new QS(t),"LangiumDocuments"),LangiumDocumentFactory:i(t=>new ZS(t),"LangiumDocumentFactory"),DocumentBuilder:i(t=>new yw(t),"DocumentBuilder"),IndexManager:i(t=>new gw(t),"IndexManager"),WorkspaceManager:i(t=>new vw(t),"WorkspaceManager"),FileSystemProvider:i(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:i(()=>new Ow,"WorkspaceLock"),ConfigurationProvider:i(t=>new hw(t),"ConfigurationProvider")},profilers:{}}}i(Be,"createDefaultSharedCoreModule");var rd;(function(e){e.merge=(t,r)=>Za(Za({},t),r)})(rd||(rd={}));function ee(e,t,r,n,a,s,o,l,u){const c=[e,t,r,n,a,s,o,l,u].reduce(Za,{});return ih(c)}i(ee,"inject");var Dw=Symbol("isProxy");function ah(e){if(e&&e[Dw])for(const t of Object.values(e))ah(t);return e}i(ah,"eagerLoad");function ih(e,t){const r=new Proxy({},{deleteProperty:i(()=>!1,"deleteProperty"),set:i(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:i((n,a)=>a===Dw?!0:nd(n,a,e,t||r),"get"),getOwnPropertyDescriptor:i((n,a)=>(nd(n,a,e,t||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:i((n,a)=>a in e,"has"),ownKeys:i(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}i(ih,"_inject");var ky=Symbol();function nd(e,t,r,n){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===ky)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){const a=r[t];e[t]=ky;try{e[t]=typeof a=="function"?a(n):ih(a,n)}catch(s){throw e[t]=s instanceof Error?s:void 0,s}return e[t]}else return}i(nd,"_resolve");function Za(e,t){if(t){for(const[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){const a=e[r];typeof a=="object"&&a!==null?e[r]=Za(a,n):e[r]=Za({},n)}else e[r]=n}return e}i(Za,"_merge");var ad={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Sn;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(Sn||(Sn={}));var xw=class extends Lu{static{i(this,"IndentationAwareTokenBuilder")}constructor(e=ad){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...ad,...e},this.indentTokenType=za({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=za({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){const r=super.buildTokens(e,t);if(!zu(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,c;const f=[];for(const d of r){for(const[m,g]of o)d.name===m?d.PUSH_MODE=Sn.IGNORE_INDENTATION:d.name===g&&(d.POP_MODE=!0);d.name===a?l=d:d.name===n?u=d:d.name===s?c=d:f.push(d)}if(!l||!u||!c)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[Sn.REGULAR]:[l,u,...f,c],[Sn.IGNORE_INDENTATION]:[...f,c]},defaultMode:Sn.REGULAR}:[l,u,c,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r +`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:a?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,t,r,n){const a=this.getLineNumber(t,n);return Zs(e,r,n,n+r.length,a,a,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;const u=this.indentationStack.length-l-1,c=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},wF=class extends Jm{static{i(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof xw)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=Xm){const r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],c=r.tokens.length-1;for(let f=0;f=0&&u.push(r.tokens[c]),r.tokens=u,r}},sh={};Wr(sh,{AstUtils:()=>Id,BiMap:()=>Il,Cancellation:()=>pe,ContextCache:()=>Gu,CstUtils:()=>_d,DONE_RESULT:()=>et,Deferred:()=>Sr,Disposable:()=>In,DisposableCache:()=>Mu,DocumentCache:()=>iw,EMPTY_STREAM:()=>Ba,ErrorWithLocation:()=>Kl,GrammarUtils:()=>ip,MultiMap:()=>wr,OperationCancelled:()=>er,Reduction:()=>vs,RegExpUtils:()=>op,SimpleCache:()=>Wm,StreamImpl:()=>Qt,TreeStreamImpl:()=>Ua,URI:()=>vt,UriTrie:()=>Um,UriUtils:()=>rt,WorkspaceCache:()=>qm,assertCondition:()=>sp,assertUnreachable:()=>qr,delayNextTick:()=>Du,interruptAndCheck:()=>ze,isOperationCancelled:()=>ea,loadGrammarFromJson:()=>Ue,setInterruptionPeriod:()=>zm,startCancelableOperation:()=>xu,stream:()=>ue});Ol(sh,Fu);var Mw=class{static{i(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Xe={fileSystemProvider:i(()=>new Mw,"fileSystemProvider")},IF={Grammar:i(()=>{},"Grammar"),LanguageMetaData:i(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},NF={AstReflection:i(()=>new Xd,"AstReflection")};function Gw(){const e=ee(Be(Xe),NF),t=ee(je({shared:e}),IF);return e.ServiceRegistry.register(t),t}i(Gw,"createMinimalGrammarServices");function Ue(e){const t=Gw(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,vt.parse(`memory:/${r.name??"grammar"}.langium`)),r}i(Ue,"loadGrammarFromJson");Ol(Vg,sh);var PF=class{static{i(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new wr}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new Fw(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const r=[];for(const s of t.entries.keys()){const o=t.entries.get(s),l=o.reduce((u,c)=>u+c);r.push({name:`${t.identifier}.${s}`,count:o.length,duration:l})}const n=t.duration-r.map(s=>s.duration).reduce((s,o)=>s+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return i(a,"Round"),console.table(r.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/t.duration),"Time (ms)":a(s.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},Fw=class{static{i(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new wr,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);const r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);const n=r-t.content;this.entries.add(e,n)}},id;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(id||(id={}));var sd;(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(sd||(sd={}));var od;(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(od||(od={}));var ld;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(ld||(ld={}));var ud;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(ud||(ud={}));var cd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cd||(cd={}));var fd;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fd||(fd={}));var dd;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dd||(dd={}));var pd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(pd||(pd={}));var md;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(md||(md={}));var hd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(hd||(hd={}));var yd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(yd||(yd={}));var gd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(gd||(gd={}));var vd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(vd||(vd={}));var Td;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Td||(Td={}));({...id.Terminals,...sd.Terminals,...od.Terminals,...ld.Terminals,...ud.Terminals,...cd.Terminals,...fd.Terminals,...dd.Terminals,...pd.Terminals,...md.Terminals,...hd.Terminals,...yd.Terminals,...vd.Terminals,...gd.Terminals,...Td.Terminals});var Oy={$type:"AbnfAlternation",alternatives:"alternatives"},Ly={$type:"AbnfConcatenation",elements:"elements"},Qu={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Dy={$type:"AbnfGroup",element:"element"},xy={$type:"AbnfNumVal",value:"value"},My={$type:"AbnfOptionalGroup",element:"element"},ua={$type:"AbnfPrimary"},ec={$type:"AbnfRule",definition:"definition",name:"name"},Gy={$type:"AbnfRuleName",name:"name"},Fy={$type:"AbnfStringLiteral",value:"value"},uo={$type:"Accelerator",name:"name",x:"x",y:"y"},tc={$type:"Alignment",direction:"direction",members:"members"},co={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},Di={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},rc={$type:"Annotations",x:"x",y:"y"},Yt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function kF(e){return Ne.isInstance(e,Yt.$type)}i(kF,"isArchitecture");var fo={$type:"Axis",label:"label",name:"name"},Uo={$type:"Branch",name:"name",order:"order"};function OF(e){return Ne.isInstance(e,Uo.$type)}i(OF,"isBranch");var zy={$type:"Checkout",branch:"branch"},po={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},nc={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Ra={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function LF(e){return Ne.isInstance(e,Ra.$type)}i(LF,"isCommit");var mo={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Jr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},ho={$type:"Curve",entries:"entries",label:"label",name:"name"},un={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function DF(e){return Ne.isInstance(e,un.$type)}i(DF,"isCynefin");var yo={$type:"Deaccelerator",name:"name",x:"x",y:"y"},jy={$type:"Decorator",strategy:"strategy"},ca={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Ko={$type:"DomainBlock",domain:"domain",items:"items"};function xF(e){return Ne.isInstance(e,Ko.$type)}i(xF,"isDomainBlock");var $d={$type:"DomainItem",label:"label"};function MF(e){return Ne.isInstance(e,$d.$type)}i(MF,"isDomainItem");var By={$type:"EbnfChoice",alternatives:"alternatives"},Uy={$type:"EbnfExceptionPostfix",except:"except"},Ky={$type:"EbnfGroup",element:"element"},Wy={$type:"EbnfNonTerminal",name:"name"},qy={$type:"EbnfOneOrMorePostfix",operator:"operator"},Vy={$type:"EbnfOptional",element:"element"},Hy={$type:"EbnfOptionalPostfix",operator:"operator"},xi={$type:"EbnfPostfix"},Zr={$type:"EbnfPrimary"},Yy={$type:"EbnfRepetition",element:"element"},ac={$type:"EbnfRule",definition:"definition",name:"name"},Xy={$type:"EbnfSequence",elements:"elements"},Jy={$type:"EbnfSpecial",text:"text"},ic={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Zy={$type:"EbnfTerminal",value:"value"},Qy={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Vt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},fa={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Qr={$type:"EmFrame"},Mi={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},eg={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},sc={$type:"EmModelEntity",name:"name"};function GF(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}i(GF,"isEmModelEntityType");var go={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},hr={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function FF(e){return Ne.isInstance(e,hr.$type)}i(FF,"isEmResetFrame");var Lr={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},oc={$type:"Entry",axis:"axis",value:"value"},fr={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},tg={$type:"Evolution",stages:"stages"},vo={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},lc={$type:"Evolve",component:"component",target:"target"},cn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function zF(e){return Ne.isInstance(e,cn.$type)}i(zF,"isGitGraph");var Gi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},es={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function jF(e){return Ne.isInstance(e,es.$type)}i(jF,"isInfo");var Fi={$type:"Item",classSelector:"classSelector",name:"name"},uc={$type:"Junction",id:"id",in:"in"},zi={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},To={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},en={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Aa={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function BF(e){return Ne.isInstance(e,Aa.$type)}i(BF,"isMerge");var $o={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},cc={$type:"Option",name:"name",value:"value"},Ea={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function UF(e){return Ne.isInstance(e,Ea.$type)}i(UF,"isPacket");var Ca={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function KF(e){return Ne.isInstance(e,Ca.$type)}i(KF,"isPacketBlock");var rg={$type:"PegAny",dot:"dot"},ng={$type:"PegGroup",element:"element"},ag={$type:"PegIdentifier",name:"name"},ig={$type:"PegLiteral",value:"value"},sg={$type:"PegOrderedChoice",alternatives:"alternatives"},fc={$type:"PegPrefix",operator:"operator",suffix:"suffix"},ji={$type:"PegPrimary"},dc={$type:"PegRule",definition:"definition",name:"name"},og={$type:"PegSequence",elements:"elements"},pc={$type:"PegSuffix",operator:"operator",primary:"primary"},fn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function WF(e){return Ne.isInstance(e,fn.$type)}i(WF,"isPie");var Wo={$type:"PieSection",label:"label",value:"value"};function qF(e){return Ne.isInstance(e,Wo.$type)}i(qF,"isPieSection");var mc={$type:"Pipeline",components:"components",parent:"parent"},Ro={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},tn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},ba={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function VF(e){return Ne.isInstance(e,ba.$type)}i(VF,"isRailroad");var _a={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function HF(e){return Ne.isInstance(e,_a.$type)}i(HF,"isRailroadAbnf");var lg={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Sa={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function YF(e){return Ne.isInstance(e,Sa.$type)}i(YF,"isRailroadEbnf");var dr={$type:"RailroadExpression"},ug={$type:"RailroadNonTerminalExpr",name:"name"},cg={$type:"RailroadOneOrMoreExpr",element:"element"},fg={$type:"RailroadOptionalExpr",element:"element"},wa={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function XF(e){return Ne.isInstance(e,wa.$type)}i(XF,"isRailroadPeg");var hc={$type:"RailroadRule",definition:"definition",name:"name"},dg={$type:"RailroadSequenceExpr",elements:"elements"},pg={$type:"RailroadSpecialExpr",text:"text"},mg={$type:"RailroadTerminalExpr",value:"value"},hg={$type:"RailroadZeroOrMoreExpr",element:"element"},yc={$type:"Section",classSelector:"classSelector",name:"name"},da={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},gc={$type:"Size",height:"height",width:"width"},pa={$type:"Statement"},ts={$type:"Transition",from:"from",label:"label",to:"to"};function JF(e){return Ne.isInstance(e,ts.$type)}i(JF,"isTransition");var Ia={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function ZF(e){return Ne.isInstance(e,Ia.$type)}i(ZF,"isTreemap");var vc={$type:"TreemapRow",indent:"indent",item:"item"},ma={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},Bi={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},We={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function QF(e){return Ne.isInstance(e,We.$type)}i(QF,"isWardley");var zw=class extends wd{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Oy.$type,properties:{alternatives:{name:Oy.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Ly.$type,properties:{elements:{name:Ly.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Qu.$type,properties:{primary:{name:Qu.primary},repeat:{name:Qu.repeat}},superTypes:[]},AbnfGroup:{name:Dy.$type,properties:{element:{name:Dy.element}},superTypes:[ua.$type]},AbnfNumVal:{name:xy.$type,properties:{value:{name:xy.value}},superTypes:[ua.$type]},AbnfOptionalGroup:{name:My.$type,properties:{element:{name:My.element}},superTypes:[ua.$type]},AbnfPrimary:{name:ua.$type,properties:{},superTypes:[]},AbnfRule:{name:ec.$type,properties:{definition:{name:ec.definition},name:{name:ec.name}},superTypes:[]},AbnfRuleName:{name:Gy.$type,properties:{name:{name:Gy.name}},superTypes:[ua.$type]},AbnfStringLiteral:{name:Fy.$type,properties:{value:{name:Fy.value}},superTypes:[ua.$type]},Accelerator:{name:uo.$type,properties:{name:{name:uo.name},x:{name:uo.x},y:{name:uo.y}},superTypes:[]},Alignment:{name:tc.$type,properties:{direction:{name:tc.direction},members:{name:tc.members,defaultValue:[]}},superTypes:[]},Anchor:{name:co.$type,properties:{evolution:{name:co.evolution},name:{name:co.name},visibility:{name:co.visibility}},superTypes:[]},Annotation:{name:Di.$type,properties:{number:{name:Di.number},text:{name:Di.text},x:{name:Di.x},y:{name:Di.y}},superTypes:[]},Annotations:{name:rc.$type,properties:{x:{name:rc.x},y:{name:rc.y}},superTypes:[]},Architecture:{name:Yt.$type,properties:{accDescr:{name:Yt.accDescr},accTitle:{name:Yt.accTitle},alignments:{name:Yt.alignments,defaultValue:[]},edges:{name:Yt.edges,defaultValue:[]},groups:{name:Yt.groups,defaultValue:[]},junctions:{name:Yt.junctions,defaultValue:[]},services:{name:Yt.services,defaultValue:[]},title:{name:Yt.title}},superTypes:[]},Axis:{name:fo.$type,properties:{label:{name:fo.label},name:{name:fo.name}},superTypes:[]},Branch:{name:Uo.$type,properties:{name:{name:Uo.name},order:{name:Uo.order}},superTypes:[pa.$type]},Checkout:{name:zy.$type,properties:{branch:{name:zy.branch}},superTypes:[pa.$type]},CherryPicking:{name:po.$type,properties:{id:{name:po.id},parent:{name:po.parent},tags:{name:po.tags,defaultValue:[]}},superTypes:[pa.$type]},ClassDefStatement:{name:nc.$type,properties:{className:{name:nc.className},styleText:{name:nc.styleText}},superTypes:[]},Commit:{name:Ra.$type,properties:{id:{name:Ra.id},message:{name:Ra.message},tags:{name:Ra.tags,defaultValue:[]},type:{name:Ra.type}},superTypes:[pa.$type]},Common:{name:mo.$type,properties:{accDescr:{name:mo.accDescr},accTitle:{name:mo.accTitle},title:{name:mo.title}},superTypes:[]},Component:{name:Jr.$type,properties:{decorator:{name:Jr.decorator},evolution:{name:Jr.evolution},inertia:{name:Jr.inertia,defaultValue:!1},label:{name:Jr.label},name:{name:Jr.name},visibility:{name:Jr.visibility}},superTypes:[]},Curve:{name:ho.$type,properties:{entries:{name:ho.entries,defaultValue:[]},label:{name:ho.label},name:{name:ho.name}},superTypes:[]},Cynefin:{name:un.$type,properties:{accDescr:{name:un.accDescr},accTitle:{name:un.accTitle},domains:{name:un.domains,defaultValue:[]},title:{name:un.title},transitions:{name:un.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:yo.$type,properties:{name:{name:yo.name},x:{name:yo.x},y:{name:yo.y}},superTypes:[]},Decorator:{name:jy.$type,properties:{strategy:{name:jy.strategy}},superTypes:[]},Direction:{name:ca.$type,properties:{accDescr:{name:ca.accDescr},accTitle:{name:ca.accTitle},dir:{name:ca.dir},statements:{name:ca.statements,defaultValue:[]},title:{name:ca.title}},superTypes:[cn.$type]},DomainBlock:{name:Ko.$type,properties:{domain:{name:Ko.domain},items:{name:Ko.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:$d.$type,properties:{label:{name:$d.label}},superTypes:[]},EbnfChoice:{name:By.$type,properties:{alternatives:{name:By.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Uy.$type,properties:{except:{name:Uy.except}},superTypes:[xi.$type]},EbnfGroup:{name:Ky.$type,properties:{element:{name:Ky.element}},superTypes:[Zr.$type]},EbnfNonTerminal:{name:Wy.$type,properties:{name:{name:Wy.name}},superTypes:[Zr.$type]},EbnfOneOrMorePostfix:{name:qy.$type,properties:{operator:{name:qy.operator}},superTypes:[xi.$type]},EbnfOptional:{name:Vy.$type,properties:{element:{name:Vy.element}},superTypes:[Zr.$type]},EbnfOptionalPostfix:{name:Hy.$type,properties:{operator:{name:Hy.operator}},superTypes:[xi.$type]},EbnfPostfix:{name:xi.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Zr.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Yy.$type,properties:{element:{name:Yy.element}},superTypes:[Zr.$type]},EbnfRule:{name:ac.$type,properties:{definition:{name:ac.definition},name:{name:ac.name}},superTypes:[]},EbnfSequence:{name:Xy.$type,properties:{elements:{name:Xy.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Jy.$type,properties:{text:{name:Jy.text}},superTypes:[Zr.$type]},EbnfTerm:{name:ic.$type,properties:{base:{name:ic.base},postfixes:{name:ic.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Zy.$type,properties:{value:{name:Zy.value}},superTypes:[Zr.$type]},EbnfZeroOrMorePostfix:{name:Qy.$type,properties:{operator:{name:Qy.operator}},superTypes:[xi.$type]},Edge:{name:Vt.$type,properties:{lhsDir:{name:Vt.lhsDir},lhsGroup:{name:Vt.lhsGroup,defaultValue:!1},lhsId:{name:Vt.lhsId},lhsInto:{name:Vt.lhsInto,defaultValue:!1},rhsDir:{name:Vt.rhsDir},rhsGroup:{name:Vt.rhsGroup,defaultValue:!1},rhsId:{name:Vt.rhsId},rhsInto:{name:Vt.rhsInto,defaultValue:!1},title:{name:Vt.title}},superTypes:[]},EmDataEntity:{name:fa.$type,properties:{dataBlockValue:{name:fa.dataBlockValue},dataType:{name:fa.dataType},name:{name:fa.name}},superTypes:[]},EmFrame:{name:Qr.$type,properties:{},superTypes:[]},EmGwt:{name:Mi.$type,properties:{givenStatements:{name:Mi.givenStatements,defaultValue:[]},sourceFrame:{name:Mi.sourceFrame,referenceType:Qr.$type},thenStatements:{name:Mi.thenStatements,defaultValue:[]},whenStatements:{name:Mi.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:eg.$type,properties:{entityIdentifier:{name:eg.entityIdentifier,referenceType:sc.$type}},superTypes:[]},EmModelEntity:{name:sc.$type,properties:{name:{name:sc.name}},superTypes:[]},EmNoteEntity:{name:go.$type,properties:{dataBlockValue:{name:go.dataBlockValue},dataType:{name:go.dataType},sourceFrame:{name:go.sourceFrame,referenceType:Qr.$type}},superTypes:[]},EmResetFrame:{name:hr.$type,properties:{dataInlineValue:{name:hr.dataInlineValue},dataReference:{name:hr.dataReference,referenceType:fa.$type},dataType:{name:hr.dataType},entityIdentifier:{name:hr.entityIdentifier},modelEntityType:{name:hr.modelEntityType},name:{name:hr.name},sourceFrames:{name:hr.sourceFrames,defaultValue:[],referenceType:Qr.$type}},superTypes:[Qr.$type]},EmTimeFrame:{name:Lr.$type,properties:{dataInlineValue:{name:Lr.dataInlineValue},dataReference:{name:Lr.dataReference,referenceType:fa.$type},dataType:{name:Lr.dataType},entityIdentifier:{name:Lr.entityIdentifier},modelEntityType:{name:Lr.modelEntityType},name:{name:Lr.name},sourceFrames:{name:Lr.sourceFrames,defaultValue:[],referenceType:Qr.$type}},superTypes:[Qr.$type]},Entry:{name:oc.$type,properties:{axis:{name:oc.axis,referenceType:fo.$type},value:{name:oc.value}},superTypes:[]},EventModel:{name:fr.$type,properties:{accDescr:{name:fr.accDescr},accTitle:{name:fr.accTitle},dataEntities:{name:fr.dataEntities,defaultValue:[]},frames:{name:fr.frames,defaultValue:[]},gwtEntities:{name:fr.gwtEntities,defaultValue:[]},modelEntities:{name:fr.modelEntities,defaultValue:[]},noteEntities:{name:fr.noteEntities,defaultValue:[]},title:{name:fr.title}},superTypes:[]},Evolution:{name:tg.$type,properties:{stages:{name:tg.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:vo.$type,properties:{boundary:{name:vo.boundary},name:{name:vo.name},secondName:{name:vo.secondName}},superTypes:[]},Evolve:{name:lc.$type,properties:{component:{name:lc.component},target:{name:lc.target}},superTypes:[]},GitGraph:{name:cn.$type,properties:{accDescr:{name:cn.accDescr},accTitle:{name:cn.accTitle},statements:{name:cn.statements,defaultValue:[]},title:{name:cn.title}},superTypes:[]},Group:{name:Gi.$type,properties:{icon:{name:Gi.icon},id:{name:Gi.id},in:{name:Gi.in},title:{name:Gi.title}},superTypes:[]},Info:{name:es.$type,properties:{accDescr:{name:es.accDescr},accTitle:{name:es.accTitle},title:{name:es.title}},superTypes:[]},Item:{name:Fi.$type,properties:{classSelector:{name:Fi.classSelector},name:{name:Fi.name}},superTypes:[]},Junction:{name:uc.$type,properties:{id:{name:uc.id},in:{name:uc.in}},superTypes:[]},Label:{name:zi.$type,properties:{negX:{name:zi.negX,defaultValue:!1},negY:{name:zi.negY,defaultValue:!1},offsetX:{name:zi.offsetX},offsetY:{name:zi.offsetY}},superTypes:[]},Leaf:{name:To.$type,properties:{classSelector:{name:To.classSelector},name:{name:To.name},value:{name:To.value}},superTypes:[Fi.$type]},Link:{name:en.$type,properties:{arrow:{name:en.arrow},from:{name:en.from},fromPort:{name:en.fromPort},linkLabel:{name:en.linkLabel},to:{name:en.to},toPort:{name:en.toPort}},superTypes:[]},Merge:{name:Aa.$type,properties:{branch:{name:Aa.branch},id:{name:Aa.id},tags:{name:Aa.tags,defaultValue:[]},type:{name:Aa.type}},superTypes:[pa.$type]},Note:{name:$o.$type,properties:{evolution:{name:$o.evolution},text:{name:$o.text},visibility:{name:$o.visibility}},superTypes:[]},Option:{name:cc.$type,properties:{name:{name:cc.name},value:{name:cc.value,defaultValue:!1}},superTypes:[]},Packet:{name:Ea.$type,properties:{accDescr:{name:Ea.accDescr},accTitle:{name:Ea.accTitle},blocks:{name:Ea.blocks,defaultValue:[]},title:{name:Ea.title}},superTypes:[]},PacketBlock:{name:Ca.$type,properties:{bits:{name:Ca.bits},end:{name:Ca.end},label:{name:Ca.label},start:{name:Ca.start}},superTypes:[]},PegAny:{name:rg.$type,properties:{dot:{name:rg.dot}},superTypes:[ji.$type]},PegGroup:{name:ng.$type,properties:{element:{name:ng.element}},superTypes:[ji.$type]},PegIdentifier:{name:ag.$type,properties:{name:{name:ag.name}},superTypes:[ji.$type]},PegLiteral:{name:ig.$type,properties:{value:{name:ig.value}},superTypes:[ji.$type]},PegOrderedChoice:{name:sg.$type,properties:{alternatives:{name:sg.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:fc.$type,properties:{operator:{name:fc.operator},suffix:{name:fc.suffix}},superTypes:[]},PegPrimary:{name:ji.$type,properties:{},superTypes:[]},PegRule:{name:dc.$type,properties:{definition:{name:dc.definition},name:{name:dc.name}},superTypes:[]},PegSequence:{name:og.$type,properties:{elements:{name:og.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:pc.$type,properties:{operator:{name:pc.operator},primary:{name:pc.primary}},superTypes:[]},Pie:{name:fn.$type,properties:{accDescr:{name:fn.accDescr},accTitle:{name:fn.accTitle},sections:{name:fn.sections,defaultValue:[]},showData:{name:fn.showData,defaultValue:!1},title:{name:fn.title}},superTypes:[]},PieSection:{name:Wo.$type,properties:{label:{name:Wo.label},value:{name:Wo.value}},superTypes:[]},Pipeline:{name:mc.$type,properties:{components:{name:mc.components,defaultValue:[]},parent:{name:mc.parent}},superTypes:[]},PipelineComponent:{name:Ro.$type,properties:{evolution:{name:Ro.evolution},label:{name:Ro.label},name:{name:Ro.name}},superTypes:[]},Radar:{name:tn.$type,properties:{accDescr:{name:tn.accDescr},accTitle:{name:tn.accTitle},axes:{name:tn.axes,defaultValue:[]},curves:{name:tn.curves,defaultValue:[]},options:{name:tn.options,defaultValue:[]},title:{name:tn.title}},superTypes:[]},Railroad:{name:ba.$type,properties:{accDescr:{name:ba.accDescr},accTitle:{name:ba.accTitle},rules:{name:ba.rules,defaultValue:[]},title:{name:ba.title}},superTypes:[]},RailroadAbnf:{name:_a.$type,properties:{accDescr:{name:_a.accDescr},accTitle:{name:_a.accTitle},rules:{name:_a.rules,defaultValue:[]},title:{name:_a.title}},superTypes:[]},RailroadChoiceExpr:{name:lg.$type,properties:{alternatives:{name:lg.alternatives,defaultValue:[]}},superTypes:[dr.$type]},RailroadEbnf:{name:Sa.$type,properties:{accDescr:{name:Sa.accDescr},accTitle:{name:Sa.accTitle},rules:{name:Sa.rules,defaultValue:[]},title:{name:Sa.title}},superTypes:[]},RailroadExpression:{name:dr.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:ug.$type,properties:{name:{name:ug.name}},superTypes:[dr.$type]},RailroadOneOrMoreExpr:{name:cg.$type,properties:{element:{name:cg.element}},superTypes:[dr.$type]},RailroadOptionalExpr:{name:fg.$type,properties:{element:{name:fg.element}},superTypes:[dr.$type]},RailroadPeg:{name:wa.$type,properties:{accDescr:{name:wa.accDescr},accTitle:{name:wa.accTitle},rules:{name:wa.rules,defaultValue:[]},title:{name:wa.title}},superTypes:[]},RailroadRule:{name:hc.$type,properties:{definition:{name:hc.definition},name:{name:hc.name}},superTypes:[]},RailroadSequenceExpr:{name:dg.$type,properties:{elements:{name:dg.elements,defaultValue:[]}},superTypes:[dr.$type]},RailroadSpecialExpr:{name:pg.$type,properties:{text:{name:pg.text}},superTypes:[dr.$type]},RailroadTerminalExpr:{name:mg.$type,properties:{value:{name:mg.value}},superTypes:[dr.$type]},RailroadZeroOrMoreExpr:{name:hg.$type,properties:{element:{name:hg.element}},superTypes:[dr.$type]},Section:{name:yc.$type,properties:{classSelector:{name:yc.classSelector},name:{name:yc.name}},superTypes:[Fi.$type]},Service:{name:da.$type,properties:{icon:{name:da.icon},iconText:{name:da.iconText},id:{name:da.id},in:{name:da.in},title:{name:da.title}},superTypes:[]},Size:{name:gc.$type,properties:{height:{name:gc.height},width:{name:gc.width}},superTypes:[]},Statement:{name:pa.$type,properties:{},superTypes:[]},Transition:{name:ts.$type,properties:{from:{name:ts.from},label:{name:ts.label},to:{name:ts.to}},superTypes:[]},TreeNode:{name:ma.$type,properties:{classAnnotation:{name:ma.classAnnotation},descAnnotation:{name:ma.descAnnotation},iconAnnotation:{name:ma.iconAnnotation},indent:{name:ma.indent},name:{name:ma.name}},superTypes:[]},TreeView:{name:Bi.$type,properties:{accDescr:{name:Bi.accDescr},accTitle:{name:Bi.accTitle},nodes:{name:Bi.nodes,defaultValue:[]},title:{name:Bi.title}},superTypes:[]},Treemap:{name:Ia.$type,properties:{accDescr:{name:Ia.accDescr},accTitle:{name:Ia.accTitle},title:{name:Ia.title},TreemapRows:{name:Ia.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:vc.$type,properties:{indent:{name:vc.indent},item:{name:vc.item}},superTypes:[]},Wardley:{name:We.$type,properties:{accDescr:{name:We.accDescr},accelerators:{name:We.accelerators,defaultValue:[]},accTitle:{name:We.accTitle},anchors:{name:We.anchors,defaultValue:[]},annotation:{name:We.annotation,defaultValue:[]},annotations:{name:We.annotations,defaultValue:[]},components:{name:We.components,defaultValue:[]},deaccelerators:{name:We.deaccelerators,defaultValue:[]},evolution:{name:We.evolution},evolves:{name:We.evolves,defaultValue:[]},links:{name:We.links,defaultValue:[]},notes:{name:We.notes,defaultValue:[]},pipelines:{name:We.pipelines,defaultValue:[]},size:{name:We.size},title:{name:We.title}},superTypes:[]}}}static{i(this,"MermaidAstReflection")}},Ne=new zw,yg,ez=i(()=>yg??(yg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),gg,tz=i(()=>gg??(gg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),vg,rz=i(()=>vg??(vg=Ue('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Tg,nz=i(()=>Tg??(Tg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),$g,az=i(()=>$g??($g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Rg,iz=i(()=>Rg??(Rg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Ag,sz=i(()=>Ag??(Ag=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Eg,oz=i(()=>Eg??(Eg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Cg,lz=i(()=>Cg??(Cg=Ue('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),bg,uz=i(()=>bg??(bg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),_g,cz=i(()=>_g??(_g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),Sg,fz=i(()=>Sg??(Sg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),wg,dz=i(()=>wg??(wg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Ig,pz=i(()=>Ig??(Ig=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Ng,mz=i(()=>Ng??(Ng=Ue(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),hz={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yz={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gz={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vz={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tz={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$z={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Rz={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Az={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ez={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Cz={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bz={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_z={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sz={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wz={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iz={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ut={AstReflection:i(()=>new zw,"AstReflection")},Nz={Grammar:i(()=>ez(),"Grammar"),LanguageMetaData:i(()=>hz,"LanguageMetaData"),parser:{}},Pz={Grammar:i(()=>tz(),"Grammar"),LanguageMetaData:i(()=>yz,"LanguageMetaData"),parser:{}},kz={Grammar:i(()=>rz(),"Grammar"),LanguageMetaData:i(()=>gz,"LanguageMetaData"),parser:{}},Oz={Grammar:i(()=>nz(),"Grammar"),LanguageMetaData:i(()=>vz,"LanguageMetaData"),parser:{}},Lz={Grammar:i(()=>az(),"Grammar"),LanguageMetaData:i(()=>Tz,"LanguageMetaData"),parser:{}},Dz={Grammar:i(()=>iz(),"Grammar"),LanguageMetaData:i(()=>$z,"LanguageMetaData"),parser:{}},xz={Grammar:i(()=>sz(),"Grammar"),LanguageMetaData:i(()=>Rz,"LanguageMetaData"),parser:{}},Mz={Grammar:i(()=>oz(),"Grammar"),LanguageMetaData:i(()=>Az,"LanguageMetaData"),parser:{}},Gz={Grammar:i(()=>lz(),"Grammar"),LanguageMetaData:i(()=>Ez,"LanguageMetaData"),parser:{}},Fz={Grammar:i(()=>uz(),"Grammar"),LanguageMetaData:i(()=>Cz,"LanguageMetaData"),parser:{}},zz={Grammar:i(()=>cz(),"Grammar"),LanguageMetaData:i(()=>bz,"LanguageMetaData"),parser:{}},jz={Grammar:i(()=>fz(),"Grammar"),LanguageMetaData:i(()=>_z,"LanguageMetaData"),parser:{}},Bz={Grammar:i(()=>dz(),"Grammar"),LanguageMetaData:i(()=>Sz,"LanguageMetaData"),parser:{}},Uz={Grammar:i(()=>pz(),"Grammar"),LanguageMetaData:i(()=>wz,"LanguageMetaData"),parser:{}},Kz={Grammar:i(()=>mz(),"Grammar"),LanguageMetaData:i(()=>Iz,"LanguageMetaData"),parser:{}},Wz=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,qz=/accTitle[\t ]*:([^\n\r]*)/,Vz=/title([\t ][^\n\r]*|)/,Hz={ACC_DESCR:Wz,ACC_TITLE:qz,TITLE:Vz},lr=class extends Fm{static{i(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){const n=Hz[e.name];if(n===void 0)return;const a=n.exec(t);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},ui=class extends lr{static{i(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},ct=class extends Lu{static{i(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const n=super.buildKeywordTokens(e,t,r);return n.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends ct{static{i(this,"CommonTokenBuilder")}});/*! Bundled license information: + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var Yz=class extends ct{static{i(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},jw={parser:{TokenBuilder:i(()=>new Yz,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")}};function Bw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Mz,jw);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}i(Bw,"createRadarServices");var Xz=class extends ct{static{i(this,"RailroadTokenBuilder")}constructor(){super(["railroad-beta"])}},Pg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Xz,"TokenBuilder"),ValueConverter:i(()=>new Jz,"ValueConverter")}};function Kw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),zz,Uw);return t.ServiceRegistry.register(r),{shared:t,Railroad:r}}i(Kw,"createRailroadServices");var Zz=class extends ct{static{i(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},kg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Zz,"TokenBuilder"),ValueConverter:i(()=>new Qz,"ValueConverter")}};function qw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Fz,Ww);return t.ServiceRegistry.register(r),{shared:t,RailroadEbnf:r}}i(qw,"createRailroadEbnfServices");var ej=class extends ct{static{i(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},tj=class extends lr{static{i(this,"RailroadAbnfValueConverter")}runConverter(e,t,r){const n=super.runConverter(e,t,r);if(e.name==="TITLE"&&typeof n=="string"){const a=n.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return n}runCustomConverter(e,t,r){if(e.name==="ABNF_STRING")return t.slice(1,-1)}},Vw={parser:{TokenBuilder:i(()=>new ej,"TokenBuilder"),ValueConverter:i(()=>new tj,"ValueConverter")}};function Hw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Gz,Vw);return t.ServiceRegistry.register(r),{shared:t,RailroadAbnf:r}}i(Hw,"createRailroadAbnfServices");var rj=class extends ct{static{i(this,"RailroadPegTokenBuilder")}constructor(){super(["railroad-peg-beta"])}},Og=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew rj,"TokenBuilder"),ValueConverter:i(()=>new nj,"ValueConverter")}};function Xw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),jz,Yw);return t.ServiceRegistry.register(r),{shared:t,RailroadPeg:r}}i(Xw,"createRailroadPegServices");var aj=class extends ct{static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},ij=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,sj=class extends lr{static{i(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;const n=ij.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function Jw(e){const t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){const n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}i(Jw,"registerValidationChecks");var oj=class{static{i(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(const n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},Zw={parser:{TokenBuilder:i(()=>new aj,"TokenBuilder"),ValueConverter:i(()=>new sj,"ValueConverter")},validation:{TreemapValidator:i(()=>new oj,"TreemapValidator")}};function Qw(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Bz,Zw);return t.ServiceRegistry.register(r),Jw(r),{shared:t,Treemap:r}}i(Qw,"createTreemapServices");var lj=class extends lr{static{i(this,"WardleyValueConverter")}runCustomConverter(e,t,r){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return}}},eI={parser:{ValueConverter:i(()=>new lj,"ValueConverter")}};function tI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Kz,eI);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}i(tI,"createWardleyServices");var uj=class extends ct{static{i(this,"CynefinTokenBuilder")}constructor(){super(["cynefin-beta"])}},rI={parser:{TokenBuilder:i(()=>new uj,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")}};function nI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Pz,rI);return t.ServiceRegistry.register(r),{shared:t,Cynefin:r}}i(nI,"createCynefinServices");var cj=class extends ct{static{i(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},aI={parser:{TokenBuilder:i(()=>new cj,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")}};function iI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Oz,aI);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}i(iI,"createGitGraphServices");var fj=class extends ct{static{i(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},sI={parser:{TokenBuilder:i(()=>new fj,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")}};function oI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Lz,sI);return t.ServiceRegistry.register(r),{shared:t,Info:r}}i(oI,"createInfoServices");var dj=class extends ct{static{i(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},lI={parser:{TokenBuilder:i(()=>new dj,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")}};function uI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Dz,lI);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}i(uI,"createPacketServices");var pj=class extends ct{static{i(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},mj=class extends lr{static{i(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},cI={parser:{TokenBuilder:i(()=>new pj,"TokenBuilder"),ValueConverter:i(()=>new mj,"ValueConverter")}};function fI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),xz,cI);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}i(fI,"createPieServices");var hj=class extends lr{static{i(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="QUOTED_NAME")return t.substring(1,t.length-1);if(e.name==="BARE_NAME")return t.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return t.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const n=t.trim();return n.substring(5,n.length-1)}if(e.name==="DESC_ANNOTATION")return t.trim().substring(2).trim()}},yj=class extends ct{static{i(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},dI={parser:{TokenBuilder:i(()=>new yj,"TokenBuilder"),ValueConverter:i(()=>new hj,"ValueConverter")}};function pI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Uz,dI);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}i(pI,"createTreeViewServices");var gj=class extends ct{static{i(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},vj=class extends lr{static{i(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},mI={parser:{TokenBuilder:i(()=>new gj,"TokenBuilder"),ValueConverter:i(()=>new vj,"ValueConverter")}};function hI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),Nz,mI);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}i(hI,"createArchitectureServices");var Tj=class extends ct{static{i(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},Lg=new Set(["cmd","command"]),Dg=new Set(["evt","event"]),Tc=new Set(["rmo","readmodel"]),xg=new Set(["pcr","processor"]),Mg=new Set(["ui"]);function yI(e){const t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){const n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}i(yI,"registerValidationChecks");var $j=class{static{i(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(Lg.has(e.modelEntityType)?this.validateSources(e,new Set([...Mg,...xg]),"command","ui or processor",t):Dg.has(e.modelEntityType)?this.validateSources(e,Lg,"event","command",t):Tc.has(e.modelEntityType)?this.validateSources(e,Dg,"read model","event",t):xg.has(e.modelEntityType)?this.validateSources(e,Tc,"processor","read model",t):Mg.has(e.modelEntityType)&&this.validateSources(e,Tc,"ui","read model",t))}validateSources(e,t,r,n,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!t.has(o.modelEntityType)&&a("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},gI={parser:{TokenBuilder:i(()=>new Tj,"TokenBuilder"),ValueConverter:i(()=>new ui,"ValueConverter")},validation:{EventModelingValidator:i(()=>new $j,"EventModelingValidator")}};function vI(e=Xe){const t=ee(Be(e),ut),r=ee(je({shared:t}),kz,gI);return t.ServiceRegistry.register(r),yI(r),{shared:t,EventModel:r}}i(vI,"createEventModelingServices");var qe={},Rj={info:i(async()=>{const{createInfoServices:e}=await Promise.resolve().then(function(){return Cj}),t=e().Info.parser.LangiumParser;qe.info=t},"info"),packet:i(async()=>{const{createPacketServices:e}=await Promise.resolve().then(function(){return bj}),t=e().Packet.parser.LangiumParser;qe.packet=t},"packet"),pie:i(async()=>{const{createPieServices:e}=await Promise.resolve().then(function(){return _j}),t=e().Pie.parser.LangiumParser;qe.pie=t},"pie"),treeView:i(async()=>{const{createTreeViewServices:e}=await Promise.resolve().then(function(){return Sj}),t=e().TreeView.parser.LangiumParser;qe.treeView=t},"treeView"),architecture:i(async()=>{const{createArchitectureServices:e}=await Promise.resolve().then(function(){return wj}),t=e().Architecture.parser.LangiumParser;qe.architecture=t},"architecture"),gitGraph:i(async()=>{const{createGitGraphServices:e}=await Promise.resolve().then(function(){return Ij}),t=e().GitGraph.parser.LangiumParser;qe.gitGraph=t},"gitGraph"),eventmodeling:i(async()=>{const{createEventModelingServices:e}=await Promise.resolve().then(function(){return Nj}),t=e().EventModel.parser.LangiumParser;qe.eventmodeling=t},"eventmodeling"),radar:i(async()=>{const{createRadarServices:e}=await Promise.resolve().then(function(){return Pj}),t=e().Radar.parser.LangiumParser;qe.radar=t},"radar"),railroad:i(async()=>{const{createRailroadServices:e}=await Promise.resolve().then(function(){return kj}),t=e().Railroad.parser.LangiumParser;qe.railroad=t},"railroad"),railroadEbnf:i(async()=>{const{createRailroadEbnfServices:e}=await Promise.resolve().then(function(){return Oj}),t=e().RailroadEbnf.parser.LangiumParser;qe.railroadEbnf=t},"railroadEbnf"),railroadAbnf:i(async()=>{const{createRailroadAbnfServices:e}=await Promise.resolve().then(function(){return Lj}),t=e().RailroadAbnf.parser.LangiumParser;qe.railroadAbnf=t},"railroadAbnf"),railroadPeg:i(async()=>{const{createRailroadPegServices:e}=await Promise.resolve().then(function(){return Dj}),t=e().RailroadPeg.parser.LangiumParser;qe.railroadPeg=t},"railroadPeg"),treemap:i(async()=>{const{createTreemapServices:e}=await Promise.resolve().then(function(){return xj}),t=e().Treemap.parser.LangiumParser;qe.treemap=t},"treemap"),wardley:i(async()=>{const{createWardleyServices:e}=await Promise.resolve().then(function(){return Mj}),t=e().Wardley.parser.LangiumParser;qe.wardley=t},"wardley"),cynefin:i(async()=>{const{createCynefinServices:e}=await Promise.resolve().then(function(){return Gj}),t=e().Cynefin.parser.LangiumParser;qe.cynefin=t},"cynefin")};async function Aj(e,t){const r=Rj[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);qe[e]||await r();const a=qe[e].parse(t);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new Ej(a);return a.value}i(Aj,"parse");var Ej=class extends Error{constructor(e){const t=e.lexerErrors.map(n=>{const a=n.line!==void 0&&!isNaN(n.line)?n.line:"?",s=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${a}, column ${s}: ${n.message}`}).join(` +`),r=e.parserErrors.map(n=>{const a=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",s=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${n.message}`}).join(` +`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{i(this,"MermaidParseError")}},Cj=Object.freeze({__proto__:null,InfoModule:sI,createInfoServices:oI}),bj=Object.freeze({__proto__:null,PacketModule:lI,createPacketServices:uI}),_j=Object.freeze({__proto__:null,PieModule:cI,createPieServices:fI}),Sj=Object.freeze({__proto__:null,TreeViewModule:dI,createTreeViewServices:pI}),wj=Object.freeze({__proto__:null,ArchitectureModule:mI,createArchitectureServices:hI}),Ij=Object.freeze({__proto__:null,GitGraphModule:aI,createGitGraphServices:iI}),Nj=Object.freeze({__proto__:null,EventModelingModule:gI,createEventModelingServices:vI}),Pj=Object.freeze({__proto__:null,RadarModule:jw,createRadarServices:Bw}),kj=Object.freeze({__proto__:null,RailroadModule:Uw,createRailroadServices:Kw}),Oj=Object.freeze({__proto__:null,RailroadEbnfModule:Ww,createRailroadEbnfServices:qw}),Lj=Object.freeze({__proto__:null,RailroadAbnfModule:Vw,createRailroadAbnfServices:Hw}),Dj=Object.freeze({__proto__:null,RailroadPegModule:Yw,createRailroadPegServices:Xw}),xj=Object.freeze({__proto__:null,TreemapModule:Zw,createTreemapServices:Qw}),Mj=Object.freeze({__proto__:null,WardleyModule:eI,createWardleyServices:tI}),Gj=Object.freeze({__proto__:null,CynefinModule:rI,createCynefinServices:nI});export{Ej as M,qw as a,Hw as b,Kw as c,Xw as d,FF as i,Aj as p}; diff --git a/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-D_g9voaT.js b/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-D_g9voaT.js new file mode 100644 index 000000000..e3fc97f91 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-D_g9voaT.js @@ -0,0 +1,62 @@ +import{p as xt}from"./chunk-JWPE2WC7-CM6UswKM.js";import{s as gt,g as $t,q as bt,p as wt,a as Ct,b as vt,_ as s,l as Y,G as Dt,d as kt,r as At,D as U,A as Q,E as Tt,X as ot}from"./mermaid.core-CM2luXFy.js";import{p as Bt}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),G=rt(),St=s(()=>G.domains,"getDomains"),Mt=s(()=>G.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(Y.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),G=rt()},"clear"),X={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,X),X.setDomains(t.domains),X.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);Y.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();Y.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),O=["complex","complicated","chaotic","clear"];for(const l of O){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of O){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of O){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const H=x.getBBox();H.width>0&&($=H.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){Y.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,H=-x/C,ht=$/C,et=M+H*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Gt=s(()=>{const t=Vt();return` + .cynefinDomain { + stroke: none; + } + .cynefinDomainLabel { + font-size: ${t.domainFontSize}px; + font-weight: bold; + fill: ${t.labelColor}; + } + .cynefinSubtitle { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${t.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${t.itemFontSize}px; + fill: ${t.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${t.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${t.boundaryColor}; + stroke-width: ${t.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${t.cliffColor}; + stroke-width: ${t.cliffWidth}; + } + .cynefinConfusion { + stroke: ${t.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${t.arrowColor}; + stroke-width: ${t.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${t.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + } + .cynefinTitle { + font-size: ${t.domainFontSize+2}px; + font-weight: bold; + fill: ${t.labelColor}; + } + `},"styles"),Ht=Gt,Ut={parser:Wt,db:X,renderer:Ft,styles:Ht};export{Ut as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-EyurVxGj.js b/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-EyurVxGj.js new file mode 100644 index 000000000..a16e52813 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cynefinDiagram-5FMLGOSQ-EyurVxGj.js @@ -0,0 +1,62 @@ +import{p as xt}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,d as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaidParser.worker-DimdFOud.js";import{p as Bt}from"./cynefin-OW5HDTMX-CZChzy6K.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` + .cynefinDomain { + stroke: none; + } + .cynefinDomainLabel { + font-size: ${t.domainFontSize}px; + font-weight: bold; + fill: ${t.labelColor}; + } + .cynefinSubtitle { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${t.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${t.itemFontSize}px; + fill: ${t.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${t.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${t.boundaryColor}; + stroke-width: ${t.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${t.cliffColor}; + stroke-width: ${t.cliffWidth}; + } + .cynefinConfusion { + stroke: ${t.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${t.arrowColor}; + stroke-width: ${t.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${t.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + } + .cynefinTitle { + font-size: ${t.domainFontSize+2}px; + font-weight: bold; + fill: ${t.labelColor}; + } + `},"styles"),Gt=Ht,jt={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{jt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/cytoscape.esm-CNiYdHpY.js b/apps/pythinker-code/dist-web/assets/cytoscape.esm-CNiYdHpY.js new file mode 100644 index 000000000..888a729f9 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/cytoscape.esm-CNiYdHpY.js @@ -0,0 +1,331 @@ +function Ds(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Ql(r,e,t){return(e=Jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ic(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function sc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function oc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uc(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xe(r,e){return tc(r)||sc(r,e)||Ks(r,e)||oc()}function yn(r){return ac(r)||ic(r)||Ks(r)||uc()}function lc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Jl(r){var e=lc(r,"string");return typeof e=="symbol"?e:e+""}function je(r){"@babel/helpers - typeof";return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(r)}function Ks(r,e){if(r){if(typeof r=="string")return Ds(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ds(r,e):void 0}}var Qe=typeof window>"u"?null:window,Co=Qe?Qe.navigator:null;Qe&&Qe.document;var vc=je(""),jl=je({}),fc=je(function(){}),cc=typeof HTMLElement>"u"?"undefined":je(HTMLElement),La=function(e){return e&&e.instanceString&&He(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&je(e)==vc},He=function(e){return e!=null&&je(e)===fc},Fe=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&je(e)===jl&&!Fe(e)&&e.constructor===Object},dc=function(e){return e!=null&&je(e)===jl},ae=function(e){return e!=null&&je(e)===je(1)&&!isNaN(e)},ev=function(e){return ae(e)&&Math.floor(e)===e},mn=function(e){if(cc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Xs=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},hc=function(e){return La(e)==="event"},st=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},gc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},pc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},yc=function(e){return dc(e)&&He(e.then)},mc=function(){return Co&&Co.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Sc=function(e,t){return-1*nv(e,t)},me=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+xc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},Bc=function(e){var t,a=new RegExp("^"+bc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Pc=function(e){return Ac[e.toLowerCase()]},iv=function(e){return(Fe(e)?e:null)||Pc(e)||kc(e)||Bc(e)||Dc(e)},Ac={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},sv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=u||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function B(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function D(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,u),w(y)}return d===void 0&&(d=setTimeout(T,u)),h}return P.cancel=B,P.flush=D,P}return vi=s,vi}var qc=Vc(),Fa=Oa(qc),fi=Qe?Qe.performance:null,lv=fi&&fi.now?function(){return fi.now()}:function(){return Date.now()},_c=(function(){if(Qe){if(Qe.requestAnimationFrame)return function(r){Qe.requestAnimationFrame(r)};if(Qe.mozRequestAnimationFrame)return function(r){Qe.mozRequestAnimationFrame(r)};if(Qe.webkitRequestAnimationFrame)return function(r){Qe.webkitRequestAnimationFrame(r)};if(Qe.msRequestAnimationFrame)return function(r){Qe.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(lv())},1e3/60)}})(),bn=function(e){return _c(e)},Kr=lv,Et=9261,vv=65599,_t=5381,fv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Et,a=t,n;n=e.next(),!n.done;)a=a*vv+n.value|0;return a},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Et;return t*vv+e|0},Ta=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;return(t<<5)+t+e|0},Gc=function(e,t){return e*2097152+t},Jr=function(e){return e[0]*2097152+e[1]},Ka=function(e,t){return[Ca(e[0],t[0]),Ta(e[1],t[1])]},Vo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},js=function(e){e.splice(0,e.length)},Jc=function(e,t){for(var a=0;a"u"?"undefined":je(Set))!==ed?Set:rd,Ln=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Xs(e)){Ge("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ge("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ra,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];Fe(t.classes)?l=t.classes:he(t.classes)&&(l=t.classes.split(/\s+/));for(var v=0,f=l.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bB;0<=B?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;wD;0<=D?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),B=0;B0)for(N.unshift(M);f[_];){var z=f[_];N.unshift(z.edge),N.unshift(z.node),F=z.node,_=F.id()}return o.spawn(N)}}}},ud={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,u=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var T=[],k=i,B=v,D=p[B];T.unshift(k),D!=null&&T.unshift(D),k=g[B],k!=null;)B=k.id(),D=p[B];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AD&&(d[B]=D,m[B]=k,b[B]=E),!i){var P=k*v+T;!i&&d[P]>D&&(d[P]=D,m[P]=T,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,se=b(ye),de=[],ge=se;;){if(ge==null)return t.spawn();var Ee=m(ge),be=Ee.edge,Te=Ee.pred;if(de.unshift(ge[0]),ge.same(pe)&&de.length>0)break;be!=null&&de.unshift(be),ge=Te}return u.spawn(de)},C=0;C=0;v--){var f=l[v],c=f[1],h=f[2];(t[c]===o&&t[h]===u||t[c]===u&&t[h]===o)&&l.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=pd(i,e,t),a--}return t},yd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(N){return N.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/gd);if(i<2){Ge("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},mv=function(e,t){return t===0?e:mv(t,e%t)},Cd=function(e){for(var t=e[0],a=0;a0&&(t=mv(t,e[a]));else return 0;return t},Td=function(e){return Math.PI*e/180},Xa=function(e,t){return Math.atan2(t,e)-Math.PI/2},eo=Math.log2||function(r){return Math.log(r)/Math.log(2)},ro=function(e){return e>0?1:e<0?-1:0},kt=function(e,t){return Math.sqrt(wt(e,t))},wt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Sd=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Dd=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Bd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Pd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},bv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},on=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},un=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Xe(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},$o=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},to=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},tt=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Uo=function(e,t){return tt(e,t.x,t.y)},wv=function(e,t){return tt(e,t.x1,t.y1)&&tt(e,t.x2,t.y2)},Ad=(hi=Math.hypot)!==null&&hi!==void 0?hi:function(r,e){return Math.sqrt(r*r+e*e)};function Rd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Ad(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,B=0;B7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?ut(i,s):u,v=i/2,f=s/2;l=Math.min(l,v,f);var c=l!==v,h=l!==f,d;if(c){var y=a-v+l-o,g=n-f-o,p=a+v-l+o,m=g;if(d=at(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+l-o,E=b,C=n+f-l+o;if(d=at(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+l-o,T=n+f+o,k=a+v-l+o,B=T;if(d=at(e,t,a,n,x,T,k,B,!1),d.length>0)return d}if(h){var D=a-v-o,P=n-f+l-o,A=D,R=n+f-l+o;if(d=at(e,t,a,n,D,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+l,M=n-f+l;if(L=ya(e,t,a,n,I,M,l+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var N=a+v-l,F=n-f+l;if(L=ya(e,t,a,n,N,F,l+o),L.length>0&&L[0]>=N&&L[1]<=F)return[L[0],L[1]]}{var _=a+v-l,z=n+f-l;if(L=ya(e,t,a,n,_,z,l+o),L.length>0&&L[0]>=_&&L[1]>=z)return[L[0],L[1]]}{var q=a-v+l,Z=n+f-l;if(L=ya(e,t,a,n,q,Z,l+o),L.length>0&&L[0]<=q&&L[1]>=Z)return[L[0],L[1]]}return[]},Ld=function(e,t,a,n,i,s,o){var u=o,l=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return l-u<=e&&e<=v+u&&f-u<=t&&t<=c+u},Id=function(e,t,a,n,i,s,o,u,l){var v={x1:Math.min(a,o,i)-l,x2:Math.max(a,o,i)+l,y1:Math.min(n,u,s)-l,y2:Math.max(n,u,s)+l};return!(ev.x2||tv.y2)},Od=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-t+s)/o,l=(-t-s)/o;return[u,l]},Nd=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,u,l,v,f,c,h,d;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,o=u*u*u+l*l,i[1]=0,h=t/3,o>0){f=l+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=l-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}u=-u,v=u*u*u,v=Math.acos(l/Math.sqrt(v)),d=2*Math.sqrt(u),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},zd=function(e,t,a,n,i,s,o,u){var l=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*u-n*t+2*s*s+2*s*t-u*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Nd(l,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wl?(e-i)*(e-i)+(t-s)*(t-s):v-c},Er=function(e,t,a){for(var n,i,s,o,u,l=0,v=0;v=e&&e>=s||n<=e&&e<=s)u=(e-n)/(s-n)*(o-i)+i,u>t&&l++;else continue;return l%2!==0},Xr=function(e,t,a,n,i,s,o,u,l){var v=new Array(a.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=En(v,-l);y=xn(g)}else y=v;return Er(e,t,y)},Vd=function(e,t,a,n,i,s,o,u){for(var l=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*u[0]+e,w=m[0]*u[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*u[0]+e,C=m[1]*u[1]+t;return[b,w,E,C]}else return[b,w]},gi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},at=function(e,t,a,n,i,s,o,u,l){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=u-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:l?[e+b*f,t+b*d]:[]}else return g===0||p===0?gi(e,a,o)===o?[o,u]:gi(e,a,i)===i?[i,s]:gi(i,o,a)===a?[a,n]:[]:[]},_d=function(e,t,a,n,i){var s=[],o=n/2,u=i/2,l=t,v=a;s.push({x:l+o*e[0],y:v+u*e[1]});for(var f=1;f0){var y=En(f,-u);h=xn(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return l[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[D]+I&&(x[A]=x[D]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[D]+I&&(C[A]=C[A]+C[D],E[A].push(D))}else for(var M=0;M0;){for(var z=w.pop(),q=0;q0&&o.push(a[u]);o.length!==0&&i.push(n.collection(o))}return i},th=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:ih,o=n,u,l,v=0;v=2?va(e,t,a,0,Qo,sh):va(e,t,a,0,Zo)},squaredEuclidean:function(e,t,a){return va(e,t,a,0,Qo)},manhattan:function(e,t,a){return va(e,t,a,0,Zo)},max:function(e,t,a){return va(e,t,a,-1/0,oh)}};Zt["squared-euclidean"]=Zt.squaredEuclidean;Zt.squaredeuclidean=Zt.squaredEuclidean;function On(r,e,t,a,n,i){var s;return He(r)?s=r:s=Zt[r]||Zt.euclidean,e===0&&He(r)?s(n,i):s(e,t,a,n,i)}var uh=lr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),no=function(e){return uh(e)},Cn=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},u=function(c){return n[c](t)},l=a,v=t;return On(e,n.length,o,u,l,v)},yi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),u=null,l=0;la)return!1}return!0},fh=function(e,t,a){for(var n=0;no&&(o=t[l][v],u=v);i[u].push(e[l])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="max"?(u=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},au=function(e,t,a){for(var n=[],i=0;io&&(s=l,o=t[i*e+l])}s>0&&n.push(s)}for(var v=0;vl&&(u=v,l=f)}a[i]=s[u]}return n=au(e,t,a),n},nu=function(e){for(var t=this.cy(),a=this.nodes(),n=Ch(e),i={},s=0;s=D?(P=D,D=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+q]=Z,z+=Z}if(z>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var Q=0,X=0;X1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(T){T.isEdge()&&f[b].push(T.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(u?l?o=!0:l=b:u=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(l&&u)if(i){if(v&&l!=v)return h;v=l}else{if(v&&l!=v&&u!=v)return h;v||(v=l)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,T;f[w].length;)C=f[w].shift(),x=c[C][0],T=c[C][1],w!=T?(f[T]=f[T].filter(function(k){return k!=C}),w=T):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Za=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},u=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},l=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(l(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,u(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Rh={hopcroftTarjanBiconnected:Za,htbc:Za,htb:Za,hopcroftTarjanBiconnectedComponents:Za},Qa=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var v=e.getElementById(l).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==l&&(g in t||o(g),t[g].explored||(t[l].low=Math.min(t[l].low,t[g].low)))}),t[l].index===t[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||o(l)}}),{cut:s,components:n}},Mh={tarjanStronglyConnected:Qa,tsc:Qa,tscc:Qa,tarjanStronglyConnectedComponents:Qa},Bv={};[Sa,od,ud,vd,cd,hd,yd,$d,Ut,Kt,As,nh,yh,xh,Bh,Ah,Rh,Mh].forEach(function(r){me(Bv,r)});/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/var Pv=0,Av=1,Rv=2,Nr=function(e){if(!(this instanceof Nr))return new Nr(e);this.id="Thenable/1.0.7",this.state=Pv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Nr.prototype={fulfill:function(e){return iu(this,Av,"fulfillValue",e)},reject:function(e){return iu(this,Rv,"rejectReason",e)},then:function(e,t){var a=this,n=new Nr;return a.onFulfilled.push(ou(e,n,"fulfill")),a.onRejected.push(ou(t,n,"reject")),Mv(a),n.proxy}};var iu=function(e,t,a,n){return e.state===Pv&&(e.state=t,e[a]=n,Mv(e)),e},Mv=function(e){e.state===Av?su(e,"onFulfilled",e.fulfillValue):e.state===Rv&&su(e,"onRejected",e.rejectReason)},su=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return Vi=e,Vi}var qi,Au;function Qh(){if(Au)return qi;Au=1;var r=Fn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return qi=e,qi}var _i,Ru;function Jh(){if(Ru)return _i;Ru=1;var r=Kh(),e=Xh(),t=Yh(),a=Zh(),n=Qh();function i(s){var o=-1,u=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Fe(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};ln.className=ln.classNames=ln.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Je,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+";Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+";Re.value=Re.string+"|"+Re.number;Re.id=Re.variable;(function(){var r,e,t;for(r=Re.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)})();var ze=function(){return{checks:[]}},le={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Is=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Sc(r.selector,e.selector)}),Pg=(function(){for(var r={},e,t=0;t0&&v.edgeCount>0)return Ne("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return Ne("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&Ne("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Og=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return he(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case le.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case le.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(h)+"]"}case le.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case le.DATA_EXIST:{var b=v.field;return"["+b+"]"}case le.META_COMPARE:{var w=v.operator,E=v.field;return"[["+E+a(e(w))+t(h)+"]]"}case le.STATE:return h;case le.ID:return"#"+h;case le.CLASS:return"."+h;case le.PARENT:case le.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case le.ANCESTOR:case le.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case le.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),T=i(v.right,f);return C+(C.length>0?" ":"")+x+T}case le.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||o||v)&&(u=!i&&!s?"":""+e,l=""+a),v&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e0;){var v=n.shift();e(v),i.add(v.id()),o&&a(n,i,v)}return r}function qv(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return uo(this,r,e,qv)};function _v(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Qt.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uo(this,r,e,_v)};function Hg(r,e,t){_v(r,e,t),qv(r,e,t)}Qt.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uo(this,r,e,Hg)};Qt.ancestors=Qt.parents;var Ba,Gv;Ba=Gv={data:Oe.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Oe.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Oe.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Oe.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Oe.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Oe.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ba.attr=Ba.data;Ba.removeAttr=Ba.removeData;var Wg=Gv,qn={};function gs(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;se}),minIndegree:It("indegree",function(r,e){return re}),minOutdegree:It("outdegree",function(r,e){return re})});me(qn,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?l.position(e,t+h[e]):i!==void 0&&l.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),y=o?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:d.x-m.x,y:d.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}};Or.modelPosition=Or.point=Or.position;Or.modelPositions=Or.points=Or.positions;Or.renderedPoint=Or.renderedPosition;Or.relativePoint=Or.relativePosition;var $g=Hv,Jt=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},jt=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},Ug=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Xt,ht;Xt=ht={};ht.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}};ht.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};ht.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=o.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(k,B,D){var P=0,A=0,R=B+D;return k>0&&R>0&&(P=B/R*k,A=D/R*k),{biasDiff:P,biasComplementDiff:A}}function d(k,B,D,P){if(D.units==="%")switch(P){case"width":return k>0?D.pfValue*k:0;case"height":return B>0?D.pfValue*B:0;case"average":return k>0&&B>0?D.pfValue*(k+B)/2:0;case"min":return k>0&&B>0?k>B?D.pfValue*B:D.pfValue*k:0;case"max":return k>0&&B>0?k>B?D.pfValue*k:D.pfValue*B:0;default:return 0}else return D.units==="px"?D.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=h(v.width.val-f.w,y,g),w=b.biasDiff,E=b.biasComplementDiff,C=h(v.height.val-f.h,p,m),x=C.biasDiff,T=C.biasComplementDiff;o.autoPadding=d(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+E)/2,o.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+T)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},et=function(e,t){return t==null?e:Ir(e,t.x1,t.y1,t.x2,t.y2)},fa=function(e,t,a){return pr(e,t,a)},Ja=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,u,l;if(o!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=u-s,f.y1=l-s,f.x2=u+s,f.y2=l+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,on(f,1),Ir(e,f.x1,f.y1,f.x2,f.y2)}}},ps=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),v=fa(s,"labelWidth",a),f=fa(s,"labelHeight",a),c=fa(s,"labelX",a),h=fa(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,E=t.pstyle("text-background-padding").pfValue,C=2,x=f,T=v,k=T/2,B=x/2,D,P,A,R;if(g)D=c-k,P=c+k,A=h-B,R=h+B;else{switch(Jt(u.value)){case"left":D=c-T,P=c;break;case"center":D=c-k,P=c+k;break;case"right":D=c,P=c+T;break}switch(jt(l.value)){case"top":A=h-x,R=h;break;case"center":A=h-B,R=h+B;break;case"bottom":A=h,R=h+x;break}}var L=d-Math.max(m,w)-E-C,I=d+Math.max(m,w)+E+C,M=y-Math.max(m,w)-E-C,N=y+Math.max(m,w)+E+C;D+=L,P+=I,A+=M,R+=N;var F=a||"main",_=i.labelBounds,z=_[F]=_[F]||{};z.x1=D,z.y1=A,z.x2=P,z.y2=R,z.w=P-D,z.h=R-A,z.leftPad=L,z.rightPad=I,z.topPad=M,z.botPad=N;var q=g&&p.strValue==="autorotate",Z=p.pfValue!=null&&p.pfValue!==0;if(q||Z){var Q=q?fa(i.rstyle,"labelAngle",a):p.pfValue,X=Math.cos(Q),J=Math.sin(Q),j=(D+P)/2,ne=(A+R)/2;if(!g){switch(Jt(u.value)){case"left":j=P;break;case"right":j=D;break}switch(jt(l.value)){case"top":ne=R;break;case"bottom":ne=A;break}}var Y=function(we,ye){return we=we-j,ye=ye-ne,{x:we*X-ye*J+j,y:we*J+ye*X+ne}},V=Y(D,A),H=Y(D,R),$=Y(P,A),K=Y(P,R);D=Math.min(V.x,H.x,$.x,K.x),P=Math.max(V.x,H.x,$.x,K.x),A=Math.min(V.y,H.y,$.y,K.y),R=Math.max(V.y,H.y,$.y,K.y)}var te=F+"Rot",ve=_[te]=_[te]||{};ve.x1=D,ve.y1=A,ve.x2=P,ve.y2=R,ve.w=P-D,ve.h=R-A,Ir(e,D,A,P,R),Ir(i.labelBounds.all,D,A,P,R)}return e}},sl=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,s=n+i;$v(e,t,a,s,"outside",s/2)}},$v=function(e,t,a,n,i,s){if(!(a===0||n<=0||i==="inside")){var o=t.cy(),u=o.renderer(),l=u.nodeShapes[u.getNodeShape(t)];if(l){var v=t.position(),f=v.x,c=v.y,h=t.width(),d=t.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var y=l.miterBounds(f,c,h,d,n);et(e,y)}else s!=null&&s>0&&un(e,[s,s,s,s])}}},Kg=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;$v(e,t,a,n,i)}},Xg=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=yr(),o=e._private,u=e.isNode(),l=e.isEdge(),v,f,c,h,d,y,g=o.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(De){return De.pstyle("display").value!=="none"},b=!n||m(e)&&(!l||m(e.source())&&m(e.target()));if(b){var w=0,E=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var T=Math.max(E,x),k=0,B=0;if(n&&(k=e.pstyle("width").pfValue,B=k/2),u&&t.includeNodes){var D=e.position();d=D.x,y=D.y;var P=e.outerWidth(),A=P/2,R=e.outerHeight(),L=R/2;v=d-A,f=d+A,c=y-L,h=y+L,Ir(s,v,c,f,h),n&&sl(s,e),n&&t.includeOutlines&&!i&&sl(s,e),n&&Kg(s,e)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=B,f+=B,c-=B,h+=B,Ir(s,v,c,f,h),I==="haystack"){var M=g.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var N=v;v=f,f=N}if(c>h){var F=c;c=h,h=F}Ir(s,v-B,c-B,f+B,h+B)}}else if(I==="bezier"||I==="unbundled-bezier"||rt(I,"segments")||rt(I,"taxi")){var _;switch(I){case"bezier":case"unbundled-bezier":_=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=g.linePts;break}if(_!=null)for(var z=0;z<_.length;z++){var q=_[z];v=q.x-B,f=q.x+B,c=q.y-B,h=q.y+B,Ir(s,v,c,f,h)}}}else{var Z=e.source(),Q=Z.position(),X=e.target(),J=X.position();if(v=Q.x,f=J.x,c=Q.y,h=J.y,v>f){var j=v;v=f,f=j}if(c>h){var ne=c;c=h,h=ne}v-=B,f+=B,c-=B,h+=B,Ir(s,v,c,f,h)}if(n&&t.includeEdges&&l&&(Ja(s,e,"mid-source"),Ja(s,e,"mid-target"),Ja(s,e,"source"),Ja(s,e,"target")),n){var Y=e.pstyle("ghost").value==="yes";if(Y){var V=e.pstyle("ghost-offset-x").pfValue,H=e.pstyle("ghost-offset-y").pfValue;Ir(s,s.x1+V,s.y1+H,s.x2+V,s.y2+H)}}var $=o.bodyBounds=o.bodyBounds||{};$o($,s),un($,p),on($,1),n&&(v=s.x1,f=s.x2,c=s.y1,h=s.y2,Ir(s,v-T,c-T,f+T,h+T));var K=o.overlayBounds=o.overlayBounds||{};$o(K,s),un(K,p),on(K,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?Bd(te.all):te.all=yr(),n&&t.includeLabels&&(t.includeMainLabels&&ps(s,e,null),l&&(t.includeSourceLabels&&ps(s,e,"source"),t.includeTargetLabels&&ps(s,e,"target")))}return s.x1=Br(s.x1),s.y1=Br(s.y1),s.x2=Br(s.x2),s.y2=Br(s.y2),s.w=Br(s.x2-s.x1),s.h=Br(s.y2-s.y1),s.w>0&&s.h>0&&b&&(un(s,p),on(s,1)),s},Uv=function(e){var t=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:lp,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};ft.removeAllListeners=function(){return this.removeListener("*")};ft.emit=ft.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Fe(e)||(e=[e]),vp(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(){var v=a[u];if(v.type===s.type&&(!v.namespace||v.namespace===s.namespace||v.namespace===up)&&i.eventMatches(i.context,v,s)){var f=[s];e!=null&&Jc(f,e),i.beforeEmit(i.context,v,s),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==v}));var c=i.callbackContext(i.context,v,s),h=v.callback.apply(c,f);i.afterEmit(i.context,v,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&he(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;ia&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":je(Symbol))!=e&&je(Symbol.iterator)!=e;t&&(Tn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Ql({next:function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Me(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(he(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(v[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});cr.neighbourhood=cr.neighborhood;cr.closedNeighbourhood=cr.closedNeighborhood;cr.openNeighbourhood=cr.openNeighborhood;me(cr,{source:Pr(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Pr(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:yl({attr:"source"}),targets:yl({attr:"target"})});function yl(r){return function(t){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});cr.componentsOf=cr.components;var ur=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ge("A collection must have a reference to the core");return}var i=new Ur,s=!1;if(!t)t=[];else if(t.length>0&&Me(t[0])&&!Ia(t[0])){s=!0;for(var o=[],u=new ra,l=0,v=t.length;l0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,u=0,l=t.length;u0){for(var F=o.length===t.length?t:new ur(a,o),_=0;_0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(R){for(var L=R._private.edges,I=0;I0&&(r?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var P=0;P0?P=R:D=R;while(Math.abs(A)>s&&++L=i?m(B,L):I===0?L:w(B,D,D+l)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var T=function(D){return C||x(),r===e&&t===a?D:D===0?0:D===1?1:g(E(D),e,a)};T.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var k="generateBezier("+[r,e,t,a]+")";return T.toString=function(){return k},T}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var xp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),u=e(a,n,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),v=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+v*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(l=a(n,i),h=l/s*f):h=f;d=t(d||o,h),u.push(1+d.x),l+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(y){return u[y*(u.length-1)|0]}:l}})(),Ve=function(e,t,a,n){var i=wp(e,t,a,n);return function(s,o,u){return s+(o-s)*i(u)}},fn={linear:function(e,t,a){return e+(t-e)*a},ease:Ve(.25,.1,.25,1),"ease-in":Ve(.42,0,1,1),"ease-out":Ve(0,0,.58,1),"ease-in-out":Ve(.42,0,.58,1),"ease-in-sine":Ve(.47,0,.745,.715),"ease-out-sine":Ve(.39,.575,.565,1),"ease-in-out-sine":Ve(.445,.05,.55,.95),"ease-in-quad":Ve(.55,.085,.68,.53),"ease-out-quad":Ve(.25,.46,.45,.94),"ease-in-out-quad":Ve(.455,.03,.515,.955),"ease-in-cubic":Ve(.55,.055,.675,.19),"ease-out-cubic":Ve(.215,.61,.355,1),"ease-in-out-cubic":Ve(.645,.045,.355,1),"ease-in-quart":Ve(.895,.03,.685,.22),"ease-out-quart":Ve(.165,.84,.44,1),"ease-in-out-quart":Ve(.77,0,.175,1),"ease-in-quint":Ve(.755,.05,.855,.06),"ease-out-quint":Ve(.23,1,.32,1),"ease-in-out-quint":Ve(.86,0,.07,1),"ease-in-expo":Ve(.95,.05,.795,.035),"ease-out-expo":Ve(.19,1,.22,1),"ease-in-out-expo":Ve(1,0,0,1),"ease-in-circ":Ve(.6,.04,.98,.335),"ease-out-circ":Ve(.075,.82,.165,1),"ease-in-out-circ":Ve(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return fn.linear;var n=xp(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":Ve};function wl(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function xl(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Ot(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=xl(r,n),o=xl(e,n);if(ae(s)&&ae(o))return wl(i,s,o,t,a);if(Fe(s)&&Fe(o)){for(var u=[],l=0;l0?(h==="spring"&&d.push(s.duration),s.easingImpl=fn[h].apply(null,d)):s.easingImpl=fn[h]}var y=s.easingImpl,g;if(s.duration===0?g=1:g=(t-u)/s.duration,s.applying&&(g=s.progress),g<0?g=0:g>1&&(g=1),s.delay==null){var p=s.startPosition,m=s.position;if(m&&n&&!r.locked()){var b={};da(p.x,m.x)&&(b.x=Ot(p.x,m.x,g,y)),da(p.y,m.y)&&(b.y=Ot(p.y,m.y,g,y)),r.position(b)}var w=s.startPan,E=s.pan,C=i.pan,x=E!=null&&a;x&&(da(w.x,E.x)&&(C.x=Ot(w.x,E.x,g,y)),da(w.y,E.y)&&(C.y=Ot(w.y,E.y,g,y)),r.emit("pan"));var T=s.startZoom,k=s.zoom,B=k!=null&&a;B&&(da(T,k)&&(i.zoom=ka(i.minZoom,Ot(T,k,g,y),i.maxZoom)),r.emit("zoom")),(x||B)&&r.emit("viewport");var D=s.style;if(D&&D.length>0&&n){for(var P=0;P=0;x--){var T=C[x];T()}C.splice(0,C.length)},m=h.length-1;m>=0;m--){var b=h[m],w=b._private;if(w.stopped){h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Cp(v,b,r),Ep(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),y}for(var i=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var Tp={animate:Oe.animate(),animation:Oe.animation(),animated:Oe.animated(),clearQueue:Oe.clearQueue(),delay:Oe.delay(),delayAnimation:Oe.delayAnimation(),stop:Oe.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&bn(function(i){El(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){El(s,e)},a.beforeRenderPriorities.animations):t()}},Sp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Ia(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},rn=function(e){return he(e)?new lt(e):e},af={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new _n(Sp,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,rn(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,rn(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,rn(t),a),this},once:function(e,t,a){return this.emitter().one(e,rn(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Oe.eventAliasesOn(af);var Ns={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Ns.jpeg=Ns.jpg;var cn={layout:function(e){var t=this;if(e==null){Ge("Layout options must be specified to make a layout");return}if(e.name==null){Ge("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){Ge("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;he(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(me({},e,{cy:t,eles:i}));return s}};cn.createLayout=cn.makeLayout=cn.layout;var kp={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};zs.invalidateDimensions=zs.resize;var dn={collection:function(e,t){return he(e)?this.$(e):Tr(e)?e.collection():Fe(e)?(t||(t={}),new ur(this,e,t.unique,t.removed)):new ur(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};dn.elements=dn.filter=dn.$;var sr={},wa="t",Bp="f";sr.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i0;if(c||f&&h){var d=void 0;c&&h||c?d=l.properties:h&&(d=l.mappedProperties);for(var y=0;y1&&(w=1),o.color){var C=a.valueMin[0],x=a.valueMax[0],T=a.valueMin[1],k=a.valueMax[1],B=a.valueMin[2],D=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(x-C)*w),Math.round(T+(k-T)*w),Math.round(B+(D-B)*w),Math.round(P+(A-P)*w)];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var L=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,L,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),M=f.data,N=0;N0&&i>0){for(var o={},u=!1,l=0;l0?r.delayAnimation(s).play().promise().then(b):b()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};sr.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);r.removed()||o!=null&&o(t,a,r)&&i(s)};sr.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};sr.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};sr.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var _a={};_a.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Ne("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new lt(f);if(c.invalid){Ne("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),o();continue}}var h=v[2],d=!1;i=h;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ne("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}s=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){Ne("Skipping property: Invalid property name in: "+s),u();continue}var E=t.parse(m,b);if(!E){Ne("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:m,val:b}),u()}if(d){o();break}t.selector(f);for(var C=0;C=7&&e[0]==="d"&&(v=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(o.mapData.regex).exec(e))){if(t||l.multiple)return!1;var h=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(d.pfValue===y.pfValue||d.strValue===y.strValue)return Ne("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(l.color){var g=d.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:y.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Fe(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],x="",T=!1,k=0;k0?" ":"")+B.strValue}return l.validate&&!l.validate(w,E)?null:l.singleEnum&&T?w.length===1&&he(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:E}}var D=function(){for(var Y=0;Yl.max||l.strictMax&&e===l.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return l.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:Td(e)),P==="%"&&(I.pfValue=e/100),I}else if(l.propList){var M=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),_=0;_0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((s-2*t)/a.w,(o-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Me(e)&&(s=e.level,e.position!=null?i=In(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;ae(l.x)&&(t.pan.x=l.x,o=!1),ae(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(he(e)){var a=e;e=this.mutableElements().filter(a)}else Tr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Bt.centre=Bt.center;Bt.autolockNodes=Bt.autolock;Bt.autoungrabifyNodes=Bt.autoungrabify;var Aa={data:Oe.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Oe.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Oe.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Oe.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Aa.attr=Aa.data;Aa.removeAttr=Aa.removeData;var Ra=function(e){var t=this;e=me({},e);var a=e.container;a&&!mn(a)&&mn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var s=Qe!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=me({name:s?"grid":"null"},o.layout),o.renderer=me({name:s?"canvas":"null"},o.renderer);var u=function(d,y,g){return y!==void 0?y:g!==void 0?g:d},l=this._private={container:a,ready:!1,options:o,elements:new ur(this),listeners:[],aniEles:new ur(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Me(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Me(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var v=function(d,y){var g=d.some(yc);if(g)return ta.all(d).then(y);y(d)};l.styleEnabled&&t.setStyle([]);var f=me({},o,o.renderer);t.initRenderer(f);var c=function(d,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Me(d)||Fe(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=me({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([o.style,o.elements],function(h){var d=h[0],y=h[1];l.styleEnabled&&t.style().append(d),c(y,function(){t.startAnimationLoop(),l.ready=!0,He(o.ready)&&t.on("ready",o.ready);for(var g=0;g0,o=!!r.boundingBox,u=yr(o?r.boundingBox:structuredClone(e.extent())),l;if(Tr(r.roots))l=r.roots;else if(Fe(r.roots)){for(var v=[],f=0;f0;){var R=A(),L=k(R,D);if(L)R.outgoers().filter(function(pe){return pe.isNode()&&t.has(pe)}).forEach(P);else if(L===null){Ne("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var M=0;M0&&p[0].length<=3?be/2:0),Be=2*Math.PI/p[ge].length*Ee;return ge===0&&p[0].length===1&&(Te=1),{x:$.x+Te*Math.cos(Be),y:$.y+Te*Math.sin(Be)}}else{var Ae=p[ge].length,Le=Math.max(Ae===1?0:o?(u.w-r.padding*2-K.w)/((r.grid?ve:Ae)-1):(u.w-r.padding*2-K.w)/((r.grid?ve:Ae)+1),I),ee={x:$.x+(Ee+1-(Ae+1)/2)*Le,y:$.y+(ge+1-(X+1)/2)*te};return ee}},we={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(we).indexOf(r.direction)===-1&&Ge("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(we).join(", ")));var ye=function(se){return Uc(De(se),u,we[r.direction])};return t.nodes().layoutPositions(this,r,ye),this};var Lp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function sf(r){this.options=me({},Lp,r)}sf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),v,f=0,c=0;c1&&e.avoidOverlap){f*=1.75;var p=Math.cos(l)-Math.cos(0),m=Math.sin(l)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,x){var T=e.startAngle+x*l*(n?1:-1),k=v*Math.cos(T),B=v*Math.sin(T),D={x:o.x+k,y:o.y+B};return D};return a.nodes().layoutPositions(this,e,w),this};var Ip={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function of(r){this.options=me({},Ip,r)}of.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,v=0;v0){var E=Math.abs(m[0].value-w.value);E>=g&&(m=[],p.push(m))}m.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=p.length>0&&p[0].length>1,T=Math.min(s.w,s.h)/2-C,k=T/(p.length+x?1:0);C=Math.min(C,k)}for(var B=0,D=0;D1&&e.avoidOverlap){var L=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),M=Math.sqrt(C*C/(L*L+I*I));B=Math.max(M,B)}P.r=B,B+=C}if(e.equidistant){for(var N=0,F=0,_=0;_=r.numIter||(_p(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature=r.animationThreshold&&i(),bn(v)}};v()}else{for(;l;)l=s(u),u++;Sl(a,r),o()}return this};Un.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Un.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Np=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=yr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=a.eles.components(),l={},v=0;v0){o.graphSet.push(T);for(var v=0;vn.count?0:n.graph},uf=function(e,t,a,n){var i=n.graphSet[a];if(-10)var f=n.nodeOverlap*v,c=Math.sqrt(o*o+u*u),h=f*o/c,d=f*u/c;else var y=kn(e,o,u),g=kn(t,-1*o,-1*u),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*p/c,d=f*m/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},Wp=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},kn=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=a/t,l=s/o,v={};return t===0&&0a?(v.x=n,v.y=i+s/2,v):0t&&-1*l<=u&&u<=l?(v.x=n-o/2,v.y=i-o*a/2/t,v):0=l)?(v.x=n+s*t/2/a,v.y=i+s/2,v):(0>a&&(u<=-1*l||u>=l)&&(v.x=n-s*t/2/a,v.y=i-s/2),v)},$p=function(e,t){for(var a=0;aa){var g=t.gravity*h/y,p=t.gravity*d/y;c.offsetX+=g,c.offsetY+=p}}}}},Kp=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},vf=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(d+=g+t.componentSpacing,h=0,y=0,g=0)}}},Zp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ff(r){this.options=me({},Zp,r)}ff.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(Z){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),v=function(Q){if(Q==null)return Math.min(u,l);var X=Math.min(u,l);X==u?u=Q:l=Q},f=function(Q){if(Q==null)return Math.max(u,l);var X=Math.max(u,l);X==u?u=Q:l=Q},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)u=c,l=h;else if(c!=null&&h==null)u=c,l=Math.ceil(s/u);else if(c==null&&h!=null)l=h,u=Math.ceil(s/l);else if(l*u>s){var d=v(),y=f();(d-1)*y>=s?v(d-1):(y-1)*d>=s&&f(y-1)}else for(;l*u=s?f(p+1):v(g+1)}var m=i.w/l,b=i.h/u;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w=l&&(L=0,R++)},M={},N=0;N(L=Fd(r,e,I[M],I[M+1],I[M+2],I[M+3])))return g(x,L),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var I=k.allpts,M=0;M+5(L=zd(r,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return g(x,L),!0}for(var N=N||T.source,F=F||T.target,_=n.getArrowWidth(B,D),z=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],M=0;M0&&(p(N),p(F))}function b(x,T,k){return pr(x,T,k)}function w(x,T){var k=x._private,B=c,D;T?D=T+"-":D="",x.boundingBox();var P=k.labelBounds[T||"main"],A=x.pstyle(D+"label").value,R=x.pstyle("text-events").strValue==="yes";if(!(!R||!A)){var L=b(k.rscratch,"labelX",T),I=b(k.rscratch,"labelY",T),M=b(k.rscratch,"labelAngle",T),N=x.pstyle(D+"text-margin-x").pfValue,F=x.pstyle(D+"text-margin-y").pfValue,_=P.x1-B-N,z=P.x2+B-N,q=P.y1-B-F,Z=P.y2+B-F;if(M){var Q=Math.cos(M),X=Math.sin(M),J=function(K,te){return K=K-L,te=te-I,{x:K*Q-te*X+L,y:K*X+te*Q+I}},j=J(_,q),ne=J(_,Z),Y=J(z,q),V=J(z,Z),H=[j.x+N,j.y+F,Y.x+N,Y.y+F,V.x+N,V.y+F,ne.x+N,ne.y+F];if(Er(r,e,H))return g(x),!0}else if(tt(P,r,e))return g(x),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?p(C)||w(C):m(C)||w(C)||w(C,"source")||w(C,"target")}return o};At.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],u=Math.min(r,t),l=Math.max(r,t),v=Math.min(e,a),f=Math.max(e,a);r=u,t=l,e=v,a=f;var c=yr({x1:r,y1:e,x2:t,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],d=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function y(K,te,ve){return pr(K,te,ve)}function g(K,te){var ve=K._private,De=s,we="";K.boundingBox();var ye=ve.labelBounds.main;if(!ye)return null;var pe=y(ve.rscratch,"labelX",te),se=y(ve.rscratch,"labelY",te),de=y(ve.rscratch,"labelAngle",te),ge=K.pstyle(we+"text-margin-x").pfValue,Ee=K.pstyle(we+"text-margin-y").pfValue,be=ye.x1-De-ge,Te=ye.x2+De-ge,Be=ye.y1-De-Ee,Ae=ye.y2+De-Ee;if(de){var Le=Math.cos(de),ee=Math.sin(de),S=function(W,G){return W=W-pe,G=G-se,{x:W*Le-G*ee+pe,y:W*ee+G*Le+se}};return[S(be,Be),S(Te,Be),S(Te,Ae),S(be,Ae)]}else return[{x:be,y:Be},{x:Te,y:Be},{x:Te,y:Ae},{x:be,y:Ae}]}function p(K,te,ve,De){function we(ye,pe,se){return(se.y-ye.y)*(pe.x-ye.x)>(pe.y-ye.y)*(se.x-ye.x)}return we(K,ve,De)!==we(te,ve,De)&&we(K,te,ve)!==we(K,te,De)}for(var m=0;m0?-(Math.PI-e.ang):Math.PI+e.ang},ty=function(e,t,a,n,i){if(e!==Al?Rl(t,e,Vr):ry(Dr,Vr),Rl(t,a,Dr),Bl=Vr.nx*Dr.ny-Vr.ny*Dr.nx,Pl=Vr.nx*Dr.nx-Vr.ny*-Dr.ny,$r=Math.asin(Math.max(-1,Math.min(1,Bl))),Math.abs($r)<1e-6){Fs=t.x,Vs=t.y,xt=zt=0;return}Ct=1,hn=!1,Pl<0?$r<0?$r=Math.PI+$r:($r=Math.PI-$r,Ct=-1,hn=!0):$r>0&&(Ct=-1,hn=!0),t.radius!==void 0?zt=t.radius:zt=n,mt=$r/2,tn=Math.min(Vr.len/2,Dr.len/2),i?(zr=Math.abs(Math.cos(mt)*zt/Math.sin(mt)),zr>tn?(zr=tn,xt=Math.abs(zr*Math.sin(mt)/Math.cos(mt))):xt=zt):(zr=Math.min(tn,zt),xt=Math.abs(zr*Math.sin(mt)/Math.cos(mt))),qs=t.x+Dr.nx*zr,_s=t.y+Dr.ny*zr,Fs=qs-Dr.ny*xt*Ct,Vs=_s+Dr.nx*xt*Ct,gf=t.x+Vr.nx*zr,pf=t.y+Vr.ny*zr,Al=t};function yf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function go(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ty(r,e,t,a,n),{cx:Fs,cy:Vs,radius:xt,startX:gf,startY:pf,stopX:qs,stopY:_s,startAngle:Vr.ang+Math.PI/2*Ct,endAngle:Dr.ang-Math.PI/2*Ct,counterClockwise:hn})}var Ma=.01,ay=Math.sqrt(2*Ma),hr={};hr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),u=s.units!=null&&o.units!=null,l=function(E,C,x,T){var k=T-C,B=x-E,D=Math.sqrt(B*B+k*k);return{x:-k/D,y:B/D}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(u){var f=this.manualEndptToPx(r.source()[0],s),c=Xe(f,2),h=c[0],d=c[1],y=this.manualEndptToPx(r.target()[0],o),g=Xe(y,2),p=g[0],m=g[1],b={x1:h,y1:d,x2:p,y2:m};n=l(h,d,p,m),i=b}else Ne("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};hr.findHaystackPoints=function(r){for(var e=0;e0?Math.max(G-U,0):Math.min(G+U,0)},A=P(B,T),R=P(D,k),L=!1;m===l?p=Math.abs(A)>Math.abs(R)?n:a:m===u||m===o?(p=a,L=!0):(m===i||m===s)&&(p=n,L=!0);var I=p===a,M=I?R:A,N=I?D:B,F=ro(N),_=!1;!(L&&(w||C))&&(m===o&&N<0||m===u&&N>0||m===i&&N>0||m===s&&N<0)&&(F*=-1,M=F*Math.abs(M),_=!0);var z;if(w){var q=E<0?1+E:E;z=q*M}else{var Z=E<0?M:0;z=Z+E*F}var Q=function(G){return Math.abs(G)=Math.abs(M)},X=Q(z),J=Q(Math.abs(M)-Math.abs(z)),j=X||J;if(j&&!_)if(I){var ne=Math.abs(N)<=c/2,Y=Math.abs(B)<=h/2;if(ne){var V=(v.x1+v.x2)/2,H=v.y1,$=v.y2;t.segpts=[V,H,V,$]}else if(Y){var K=(v.y1+v.y2)/2,te=v.x1,ve=v.x2;t.segpts=[te,K,ve,K]}else t.segpts=[v.x1,v.y2]}else{var De=Math.abs(N)<=f/2,we=Math.abs(D)<=d/2;if(De){var ye=(v.y1+v.y2)/2,pe=v.x1,se=v.x2;t.segpts=[pe,ye,se,ye]}else if(we){var de=(v.x1+v.x2)/2,ge=v.y1,Ee=v.y2;t.segpts=[de,ge,de,Ee]}else t.segpts=[v.x2,v.y1]}else if(I){var be=v.y1+z+(g?c/2*F:0),Te=v.x1,Be=v.x2;t.segpts=[Te,be,Be,be]}else{var Ae=v.x1+z+(g?f/2*F:0),Le=v.y1,ee=v.y2;t.segpts=[Ae,Le,Ae,ee]}if(t.isRound){var S=r.pstyle("taxi-radius").value,O=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(S),t.isArcRadius=new Array(t.segpts.length/2).fill(O)}};hr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,h=e.srcRs,d=e.tgtRs,y=!ae(t.startX)||!ae(t.startY),g=!ae(t.arrowStartX)||!ae(t.arrowStartY),p=!ae(t.endX)||!ae(t.endY),m=!ae(t.arrowEndX)||!ae(t.arrowEndY),b=3,w=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=kt({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),x=CN.poolIndex()){var F=M;M=N,N=F}var _=A.srcPos=M.position(),z=A.tgtPos=N.position(),q=A.srcW=M.outerWidth(),Z=A.srcH=M.outerHeight(),Q=A.tgtW=N.outerWidth(),X=A.tgtH=N.outerHeight(),J=A.srcShape=t.nodeShapes[e.getNodeShape(M)],j=A.tgtShape=t.nodeShapes[e.getNodeShape(N)],ne=A.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,Y=A.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,V=A.tgtRs=N._private.rscratch,H=A.srcRs=M._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var $=0;$=ay||(Be=Math.sqrt(Math.max(Te*Te,Ma)+Math.max(be*be,Ma)));var Ae=A.vector={x:Te,y:be},Le=A.vectorNorm={x:Ae.x/Be,y:Ae.y/Be},ee={x:-Le.y,y:Le.x};A.nodesOverlap=!ae(Be)||j.checkPoint(ye[0],ye[1],0,Q,X,z.x,z.y,Y,V)||J.checkPoint(se[0],se[1],0,q,Z,_.x,_.y,ne,H),A.vectorNormInverse=ee,R={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:z,srcRs:V,tgtPos:_,tgtRs:H,srcW:Q,srcH:X,tgtW:q,tgtH:Z,srcIntn:de,tgtIntn:pe,srcShape:j,tgtShape:J,posPts:{x1:Ee.x2,y1:Ee.y2,x2:Ee.x1,y2:Ee.y1},intersectionPts:{x1:ge.x2,y1:ge.y2,x2:ge.x1,y2:ge.y1},vector:{x:-Ae.x,y:-Ae.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-ee.x,y:-ee.y}}}var S=we?R:A;te.nodesOverlap=S.nodesOverlap,te.srcIntn=S.srcIntn,te.tgtIntn=S.tgtIntn,te.isRound=ve.startsWith("round"),n&&(M.isParent()||M.isChild()||N.isParent()||N.isChild())&&(M.parents().anySame(N)||N.parents().anySame(M)||M.same(N)&&M.isParent())?e.findCompoundLoopPoints(K,S,$,De):M===N?e.findLoopPoints(K,S,$,De):ve.endsWith("segments")?e.findSegmentsPoints(K,S):ve.endsWith("taxi")?e.findTaxiPoints(K,S):ve==="straight"||!De&&A.eles.length%2===1&&$===Math.floor(A.eles.length/2)?e.findStraightEdgePoints(K):e.findBezierPoints(K,S,$,De,we),e.findEndpoints(K),e.tryToCorrectInvalidPoints(K,S),e.checkForInvalidEdgeWarning(K),e.storeAllpts(K),e.storeEdgeProjections(K),e.calculateArrowAngles(K),e.recalculateEdgeLabelProjections(K),e.calculateLabelAngles(K)}},x=0;x0){var ye=l,pe=wt(ye,Gt(s)),se=wt(ye,Gt(we)),de=pe;if(se2){var ge=wt(ye,{x:we[2],y:we[3]});ge0){var ue=v,re=wt(ue,Gt(s)),oe=wt(ue,Gt(U)),ie=re;if(oe2){var fe=wt(ue,{x:U[2],y:U[3]});fe=d||x){g={cp:w,segment:C};break}}if(g)break}var T=g.cp,k=g.segment,B=(d-p)/k.length,D=k.t1-k.t0,P=h?k.t0+D*B:k.t1-D*B;P=ka(0,P,1),e=$t(T.p0,T.p1,T.p2,P),c=iy(T.p0,T.p1,T.p2,P);break}case"straight":case"segments":case"haystack":{for(var A=0,R,L,I,M,N=a.allpts.length,F=0;F+3=d));F+=2);var _=d-L,z=_/R;z=ka(0,z,1),e=kd(I,M,z),c=wf(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Hr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Hr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=St(a,r._private.labelDimsKey);if(pr(t.rscratch,"prefixedLabelDimsKey",e)!==n){qr(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),s=r.pstyle("line-height").pfValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("text-wrap").strValue,l=pr(t.rscratch,"labelWrapCachedLines",e)||[],v=u!=="wrap"?1:Math.max(l.length,1),f=o*s,c=i.width,h=i.height+(v-1)*(s-1)*o;qr(t.rstyle,"labelWidth",e,c),qr(t.rscratch,"labelWidth",e,c),qr(t.rstyle,"labelHeight",e,h),qr(t.rscratch,"labelHeight",e,h),qr(t.rscratch,"labelLineHeight",e,f),qr(t.rscratch,"labelActualDescent",e,i.labelActualDescent)}};Hr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(Z,Q){return Q?(qr(t.rscratch,Z,e,Q),Q):pr(t.rscratch,Z,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="​",v=n.split(` +`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;gf){var E=p.matchAll(y),C="",x=0,T=Cr(E),k;try{for(T.s();!(k=T.n()).done;){var B=k.value,D=B[0],P=p.substring(x,B.index);x=B.index+D.length;var A=C.length===0?P:C+P+D,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+D:(C&&d.push(C),C=P+D)}}catch(q){T.e(q)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(` +`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",N="…",F=!1;if(this.calculateLabelDimensions(r,n).widthI)break;M+=n[_],_===n.length-1&&(F=!0)}return F||(M+=N),M}return n};Hr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return e==="auto"?r.isNode()?Ug(t):"center":e};Hr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=r.pstyle("text-metrics").strValue||"font",f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var d=0,y=0,g=e.split(` +`),p=g.length,m=0,b=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u=r.desktopTapThreshold2}var fr=i(S);rr&&(r.hoverData.tapholdCancelled=!0);var Ar=function(){var kr=r.hoverData.dragDelta=r.hoverData.dragDelta||[];kr.length===0?(kr.push(ke[0]),kr.push(ke[1])):(kr[0]+=ke[0],kr[1]+=ke[1])};W=!0,n(Ce,["mousemove","vmousemove","tapdrag"],S,{x:re[0],y:re[1]});var $e=function(kr){return{originalEvent:S,type:kr,position:{x:re[0],y:re[1]}}},Sr=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||G.emit($e("boxstart")),fe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(rr){var Rr=$e("cxtdrag");ce?ce.emit(Rr):G.emit(Rr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ce!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit($e("cxtdragout")),r.hoverData.cxtOver=Ce,Ce&&Ce.emit($e("cxtdragover")))}}else if(r.hoverData.dragging){if(W=!0,G.panningEnabled()&&G.userPanningEnabled()){var Qr;if(r.hoverData.justStartedPan){var Mt=r.hoverData.mdownPos;Qr={x:(re[0]-Mt[0])*U,y:(re[1]-Mt[1])*U},r.hoverData.justStartedPan=!1}else Qr={x:ke[0]*U,y:ke[1]*U};G.panBy(Qr),G.emit($e("dragpan")),r.hoverData.dragged=!0}re=r.projectIntoViewport(S.clientX,S.clientY)}else if(fe[4]==1&&(ce==null||ce.pannable())){if(rr){if(!r.hoverData.dragging&&G.boxSelectionEnabled()&&(fr||!G.panningEnabled()||!G.userPanningEnabled()))Sr();else if(!r.hoverData.selecting&&G.panningEnabled()&&G.userPanningEnabled()){var yt=s(ce,r.hoverData.downs);yt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,fe[4]=0,r.data.bgActivePosistion=Gt(oe),r.redrawHint("select",!0),r.redraw())}ce&&ce.pannable()&&ce.active()&&ce.unactivate()}}else{if(ce&&ce.pannable()&&ce.active()&&ce.unactivate(),(!ce||!ce.grabbed())&&Ce!=xe&&(xe&&n(xe,["mouseout","tapdragout"],S,{x:re[0],y:re[1]}),Ce&&n(Ce,["mouseover","tapdragover"],S,{x:re[0],y:re[1]}),r.hoverData.last=Ce),ce)if(rr){if(G.boxSelectionEnabled()&&fr)ce&&ce.grabbed()&&(y(Pe),ce.emit($e("freeon")),Pe.emit($e("free")),r.dragData.didDrag&&(ce.emit($e("dragfreeon")),Pe.emit($e("dragfree")))),Sr();else if(ce&&ce.grabbed()&&r.nodeIsDraggable(ce)){var wr=!r.dragData.didDrag;wr&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Pe,{inDragLayer:!0});var ar={x:0,y:0};if(ae(ke[0])&&ae(ke[1])&&(ar.x+=ke[0],ar.y+=ke[1],wr)){var xr=r.hoverData.dragDelta;xr&&ae(xr[0])&&ae(xr[1])&&(ar.x+=xr[0],ar.y+=xr[1])}r.hoverData.draggingEles=!0,Pe.silentShift(ar).emit($e("position")).emit($e("drag")),r.redrawHint("drag",!0),r.redraw()}}else Ar();W=!0}if(fe[2]=re[0],fe[3]=re[1],W)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var B,D,P;r.registerBinding(e,"mouseup",function(S){if(!(r.hoverData.which===1&&S.which!==1&&r.hoverData.capture)){var O=r.hoverData.capture;if(O){r.hoverData.capture=!1;var W=r.cy,G=r.projectIntoViewport(S.clientX,S.clientY),U=r.selection,ue=r.findNearestElement(G[0],G[1],!0,!1),re=r.dragData.possibleDragElements,oe=r.hoverData.down,ie=i(S);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,oe&&oe.unactivate();var fe=function(tr){return{originalEvent:S,type:tr,position:{x:G[0],y:G[1]}}};if(r.hoverData.which===3){var Ce=fe("cxttapend");if(oe?oe.emit(Ce):W.emit(Ce),!r.hoverData.cxtDragged){var xe=fe("cxttap");oe?oe.emit(xe):W.emit(xe)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(ue,["mouseup","tapend","vmouseup"],S,{x:G[0],y:G[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],S,{x:G[0],y:G[1]}),D=!1,S.timeStamp-P<=W.multiClickDebounceTime()?(B&&clearTimeout(B),D=!0,P=null,n(oe,["dblclick","dbltap","vdblclick"],S,{x:G[0],y:G[1]})):(B=setTimeout(function(){D||n(oe,["oneclick","onetap","voneclick"],S,{x:G[0],y:G[1]})},W.multiClickDebounceTime()),P=S.timeStamp)),oe==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(S)&&(W.$(t).unselect(["tapunselect"]),re.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=re=W.collection()),ue==oe&&!r.dragData.didDrag&&!r.hoverData.selecting&&ue!=null&&ue._private.selectable&&(r.hoverData.dragging||(W.selectionType()==="additive"||ie?ue.selected()?ue.unselect(["tapunselect"]):ue.select(["tapselect"]):ie||(W.$(t).unmerge(ue).unselect(["tapunselect"]),ue.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var ce=W.collection(r.getAllInBox(U[0],U[1],U[2],U[3]));r.redrawHint("select",!0),ce.length>0&&r.redrawHint("eles",!0),W.emit(fe("boxend"));var ke=function(tr){return tr.selectable()&&!tr.selected()};W.selectionType()==="additive"||ie||W.$(t).unmerge(ce).unselect(),ce.emit(fe("box")).stdFilter(ke).select().emit(fe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!U[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Pe=oe&&oe.grabbed();y(re),Pe&&(oe.emit(fe("freeon")),re.emit(fe("free")),r.dragData.didDrag&&(oe.emit(fe("dragfreeon")),re.emit(fe("dragfree"))))}}U[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var A=[],R=4,L,I=1e5,M=function(S){for(var O=Math.abs(S[0]),W=1;W=R){L=!1;var G=A;if(G[0]>=5){var U;M(G)?U=G[0]:U=Cd(G),U>1&&(L=!0,I=U)}}else A.push(Math.abs(W)),O=!0;else L&&(I=Math.min(Math.abs(W),I));if(!r.scrollingPage){var ue=r.cy,re=ue.zoom(),oe=ue.pan(),ie=r.projectIntoViewport(S.clientX,S.clientY),fe=[ie[0]*re+oe.x,ie[1]*re+oe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||x()){S.preventDefault();return}if(ue.panningEnabled()&&ue.userPanningEnabled()&&ue.zoomingEnabled()&&ue.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Ce;O&&Math.abs(W)>5&&(W=ro(W)*5),Ce=W/-250,L&&(Ce/=I,Ce*=3),Ce=Ce*r.wheelSensitivity;var xe=S.deltaMode===1;xe&&(Ce*=33);var ce=ue.zoom()*Math.pow(10,Ce);S.type==="gesturechange"&&(ce=r.gestureStartZoom*S.scale),ue.zoom({level:ce,renderedPosition:{x:fe[0],y:fe[1]}}),ue.emit({type:S.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:S,position:{x:ie[0],y:ie[1]}})}}}};r.registerBinding(r.container,"wheel",N,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(ee){r.hasTouchStarted||N(ee)},!0),r.registerBinding(r.container,"mouseout",function(S){var O=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:O[0],y:O[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var O=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:O[0],y:O[1]}})},!1);var F,_,z,q,Z,Q,X,J,j,ne,Y,V,H,$=function(S,O,W,G){return Math.sqrt((W-S)*(W-S)+(G-O)*(G-O))},K=function(S,O,W,G){return(W-S)*(W-S)+(G-O)*(G-O)},te;r.registerBinding(r.container,"touchstart",te=function(S){if(r.hasTouchStarted=!0,!!T(S)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var O=r.cy,W=r.touchData.now,G=r.touchData.earlier;if(S.touches[0]){var U=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);W[0]=U[0],W[1]=U[1]}if(S.touches[1]){var U=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);W[2]=U[0],W[3]=U[1]}if(S.touches[2]){var U=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);W[4]=U[0],W[5]=U[1]}var ue=function(fr){return{originalEvent:S,type:fr,position:{x:W[0],y:W[1]}}};if(S.touches[1]){r.touchData.singleTouchMoved=!0,y(r.dragData.touchDragEles);var re=r.findContainerClientCoords();j=re[0],ne=re[1],Y=re[2],V=re[3],F=S.touches[0].clientX-j,_=S.touches[0].clientY-ne,z=S.touches[1].clientX-j,q=S.touches[1].clientY-ne,H=0<=F&&F<=Y&&0<=z&&z<=Y&&0<=_&&_<=V&&0<=q&&q<=V;var oe=O.pan(),ie=O.zoom();Z=$(F,_,z,q),Q=K(F,_,z,q),X=[(F+z)/2,(_+q)/2],J=[(X[0]-oe.x)/ie,(X[1]-oe.y)/ie];var fe=200,Ce=fe*fe;if(Q=1){for(var br=r.touchData.startPosition=[null,null,null,null,null,null],Ye=0;Ye=r.touchTapThreshold2}if(O&&r.touchData.cxt){S.preventDefault();var Ye=S.touches[0].clientX-j,Ze=S.touches[0].clientY-ne,We=S.touches[1].clientX-j,fr=S.touches[1].clientY-ne,Ar=K(Ye,Ze,We,fr),$e=Ar/Q,Sr=150,Rr=Sr*Sr,Qr=1.5,Mt=Qr*Qr;if($e>=Mt||Ar>=Rr){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var yt=ie("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(yt),r.touchData.start=null):G.emit(yt)}}if(O&&r.touchData.cxt){var yt=ie("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(yt):G.emit(yt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var wr=r.findNearestElement(U[0],U[1],!0,!0);(!r.touchData.cxtOver||wr!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(ie("cxtdragout")),r.touchData.cxtOver=wr,wr&&wr.emit(ie("cxtdragover")))}else if(O&&S.touches[2]&&G.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||G.emit(ie("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,W[4]=1,!W||W.length===0||W[0]===void 0?(W[0]=(U[0]+U[2]+U[4])/3,W[1]=(U[1]+U[3]+U[5])/3,W[2]=(U[0]+U[2]+U[4])/3+1,W[3]=(U[1]+U[3]+U[5])/3+1):(W[2]=(U[0]+U[2]+U[4])/3,W[3]=(U[1]+U[3]+U[5])/3),r.redrawHint("select",!0),r.redraw();else if(O&&S.touches[1]&&!r.touchData.didSelect&&G.zoomingEnabled()&&G.panningEnabled()&&G.userZoomingEnabled()&&G.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ar=r.dragData.touchDragEles;if(ar){r.redrawHint("drag",!0);for(var xr=0;xr0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var De;r.registerBinding(e,"touchcancel",De=function(S){var O=r.touchData.start;r.touchData.capture=!1,O&&O.unactivate()});var we,ye,pe,se;if(r.registerBinding(e,"touchend",we=function(S){var O=r.touchData.start,W=r.touchData.capture;if(W)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var G=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var U=r.cy,ue=U.zoom(),re=r.touchData.now,oe=r.touchData.earlier;if(S.touches[0]){var ie=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);re[0]=ie[0],re[1]=ie[1]}if(S.touches[1]){var ie=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);re[2]=ie[0],re[3]=ie[1]}if(S.touches[2]){var ie=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);re[4]=ie[0],re[5]=ie[1]}var fe=function(Rr){return{originalEvent:S,type:Rr,position:{x:re[0],y:re[1]}}};O&&O.unactivate();var Ce;if(r.touchData.cxt){if(Ce=fe("cxttapend"),O?O.emit(Ce):U.emit(Ce),!r.touchData.cxtDragged){var xe=fe("cxttap");O?O.emit(xe):U.emit(xe)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&U.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var ce=U.collection(r.getAllInBox(G[0],G[1],G[2],G[3]));G[0]=void 0,G[1]=void 0,G[2]=void 0,G[3]=void 0,G[4]=0,r.redrawHint("select",!0),U.emit(fe("boxend"));var ke=function(Rr){return Rr.selectable()&&!Rr.selected()};ce.emit(fe("box")).stdFilter(ke).select().emit(fe("boxselect")),ce.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(O?.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Pe=r.dragData.touchDragEles;if(O!=null){var rr=O._private.grabbed;y(Pe),r.redrawHint("drag",!0),r.redrawHint("eles",!0),rr&&(O.emit(fe("freeon")),Pe.emit(fe("free")),r.dragData.didDrag&&(O.emit(fe("dragfreeon")),Pe.emit(fe("dragfree")))),n(O,["touchend","tapend","vmouseup","tapdragout"],S,{x:re[0],y:re[1]}),O.unactivate(),r.touchData.start=null}else{var tr=r.findNearestElement(re[0],re[1],!0,!0);n(tr,["touchend","tapend","vmouseup","tapdragout"],S,{x:re[0],y:re[1]})}var br=r.touchData.startPosition[0]-re[0],Ye=br*br,Ze=r.touchData.startPosition[1]-re[1],We=Ze*Ze,fr=Ye+We,Ar=fr*ue*ue;r.touchData.singleTouchMoved||(O||U.$(":selected").unselect(["tapunselect"]),n(O,["tap","vclick"],S,{x:re[0],y:re[1]}),ye=!1,S.timeStamp-se<=U.multiClickDebounceTime()?(pe&&clearTimeout(pe),ye=!0,se=null,n(O,["dbltap","vdblclick"],S,{x:re[0],y:re[1]})):(pe=setTimeout(function(){ye||n(O,["onetap","voneclick"],S,{x:re[0],y:re[1]})},U.multiClickDebounceTime()),se=S.timeStamp)),O!=null&&!r.dragData.didDrag&&O._private.selectable&&Ar"u"){var de=[],ge=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},Ee=function(S){return{event:S,touch:ge(S)}},be=function(S){de.push(Ee(S))},Te=function(S){for(var O=0;O0)return q[0]}return null},d=Object.keys(c),y=0;y0?h:xv(i,s,e,t,a,n,o,u)},checkPoint:function(e,t,a,n,i,s,o,u){u=u==="auto"?ut(n,i):u;var l=2*u;if(Xr(e,t,this.points,s,o,n,i-l,[0,-1],a)||Xr(e,t,this.points,s,o,n-l,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[s-v,o-f,s-v,o,s+v,o,s+v,o-f];return!!(Er(e,t,c)||Tt(e,t,l,l,s+n/2-u,o+i/2-u,a)||Tt(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};Yr.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",gr(3,0)),this.generateRoundPolygon("round-triangle",gr(3,0)),this.generatePolygon("rectangle",gr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",gr(5,0)),this.generateRoundPolygon("round-pentagon",gr(5,0)),this.generatePolygon("hexagon",gr(6,0)),this.generateRoundPolygon("round-hexagon",gr(6,0)),this.generatePolygon("heptagon",gr(7,0)),this.generateRoundPolygon("round-heptagon",gr(7,0)),this.generatePolygon("octagon",gr(8,0)),this.generateRoundPolygon("round-octagon",gr(8,0));var a=new Array(20);{var n=Bs(5,0),i=Bs(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(l){if(m>=e.deqCost*h||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*bs)break;var E=e.deq(a,g,y);if(E.length>0)for(var C=0;C0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,g,y)&&i())},o=e.priority||Js;n.beforeRender(s,o(a))}}}},ly=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wn;ct(this,r),this.idsByKey=new Ur,this.keyForId=new Ur,this.cachesByLvl=new Ur,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return dt(r,[{key:"getIdsFor",value:function(t){t==null&&Ge("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new ra,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Ur,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Ol=25,an=50,gn=-4,Gs=3,Df=7.99,vy=8,fy=1024,cy=1024,dy=1024,hy=.2,gy=.8,py=10,yy=.15,my=.1,by=.9,wy=.9,xy=100,Ey=1,Wt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Cy=lr({getKey:null,doesEleInvalidateKey:wn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:dv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ba=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=Cy(t);me(a,n),a.lookup=new ly(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},er=ba.prototype;er.reasons=Wt;er.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};er.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};er.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Va(function(t,a){return a.reqs-t.reqs});return e};er.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};er.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(eo(o*t))),a=Df||a>Gs)return null;var l=Math.pow(2,a),v=e.h*l,f=e.w*l,c=s.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var h=u.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=Ol?d=Ol:v<=an?d=an:d=Math.ceil(v/an)*an,v>dy||f>cy)return null;var y=i.getTextureQueue(d),g=y[y.length-2],p=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidtha;D--)k=i.getElement(r,e,t,D,Wt.downscale);B()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!E)for(var A=a-1;A>=gn;A--){var R=u.get(r,A);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:l,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+vy),g.eleCaches.push(h),u.set(r,a,h),i.checkTextureFullness(g),h};er.invalidateElements=function(r){for(var e=0;e=hy*r.width&&this.retireTexture(r)};er.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>gy&&r.fullnessChecks>=py?ot(t,r):r.fullnessChecks++};er.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;ot(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,js(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),ot(n,s),a.push(s),s}};er.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};er.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=t.pop(),u=o.key,l=o.eles[0],v=i.hasCache(l,o.level);if(a[u]=null,v)continue;n.push(o);var f=e.getBoundingBox(l);e.getElement(l,f,r,o.level,Wt.dequeue)}return n};er.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Qs,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};er.onDequeue=function(r){this.onDequeues.push(r)};er.offDequeue=function(r){ot(this.onDequeues,r)};er.setupDequeueing=kf.setupDequeueing({deqRedrawThreshold:xy,deqCost:yy,deqAvgCost:my,deqNoDrawCost:by,deqFastCost:wy,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a=Sy||t>Bn)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),v=u[t]=u[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var B=function(L){if(a.validateLayersElesOrdering(L,r),a.levelIsComplete(L,r))return h=u[L],!0},D=function(L){if(!h)for(var I=t+L;xa<=I&&I<=Bn&&!B(I);I+=L);};D(1),D(-1);for(var P=v.length-1;P>=0;P--){var A=v[P];A.invalid&&ot(v,A)}};if(!c)d();else return v;var y=function(){if(!f){f=yr();for(var B=0;Bzl||A>zl)return null;var R=P*A;if(R>Ly)return null;var L=a.makeLayer(f,t);if(D!=null){var I=v.indexOf(D)+1;v.splice(I,0,L)}else(B.insert===void 0||B.insert)&&v.unshift(L);return L};if(a.skipping&&!o)return null;for(var p=null,m=r.length/Ty,b=!o,w=0;w=m||!wv(p.bb,E.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;h||b?a.queueLayer(p,E):a.drawEleInLayer(p,E,t,e),p.eles.push(E),x[t]=p}return h||(b?null:v)};vr.getEleLevelForLayerLevel=function(r,e){return r};vr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Iy),i.setImgSmoothing(s,!0))};vr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};vr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a0){e=!0;break}}return e};vr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Kr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};vr.invalidateLayer=function(r){if(this.lastInvalidationTime=Kr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];ot(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=l*v,m=l*v,b=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(s.eleStrokeStyle(r,e,L),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=d,s.eleStrokeStyle(r,e,L),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=h+y,r.lineCap=d,y>0)s.colorStrokeStyle(r,g[0],g[1],g[2],L);else{r.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(r,e)},C=function(){n&&s.drawEdgeUnderlay(r,e)},x=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(r,e,L)},T=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var B=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,A=p*P;r.translate(B,D),b(A),x(A),r.translate(-B,-D)}else w();C(),b(),x(),E(),T(),t&&r.translate(u.x1,u.y1)}};var Af=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=l,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Zr.drawEdgeOverlay=Af("overlay");Zr.drawEdgeUnderlay=Af("underlay");Zr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(u){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e),l=e.pstyle("text-metrics").strValue==="glyph";r.textAlign=u,r.textBaseline=l?"alphabetic":"bottom"}else{var v=e.element()._private.rscratch.badLine,f=e.pstyle("label"),c=e.pstyle("source-label"),h=e.pstyle("target-label");if(v||(!f||!f.value)&&(!c||!c.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var d=!t,y;t&&(y=t,r.translate(-y.x1,-y.y1)),n==null?(s.drawText(r,e,null,d,i),e.isEdge()&&(s.drawText(r,e,"source",d,i),s.drawText(r,e,"target",d,i))):s.drawText(r,e,n,d,i),t&&r.translate(y.x1,y.y1)};Rt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],o),this.colorStrokeStyle(r,v[0],v[1],v[2],u)};function $y(r,e,t,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,u=t+n/2;r.beginPath(),r.arc(o,u,s,0,Math.PI*2),r.closePath()}function _l(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+a-s,t),r.quadraticCurveTo(e+a,t,e+a,t+s),r.lineTo(e+a,t+n-s),r.quadraticCurveTo(e+a,t+n,e+a-s,t+n),r.lineTo(e+s,t+n),r.quadraticCurveTo(e,t+n,e,t+n-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Rt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=pr(n,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};Rt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=pr(s,"labelX",t),l=pr(s,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=pr(s,"labelWidth",t),y=pr(s,"labelHeight",t),g=pr(s,"labelActualDescent",t),p=e.pstyle(h+"text-margin-x").pfValue,m=e.pstyle(h+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,E=e.pstyle("text-valign").value;b&&(w="center",E="center"),u+=p,l+=m;var C;a?C=this.getTextAngle(e,t):C=0,C!==0&&(v=u,f=l,r.translate(v,f),r.rotate(C),u=0,l=0);var x=Jt(w),T=jt(E);switch(T){case"top":break;case"center":l+=y/2;break;case"bottom":l+=y;break}var k=e.pstyle("text-background-opacity").value,B=e.pstyle("text-border-opacity").value,D=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,A=e.pstyle("text-background-shape").strValue,R=A==="round-rectangle"||A==="roundrectangle",L=A==="circle",I=2;if(k>0||D>0&&B>0){var M=r.fillStyle,N=r.strokeStyle,F=r.lineWidth,_=e.pstyle("text-background-color").value,z=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value,Z=k>0,Q=D>0&&B>0,X=u-P;switch(x){case"left":X-=d;break;case"center":X-=d/2;break}var J=l-y-P,j=d+2*P,ne=y+2*P;if(Z&&(r.fillStyle="rgba(".concat(_[0],",").concat(_[1],",").concat(_[2],",").concat(k*o,")")),Q&&(r.strokeStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(B*o,")"),r.lineWidth=D,r.setLineDash))switch(q){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=D/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(R?(r.beginPath(),_l(r,X,J,j,ne,I)):L?(r.beginPath(),$y(r,X,J,j,ne)):(r.beginPath(),r.rect(X,J,j,ne)),Z&&r.fill(),Q&&r.stroke(),Q&&q==="double"){var Y=D/2;r.beginPath(),R?_l(r,X+Y,J+Y,j-2*Y,ne-2*Y,I):r.rect(X+Y,J+Y,j-2*Y,ne-2*Y),r.stroke()}r.fillStyle=M,r.strokeStyle=N,r.lineWidth=F,r.setLineDash&&r.setLineDash([])}var V=2*e.pstyle("text-outline-width").pfValue;if(V>0&&(r.lineWidth=V),l-=g,e.pstyle("text-wrap").value==="wrap"){var H=pr(s,"labelWrapCachedLines",t),$=pr(s,"labelLineHeight",t),K=d/2,te=this.getLabelJustification(e);switch(te==="auto"||(x==="left"?te==="left"?u+=-d:te==="center"&&(u+=-K):x==="center"?te==="left"?u+=-K:te==="right"&&(u+=K):x==="right"&&(te==="center"?u+=K:te==="right"&&(u+=d))),T){case"top":l-=(H.length-1)*$;break;case"center":case"bottom":l-=(H.length-1)*$;break}for(var ve=0;ve0&&r.strokeText(H[ve],u,l),r.fillText(H[ve],u,l),l+=$}else V>0&&r.strokeText(c,u,l),r.fillText(c,u,l);C!==0&&(r.rotate(-C),r.translate(-v,-f))}}};var gt={};gt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,u,l=e._private,v=l.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=s.usePaths(),d,y=!1,g=e.padding();o=e.width()+2*g,u=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),E=new Array(b.length),C=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(r,e,O)},Y=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;s.colorStrokeStyle(r,R[0],R[1],R[2],O)},V=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X;s.colorStrokeStyle(r,Z[0],Z[1],Z[2],O)},H=function(O,W,G,U){var ue=s.nodePathCache=s.nodePathCache||[],re=cv(G==="polygon"?G+","+U.join(","):G,""+W,""+O,""+j),oe=ue[re],ie,fe=!1;return oe!=null?(ie=oe,fe=!0,v.pathCache=ie):(ie=new Path2D,ue[re]=v.pathCache=ie),{path:ie,cacheHit:fe}},$=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var te=H(o,u,$,K);d=te.path,y=te.cacheHit}var ve=function(){if(!y){var O=f;h&&(O={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,O.x,O.y,o,u,j,v)}h?r.fill(d):r.fill()},De=function(){for(var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,U=0,ue=0;ue0&&arguments[0]!==void 0?arguments[0]:!1,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,W),O&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,j,v)))},ye=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasStripe(e)&&(r.save(),h?r.clip(v.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,j,v),r.clip()),s.drawStripe(r,e,W),r.restore(),O&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,j,v)))},pe=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,W=(D>0?D:-D)*O,G=D>0?0:255;D!==0&&(s.colorFillStyle(r,G,G,G,W),h?r.fill(d):r.fill())},se=function(){if(P>0){if(r.lineWidth=P,r.lineCap=M,r.lineJoin=I,r.setLineDash)switch(L){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(F),r.lineDashOffset=_;break;case"solid":case"double":r.setLineDash([]);break}if(N!=="center"){if(r.save(),r.lineWidth*=2,N==="inside")h?r.clip(d):r.clip();else{var O=new Path2D;O.rect(-o/2-P,-u/2-P,o+2*P,u+2*P),O.addPath(d),r.clip(O,"evenodd")}h?r.stroke(d):r.stroke(),r.restore()}else h?r.stroke(d):r.stroke();if(L==="double"){r.lineWidth=P/3;var W=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=W}r.setLineDash&&r.setLineDash([])}},de=function(){if(q>0){if(r.lineWidth=q,r.lineCap="butt",r.setLineDash)switch(Q){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var O=f;h&&(O={x:0,y:0});var W=s.getNodeShape(e),G=P;N==="inside"&&(G=0),N==="outside"&&(G*=2);var U=(o+G+(q+J))/o,ue=(u+G+(q+J))/u,re=o*U,oe=u*ue,ie=s.nodeShapes[W].points,fe;if(h){var Ce=H(re,oe,W,ie);fe=Ce.path}if(W==="ellipse")s.drawEllipsePath(fe||r,O.x,O.y,re,oe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(W)){var xe=0,ce=0,ke=0;W==="round-diamond"?xe=(G+J+q)*1.4:W==="round-heptagon"?(xe=(G+J+q)*1.075,ke=-(G/2+J+q)/35):W==="round-hexagon"?xe=(G+J+q)*1.12:W==="round-pentagon"?(xe=(G+J+q)*1.13,ke=-(G/2+J+q)/15):W==="round-tag"?(xe=(G+J+q)*1.12,ce=(G/2+q+J)*.07):W==="round-triangle"&&(xe=(G+J+q)*(Math.PI/2),ke=-(G+J/2+q)/Math.PI),xe!==0&&(U=(o+xe)/o,re=o*U,["round-hexagon","round-tag"].includes(W)||(ue=(u+xe)/u,oe=u*ue)),j=j==="auto"?Cv(re,oe):j;for(var Pe=re/2,rr=oe/2,tr=j+(G+q+J)/2,br=new Array(ie.length/2),Ye=new Array(ie.length/2),Ze=0;Ze0){if(n=n||a.position(),i==null||s==null){var h=a.padding();i=a.width()+2*h,s=a.height()+2*h}o.colorFillStyle(t,v[0],v[1],v[2],l),o.nodeShapes[f].draw(t,n.x,n.y,i+u*2,s+u*2,c),t.fill()}}}};gt.drawNodeOverlay=Rf("overlay");gt.drawNodeUnderlay=Rf("underlay");gt.hasPie=function(r){return r=r[0],r._private.hasPie};gt.hasStripe=function(r){return r=r[0],r._private.hasStripe};gt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,h,d=0,y=this.usePaths();if(y&&(u=0,l=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),s.units==="%"?h=c*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d;E+=o;var C=2*Math.PI*w,x=E+C;p===0||d>=1||d+w>1||(h===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,c,E,x),r.closePath()):(r.beginPath(),r.arc(u,l,c,E,x),r.arc(u,l,h,x,E,!0),r.closePath()),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),d+=w)}};gt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),u=e.height(),l=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var h=o,d=u;c.units==="%"?(h=h*c.pfValue,d=d*c.pfValue):c.pfValue!==void 0&&(h=c.pfValue,d=c.pfValue),v&&(i=0,s=0),s-=h/2,i-=d/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+l>1&&(b=1-l),!(g===0||l>=1||l+b>1)&&(r.beginPath(),r.rect(i,s+d*l,h,d*b),r.closePath(),this.colorFillStyle(r,p[0],p[1],p[2],m),r.fill(),l+=b)}r.restore()};var mr={},Uy=100;mr.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};mr.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;ne.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=s!==void 0?s:b,E=t.pan(),C={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},T=e.prevViewport,k=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!k&&!(y&&!d)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=u,C.x*=u,C.y*=u;var B=e.getCachedZSortedEles();function D(Y,V,H,$,K){var te=Y.globalCompositeOperation;Y.globalCompositeOperation="destination-out",e.colorFillStyle(Y,255,255,255,e.motionBlurTransparency),Y.fillRect(V,H,$,K),Y.globalCompositeOperation=te}function P(Y,V){var H,$,K,te;!e.clearingMotionBlur&&(Y===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Y===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(H={x:E.x*h,y:E.y*h},$=b*h,K=e.canvasWidth*h,te=e.canvasHeight*h):(H=C,$=w,K=e.canvasWidth,te=e.canvasHeight),Y.setTransform(1,0,0,1,0,0),V==="motionBlur"?D(Y,0,0,K,te):!a&&(V===void 0||V)&&Y.clearRect(0,0,K,te),n||(Y.translate(H.x,H.y),Y.scale($,$)),o&&Y.translate(o.x,o.y),s&&Y.scale(s,s)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var A=e.data.bufferContexts[e.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=l.contexts[e.NODE],L=e.textureCache.texture,x=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?D(R,0,0,x.width,x.height):R.clearRect(0,0,x.width,x.height);var I=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I[0],I[1],I[2],M),R.fillRect(0,0,x.width,x.height);var b=t.zoom();P(R,!1),R.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),R.drawImage(L,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var N=t.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&F,z=[];if(z[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,z[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),z[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,z[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||z[e.NODE]){var q=c&&!z[e.NODE]&&h!==1,R=a||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),Z=c&&!q?"motionBlur":void 0;P(R,Z),_?e.drawCachedNodes(R,B.nondrag,u,N):e.drawLayeredElements(R,B.nondrag,u,N),e.debug&&e.drawDebugPoints(R,B.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||z[e.DRAG])){var q=c&&!z[e.DRAG]&&h!==1,R=a||(q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(R,c&&!q?"motionBlur":void 0),_?e.drawCachedNodes(R,B.drag,u,N):e.drawCachedElements(R,B.drag,u,N),e.debug&&e.drawDebugPoints(R,B.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&h!==1){var Q=l.contexts[e.NODE],X=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],J=l.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(V,H,$){V.setTransform(1,0,0,1,0,0),$||!p?V.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(V,0,0,e.canvasWidth,e.canvasHeight);var K=h;V.drawImage(H,0,0,e.canvasWidth*K,e.canvasHeight*K,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||z[e.NODE])&&(ne(Q,X,z[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||z[e.DRAG])&&(ne(J,j,z[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},Uy)),a||t.emit("render")};var ha;mr.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,u=n.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!s&&u[t.SELECT_BOX]&&!o){var v=l||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),h=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(h.x,h.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var d=t.lastRedrawTime;if(t.showFps&&d){d=Math.round(d);var y=Math.round(1e3/d),g="1 frame = "+d+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ha){var p=v.measureText(g);ha=p.actualBoundingBoxAscent}v.fillText(g,0,ha);var m=60;v.strokeRect(0,ha+10,250,20),v.fillRect(0,ha+10,250*Math.min(y/m,1),20)}o||(u[t.SELECT_BOX]=!1)}};function Gl(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function Ky(r,e,t){var a=Gl(r,r.VERTEX_SHADER,e),n=Gl(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Xy(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function mo(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function Yy(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function Zy(r,e,t,a,n){var i=a*t+e.x,s=n*t+e.y;return s=Math.round(r.canvasHeight-s),[i,s]}function Qy(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function Jy(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function jy(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function em(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Mf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Lf(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function rm(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function tm(r,e,t,a){var n=Mf(r,e),i=Xe(n,2),s=i[0],o=i[1],u=Lf(r,o,a),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Fr(r,e,t,a){var n=Mf(r,t),i=Xe(n,3),s=i[0],o=i[1],u=i[2],l=Lf(r,o,e*s),v=s*u,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),o===r.FLOAT?r.vertexAttribPointer(a,s,o,!1,v,0):o===r.INT&&r.vertexAttribIPointer(a,s,o,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;hs&&(o=s/a,u=a*o,l=n*o),{scale:o,texW:u,texH:l}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,u=this.texHeight,l=this.getScale(a),v=l.scale,f=l.texW,c=l.texH,h=function(b,w){if(n&&w){var E=w.context,C=b.x,x=b.row,T=C,k=u*x;E.save(),E.translate(T,k),E.scale(v,v),n(E,a),E.restore()}},d=[null,null],y=function(){h(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:f,h:c},d[1]={x:i.freePointer.x+f,y:i.freePointer.row*u,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),h({x:0,row:0},b);var E=s-i.freePointer.x,C=f-E,x=u;{var T=i.freePointer.x,k=i.freePointer.row*u,B=E;w.context.drawImage(b,0,0,B,x,T,k,B,x),d[0]={x:T,y:k,w:B,h:c}}{var D=E,P=(i.freePointer.row+1)*u,A=C;w&&w.context.drawImage(b,D,0,A,x,0,P,A,x),d[1]={x:0,y:P,w:A,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),s=i.texW;return this.freePointer.x+s>a?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,u=o===void 0?function(){return!0}:o,l=n.filterType,v=l===void 0?function(){return!0}:l,f=!1,c=!1,h=Cr(t),d;try{for(h.s();!(d=h.n()).done;){var y=d.value;if(u(y)){var g=Cr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,E=w.type;if(v(E)){var C=a.collections.get(w.collection),x=w.getKey(y),T=Array.isArray(x)?x:[x];if(s)T.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),B=a._key(E,k),D=a.typeAndIdToKey.get(B);D!==void 0&&!Jy(T,D)&&(f=!0,a.typeAndIdToKey.delete(B),D.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){h.e(b)}finally{h.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=Cr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),u=!1,l=o.draw(i,n,function(c){s.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),s.drawElement(c,t,n,!0,!0),c.restore()):s.drawElement(c,t,n,!0,!0),u=!0});if(u){var v=s.getID?s.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return l}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(u){var l=i.getBoundingBox(t,u),v=n.getOrCreateAtlas(t,a,l,u),f=v.getOffsets(u),c=Xe(f,2),h=c[0],d=c[1];return{atlas:v,tex:h,tex1:h,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],a=Cr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Xe(n.value,2),s=i[0],o=i[1],u=o.getCounts(),l=u.keyCount,v=u.atlasCount;t.push({type:s,keyCount:l,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),fm=(function(){function r(e){ct(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return dt(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),cm=` + float circleSD(vec2 p, float r) { + return distance(vec2(0), p) - r; // signed distance + } +`,dm=` + float rectangleSD(vec2 p, vec2 b) { + vec2 d = abs(p)-b; + return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); + } +`,hm=` + float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { + cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; + cr.x = (p.y > 0.0) ? cr.x : cr.y; + vec2 q = abs(p) - b + cr.x; + return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; + } +`,gm=` + float ellipseSD(vec2 p, vec2 ab) { + p = abs( p ); // symmetry + + // find root with Newton solver + vec2 q = ab*(p-ab); + float w = (q.x1.0) ? d : -d; + } +`,Ea={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Pn={IGNORE:1,USE_BB:2},Es=0,Ul=1,Kl=2,Cs=3,Vt=4,nn=5,ga=6,pa=7,pm=(function(){function r(e,t,a){ct(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Xy,this.atlasManager=new vm(e,a),this.batchManager=new fm(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ea.SCREEN),this.pickingProgram=this._createShaderProgram(Ea.PICKING),this.vao=this._createVAO()}return dt(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es + precision highp float; + + uniform mat3 uPanZoomMatrix; + uniform int uAtlasSize; + + // instanced + in vec2 aPosition; // a vertex from the unit square + + in mat3 aTransform; // used to transform verticies, eg into a bounding box + in int aVertType; // the type of thing we are rendering + + // the z-index that is output when using picking mode + in vec4 aIndex; + + // For textures + in int aAtlasId; // which shader unit/atlas to use + in vec4 aTex; // x/y/w/h of texture in atlas + + // for edges + in vec4 aPointAPointB; + in vec4 aPointCPointD; + in vec2 aLineWidth; // also used for node border width + + // simple shapes + in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] + in vec4 aColor; // also used for edges + in vec4 aBorderColor; // aLineWidth is used for border width + + // output values passed to the fragment shader + out vec2 vTexCoord; + out vec4 vColor; + out vec2 vPosition; + // flat values are not interpolated + flat out int vAtlasId; + flat out int vVertType; + flat out vec2 vTopRight; + flat out vec2 vBotLeft; + flat out vec4 vCornerRadius; + flat out vec4 vBorderColor; + flat out vec2 vBorderWidth; + flat out vec4 vIndex; + + void main(void) { + int vid = gl_VertexID; + vec2 position = aPosition; // TODO make this a vec3, simplifies some code below + + if(aVertType == `.concat(Es,`) { + float texX = aTex.x; // texture coordinates + float texY = aTex.y; + float texW = aTex.z; + float texH = aTex.w; + + if(vid == 1 || vid == 2 || vid == 4) { + texX += texW; + } + if(vid == 2 || vid == 4 || vid == 5) { + texY += texH; + } + + float d = float(uAtlasSize); + vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Vt," || aVertType == ").concat(pa,` + || aVertType == `).concat(nn," || aVertType == ").concat(ga,`) { // simple shapes + + // the bounding box is needed by the fragment shader + vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat + vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat + vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated + + // calculations are done in the fragment shader, just pass these along + vColor = aColor; + vCornerRadius = aCornerRadius; + vBorderColor = aBorderColor; + vBorderWidth = aLineWidth; + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Ul,`) { + vec2 source = aPointAPointB.xy; + vec2 target = aPointAPointB.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + // stretch the unit square into a long skinny rectangle + vec2 xBasis = target - source; + vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); + vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; + + gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); + vColor = aColor; + } + else if(aVertType == `).concat(Kl,`) { + vec2 pointA = aPointAPointB.xy; + vec2 pointB = aPointAPointB.zw; + vec2 pointC = aPointCPointD.xy; + vec2 pointD = aPointCPointD.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + vec2 p0, p1, p2, pos; + if(position.x == 0.0) { // The left side of the unit square + p0 = pointA; + p1 = pointB; + p2 = pointC; + pos = position; + } else { // The right side of the unit square, use same approach but flip the geometry upside down + p0 = pointD; + p1 = pointC; + p2 = pointB; + pos = vec2(0.0, -position.y); + } + + vec2 p01 = p1 - p0; + vec2 p12 = p2 - p1; + vec2 p21 = p1 - p2; + + // Find the normal vector. + vec2 tangent = normalize(normalize(p12) + normalize(p01)); + vec2 normal = vec2(-tangent.y, tangent.x); + + // Find the vector perpendicular to p0 -> p1. + vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); + + // Determine the bend direction. + float sigma = sign(dot(p01 + p21, normal)); + float width = aLineWidth[0]; + + if(sign(pos.y) == -sigma) { + // This is an intersecting vertex. Adjust the position so that there's no overlap. + vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } else { + // This is a non-intersecting vertex. Treat it like a mitre join. + vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } + + vColor = aColor; + } + else if(aVertType == `).concat(Cs,` && vid < 3) { + // massage the first triangle into an edge arrow + if(vid == 0) + position = vec2(-0.15, -0.3); + if(vid == 1) + position = vec2( 0.0, 0.0); + if(vid == 2) + position = vec2( 0.15, -0.3); + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + vColor = aColor; + } + else { + gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space + } + + vAtlasId = aAtlasId; + vVertType = aVertType; + vIndex = aIndex; + } + `),i=this.batchManager.getIndexArray(),s=`#version 300 es + precision highp float; + + // declare texture unit for each texture atlas in the batch + `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(` + `),` + + uniform vec4 uBGColor; + uniform float uZoom; + + in vec2 vTexCoord; + in vec4 vColor; + in vec2 vPosition; // model coordinates + + flat in int vAtlasId; + flat in vec4 vIndex; + flat in int vVertType; + flat in vec2 vTopRight; + flat in vec2 vBotLeft; + flat in vec4 vCornerRadius; + flat in vec4 vBorderColor; + flat in vec2 vBorderWidth; + + out vec4 outColor; + + `).concat(cm,` + `).concat(dm,` + `).concat(hm,` + `).concat(gm,` + + vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha + return vec4( + top.rgb + (bot.rgb * (1.0 - top.a)), + top.a + (bot.a * (1.0 - top.a)) + ); + } + + vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance + // scale to the zoom level so that borders don't look blurry when zoomed in + // note 1.5 is an aribitrary value chosen because it looks good + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + } + + void main(void) { + if(vVertType == `).concat(Es,`) { + // look up the texel from the texture unit + `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(` + else `),` + } + else if(vVertType == `).concat(Cs,`) { + // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; + outColor = blend(vColor, uBGColor); + outColor.a = 1.0; // make opaque, masks out line under arrow + } + else if(vVertType == `).concat(Vt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done + } + else if(vVertType == `).concat(Vt," || vVertType == ").concat(pa,` + || vVertType == `).concat(nn," || vVertType == ").concat(ga,`) { // use SDF + + float outerBorder = vBorderWidth[0]; + float innerBorder = vBorderWidth[1]; + float borderPadding = outerBorder * 2.0; + float w = vTopRight.x - vBotLeft.x - borderPadding; + float h = vTopRight.y - vBotLeft.y - borderPadding; + vec2 b = vec2(w/2.0, h/2.0); // half width, half height + vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center + + float d; // signed distance + if(vVertType == `).concat(Vt,`) { + d = rectangleSD(p, b); + } else if(vVertType == `).concat(pa,` && w == h) { + d = circleSD(p, b.x); // faster than ellipse + } else if(vVertType == `).concat(pa,`) { + d = ellipseSD(p, b); + } else { + d = roundRectangleSD(p, b, vCornerRadius.wzyx); + } + + // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling + // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box + if(d > 0.0) { + if(d > outerBorder) { + discard; + } else { + outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); + } + } else { + if(d > innerBorder) { + vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; + vec4 innerBorderColor = blend(vBorderColor, vColor); + outColor = distInterp(innerBorderColor, outerColor, d); + } + else { + vec4 outerColor; + if(innerBorder == 0.0 && outerBorder == 0.0) { + outerColor = vec4(0); + } else if(innerBorder == 0.0) { + outerColor = vBorderColor; + } else { + outerColor = blend(vBorderColor, vColor); + } + outColor = distInterp(vColor, outerColor, d - innerBorder); + } + } + } + else { + outColor = vColor; + } + + `).concat(t.picking?`if(outColor.a == 0.0) discard; + else outColor = vIndex;`:"",` + } + `),o=Ky(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:Ea.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===Pn.IGNORE)return;if(u==Pn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p=this.maxInstances&&this.endBatch()}}}}catch(D){v.e(D)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;Wl(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;pn(t,t,[v,f]),$l(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;pn(t,t,[s,o]),Hs(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);bt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=o,o===nn||o===ga){var l=i.getBoundingBox(t),v=this._getCornerRadius(t,s.radius,l),f=this.cornerRadiusBuffer.getView(u);f[0]=v,f[1]=v,f[2]=v,f[3]=v,o===ga&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(u);Ft(a,c);var h=this.renderTarget.picking?1:n==="node-body"?t.effectiveOpacity():1,d=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h,y=t.pstyle(s.color).value,g=this.colorBuffer.getView(u);bt(y,d,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,s.border){var m=t.pstyle("border-width").value;if(m>0){var b=t.pstyle("border-color").value,w=h*t.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(u);bt(b,w,E);var C=t.pstyle("border-position").value;if(C==="inside")p[0]=0,p[1]=-m;else if(C==="outside")p[0]=m,p[1]=0;else{var x=m/2;p[0]=x,p[1]=-x}}}var T=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,T,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return Vt;case"ellipse":return pa;case"roundrectangle":case"round-rectangle":return nn;case"bottom-round-rectangle":return ga;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,s=n.h;if(t.pstyle(a).value==="auto")return ut(i,s);var o=t.pstyle(a).pfValue,u=i/2,l=s/2;return Math.min(o,l,u)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,s,o,u;if(n==="source"?(s=i.arrowStartX,o=i.arrowStartY,u=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(u)||u==null)){var l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,h=f*c,d=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,g=this.r.getArrowWidth(d,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);Wl(m),pn(m,m,[s,o]),Hs(m,m,[g,g]),$l(m,m,u),this.vertTypeBuffer.getView(p)[0]=Cs;var b=this.indexBuffer.getView(p);Ft(a,b);var w=this.colorBuffer.getView(p);bt(v,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*s;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=Ul;var f=this.indexBuffer.getView(v);Ft(a,f);var c=this.colorBuffer.getView(v);bt(u,l,c);var h=this.lineWidthBuffer.getView(v);h[0]=o;var d=this.pointAPointBBuffer.getView(v);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var s=i/a;this._setCurvePoint(t,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?Pn.USE_BB:Pn.IGNORE},u=function(f){var c=f.position(),h=c.x,d=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:h-y/2,y1:d-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:Qy,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Ts(e.getLabelKey,null),getBoundingBox:Ss(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Ts(e.getSourceLabelKey,"source"),getBoundingBox:Ss(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Ts(e.getTargetLabelKey,"target"),getBoundingBox:Ss(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Fa(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&l()}),mm(t)};function ym(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return iv(t)}function Of(r,e){var t=r._private.rscratch;return pr(t,"labelWrapCachedLines",e)||[]}var Ts=function(e,t){return function(a){var n=e(a),i=Of(a,t);return i.length>1?i.map(function(s,o){return"".concat(n,"_").concat(o)}):n}},Ss=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),u=Of(a,t),l=i.h/u.length,v=l*o,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:l,yOffset:v}}}return i}};function mm(r){{var e=r.render;r.render=function(i){i=i||{};var s=r.cy;r.webgl&&(s.zoom()>Df?(bm(r),e.call(r,i)):(wm(r),zf(r,i,Ea.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,s,o,u){return km(r,i,s)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,s){n.call(r,i,s),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function bm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function wm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function xm(r){var e=r.canvasWidth,t=r.canvasHeight,a=mo(r),n=a.pan,i=a.zoom,s=xs();pn(s,s,[n.x,n.y]),Hs(s,s,[i,i]);var o=xs();sm(o,e,t);var u=xs();return im(u,o,s),u}function Nf(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=mo(r),i=n.pan,s=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(s,s)}function Em(r,e){r.drawSelectionRectangle(e,function(t){return Nf(r,t)})}function Cm(r){var e=r.data.contexts[r.NODE];e.save(),Nf(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Tm(r){var e=function(n,i,s){for(var o=n.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=o.atlases,v=0;v=0&&w.add(x)}return w}function km(r,e,t){var a=Sm(r,e,t),n=r.getCachedZSortedEles(),i,s,o=Cr(a),u;try{for(o.s();!(u=o.n()).done;){var l=u.value,v=n[l];if(!i&&v.isNode()&&(i=v),!s&&v.isEdge()&&(s=v),i&&s)break}}catch(f){o.e(f)}finally{o.f()}return[i,s].filter(Boolean)}function ks(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function zf(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&Em(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=xm(r),u=r.getCachedZSortedEles();if(i=u.length,n.startFrame(o,t),t.screen){for(var l=0;l0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*l,-a.y1*l),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(a.x1*l,a.y1*l);else{var y=e.pan(),g={x:y.x*l,y:y.y*l};l*=e.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return c};function Dm(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i"u"?"undefined":je(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[Pf,Wr,Zr,yo,Rt,gt,mr,If,pt,Wa,qf].forEach(function(r){me(Se,r)});var Am=[{name:"null",impl:hf},{name:"base",impl:Sf},{name:"canvas",impl:Bm}],Rm=[{type:"layout",extensions:ey},{type:"renderer",extensions:Am}],Gf={},Hf={};function Wf(r,e,t){var a=t,n=function(T){Ne("Can not register `"+e+"` for `"+r+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(Ra.prototype[e])return n(e);Ra.prototype[e]=t}else if(r==="collection"){if(ur.prototype[e])return n(e);ur.prototype[e]=t}else if(r==="layout"){for(var i=function(T){this.options=T,t.call(this,T),Me(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],u=0;ur.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Zl(r,e,t){return(e=Ql(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tc(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function ac(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function nc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ic(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(r,e){return jf(r)||ac(r,e)||Us(r,e)||nc()}function pn(r){return ec(r)||tc(r)||Us(r)||ic()}function sc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Ql(r){var e=sc(r,"string");return typeof e=="symbol"?e:e+""}function rr(r){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(r)}function Us(r,e){if(r){if(typeof r=="string")return ks(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ks(r,e):void 0}}var je=typeof window>"u"?null:window,Eo=je?je.navigator:null;je&&je.document;var oc=rr(""),Jl=rr({}),uc=rr(function(){}),lc=typeof HTMLElement>"u"?"undefined":rr(HTMLElement),Ra=function(e){return e&&e.instanceString&&$e(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&rr(e)==oc},$e=function(e){return e!=null&&rr(e)===uc},Ve=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&rr(e)===Jl&&!Ve(e)&&e.constructor===Object},vc=function(e){return e!=null&&rr(e)===Jl},ae=function(e){return e!=null&&rr(e)===rr(1)&&!isNaN(e)},fc=function(e){return ae(e)&&Math.floor(e)===e},yn=function(e){if(lc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ma(e)||jl(e)},Ma=function(e){return Ra(e)==="collection"&&e._private.single},jl=function(e){return Ra(e)==="collection"&&!e._private.single},Ks=function(e){return Ra(e)==="core"},ev=function(e){return Ra(e)==="stylesheet"},cc=function(e){return Ra(e)==="event"},ot=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},dc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},hc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},gc=function(e){return vc(e)&&$e(e.then)},pc=function(){return Eo&&Eo.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Cc=function(e,t){return-1*tv(e,t)},ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+bc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},kc=function(e){var t,a=new RegExp("^"+yc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Dc=function(e){return Bc[e.toLowerCase()]},av=function(e){return(Ve(e)?e:null)||Dc(e)||Tc(e)||kc(e)||Sc(e)},Bc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},nv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=u||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function D(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function B(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,u),w(y)}return d===void 0&&(d=setTimeout(T,u)),h}return P.cancel=D,P.flush=B,P}return li=s,li}var Fc=zc(),Na=La(Fc),vi=je?je.performance:null,ov=vi&&vi.now?function(){return vi.now()}:function(){return Date.now()},Vc=(function(){if(je){if(je.requestAnimationFrame)return function(r){je.requestAnimationFrame(r)};if(je.mozRequestAnimationFrame)return function(r){je.mozRequestAnimationFrame(r)};if(je.webkitRequestAnimationFrame)return function(r){je.webkitRequestAnimationFrame(r)};if(je.msRequestAnimationFrame)return function(r){je.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(ov())},1e3/60)}})(),mn=function(e){return Vc(e)},Xr=ov,Ct=9261,uv=65599,_t=5381,lv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,a=t,n;n=e.next(),!n.done;)a=a*uv+n.value|0;return a},xa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct;return t*uv+e|0},Ea=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t;return(t<<5)+t+e|0},qc=function(e,t){return e*2097152+t},jr=function(e){return e[0]*2097152+e[1]},Ua=function(e,t){return[xa(e[0],t[0]),Ea(e[1],t[1])]},Fo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},Js=function(e){e.splice(0,e.length)},Zc=function(e,t){for(var a=0;a"u"?"undefined":rr(Set))!==Jc?Set:jc,Mn=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ks(e)){He("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){He("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new jt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];Ve(t.classes)?l=t.classes:he(t.classes)&&(l=t.classes.split(/\s+/));for(var v=0,f=l.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bD;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;wB;0<=B?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),D=0;D0)for(O.unshift(M);f[_];){var N=f[_];O.unshift(N.edge),O.unshift(N.node),q=N.node,_=q.id()}return o.spawn(O)}}}},sd={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,u=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var T=[],k=i,D=v,B=p[D];T.unshift(k),B!=null&&T.unshift(B),k=g[D],k!=null;)D=k.id(),B=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AB&&(d[D]=B,m[D]=k,b[D]=E),!i){var P=k*v+T;!i&&d[P]>B&&(d[P]=B,m[P]=T,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,se=b(me),de=[],fe=se;;){if(fe==null)return t.spawn();var xe=m(fe),be=xe.edge,Se=xe.pred;if(de.unshift(fe[0]),fe.same(ge)&&de.length>0)break;be!=null&&de.unshift(be),fe=Se}return u.spawn(de)},C=0;C=0;v--){var f=l[v],c=f[1],h=f[2];(t[c]===o&&t[h]===u||t[c]===u&&t[h]===o)&&l.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=hd(i,e,t),a--}return t},gd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/dd);if(i<2){He("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},xd=function(e){return Math.PI*e/180},Ka=function(e,t){return Math.atan2(t,e)-Math.PI/2},js=Math.log2||function(r){return Math.log(r)/Math.log(2)},eo=function(e){return e>0?1:e<0?-1:0},Dt=function(e,t){return Math.sqrt(xt(e,t))},xt=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Ed=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Td=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Sd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},kd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},pv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},sn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},on=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Qe(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Wo=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ro=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},at=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},$o=function(e,t){return at(e,t.x,t.y)},yv=function(e,t){return at(e,t.x1,t.y1)&&at(e,t.x2,t.y2)},Dd=(di=Math.hypot)!==null&&di!==void 0?di:function(r,e){return Math.sqrt(r*r+e*e)};function Bd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Dd(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,D=0;D7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?lt(i,s):u,v=i/2,f=s/2;l=Math.min(l,v,f);var c=l!==v,h=l!==f,d;if(c){var y=a-v+l-o,g=n-f-o,p=a+v-l+o,m=g;if(d=nt(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+l-o,E=b,C=n+f-l+o;if(d=nt(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+l-o,T=n+f+o,k=a+v-l+o,D=T;if(d=nt(e,t,a,n,x,T,k,D,!1),d.length>0)return d}if(h){var B=a-v-o,P=n-f+l-o,A=B,R=n+f-l+o;if(d=nt(e,t,a,n,B,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+l,M=n-f+l;if(L=ga(e,t,a,n,I,M,l+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-l,q=n-f+l;if(L=ga(e,t,a,n,O,q,l+o),L.length>0&&L[0]>=O&&L[1]<=q)return[L[0],L[1]]}{var _=a+v-l,N=n+f-l;if(L=ga(e,t,a,n,_,N,l+o),L.length>0&&L[0]>=_&&L[1]>=N)return[L[0],L[1]]}{var F=a-v+l,U=n+f-l;if(L=ga(e,t,a,n,F,U,l+o),L.length>0&&L[0]<=F&&L[1]>=U)return[L[0],L[1]]}return[]},Ad=function(e,t,a,n,i,s,o){var u=o,l=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return l-u<=e&&e<=v+u&&f-u<=t&&t<=c+u},Rd=function(e,t,a,n,i,s,o,u,l){var v={x1:Math.min(a,o,i)-l,x2:Math.max(a,o,i)+l,y1:Math.min(n,u,s)-l,y2:Math.max(n,u,s)+l};return!(ev.x2||tv.y2)},Md=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-t+s)/o,l=(-t-s)/o;return[u,l]},Ld=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,u,l,v,f,c,h,d;if(u=(3*a-t*t)/9,l=-(27*n)+t*(9*a-2*(t*t)),l/=54,o=u*u*u+l*l,i[1]=0,h=t/3,o>0){f=l+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=l-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}u=-u,v=u*u*u,v=Math.acos(l/Math.sqrt(v)),d=2*Math.sqrt(u),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Id=function(e,t,a,n,i,s,o,u){var l=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*u-n*t+2*s*s+2*s*t-u*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Ld(l,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wl?(e-i)*(e-i)+(t-s)*(t-s):v-c},Er=function(e,t,a){for(var n,i,s,o,u,l=0,v=0;v=e&&e>=s||n<=e&&e<=s)u=(e-n)/(s-n)*(o-i)+i,u>t&&l++;else continue;return l%2!==0},Yr=function(e,t,a,n,i,s,o,u,l){var v=new Array(a.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=xn(v,-l);y=wn(g)}else y=v;return Er(e,t,y)},Nd=function(e,t,a,n,i,s,o,u){for(var l=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*u[0]+e,w=m[0]*u[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*u[0]+e,C=m[1]*u[1]+t;return[b,w,E,C]}else return[b,w]},hi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},nt=function(e,t,a,n,i,s,o,u,l){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=u-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:l?[e+b*f,t+b*d]:[]}else return g===0||p===0?hi(e,a,o)===o?[o,u]:hi(e,a,i)===i?[i,s]:hi(i,o,a)===a?[a,n]:[]:[]},Fd=function(e,t,a,n,i){var s=[],o=n/2,u=i/2,l=t,v=a;s.push({x:l+o*e[0],y:v+u*e[1]});for(var f=1;f0){var y=xn(f,-u);h=wn(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return l[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[B]+I&&(x[A]=x[B]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[B]+I&&(C[A]=C[A]+C[B],E[A].push(B))}else for(var M=0;M0;){for(var N=w.pop(),F=0;F0&&o.push(a[u]);o.length!==0&&i.push(n.collection(o))}return i},jd=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:th,o=n,u,l,v=0;v=2?ua(e,t,a,0,Zo,ah):ua(e,t,a,0,Yo)},squaredEuclidean:function(e,t,a){return ua(e,t,a,0,Zo)},manhattan:function(e,t,a){return ua(e,t,a,0,Yo)},max:function(e,t,a){return ua(e,t,a,-1/0,nh)}};Zt["squared-euclidean"]=Zt.squaredEuclidean;Zt.squaredeuclidean=Zt.squaredEuclidean;function In(r,e,t,a,n,i){var s;return $e(r)?s=r:s=Zt[r]||Zt.euclidean,e===0&&$e(r)?s(n,i):s(e,t,a,n,i)}var ih=vr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ao=function(e){return ih(e)},En=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},u=function(c){return n[c](t)},l=a,v=t;return In(e,n.length,o,u,l,v)},pi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),u=null,l=0;la)return!1}return!0},uh=function(e,t,a){for(var n=0;no&&(o=t[l][v],u=v);i[u].push(e[l])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(u=a[y.key][m.key])):i.linkage==="max"?(u=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},tu=function(e,t,a){for(var n=[],i=0;io&&(s=l,o=t[i*e+l])}s>0&&n.push(s)}for(var v=0;vl&&(u=v,l=f)}a[i]=s[u]}return n=tu(e,t,a),n},au=function(e){for(var t=this.cy(),a=this.nodes(),n=wh(e),i={},s=0;s=B?(P=B,B=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+F]=U,N+=U}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var J=0,Z=0;Z1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(T){T.isEdge()&&f[b].push(T.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(u?l?o=!0:l=b:u=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(l&&u)if(i){if(v&&l!=v)return h;v=l}else{if(v&&l!=v&&u!=v)return h;v||(v=l)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,T;f[w].length;)C=f[w].shift(),x=c[C][0],T=c[C][1],w!=T?(f[T]=f[T].filter(function(k){return k!=C}),w=T):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Ya=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},u=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},l=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(l(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,u(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,l(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Bh={hopcroftTarjanBiconnected:Ya,htbc:Ya,htb:Ya,hopcroftTarjanBiconnectedComponents:Ya},Za=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(l){i.push(l),t[l]={index:a,low:a++,explored:!1};var v=e.getElementById(l).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==l&&(g in t||o(g),t[g].explored||(t[l].low=Math.min(t[l].low,t[g].low)))}),t[l].index===t[l].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||o(l)}}),{cut:s,components:n}},Ph={tarjanStronglyConnected:Za,tsc:Za,tscc:Za,tarjanStronglyConnectedComponents:Za},Sv={};[Ca,id,sd,ud,vd,cd,gd,Gd,Ut,Kt,Ps,rh,hh,mh,Sh,Dh,Bh,Ph].forEach(function(r){ye(Sv,r)});/*! -Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable -Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) -Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var kv=0,Dv=1,Bv=2,Or=function(e){if(!(this instanceof Or))return new Or(e);this.id="Thenable/1.0.7",this.state=kv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Or.prototype={fulfill:function(e){return nu(this,Dv,"fulfillValue",e)},reject:function(e){return nu(this,Bv,"rejectReason",e)},then:function(e,t){var a=this,n=new Or;return a.onFulfilled.push(su(e,n,"fulfill")),a.onRejected.push(su(t,n,"reject")),Pv(a),n.proxy}};var nu=function(e,t,a,n){return e.state===kv&&(e.state=t,e[a]=n,Pv(e)),e},Pv=function(e){e.state===Dv?iu(e,"onFulfilled",e.fulfillValue):e.state===Bv&&iu(e,"onRejected",e.rejectReason)},iu=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return Fi=e,Fi}var Vi,Pu;function Xh(){if(Pu)return Vi;Pu=1;var r=zn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return Vi=e,Vi}var qi,Au;function Yh(){if(Au)return qi;Au=1;var r=Wh(),e=$h(),t=Uh(),a=Kh(),n=Xh();function i(s){var o=-1,u=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ve(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};un.className=un.classNames=un.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:er,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+";Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+";Re.value=Re.string+"|"+Re.number;Re.id=Re.variable;(function(){var r,e,t;for(r=Re.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)})();var Fe=function(){return{checks:[]}},ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Ls=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Cc(r.selector,e.selector)}),kg=(function(){for(var r={},e,t=0;t0&&v.edgeCount>0)return ze("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return ze("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&ze("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Mg=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return he(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case ue.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case ue.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(h)+"]"}case ue.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case ue.DATA_EXIST:{var b=v.field;return"["+b+"]"}case ue.META_COMPARE:{var w=v.operator,E=v.field;return"[["+E+a(e(w))+t(h)+"]]"}case ue.STATE:return h;case ue.ID:return"#"+h;case ue.CLASS:return"."+h;case ue.PARENT:case ue.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case ue.ANCESTOR:case ue.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case ue.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),T=i(v.right,f);return C+(C.length>0?" ":"")+x+T}case ue.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||o||v)&&(u=!i&&!s?"":""+e,l=""+a),v&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),t){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e0;){var v=n.shift();e(v),i.add(v.id()),o&&a(n,i,v)}return r}function zv(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,zv)};function Fv(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Qt.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,Fv)};function qg(r,e,t){Fv(r,e,t),zv(r,e,t)}Qt.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oo(this,r,e,qg)};Qt.ancestors=Qt.parents;var ka,Vv;ka=Vv={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ne.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ne.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ka.attr=ka.data;ka.removeAttr=ka.removeData;var _g=Vv,Vn={};function hs(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;se}),minIndegree:It("indegree",function(r,e){return re}),minOutdegree:It("outdegree",function(r,e){return re})});ye(Vn,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?l.position(e,t+h[e]):i!==void 0&&l.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),y=o?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:d.x-m.x,y:d.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}};Ir.modelPosition=Ir.point=Ir.position;Ir.modelPositions=Ir.points=Ir.positions;Ir.renderedPoint=Ir.renderedPosition;Ir.relativePoint=Ir.relativePosition;var Gg=qv,Xt,gt;Xt=gt={};gt.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}};gt.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};gt.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=o.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(k,D,B){var P=0,A=0,R=D+B;return k>0&&R>0&&(P=D/R*k,A=B/R*k),{biasDiff:P,biasComplementDiff:A}}function d(k,D,B,P){if(B.units==="%")switch(P){case"width":return k>0?B.pfValue*k:0;case"height":return D>0?B.pfValue*D:0;case"average":return k>0&&D>0?B.pfValue*(k+D)/2:0;case"min":return k>0&&D>0?k>D?B.pfValue*D:B.pfValue*k:0;case"max":return k>0&&D>0?k>D?B.pfValue*k:B.pfValue*D:0;default:return 0}else return B.units==="px"?B.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=h(v.width.val-f.w,y,g),w=b.biasDiff,E=b.biasComplementDiff,C=h(v.height.val-f.h,p,m),x=C.biasDiff,T=C.biasComplementDiff;o.autoPadding=d(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+E)/2,o.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+T)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},rt=function(e,t){return t==null?e:Lr(e,t.x1,t.y1,t.x2,t.y2)},la=function(e,t,a){return xr(e,t,a)},Qa=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,u,l;if(o!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=u-s,f.y1=l-s,f.x2=u+s,f.y2=l+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,sn(f,1),Lr(e,f.x1,f.y1,f.x2,f.y2)}}},gs=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),v=la(s,"labelWidth",a),f=la(s,"labelHeight",a),c=la(s,"labelX",a),h=la(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,E=t.pstyle("text-background-padding").pfValue,C=2,x=f,T=v,k=T/2,D=x/2,B,P,A,R;if(g)B=c-k,P=c+k,A=h-D,R=h+D;else{switch(u.value){case"left":B=c-T,P=c;break;case"center":B=c-k,P=c+k;break;case"right":B=c,P=c+T;break}switch(l.value){case"top":A=h-x,R=h;break;case"center":A=h-D,R=h+D;break;case"bottom":A=h,R=h+x;break}}var L=d-Math.max(m,w)-E-C,I=d+Math.max(m,w)+E+C,M=y-Math.max(m,w)-E-C,O=y+Math.max(m,w)+E+C;B+=L,P+=I,A+=M,R+=O;var q=a||"main",_=i.labelBounds,N=_[q]=_[q]||{};N.x1=B,N.y1=A,N.x2=P,N.y2=R,N.w=P-B,N.h=R-A,N.leftPad=L,N.rightPad=I,N.topPad=M,N.botPad=O;var F=g&&p.strValue==="autorotate",U=p.pfValue!=null&&p.pfValue!==0;if(F||U){var J=F?la(i.rstyle,"labelAngle",a):p.pfValue,Z=Math.cos(J),j=Math.sin(J),re=(B+P)/2,ne=(A+R)/2;if(!g){switch(u.value){case"left":re=P;break;case"right":re=B;break}switch(l.value){case"top":ne=R;break;case"bottom":ne=A;break}}var Q=function(we,me){return we=we-re,me=me-ne,{x:we*Z-me*j+re,y:we*j+me*Z+ne}},V=Q(B,A),H=Q(B,R),W=Q(P,A),Y=Q(P,R);B=Math.min(V.x,H.x,W.x,Y.x),P=Math.max(V.x,H.x,W.x,Y.x),A=Math.min(V.y,H.y,W.y,Y.y),R=Math.max(V.y,H.y,W.y,Y.y)}var te=q+"Rot",ce=_[te]=_[te]||{};ce.x1=B,ce.y1=A,ce.x2=P,ce.y2=R,ce.w=P-B,ce.h=R-A,Lr(e,B,A,P,R),Lr(i.labelBounds.all,B,A,P,R)}return e}},il=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,s=n+i;Gv(e,t,a,s,"outside",s/2)}},Gv=function(e,t,a,n,i,s){if(!(a===0||n<=0||i==="inside")){var o=t.cy(),u=o.renderer(),l=u.nodeShapes[u.getNodeShape(t)];if(l){var v=t.position(),f=v.x,c=v.y,h=t.width(),d=t.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var y=l.miterBounds(f,c,h,d,n);rt(e,y)}else s!=null&&s>0&&on(e,[s,s,s,s])}}},Hg=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Gv(e,t,a,n,i)}},Wg=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=yr(),o=e._private,u=e.isNode(),l=e.isEdge(),v,f,c,h,d,y,g=o.rstyle,p=u&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Be){return Be.pstyle("display").value!=="none"},b=!n||m(e)&&(!l||m(e.source())&&m(e.target()));if(b){var w=0,E=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var T=Math.max(E,x),k=0,D=0;if(n&&(k=e.pstyle("width").pfValue,D=k/2),u&&t.includeNodes){var B=e.position();d=B.x,y=B.y;var P=e.outerWidth(),A=P/2,R=e.outerHeight(),L=R/2;v=d-A,f=d+A,c=y-L,h=y+L,Lr(s,v,c,f,h),n&&il(s,e),n&&t.includeOutlines&&!i&&il(s,e),n&&Hg(s,e)}else if(l&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=D,f+=D,c-=D,h+=D,Lr(s,v,c,f,h),I==="haystack"){var M=g.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var O=v;v=f,f=O}if(c>h){var q=c;c=h,h=q}Lr(s,v-D,c-D,f+D,h+D)}}else if(I==="bezier"||I==="unbundled-bezier"||tt(I,"segments")||tt(I,"taxi")){var _;switch(I){case"bezier":case"unbundled-bezier":_=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=g.linePts;break}if(_!=null)for(var N=0;N<_.length;N++){var F=_[N];v=F.x-D,f=F.x+D,c=F.y-D,h=F.y+D,Lr(s,v,c,f,h)}}}else{var U=e.source(),J=U.position(),Z=e.target(),j=Z.position();if(v=J.x,f=j.x,c=J.y,h=j.y,v>f){var re=v;v=f,f=re}if(c>h){var ne=c;c=h,h=ne}v-=D,f+=D,c-=D,h+=D,Lr(s,v,c,f,h)}if(n&&t.includeEdges&&l&&(Qa(s,e,"mid-source"),Qa(s,e,"mid-target"),Qa(s,e,"source"),Qa(s,e,"target")),n){var Q=e.pstyle("ghost").value==="yes";if(Q){var V=e.pstyle("ghost-offset-x").pfValue,H=e.pstyle("ghost-offset-y").pfValue;Lr(s,s.x1+V,s.y1+H,s.x2+V,s.y2+H)}}var W=o.bodyBounds=o.bodyBounds||{};Wo(W,s),on(W,p),sn(W,1),n&&(v=s.x1,f=s.x2,c=s.y1,h=s.y2,Lr(s,v-T,c-T,f+T,h+T));var Y=o.overlayBounds=o.overlayBounds||{};Wo(Y,s),on(Y,p),sn(Y,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?Sd(te.all):te.all=yr(),n&&t.includeLabels&&(t.includeMainLabels&&gs(s,e,null),l&&(t.includeSourceLabels&&gs(s,e,"source"),t.includeTargetLabels&&gs(s,e,"target")))}return s.x1=Dr(s.x1),s.y1=Dr(s.y1),s.x2=Dr(s.x2),s.y2=Dr(s.y2),s.w=Dr(s.x2-s.x1),s.h=Dr(s.y2-s.y1),s.w>0&&s.h>0&&b&&(on(s,p),sn(s,1)),s},Hv=function(e){var t=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:ip,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};ct.removeAllListeners=function(){return this.removeListener("*")};ct.emit=ct.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ve(e)||(e=[e]),sp(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(){var v=a[u];if(v.type===s.type&&(!v.namespace||v.namespace===s.namespace||v.namespace===np)&&i.eventMatches(i.context,v,s)){var f=[s];e!=null&&Zc(f,e),i.beforeEmit(i.context,v,s),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==v}));var c=i.callbackContext(i.context,v,s),h=v.callback.apply(c,f);i.afterEmit(i.context,v,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&he(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;ia&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":rr(Symbol))!=e&&rr(Symbol.iterator)!=e;t&&(Cn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Zl({next:function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Me(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(he(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(v[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});dr.neighbourhood=dr.neighborhood;dr.closedNeighbourhood=dr.closedNeighborhood;dr.openNeighbourhood=dr.openNeighborhood;ye(dr,{source:Br(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Br(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:pl({attr:"source"}),targets:pl({attr:"target"})});function pl(r){return function(t){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});dr.componentsOf=dr.components;var lr=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){He("A collection must have a reference to the core");return}var i=new Kr,s=!1;if(!t)t=[];else if(t.length>0&&Me(t[0])&&!Ma(t[0])){s=!0;for(var o=[],u=new jt,l=0,v=t.length;l0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,u=0,l=t.length;u0){for(var q=o.length===t.length?t:new lr(a,o),_=0;_0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(R){for(var L=R._private.edges,I=0;I0&&(r?B.emitAndNotify("remove"):e&&B.emit("remove"));for(var P=0;P0?P=R:B=R;while(Math.abs(A)>s&&++L=i?m(D,L):I===0?L:w(D,B,B+l)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var T=function(B){return C||x(),r===e&&t===a?B:B===0?0:B===1?1:g(E(B),e,a)};T.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var k="generateBezier("+[r,e,t,a]+")";return T.toString=function(){return k},T}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var yp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),u=e(a,n,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),v=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+v*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(l=a(n,i),h=l/s*f):h=f;d=t(d||o,h),u.push(1+d.x),l+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(y){return u[y*(u.length-1)|0]}:l}})(),qe=function(e,t,a,n){var i=pp(e,t,a,n);return function(s,o,u){return s+(o-s)*i(u)}},vn={linear:function(e,t,a){return e+(t-e)*a},ease:qe(.25,.1,.25,1),"ease-in":qe(.42,0,1,1),"ease-out":qe(0,0,.58,1),"ease-in-out":qe(.42,0,.58,1),"ease-in-sine":qe(.47,0,.745,.715),"ease-out-sine":qe(.39,.575,.565,1),"ease-in-out-sine":qe(.445,.05,.55,.95),"ease-in-quad":qe(.55,.085,.68,.53),"ease-out-quad":qe(.25,.46,.45,.94),"ease-in-out-quad":qe(.455,.03,.515,.955),"ease-in-cubic":qe(.55,.055,.675,.19),"ease-out-cubic":qe(.215,.61,.355,1),"ease-in-out-cubic":qe(.645,.045,.355,1),"ease-in-quart":qe(.895,.03,.685,.22),"ease-out-quart":qe(.165,.84,.44,1),"ease-in-out-quart":qe(.77,0,.175,1),"ease-in-quint":qe(.755,.05,.855,.06),"ease-out-quint":qe(.23,1,.32,1),"ease-in-out-quint":qe(.86,0,.07,1),"ease-in-expo":qe(.95,.05,.795,.035),"ease-out-expo":qe(.19,1,.22,1),"ease-in-out-expo":qe(1,0,0,1),"ease-in-circ":qe(.6,.04,.98,.335),"ease-out-circ":qe(.075,.82,.165,1),"ease-in-out-circ":qe(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return vn.linear;var n=yp(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":qe};function bl(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function wl(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Ot(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=wl(r,n),o=wl(e,n);if(ae(s)&&ae(o))return bl(i,s,o,t,a);if(Ve(s)&&Ve(o)){for(var u=[],l=0;l0?(h==="spring"&&d.push(s.duration),s.easingImpl=vn[h].apply(null,d)):s.easingImpl=vn[h]}var y=s.easingImpl,g;if(s.duration===0?g=1:g=(t-u)/s.duration,s.applying&&(g=s.progress),g<0?g=0:g>1&&(g=1),s.delay==null){var p=s.startPosition,m=s.position;if(m&&n&&!r.locked()){var b={};fa(p.x,m.x)&&(b.x=Ot(p.x,m.x,g,y)),fa(p.y,m.y)&&(b.y=Ot(p.y,m.y,g,y)),r.position(b)}var w=s.startPan,E=s.pan,C=i.pan,x=E!=null&&a;x&&(fa(w.x,E.x)&&(C.x=Ot(w.x,E.x,g,y)),fa(w.y,E.y)&&(C.y=Ot(w.y,E.y,g,y)),r.emit("pan"));var T=s.startZoom,k=s.zoom,D=k!=null&&a;D&&(fa(T,k)&&(i.zoom=Ta(i.minZoom,Ot(T,k,g,y),i.maxZoom)),r.emit("zoom")),(x||D)&&r.emit("viewport");var B=s.style;if(B&&B.length>0&&n){for(var P=0;P=0;x--){var T=C[x];T()}C.splice(0,C.length)},m=h.length-1;m>=0;m--){var b=h[m],w=b._private;if(w.stopped){h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||bp(v,b,r),mp(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),y}for(var i=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var wp={animate:Ne.animate(),animation:Ne.animation(),animated:Ne.animated(),clearQueue:Ne.clearQueue(),delay:Ne.delay(),delayAnimation:Ne.delayAnimation(),stop:Ne.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&mn(function(i){xl(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){xl(s,e)},a.beforeRenderPriorities.animations):t()}},xp={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Ma(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},en=function(e){return he(e)?new vt(e):e},ef={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new qn(xp,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,en(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,en(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,en(t),a),this},once:function(e,t,a){return this.emitter().one(e,en(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Ne.eventAliasesOn(ef);var Os={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Os.jpeg=Os.jpg;var fn={layout:function(e){var t=this;if(e==null){He("Layout options must be specified to make a layout");return}if(e.name==null){He("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){He("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;he(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(ye({},e,{cy:t,eles:i}));return s}};fn.createLayout=fn.makeLayout=fn.layout;var Ep={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Ns.invalidateDimensions=Ns.resize;var cn={collection:function(e,t){return he(e)?this.$(e):Tr(e)?e.collection():Ve(e)?(t||(t={}),new lr(this,e,t.unique,t.removed)):new lr(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};cn.elements=cn.filter=cn.$;var sr={},ma="t",Tp="f";sr.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i0;if(c||f&&h){var d=void 0;c&&h||c?d=l.properties:h&&(d=l.mappedProperties);for(var y=0;y1&&(w=1),o.color){var C=a.valueMin[0],x=a.valueMax[0],T=a.valueMin[1],k=a.valueMax[1],D=a.valueMin[2],B=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(x-C)*w),Math.round(T+(k-T)*w),Math.round(D+(B-D)*w),Math.round(P+(A-P)*w)];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var L=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,L,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),M=f.data,O=0;O0&&i>0){for(var o={},u=!1,l=0;l0?r.delayAnimation(s).play().promise().then(b):b()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};sr.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);r.removed()||o!=null&&o(t,a,r)&&i(s)};sr.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};sr.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};sr.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};sr.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var Va={};Va.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){ze("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new vt(f);if(c.invalid){ze("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),o();continue}}var h=v[2],d=!1;i=h;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){ze("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}s=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){ze("Skipping property: Invalid property name in: "+s),u();continue}var E=t.parse(m,b);if(!E){ze("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:m,val:b}),u()}if(d){o();break}t.selector(f);for(var C=0;C=7&&e[0]==="d"&&(v=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(o.mapData.regex).exec(e))){if(t||l.multiple)return!1;var h=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(d.pfValue===y.pfValue||d.strValue===y.strValue)return ze("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(l.color){var g=d.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:y.value,bypass:t}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Ve(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],x="",T=!1,k=0;k0?" ":"")+D.strValue}return l.validate&&!l.validate(w,E)?null:l.singleEnum&&T?w.length===1&&he(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:E}}var B=function(){for(var Q=0;Ql.max||l.strictMax&&e===l.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return l.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:xd(e)),P==="%"&&(I.pfValue=e/100),I}else if(l.propList){var M=[],O=""+e;if(O!=="none"){for(var q=O.split(/\s*,\s*|\s+/),_=0;_0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((s-2*t)/a.w,(o-2*t)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Me(e)&&(s=e.level,e.position!=null?i=Ln(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=u,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;ae(l.x)&&(t.pan.x=l.x,o=!1),ae(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(he(e)){var a=e;e=this.mutableElements().filter(a)}else Tr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Pt.centre=Pt.center;Pt.autolockNodes=Pt.autolock;Pt.autoungrabifyNodes=Pt.autoungrabify;var Ba={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Ba.attr=Ba.data;Ba.removeAttr=Ba.removeData;var Pa=function(e){var t=this;e=ye({},e);var a=e.container;a&&!yn(a)&&yn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var s=je!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=ye({name:s?"grid":"null"},o.layout),o.renderer=ye({name:s?"canvas":"null"},o.renderer);var u=function(d,y,g){return y!==void 0?y:g!==void 0?g:d},l=this._private={container:a,ready:!1,options:o,elements:new lr(this),listeners:[],aniEles:new lr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Me(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Me(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var v=function(d,y){var g=d.some(gc);if(g)return ea.all(d).then(y);y(d)};l.styleEnabled&&t.setStyle([]);var f=ye({},o,o.renderer);t.initRenderer(f);var c=function(d,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Me(d)||Ve(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=ye({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([o.style,o.elements],function(h){var d=h[0],y=h[1];l.styleEnabled&&t.style().append(d),c(y,function(){t.startAnimationLoop(),l.ready=!0,$e(o.ready)&&t.on("ready",o.ready);for(var g=0;g0,o=!!r.boundingBox,u=yr(o?r.boundingBox:structuredClone(e.extent())),l;if(Tr(r.roots))l=r.roots;else if(Ve(r.roots)){for(var v=[],f=0;f0;){var R=A(),L=k(R,B);if(L)R.outgoers().filter(function(ge){return ge.isNode()&&t.has(ge)}).forEach(P);else if(L===null){ze("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var M=0;M0&&p[0].length<=3?be/2:0),De=2*Math.PI/p[fe].length*xe;return fe===0&&p[0].length===1&&(Se=1),{x:W.x+Se*Math.cos(De),y:W.y+Se*Math.sin(De)}}else{var Oe=p[fe].length,Le=Math.max(Oe===1?0:o?(u.w-r.padding*2-Y.w)/((r.grid?ce:Oe)-1):(u.w-r.padding*2-Y.w)/((r.grid?ce:Oe)+1),I),Ae={x:W.x+(xe+1-(Oe+1)/2)*Le,y:W.y+(fe+1-(Z+1)/2)*te};return Ae}},we={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(we).indexOf(r.direction)===-1&&He("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(we).join(", ")));var me=function(se){return Wc(Be(se),u,we[r.direction])};return t.nodes().layoutPositions(this,r,me),this};var Pp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function tf(r){this.options=ye({},Pp,r)}tf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),v,f=0,c=0;c1&&e.avoidOverlap){f*=1.75;var p=Math.cos(l)-Math.cos(0),m=Math.sin(l)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,x){var T=e.startAngle+x*l*(n?1:-1),k=v*Math.cos(T),D=v*Math.sin(T),B={x:o.x+k,y:o.y+D};return B};return a.nodes().layoutPositions(this,e,w),this};var Ap={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function af(r){this.options=ye({},Ap,r)}af.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,v=0;v0){var E=Math.abs(m[0].value-w.value);E>=g&&(m=[],p.push(m))}m.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=p.length>0&&p[0].length>1,T=Math.min(s.w,s.h)/2-C,k=T/(p.length+x?1:0);C=Math.min(C,k)}for(var D=0,B=0;B1&&e.avoidOverlap){var L=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),M=Math.sqrt(C*C/(L*L+I*I));D=Math.max(M,D)}P.r=D,D+=C}if(e.equidistant){for(var O=0,q=0,_=0;_=r.numIter||(zp(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature=r.animationThreshold&&i(),mn(v)}};v()}else{for(;l;)l=s(u),u++;Tl(a,r),o()}return this};$n.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};$n.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Mp=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=yr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=a.eles.components(),l={},v=0;v0){o.graphSet.push(T);for(var v=0;vn.count?0:n.graph},nf=function(e,t,a,n){var i=n.graphSet[a];if(-10)var f=n.nodeOverlap*v,c=Math.sqrt(o*o+u*u),h=f*o/c,d=f*u/c;else var y=Sn(e,o,u),g=Sn(t,-1*o,-1*u),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*p/c,d=f*m/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},qp=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Sn=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=a/t,l=s/o,v={};return t===0&&0a?(v.x=n,v.y=i+s/2,v):0t&&-1*l<=u&&u<=l?(v.x=n-o/2,v.y=i-o*a/2/t,v):0=l)?(v.x=n+s*t/2/a,v.y=i+s/2,v):(0>a&&(u<=-1*l||u>=l)&&(v.x=n-s*t/2/a,v.y=i-s/2),v)},_p=function(e,t){for(var a=0;aa){var g=t.gravity*h/y,p=t.gravity*d/y;c.offsetX+=g,c.offsetY+=p}}}}},Hp=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},of=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(d+=g+t.componentSpacing,h=0,y=0,g=0)}}},Up={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function uf(r){this.options=ye({},Up,r)}uf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=yr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),v=function(J){if(J==null)return Math.min(u,l);var Z=Math.min(u,l);Z==u?u=J:l=J},f=function(J){if(J==null)return Math.max(u,l);var Z=Math.max(u,l);Z==u?u=J:l=J},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)u=c,l=h;else if(c!=null&&h==null)u=c,l=Math.ceil(s/u);else if(c==null&&h!=null)l=h,u=Math.ceil(s/l);else if(l*u>s){var d=v(),y=f();(d-1)*y>=s?v(d-1):(y-1)*d>=s&&f(y-1)}else for(;l*u=s?f(p+1):v(g+1)}var m=i.w/l,b=i.h/u;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w=l&&(L=0,R++)},M={},O=0;O(L=Od(r,e,I[M],I[M+1],I[M+2],I[M+3])))return g(x,L),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var I=k.allpts,M=0;M+5(L=Id(r,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return g(x,L),!0}for(var O=O||T.source,q=q||T.target,_=n.getArrowWidth(D,B),N=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],M=0;M0&&(p(O),p(q))}function b(x,T,k){return xr(x,T,k)}function w(x,T){var k=x._private,D=c,B;T?B=T+"-":B="",x.boundingBox();var P=k.labelBounds[T||"main"],A=x.pstyle(B+"label").value,R=x.pstyle("text-events").strValue==="yes";if(!(!R||!A)){var L=b(k.rscratch,"labelX",T),I=b(k.rscratch,"labelY",T),M=b(k.rscratch,"labelAngle",T),O=x.pstyle(B+"text-margin-x").pfValue,q=x.pstyle(B+"text-margin-y").pfValue,_=P.x1-D-O,N=P.x2+D-O,F=P.y1-D-q,U=P.y2+D-q;if(M){var J=Math.cos(M),Z=Math.sin(M),j=function(Y,te){return Y=Y-L,te=te-I,{x:Y*J-te*Z+L,y:Y*Z+te*J+I}},re=j(_,F),ne=j(_,U),Q=j(N,F),V=j(N,U),H=[re.x+O,re.y+q,Q.x+O,Q.y+q,V.x+O,V.y+q,ne.x+O,ne.y+q];if(Er(r,e,H))return g(x),!0}else if(at(P,r,e))return g(x),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?p(C)||w(C):m(C)||w(C)||w(C,"source")||w(C,"target")}return o};Rt.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],u=Math.min(r,t),l=Math.max(r,t),v=Math.min(e,a),f=Math.max(e,a);r=u,t=l,e=v,a=f;var c=yr({x1:r,y1:e,x2:t,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],d=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function y(Y,te,ce){return xr(Y,te,ce)}function g(Y,te){var ce=Y._private,Be=s,we="";Y.boundingBox();var me=ce.labelBounds.main;if(!me)return null;var ge=y(ce.rscratch,"labelX",te),se=y(ce.rscratch,"labelY",te),de=y(ce.rscratch,"labelAngle",te),fe=Y.pstyle(we+"text-margin-x").pfValue,xe=Y.pstyle(we+"text-margin-y").pfValue,be=me.x1-Be-fe,Se=me.x2+Be-fe,De=me.y1-Be-xe,Oe=me.y2+Be-xe;if(de){var Le=Math.cos(de),Ae=Math.sin(de),X=function(z,G){return z=z-ge,G=G-se,{x:z*Le-G*Ae+ge,y:z*Ae+G*Le+se}};return[X(be,De),X(Se,De),X(Se,Oe),X(be,Oe)]}else return[{x:be,y:De},{x:Se,y:De},{x:Se,y:Oe},{x:be,y:Oe}]}function p(Y,te,ce,Be){function we(me,ge,se){return(se.y-me.y)*(ge.x-me.x)>(ge.y-me.y)*(se.x-me.x)}return we(Y,ce,Be)!==we(te,ce,Be)&&we(Y,te,ce)!==we(Y,te,Be)}for(var m=0;m0?-(Math.PI-e.ang):Math.PI+e.ang},Jp=function(e,t,a,n,i){if(e!==Pl?Al(t,e,Vr):Qp(kr,Vr),Al(t,a,kr),Dl=Vr.nx*kr.ny-Vr.ny*kr.nx,Bl=Vr.nx*kr.nx-Vr.ny*-kr.ny,$r=Math.asin(Math.max(-1,Math.min(1,Dl))),Math.abs($r)<1e-6){zs=t.x,Fs=t.y,Et=zt=0;return}Tt=1,dn=!1,Bl<0?$r<0?$r=Math.PI+$r:($r=Math.PI-$r,Tt=-1,dn=!0):$r>0&&(Tt=-1,dn=!0),t.radius!==void 0?zt=t.radius:zt=n,bt=$r/2,rn=Math.min(Vr.len/2,kr.len/2),i?(zr=Math.abs(Math.cos(bt)*zt/Math.sin(bt)),zr>rn?(zr=rn,Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))):Et=zt):(zr=Math.min(rn,zt),Et=Math.abs(zr*Math.sin(bt)/Math.cos(bt))),Vs=t.x+kr.nx*zr,qs=t.y+kr.ny*zr,zs=Vs-kr.ny*Et*Tt,Fs=qs+kr.nx*Et*Tt,cf=t.x+Vr.nx*zr,df=t.y+Vr.ny*zr,Pl=t};function hf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function ho(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Jp(r,e,t,a,n),{cx:zs,cy:Fs,radius:Et,startX:cf,startY:df,stopX:Vs,stopY:qs,startAngle:Vr.ang+Math.PI/2*Tt,endAngle:kr.ang-Math.PI/2*Tt,counterClockwise:dn})}var Aa=.01,jp=Math.sqrt(2*Aa),gr={};gr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),u=s.units!=null&&o.units!=null,l=function(E,C,x,T){var k=T-C,D=x-E,B=Math.sqrt(D*D+k*k);return{x:-k/B,y:D/B}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(u){var f=this.manualEndptToPx(r.source()[0],s),c=Qe(f,2),h=c[0],d=c[1],y=this.manualEndptToPx(r.target()[0],o),g=Qe(y,2),p=g[0],m=g[1],b={x1:h,y1:d,x2:p,y2:m};n=l(h,d,p,m),i=b}else ze("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};gr.findHaystackPoints=function(r){for(var e=0;e0?Math.max(G-$,0):Math.min(G+$,0)},A=P(D,T),R=P(B,k),L=!1;m===l?p=Math.abs(A)>Math.abs(R)?n:a:m===u||m===o?(p=a,L=!0):(m===i||m===s)&&(p=n,L=!0);var I=p===a,M=I?R:A,O=I?B:D,q=eo(O),_=!1;!(L&&(w||C))&&(m===o&&O<0||m===u&&O>0||m===i&&O>0||m===s&&O<0)&&(q*=-1,M=q*Math.abs(M),_=!0);var N;if(w){var F=E<0?1+E:E;N=F*M}else{var U=E<0?M:0;N=U+E*q}var J=function(G){return Math.abs(G)=Math.abs(M)},Z=J(N),j=J(Math.abs(M)-Math.abs(N)),re=Z||j;if(re&&!_)if(I){var ne=Math.abs(O)<=c/2,Q=Math.abs(D)<=h/2;if(ne){var V=(v.x1+v.x2)/2,H=v.y1,W=v.y2;t.segpts=[V,H,V,W]}else if(Q){var Y=(v.y1+v.y2)/2,te=v.x1,ce=v.x2;t.segpts=[te,Y,ce,Y]}else t.segpts=[v.x1,v.y2]}else{var Be=Math.abs(O)<=f/2,we=Math.abs(B)<=d/2;if(Be){var me=(v.y1+v.y2)/2,ge=v.x1,se=v.x2;t.segpts=[ge,me,se,me]}else if(we){var de=(v.x1+v.x2)/2,fe=v.y1,xe=v.y2;t.segpts=[de,fe,de,xe]}else t.segpts=[v.x2,v.y1]}else if(I){var be=v.y1+N+(g?c/2*q:0),Se=v.x1,De=v.x2;t.segpts=[Se,be,De,be]}else{var Oe=v.x1+N+(g?f/2*q:0),Le=v.y1,Ae=v.y2;t.segpts=[Oe,Le,Oe,Ae]}if(t.isRound){var X=r.pstyle("taxi-radius").value,S=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(X),t.isArcRadius=new Array(t.segpts.length/2).fill(S)}};gr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,h=e.srcRs,d=e.tgtRs,y=!ae(t.startX)||!ae(t.startY),g=!ae(t.arrowStartX)||!ae(t.arrowStartY),p=!ae(t.endX)||!ae(t.endY),m=!ae(t.arrowEndX)||!ae(t.arrowEndY),b=3,w=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=Dt({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),x=CO.poolIndex()){var q=M;M=O,O=q}var _=A.srcPos=M.position(),N=A.tgtPos=O.position(),F=A.srcW=M.outerWidth(),U=A.srcH=M.outerHeight(),J=A.tgtW=O.outerWidth(),Z=A.tgtH=O.outerHeight(),j=A.srcShape=t.nodeShapes[e.getNodeShape(M)],re=A.tgtShape=t.nodeShapes[e.getNodeShape(O)],ne=A.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,Q=A.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,V=A.tgtRs=O._private.rscratch,H=A.srcRs=M._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W=jp||(De=Math.sqrt(Math.max(Se*Se,Aa)+Math.max(be*be,Aa)));var Oe=A.vector={x:Se,y:be},Le=A.vectorNorm={x:Oe.x/De,y:Oe.y/De},Ae={x:-Le.y,y:Le.x};A.nodesOverlap=!ae(De)||re.checkPoint(me[0],me[1],0,J,Z,N.x,N.y,Q,V)||j.checkPoint(se[0],se[1],0,F,U,_.x,_.y,ne,H),A.vectorNormInverse=Ae,R={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:N,srcRs:V,tgtPos:_,tgtRs:H,srcW:J,srcH:Z,tgtW:F,tgtH:U,srcIntn:de,tgtIntn:ge,srcShape:re,tgtShape:j,posPts:{x1:xe.x2,y1:xe.y2,x2:xe.x1,y2:xe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-Oe.x,y:-Oe.y},vectorNorm:{x:-Le.x,y:-Le.y},vectorNormInverse:{x:-Ae.x,y:-Ae.y}}}var X=we?R:A;te.nodesOverlap=X.nodesOverlap,te.srcIntn=X.srcIntn,te.tgtIntn=X.tgtIntn,te.isRound=ce.startsWith("round"),n&&(M.isParent()||M.isChild()||O.isParent()||O.isChild())&&(M.parents().anySame(O)||O.parents().anySame(M)||M.same(O)&&M.isParent())?e.findCompoundLoopPoints(Y,X,W,Be):M===O?e.findLoopPoints(Y,X,W,Be):ce.endsWith("segments")?e.findSegmentsPoints(Y,X):ce.endsWith("taxi")?e.findTaxiPoints(Y,X):ce==="straight"||!Be&&A.eles.length%2===1&&W===Math.floor(A.eles.length/2)?e.findStraightEdgePoints(Y):e.findBezierPoints(Y,X,W,Be,we),e.findEndpoints(Y),e.tryToCorrectInvalidPoints(Y,X),e.checkForInvalidEdgeWarning(Y),e.storeAllpts(Y),e.storeEdgeProjections(Y),e.calculateArrowAngles(Y),e.recalculateEdgeLabelProjections(Y),e.calculateLabelAngles(Y)}},x=0;x0){var me=l,ge=xt(me,Gt(s)),se=xt(me,Gt(we)),de=ge;if(se2){var fe=xt(me,{x:we[2],y:we[3]});fe0){var K=v,le=xt(K,Gt(s)),ee=xt(K,Gt($)),ie=le;if(ee2){var oe=xt(K,{x:$[2],y:$[3]});oe=d||x){g={cp:w,segment:C};break}}if(g)break}var T=g.cp,k=g.segment,D=(d-p)/k.length,B=k.t1-k.t0,P=h?k.t0+B*D:k.t1-B*D;P=Ta(0,P,1),e=$t(T.p0,T.p1,T.p2,P),c=ry(T.p0,T.p1,T.p2,P);break}case"straight":case"segments":case"haystack":{for(var A=0,R,L,I,M,O=a.allpts.length,q=0;q+3=d));q+=2);var _=d-L,N=_/R;N=Ta(0,N,1),e=Cd(I,M,N),c=yf(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,c)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Gr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Gr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=kt(a,r._private.labelDimsKey);if(xr(t.rscratch,"prefixedLabelDimsKey",e)!==n){Ur(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),s=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,u=xr(t.rscratch,"labelWrapCachedLines",e)||[],l=o!=="wrap"?1:Math.max(u.length,1),v=i.height/l,f=v*s,c=i.width,h=i.height+(l-1)*(s-1)*v;Ur(t.rstyle,"labelWidth",e,c),Ur(t.rscratch,"labelWidth",e,c),Ur(t.rstyle,"labelHeight",e,h),Ur(t.rscratch,"labelHeight",e,h),Ur(t.rscratch,"labelLineHeight",e,f)}};Gr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(U,J){return J?(Ur(t.rscratch,U,e,J),J):xr(t.rscratch,U,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="​",v=n.split(` -`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;gf){var E=p.matchAll(y),C="",x=0,T=Cr(E),k;try{for(T.s();!(k=T.n()).done;){var D=k.value,B=D[0],P=p.substring(x,D.index);x=D.index+B.length;var A=C.length===0?P:C+P+B,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+B:(C&&d.push(C),C=P+B)}}catch(F){T.e(F)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(` -`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",O="…",q=!1;if(this.calculateLabelDimensions(r,n).widthI)break;M+=n[_],_===n.length-1&&(q=!0)}return q||(M+=O),M}return n};Gr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Gr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),f=this.labelCalcCanvasContext=v.getContext("2d");var c=v.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}f.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var h=0,d=0,y=e.split(` -`),g=0;g1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u=r.desktopTapThreshold2}var or=i(S);ar&&(r.hoverData.tapholdCancelled=!0);var Nr=function(){var Sr=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Sr.length===0?(Sr.push(ke[0]),Sr.push(ke[1])):(Sr[0]+=ke[0],Sr[1]+=ke[1])};G=!0,n(Ee,["mousemove","vmousemove","tapdrag"],S,{x:ee[0],y:ee[1]});var We=function(Sr){return{originalEvent:S,type:Sr,position:{x:ee[0],y:ee[1]}}},Wr=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||$.emit(We("boxstart")),pe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(ar){var Ar=We("cxtdrag");ve?ve.emit(Ar):$.emit(Ar),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ee!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(We("cxtdragout")),r.hoverData.cxtOver=Ee,Ee&&Ee.emit(We("cxtdragover")))}}else if(r.hoverData.dragging){if(G=!0,$.panningEnabled()&&$.userPanningEnabled()){var Jr;if(r.hoverData.justStartedPan){var Ha=r.hoverData.mdownPos;Jr={x:(ee[0]-Ha[0])*K,y:(ee[1]-Ha[1])*K},r.hoverData.justStartedPan=!1}else Jr={x:ke[0]*K,y:ke[1]*K};$.panBy(Jr),$.emit(We("dragpan")),r.hoverData.dragged=!0}ee=r.projectIntoViewport(S.clientX,S.clientY)}else if(pe[4]==1&&(ve==null||ve.pannable())){if(ar){if(!r.hoverData.dragging&&$.boxSelectionEnabled()&&(or||!$.panningEnabled()||!$.userPanningEnabled()))Wr();else if(!r.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()){var mt=s(ve,r.hoverData.downs);mt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,pe[4]=0,r.data.bgActivePosistion=Gt(ie),r.redrawHint("select",!0),r.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&Ee!=Ce&&(Ce&&n(Ce,["mouseout","tapdragout"],S,{x:ee[0],y:ee[1]}),Ee&&n(Ee,["mouseover","tapdragover"],S,{x:ee[0],y:ee[1]}),r.hoverData.last=Ee),ve)if(ar){if($.boxSelectionEnabled()&&or)ve&&ve.grabbed()&&(y(Pe),ve.emit(We("freeon")),Pe.emit(We("free")),r.dragData.didDrag&&(ve.emit(We("dragfreeon")),Pe.emit(We("dragfree")))),Wr();else if(ve&&ve.grabbed()&&r.nodeIsDraggable(ve)){var br=!r.dragData.didDrag;br&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Pe,{inDragLayer:!0});var cr={x:0,y:0};if(ae(ke[0])&&ae(ke[1])&&(cr.x+=ke[0],cr.y+=ke[1],br)){var wr=r.hoverData.dragDelta;wr&&ae(wr[0])&&ae(wr[1])&&(cr.x+=wr[0],cr.y+=wr[1])}r.hoverData.draggingEles=!0,Pe.silentShift(cr).emit(We("position")).emit(We("drag")),r.redrawHint("drag",!0),r.redraw()}}else Nr();G=!0}if(pe[2]=ee[0],pe[3]=ee[1],G)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var D,B,P;r.registerBinding(e,"mouseup",function(S){if(!(r.hoverData.which===1&&S.which!==1&&r.hoverData.capture)){var z=r.hoverData.capture;if(z){r.hoverData.capture=!1;var G=r.cy,$=r.projectIntoViewport(S.clientX,S.clientY),K=r.selection,le=r.findNearestElement($[0],$[1],!0,!1),ee=r.dragData.possibleDragElements,ie=r.hoverData.down,oe=i(S);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,ie&&ie.unactivate();var pe=function(Ue){return{originalEvent:S,type:Ue,position:{x:$[0],y:$[1]}}};if(r.hoverData.which===3){var Ee=pe("cxttapend");if(ie?ie.emit(Ee):G.emit(Ee),!r.hoverData.cxtDragged){var Ce=pe("cxttap");ie?ie.emit(Ce):G.emit(Ce)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],S,{x:$[0],y:$[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],S,{x:$[0],y:$[1]}),B=!1,S.timeStamp-P<=G.multiClickDebounceTime()?(D&&clearTimeout(D),B=!0,P=null,n(ie,["dblclick","dbltap","vdblclick"],S,{x:$[0],y:$[1]})):(D=setTimeout(function(){B||n(ie,["oneclick","onetap","voneclick"],S,{x:$[0],y:$[1]})},G.multiClickDebounceTime()),P=S.timeStamp)),ie==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(S)&&(G.$(t).unselect(["tapunselect"]),ee.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=ee=G.collection()),le==ie&&!r.dragData.didDrag&&!r.hoverData.selecting&&le!=null&&le._private.selectable&&(r.hoverData.dragging||(G.selectionType()==="additive"||oe?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):oe||(G.$(t).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var ve=G.collection(r.getAllInBox(K[0],K[1],K[2],K[3]));r.redrawHint("select",!0),ve.length>0&&r.redrawHint("eles",!0),G.emit(pe("boxend"));var ke=function(Ue){return Ue.selectable()&&!Ue.selected()};G.selectionType()==="additive"||oe||G.$(t).unmerge(ve).unselect(),ve.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!K[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Pe=ie&&ie.grabbed();y(ee),Pe&&(ie.emit(pe("freeon")),ee.emit(pe("free")),r.dragData.didDrag&&(ie.emit(pe("dragfreeon")),ee.emit(pe("dragfree"))))}}K[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var A=[],R=4,L,I=1e5,M=function(S,z){for(var G=0;G=R){var $=A;if(L=M($,5),!L){var K=Math.abs($[0]);L=O($)&&K>5}if(L)for(var le=0;le<$.length;le++)I=Math.min(Math.abs($[le]),I)}else A.push(G),z=!0;else L&&(I=Math.min(Math.abs(G),I));if(!r.scrollingPage){var ee=r.cy,ie=ee.zoom(),oe=ee.pan(),pe=r.projectIntoViewport(S.clientX,S.clientY),Ee=[pe[0]*ie+oe.x,pe[1]*ie+oe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||x()){S.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Ce;z&&Math.abs(G)>5&&(G=eo(G)*5),Ce=G/-250,L&&(Ce/=I,Ce*=3),Ce=Ce*r.wheelSensitivity;var ve=S.deltaMode===1;ve&&(Ce*=33);var ke=ee.zoom()*Math.pow(10,Ce);S.type==="gesturechange"&&(ke=r.gestureStartZoom*S.scale),ee.zoom({level:ke,renderedPosition:{x:Ee[0],y:Ee[1]}}),ee.emit({type:S.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:S,position:{x:pe[0],y:pe[1]}})}}}};r.registerBinding(r.container,"wheel",q,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(X){r.hasTouchStarted||q(X)},!0),r.registerBinding(r.container,"mouseout",function(S){var z=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:z[0],y:z[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var z=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:z[0],y:z[1]}})},!1);var _,N,F,U,J,Z,j,re,ne,Q,V,H,W,Y=function(S,z,G,$){return Math.sqrt((G-S)*(G-S)+($-z)*($-z))},te=function(S,z,G,$){return(G-S)*(G-S)+($-z)*($-z)},ce;r.registerBinding(r.container,"touchstart",ce=function(S){if(r.hasTouchStarted=!0,!!T(S)){p(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var z=r.cy,G=r.touchData.now,$=r.touchData.earlier;if(S.touches[0]){var K=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);G[0]=K[0],G[1]=K[1]}if(S.touches[1]){var K=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);G[2]=K[0],G[3]=K[1]}if(S.touches[2]){var K=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);G[4]=K[0],G[5]=K[1]}var le=function(or){return{originalEvent:S,type:or,position:{x:G[0],y:G[1]}}};if(S.touches[1]){r.touchData.singleTouchMoved=!0,y(r.dragData.touchDragEles);var ee=r.findContainerClientCoords();ne=ee[0],Q=ee[1],V=ee[2],H=ee[3],_=S.touches[0].clientX-ne,N=S.touches[0].clientY-Q,F=S.touches[1].clientX-ne,U=S.touches[1].clientY-Q,W=0<=_&&_<=V&&0<=F&&F<=V&&0<=N&&N<=H&&0<=U&&U<=H;var ie=z.pan(),oe=z.zoom();J=Y(_,N,F,U),Z=te(_,N,F,U),j=[(_+F)/2,(N+U)/2],re=[(j[0]-ie.x)/oe,(j[1]-ie.y)/oe];var pe=200,Ee=pe*pe;if(Z=1){for(var Pr=r.touchData.startPosition=[null,null,null,null,null,null],Ke=0;Ke=r.touchTapThreshold2}if(z&&r.touchData.cxt){S.preventDefault();var Ke=S.touches[0].clientX-ne,Ye=S.touches[0].clientY-Q,Je=S.touches[1].clientX-ne,or=S.touches[1].clientY-Q,Nr=te(Ke,Ye,Je,or),We=Nr/Z,Wr=150,Ar=Wr*Wr,Jr=1.5,Ha=Jr*Jr;if(We>=Ha||Nr>=Ar){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var mt=oe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(mt),r.touchData.start=null):$.emit(mt)}}if(z&&r.touchData.cxt){var mt=oe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(mt):$.emit(mt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var br=r.findNearestElement(K[0],K[1],!0,!0);(!r.touchData.cxtOver||br!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(oe("cxtdragout")),r.touchData.cxtOver=br,br&&br.emit(oe("cxtdragover")))}else if(z&&S.touches[2]&&$.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||$.emit(oe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,G[4]=1,!G||G.length===0||G[0]===void 0?(G[0]=(K[0]+K[2]+K[4])/3,G[1]=(K[1]+K[3]+K[5])/3,G[2]=(K[0]+K[2]+K[4])/3+1,G[3]=(K[1]+K[3]+K[5])/3+1):(G[2]=(K[0]+K[2]+K[4])/3,G[3]=(K[1]+K[3]+K[5])/3),r.redrawHint("select",!0),r.redraw();else if(z&&S.touches[1]&&!r.touchData.didSelect&&$.zoomingEnabled()&&$.panningEnabled()&&$.userZoomingEnabled()&&$.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var cr=r.dragData.touchDragEles;if(cr){r.redrawHint("drag",!0);for(var wr=0;wr0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var we;r.registerBinding(e,"touchcancel",we=function(S){var z=r.touchData.start;r.touchData.capture=!1,z&&z.unactivate()});var me,ge,se,de;if(r.registerBinding(e,"touchend",me=function(S){var z=r.touchData.start,G=r.touchData.capture;if(G)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var $=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var K=r.cy,le=K.zoom(),ee=r.touchData.now,ie=r.touchData.earlier;if(S.touches[0]){var oe=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);ee[0]=oe[0],ee[1]=oe[1]}if(S.touches[1]){var oe=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);ee[2]=oe[0],ee[3]=oe[1]}if(S.touches[2]){var oe=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);ee[4]=oe[0],ee[5]=oe[1]}var pe=function(Ar){return{originalEvent:S,type:Ar,position:{x:ee[0],y:ee[1]}}};z&&z.unactivate();var Ee;if(r.touchData.cxt){if(Ee=pe("cxttapend"),z?z.emit(Ee):K.emit(Ee),!r.touchData.cxtDragged){var Ce=pe("cxttap");z?z.emit(Ce):K.emit(Ce)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&K.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var ve=K.collection(r.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,r.redrawHint("select",!0),K.emit(pe("boxend"));var ke=function(Ar){return Ar.selectable()&&!Ar.selected()};ve.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")),ve.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(z?.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Pe=r.dragData.touchDragEles;if(z!=null){var ar=z._private.grabbed;y(Pe),r.redrawHint("drag",!0),r.redrawHint("eles",!0),ar&&(z.emit(pe("freeon")),Pe.emit(pe("free")),r.dragData.didDrag&&(z.emit(pe("dragfreeon")),Pe.emit(pe("dragfree")))),n(z,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]}),z.unactivate(),r.touchData.start=null}else{var Ue=r.findNearestElement(ee[0],ee[1],!0,!0);n(Ue,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]})}var Pr=r.touchData.startPosition[0]-ee[0],Ke=Pr*Pr,Ye=r.touchData.startPosition[1]-ee[1],Je=Ye*Ye,or=Ke+Je,Nr=or*le*le;r.touchData.singleTouchMoved||(z||K.$(":selected").unselect(["tapunselect"]),n(z,["tap","vclick"],S,{x:ee[0],y:ee[1]}),ge=!1,S.timeStamp-de<=K.multiClickDebounceTime()?(se&&clearTimeout(se),ge=!0,de=null,n(z,["dbltap","vdblclick"],S,{x:ee[0],y:ee[1]})):(se=setTimeout(function(){ge||n(z,["onetap","voneclick"],S,{x:ee[0],y:ee[1]})},K.multiClickDebounceTime()),de=S.timeStamp)),z!=null&&!r.dragData.didDrag&&z._private.selectable&&Nr"u"){var fe=[],xe=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},be=function(S){return{event:S,touch:xe(S)}},Se=function(S){fe.push(be(S))},De=function(S){for(var z=0;z0)return F[0]}return null},d=Object.keys(c),y=0;y0?h:mv(i,s,e,t,a,n,o,u)},checkPoint:function(e,t,a,n,i,s,o,u){u=u==="auto"?lt(n,i):u;var l=2*u;if(Yr(e,t,this.points,s,o,n,i-l,[0,-1],a)||Yr(e,t,this.points,s,o,n-l,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[s-v,o-f,s-v,o,s+v,o,s+v,o-f];return!!(Er(e,t,c)||St(e,t,l,l,s+n/2-u,o+i/2-u,a)||St(e,t,l,l,s-n/2+u,o+i/2-u,a))}}};Zr.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var a=new Array(20);{var n=Ds(5,0),i=Ds(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(l){if(m>=e.deqCost*h||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ms)break;var E=e.deq(a,g,y);if(E.length>0)for(var C=0;C0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,g,y)&&i())},o=e.priority||Qs;n.beforeRender(s,o(a))}}}},iy=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bn;dt(this,r),this.idsByKey=new Kr,this.keyForId=new Kr,this.cachesByLvl=new Kr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return ht(r,[{key:"getIdsFor",value:function(t){t==null&&He("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new jt,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Kr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Il=25,tn=50,hn=-4,_s=3,Tf=7.99,sy=8,oy=1024,uy=1024,ly=1024,vy=.2,fy=.8,cy=10,dy=.15,hy=.1,gy=.9,py=.9,yy=100,my=1,Wt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},by=vr({getKey:null,doesEleInvalidateKey:bn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:fv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ya=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=by(t);ye(a,n),a.lookup=new iy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},tr=ya.prototype;tr.reasons=Wt;tr.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};tr.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};tr.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new za(function(t,a){return a.reqs-t.reqs});return e};tr.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};tr.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(js(o*t))),a=Tf||a>_s)return null;var l=Math.pow(2,a),v=e.h*l,f=e.w*l,c=s.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,c))return null;var h=u.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=Il?d=Il:v<=tn?d=tn:d=Math.ceil(v/tn)*tn,v>ly||f>uy)return null;var y=i.getTextureQueue(d),g=y[y.length-2],p=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidtha;B--)k=i.getElement(r,e,t,B,Wt.downscale);D()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!E)for(var A=a-1;A>=hn;A--){var R=u.get(r,A);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:l,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+sy),g.eleCaches.push(h),u.set(r,a,h),i.checkTextureFullness(g),h};tr.invalidateElements=function(r){for(var e=0;e=vy*r.width&&this.retireTexture(r)};tr.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>fy&&r.fullnessChecks>=cy?ut(t,r):r.fullnessChecks++};tr.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;ut(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Js(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),ut(n,s),a.push(s),s}};tr.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};tr.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=t.pop(),u=o.key,l=o.eles[0],v=i.hasCache(l,o.level);if(a[u]=null,v)continue;n.push(o);var f=e.getBoundingBox(l);e.getElement(l,f,r,o.level,Wt.dequeue)}return n};tr.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Zs,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};tr.onDequeue=function(r){this.onDequeues.push(r)};tr.offDequeue=function(r){ut(this.onDequeues,r)};tr.setupDequeueing=Cf.setupDequeueing({deqRedrawThreshold:yy,deqCost:dy,deqAvgCost:hy,deqNoDrawCost:gy,deqFastCost:py,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a=xy||t>Dn)return null}a.validateLayersElesOrdering(t,r);var u=a.layersByLevel,l=Math.pow(2,t),v=u[t]=u[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var D=function(L){if(a.validateLayersElesOrdering(L,r),a.levelIsComplete(L,r))return h=u[L],!0},B=function(L){if(!h)for(var I=t+L;ba<=I&&I<=Dn&&!D(I);I+=L);};B(1),B(-1);for(var P=v.length-1;P>=0;P--){var A=v[P];A.invalid&&ut(v,A)}};if(!c)d();else return v;var y=function(){if(!f){f=yr();for(var D=0;DNl||A>Nl)return null;var R=P*A;if(R>Py)return null;var L=a.makeLayer(f,t);if(B!=null){var I=v.indexOf(B)+1;v.splice(I,0,L)}else(D.insert===void 0||D.insert)&&v.unshift(L);return L};if(a.skipping&&!o)return null;for(var p=null,m=r.length/wy,b=!o,w=0;w=m||!yv(p.bb,E.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;h||b?a.queueLayer(p,E):a.drawEleInLayer(p,E,t,e),p.eles.push(E),x[t]=p}return h||(b?null:v)};fr.getEleLevelForLayerLevel=function(r,e){return r};fr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Ay),i.setImgSmoothing(s,!0))};fr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};fr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a0){e=!0;break}}return e};fr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Xr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};fr.invalidateLayer=function(r){if(this.lastInvalidationTime=Xr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];ut(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=l*v,m=l*v,b=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(s.eleStrokeStyle(r,e,L),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=d,s.eleStrokeStyle(r,e,L),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=h+y,r.lineCap=d,y>0)s.colorStrokeStyle(r,g[0],g[1],g[2],L);else{r.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(r,e)},C=function(){n&&s.drawEdgeUnderlay(r,e)},x=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(r,e,L)},T=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var D=e.pstyle("ghost-offset-x").pfValue,B=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,A=p*P;r.translate(D,B),b(A),x(A),r.translate(-D,-B)}else w();C(),b(),x(),E(),T(),t&&r.translate(u.x1,u.y1)}};var Df=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=l,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Qr.drawEdgeOverlay=Df("overlay");Qr.drawEdgeUnderlay=Df("underlay");Qr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(u){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e);r.textAlign=u,r.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,v=e.pstyle("label"),f=e.pstyle("source-label"),c=e.pstyle("target-label");if(l||(!v||!v.value)&&(!f||!f.value)&&(!c||!c.value))return;r.textAlign="center",r.textBaseline="bottom"}var h=!t,d;t&&(d=t,r.translate(-d.x1,-d.y1)),n==null?(s.drawText(r,e,null,h,i),e.isEdge()&&(s.drawText(r,e,"source",h,i),s.drawText(r,e,"target",h,i))):s.drawText(r,e,n,h,i),t&&r.translate(d.x1,d.y1)};Mt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],o),this.colorStrokeStyle(r,v[0],v[1],v[2],u)};function _y(r,e,t,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,u=t+n/2;r.beginPath(),r.arc(o,u,s,0,Math.PI*2),r.closePath()}function ql(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+a-s,t),r.quadraticCurveTo(e+a,t,e+a,t+s),r.lineTo(e+a,t+n-s),r.quadraticCurveTo(e+a,t+n,e+a-s,t+n),r.lineTo(e+s,t+n),r.quadraticCurveTo(e,t+n,e,t+n-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Mt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=xr(n,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};Mt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=xr(s,"labelX",t),l=xr(s,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=xr(s,"labelWidth",t),y=xr(s,"labelHeight",t),g=e.pstyle(h+"text-margin-x").pfValue,p=e.pstyle(h+"text-margin-y").pfValue,m=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;m&&(b="center",w="center"),u+=g,l+=p;var E;switch(a?E=this.getTextAngle(e,t):E=0,E!==0&&(v=u,f=l,r.translate(v,f),r.rotate(E),u=0,l=0),w){case"top":break;case"center":l+=y/2;break;case"bottom":l+=y;break}var C=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,k=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,B=D==="round-rectangle"||D==="roundrectangle",P=D==="circle",A=2;if(C>0||T>0&&x>0){var R=r.fillStyle,L=r.strokeStyle,I=r.lineWidth,M=e.pstyle("text-background-color").value,O=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value,_=C>0,N=T>0&&x>0,F=u-k;switch(b){case"left":F-=d;break;case"center":F-=d/2;break}var U=l-y-k,J=d+2*k,Z=y+2*k;if(_&&(r.fillStyle="rgba(".concat(M[0],",").concat(M[1],",").concat(M[2],",").concat(C*o,")")),N&&(r.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(x*o,")"),r.lineWidth=T,r.setLineDash))switch(q){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=T/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(B?(r.beginPath(),ql(r,F,U,J,Z,A)):P?(r.beginPath(),_y(r,F,U,J,Z)):(r.beginPath(),r.rect(F,U,J,Z)),_&&r.fill(),N&&r.stroke(),N&&q==="double"){var j=T/2;r.beginPath(),B?ql(r,F+j,U+j,J-2*j,Z-2*j,A):r.rect(F+j,U+j,J-2*j,Z-2*j),r.stroke()}r.fillStyle=R,r.strokeStyle=L,r.lineWidth=I,r.setLineDash&&r.setLineDash([])}var re=2*e.pstyle("text-outline-width").pfValue;if(re>0&&(r.lineWidth=re),e.pstyle("text-wrap").value==="wrap"){var ne=xr(s,"labelWrapCachedLines",t),Q=xr(s,"labelLineHeight",t),V=d/2,H=this.getLabelJustification(e);switch(H==="auto"||(b==="left"?H==="left"?u+=-d:H==="center"&&(u+=-V):b==="center"?H==="left"?u+=-V:H==="right"&&(u+=V):b==="right"&&(H==="center"?u+=V:H==="right"&&(u+=d))),w){case"top":l-=(ne.length-1)*Q;break;case"center":case"bottom":l-=(ne.length-1)*Q;break}for(var W=0;W0&&r.strokeText(ne[W],u,l),r.fillText(ne[W],u,l),l+=Q}else re>0&&r.strokeText(c,u,l),r.fillText(c,u,l);E!==0&&(r.rotate(-E),r.translate(-v,-f))}}};var pt={};pt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,u,l=e._private,v=l.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=s.usePaths(),d,y=!1,g=e.padding();o=e.width()+2*g,u=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),E=new Array(b.length),C=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(r,e,S)},Q=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;s.colorStrokeStyle(r,R[0],R[1],R[2],S)},V=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;s.colorStrokeStyle(r,U[0],U[1],U[2],S)},H=function(S,z,G,$){var K=s.nodePathCache=s.nodePathCache||[],le=vv(G==="polygon"?G+","+$.join(","):G,""+z,""+S,""+re),ee=K[le],ie,oe=!1;return ee!=null?(ie=ee,oe=!0,v.pathCache=ie):(ie=new Path2D,K[le]=v.pathCache=ie),{path:ie,cacheHit:oe}},W=e.pstyle("shape").strValue,Y=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var te=H(o,u,W,Y);d=te.path,y=te.cacheHit}var ce=function(){if(!y){var S=f;h&&(S={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,S.x,S.y,o,u,re,v)}h?r.fill(d):r.fill()},Be=function(){for(var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=l.backgrounding,$=0,K=0;K0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,z),S&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},me=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasStripe(e)&&(r.save(),h?r.clip(v.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v),r.clip()),s.drawStripe(r,e,z),r.restore(),S&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,u,re,v)))},ge=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,z=(B>0?B:-B)*S,G=B>0?0:255;B!==0&&(s.colorFillStyle(r,G,G,G,z),h?r.fill(d):r.fill())},se=function(){if(P>0){if(r.lineWidth=P,r.lineCap=M,r.lineJoin=I,r.setLineDash)switch(L){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(q),r.lineDashOffset=_;break;case"solid":case"double":r.setLineDash([]);break}if(O!=="center"){if(r.save(),r.lineWidth*=2,O==="inside")h?r.clip(d):r.clip();else{var S=new Path2D;S.rect(-o/2-P,-u/2-P,o+2*P,u+2*P),S.addPath(d),r.clip(S,"evenodd")}h?r.stroke(d):r.stroke(),r.restore()}else h?r.stroke(d):r.stroke();if(L==="double"){r.lineWidth=P/3;var z=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=z}r.setLineDash&&r.setLineDash([])}},de=function(){if(F>0){if(r.lineWidth=F,r.lineCap="butt",r.setLineDash)switch(J){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var S=f;h&&(S={x:0,y:0});var z=s.getNodeShape(e),G=P;O==="inside"&&(G=0),O==="outside"&&(G*=2);var $=(o+G+(F+j))/o,K=(u+G+(F+j))/u,le=o*$,ee=u*K,ie=s.nodeShapes[z].points,oe;if(h){var pe=H(le,ee,z,ie);oe=pe.path}if(z==="ellipse")s.drawEllipsePath(oe||r,S.x,S.y,le,ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(z)){var Ee=0,Ce=0,ve=0;z==="round-diamond"?Ee=(G+j+F)*1.4:z==="round-heptagon"?(Ee=(G+j+F)*1.075,ve=-(G/2+j+F)/35):z==="round-hexagon"?Ee=(G+j+F)*1.12:z==="round-pentagon"?(Ee=(G+j+F)*1.13,ve=-(G/2+j+F)/15):z==="round-tag"?(Ee=(G+j+F)*1.12,Ce=(G/2+F+j)*.07):z==="round-triangle"&&(Ee=(G+j+F)*(Math.PI/2),ve=-(G+j/2+F)/Math.PI),Ee!==0&&($=(o+Ee)/o,le=o*$,["round-hexagon","round-tag"].includes(z)||(K=(u+Ee)/u,ee=u*K)),re=re==="auto"?wv(le,ee):re;for(var ke=le/2,Pe=ee/2,ar=re+(G+F+j)/2,Ue=new Array(ie.length/2),Pr=new Array(ie.length/2),Ke=0;Ke0){if(n=n||a.position(),i==null||s==null){var h=a.padding();i=a.width()+2*h,s=a.height()+2*h}o.colorFillStyle(t,v[0],v[1],v[2],l),o.nodeShapes[f].draw(t,n.x,n.y,i+u*2,s+u*2,c),t.fill()}}}};pt.drawNodeOverlay=Bf("overlay");pt.drawNodeUnderlay=Bf("underlay");pt.hasPie=function(r){return r=r[0],r._private.hasPie};pt.hasStripe=function(r){return r=r[0],r._private.hasStripe};pt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,h,d=0,y=this.usePaths();if(y&&(u=0,l=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),s.units==="%"?h=c*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d;E+=o;var C=2*Math.PI*w,x=E+C;p===0||d>=1||d+w>1||(h===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,c,E,x),r.closePath()):(r.beginPath(),r.arc(u,l,c,E,x),r.arc(u,l,h,x,E,!0),r.closePath()),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),d+=w)}};pt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),u=e.height(),l=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var h=o,d=u;c.units==="%"?(h=h*c.pfValue,d=d*c.pfValue):c.pfValue!==void 0&&(h=c.pfValue,d=c.pfValue),v&&(i=0,s=0),s-=h/2,i-=d/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+l>1&&(b=1-l),!(g===0||l>=1||l+b>1)&&(r.beginPath(),r.rect(i,s+d*l,h,d*b),r.closePath(),this.colorFillStyle(r,p[0],p[1],p[2],m),r.fill(),l+=b)}r.restore()};var mr={},Gy=100;mr.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};mr.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;ne.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=s!==void 0?s:b,E=t.pan(),C={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},T=e.prevViewport,k=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!k&&!(y&&!d)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=u,C.x*=u,C.y*=u;var D=e.getCachedZSortedEles();function B(Q,V,H,W,Y){var te=Q.globalCompositeOperation;Q.globalCompositeOperation="destination-out",e.colorFillStyle(Q,255,255,255,e.motionBlurTransparency),Q.fillRect(V,H,W,Y),Q.globalCompositeOperation=te}function P(Q,V){var H,W,Y,te;!e.clearingMotionBlur&&(Q===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Q===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(H={x:E.x*h,y:E.y*h},W=b*h,Y=e.canvasWidth*h,te=e.canvasHeight*h):(H=C,W=w,Y=e.canvasWidth,te=e.canvasHeight),Q.setTransform(1,0,0,1,0,0),V==="motionBlur"?B(Q,0,0,Y,te):!a&&(V===void 0||V)&&Q.clearRect(0,0,Y,te),n||(Q.translate(H.x,H.y),Q.scale(W,W)),o&&Q.translate(o.x,o.y),s&&Q.scale(s,s)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var A=e.data.bufferContexts[e.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var x=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=l.contexts[e.NODE],L=e.textureCache.texture,x=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?B(R,0,0,x.width,x.height):R.clearRect(0,0,x.width,x.height);var I=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I[0],I[1],I[2],M),R.fillRect(0,0,x.width,x.height);var b=t.zoom();P(R,!1),R.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u),R.drawImage(L,x.mpan.x,x.mpan.y,x.width/x.zoom/u,x.height/x.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=t.extent(),q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&q,N=[];if(N[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||N[e.NODE]){var F=c&&!N[e.NODE]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),U=c&&!F?"motionBlur":void 0;P(R,U),_?e.drawCachedNodes(R,D.nondrag,u,O):e.drawLayeredElements(R,D.nondrag,u,O),e.debug&&e.drawDebugPoints(R,D.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||N[e.DRAG])){var F=c&&!N[e.DRAG]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);P(R,c&&!F?"motionBlur":void 0),_?e.drawCachedNodes(R,D.drag,u,O):e.drawCachedElements(R,D.drag,u,O),e.debug&&e.drawDebugPoints(R,D.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&h!==1){var J=l.contexts[e.NODE],Z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=l.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(V,H,W){V.setTransform(1,0,0,1,0,0),W||!p?V.clearRect(0,0,e.canvasWidth,e.canvasHeight):B(V,0,0,e.canvasWidth,e.canvasHeight);var Y=h;V.drawImage(H,0,0,e.canvasWidth*Y,e.canvasHeight*Y,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||N[e.NODE])&&(ne(J,Z,N[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||N[e.DRAG])&&(ne(j,re,N[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},Gy)),a||t.emit("render")};var ca;mr.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,u=n.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!s&&u[t.SELECT_BOX]&&!o){var v=l||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),h=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(h.x,h.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var d=t.lastRedrawTime;if(t.showFps&&d){d=Math.round(d);var y=Math.round(1e3/d),g="1 frame = "+d+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ca){var p=v.measureText(g);ca=p.actualBoundingBoxAscent}v.fillText(g,0,ca);var m=60;v.strokeRect(0,ca+10,250,20),v.fillRect(0,ca+10,250*Math.min(y/m,1),20)}o||(u[t.SELECT_BOX]=!1)}};function _l(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function Hy(r,e,t){var a=_l(r,r.VERTEX_SHADER,e),n=_l(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Wy(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function yo(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function $y(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function Uy(r,e,t,a,n){var i=a*t+e.x,s=n*t+e.y;return s=Math.round(r.canvasHeight-s),[i,s]}function Ky(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function Xy(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Yy(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function Zy(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Pf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Af(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function Qy(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function Jy(r,e,t,a){var n=Pf(r,e),i=Qe(n,2),s=i[0],o=i[1],u=Af(r,o,a),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Fr(r,e,t,a){var n=Pf(r,t),i=Qe(n,3),s=i[0],o=i[1],u=i[2],l=Af(r,o,e*s),v=s*u,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),o===r.FLOAT?r.vertexAttribPointer(a,s,o,!1,v,0):o===r.INT&&r.vertexAttribIPointer(a,s,o,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;hs&&(o=s/a,u=a*o,l=n*o),{scale:o,texW:u,texH:l}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,u=this.texHeight,l=this.getScale(a),v=l.scale,f=l.texW,c=l.texH,h=function(b,w){if(n&&w){var E=w.context,C=b.x,x=b.row,T=C,k=u*x;E.save(),E.translate(T,k),E.scale(v,v),n(E,a),E.restore()}},d=[null,null],y=function(){h(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:f,h:c},d[1]={x:i.freePointer.x+f,y:i.freePointer.row*u,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),h({x:0,row:0},b);var E=s-i.freePointer.x,C=f-E,x=u;{var T=i.freePointer.x,k=i.freePointer.row*u,D=E;w.context.drawImage(b,0,0,D,x,T,k,D,x),d[0]={x:T,y:k,w:D,h:c}}{var B=E,P=(i.freePointer.row+1)*u,A=C;w&&w.context.drawImage(b,B,0,A,x,0,P,A,x),d[1]={x:0,y:P,w:A,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),s=i.texW;return this.freePointer.x+s>a?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,u=o===void 0?function(){return!0}:o,l=n.filterType,v=l===void 0?function(){return!0}:l,f=!1,c=!1,h=Cr(t),d;try{for(h.s();!(d=h.n()).done;){var y=d.value;if(u(y)){var g=Cr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,E=w.type;if(v(E)){var C=a.collections.get(w.collection),x=w.getKey(y),T=Array.isArray(x)?x:[x];if(s)T.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),D=a._key(E,k),B=a.typeAndIdToKey.get(D);B!==void 0&&!Xy(T,B)&&(f=!0,a.typeAndIdToKey.delete(D),B.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){h.e(b)}finally{h.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=Cr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),u=!1,l=o.draw(i,n,function(c){s.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),s.drawElement(c,t,n,!0,!0),c.restore()):s.drawElement(c,t,n,!0,!0),u=!0});if(u){var v=s.getID?s.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return l}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(u){var l=i.getBoundingBox(t,u),v=n.getOrCreateAtlas(t,a,l,u),f=v.getOffsets(u),c=Qe(f,2),h=c[0],d=c[1];return{atlas:v,tex:h,tex1:h,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],a=Cr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Qe(n.value,2),s=i[0],o=i[1],u=o.getCounts(),l=u.keyCount,v=u.atlasCount;t.push({type:s,keyCount:l,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),om=(function(){function r(e){dt(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ht(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),um=` - float circleSD(vec2 p, float r) { - return distance(vec2(0), p) - r; // signed distance - } -`,lm=` - float rectangleSD(vec2 p, vec2 b) { - vec2 d = abs(p)-b; - return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); - } -`,vm=` - float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { - cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; - cr.x = (p.y > 0.0) ? cr.x : cr.y; - vec2 q = abs(p) - b + cr.x; - return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; - } -`,fm=` - float ellipseSD(vec2 p, vec2 ab) { - p = abs( p ); // symmetry - - // find root with Newton solver - vec2 q = ab*(p-ab); - float w = (q.x1.0) ? d : -d; - } -`,wa={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Bn={IGNORE:1,USE_BB:2},xs=0,$l=1,Ul=2,Es=3,Vt=4,an=5,da=6,ha=7,cm=(function(){function r(e,t,a){dt(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Wy,this.atlasManager=new sm(e,a),this.batchManager=new om(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(wa.SCREEN),this.pickingProgram=this._createShaderProgram(wa.PICKING),this.vao=this._createVAO()}return ht(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es - precision highp float; - - uniform mat3 uPanZoomMatrix; - uniform int uAtlasSize; - - // instanced - in vec2 aPosition; // a vertex from the unit square - - in mat3 aTransform; // used to transform verticies, eg into a bounding box - in int aVertType; // the type of thing we are rendering - - // the z-index that is output when using picking mode - in vec4 aIndex; - - // For textures - in int aAtlasId; // which shader unit/atlas to use - in vec4 aTex; // x/y/w/h of texture in atlas - - // for edges - in vec4 aPointAPointB; - in vec4 aPointCPointD; - in vec2 aLineWidth; // also used for node border width - - // simple shapes - in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] - in vec4 aColor; // also used for edges - in vec4 aBorderColor; // aLineWidth is used for border width - - // output values passed to the fragment shader - out vec2 vTexCoord; - out vec4 vColor; - out vec2 vPosition; - // flat values are not interpolated - flat out int vAtlasId; - flat out int vVertType; - flat out vec2 vTopRight; - flat out vec2 vBotLeft; - flat out vec4 vCornerRadius; - flat out vec4 vBorderColor; - flat out vec2 vBorderWidth; - flat out vec4 vIndex; - - void main(void) { - int vid = gl_VertexID; - vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - - if(aVertType == `.concat(xs,`) { - float texX = aTex.x; // texture coordinates - float texY = aTex.y; - float texW = aTex.z; - float texH = aTex.w; - - if(vid == 1 || vid == 2 || vid == 4) { - texX += texW; - } - if(vid == 2 || vid == 4 || vid == 5) { - texY += texH; - } - - float d = float(uAtlasSize); - vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - } - else if(aVertType == `).concat(Vt," || aVertType == ").concat(ha,` - || aVertType == `).concat(an," || aVertType == ").concat(da,`) { // simple shapes - - // the bounding box is needed by the fragment shader - vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat - vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat - vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated - - // calculations are done in the fragment shader, just pass these along - vColor = aColor; - vCornerRadius = aCornerRadius; - vBorderColor = aBorderColor; - vBorderWidth = aLineWidth; - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - } - else if(aVertType == `).concat($l,`) { - vec2 source = aPointAPointB.xy; - vec2 target = aPointAPointB.zw; - - // adjust the geometry so that the line is centered on the edge - position.y = position.y - 0.5; - - // stretch the unit square into a long skinny rectangle - vec2 xBasis = target - source; - vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); - vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; - - gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); - vColor = aColor; - } - else if(aVertType == `).concat(Ul,`) { - vec2 pointA = aPointAPointB.xy; - vec2 pointB = aPointAPointB.zw; - vec2 pointC = aPointCPointD.xy; - vec2 pointD = aPointCPointD.zw; - - // adjust the geometry so that the line is centered on the edge - position.y = position.y - 0.5; - - vec2 p0, p1, p2, pos; - if(position.x == 0.0) { // The left side of the unit square - p0 = pointA; - p1 = pointB; - p2 = pointC; - pos = position; - } else { // The right side of the unit square, use same approach but flip the geometry upside down - p0 = pointD; - p1 = pointC; - p2 = pointB; - pos = vec2(0.0, -position.y); - } - - vec2 p01 = p1 - p0; - vec2 p12 = p2 - p1; - vec2 p21 = p1 - p2; - - // Find the normal vector. - vec2 tangent = normalize(normalize(p12) + normalize(p01)); - vec2 normal = vec2(-tangent.y, tangent.x); - - // Find the vector perpendicular to p0 -> p1. - vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); - - // Determine the bend direction. - float sigma = sign(dot(p01 + p21, normal)); - float width = aLineWidth[0]; - - if(sign(pos.y) == -sigma) { - // This is an intersecting vertex. Adjust the position so that there's no overlap. - vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); - gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); - } else { - // This is a non-intersecting vertex. Treat it like a mitre join. - vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); - gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); - } - - vColor = aColor; - } - else if(aVertType == `).concat(Es,` && vid < 3) { - // massage the first triangle into an edge arrow - if(vid == 0) - position = vec2(-0.15, -0.3); - if(vid == 1) - position = vec2( 0.0, 0.0); - if(vid == 2) - position = vec2( 0.15, -0.3); - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - vColor = aColor; - } - else { - gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space - } - - vAtlasId = aAtlasId; - vVertType = aVertType; - vIndex = aIndex; - } - `),i=this.batchManager.getIndexArray(),s=`#version 300 es - precision highp float; - - // declare texture unit for each texture atlas in the batch - `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(` - `),` - - uniform vec4 uBGColor; - uniform float uZoom; - - in vec2 vTexCoord; - in vec4 vColor; - in vec2 vPosition; // model coordinates - - flat in int vAtlasId; - flat in vec4 vIndex; - flat in int vVertType; - flat in vec2 vTopRight; - flat in vec2 vBotLeft; - flat in vec4 vCornerRadius; - flat in vec4 vBorderColor; - flat in vec2 vBorderWidth; - - out vec4 outColor; - - `).concat(um,` - `).concat(lm,` - `).concat(vm,` - `).concat(fm,` - - vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( - top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) - ); - } - - vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance - // scale to the zoom level so that borders don't look blurry when zoomed in - // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); - } - - void main(void) { - if(vVertType == `).concat(xs,`) { - // look up the texel from the texture unit - `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(` - else `),` - } - else if(vVertType == `).concat(Es,`) { - // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; - outColor = blend(vColor, uBGColor); - outColor.a = 1.0; // make opaque, masks out line under arrow - } - else if(vVertType == `).concat(Vt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border - outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done - } - else if(vVertType == `).concat(Vt," || vVertType == ").concat(ha,` - || vVertType == `).concat(an," || vVertType == ").concat(da,`) { // use SDF - - float outerBorder = vBorderWidth[0]; - float innerBorder = vBorderWidth[1]; - float borderPadding = outerBorder * 2.0; - float w = vTopRight.x - vBotLeft.x - borderPadding; - float h = vTopRight.y - vBotLeft.y - borderPadding; - vec2 b = vec2(w/2.0, h/2.0); // half width, half height - vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center - - float d; // signed distance - if(vVertType == `).concat(Vt,`) { - d = rectangleSD(p, b); - } else if(vVertType == `).concat(ha,` && w == h) { - d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(ha,`) { - d = ellipseSD(p, b); - } else { - d = roundRectangleSD(p, b, vCornerRadius.wzyx); - } - - // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling - // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box - if(d > 0.0) { - if(d > outerBorder) { - discard; - } else { - outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); - } - } else { - if(d > innerBorder) { - vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; - vec4 innerBorderColor = blend(vBorderColor, vColor); - outColor = distInterp(innerBorderColor, outerColor, d); - } - else { - vec4 outerColor; - if(innerBorder == 0.0 && outerBorder == 0.0) { - outerColor = vec4(0); - } else if(innerBorder == 0.0) { - outerColor = vBorderColor; - } else { - outerColor = blend(vBorderColor, vColor); - } - outColor = distInterp(vColor, outerColor, d - innerBorder); - } - } - } - else { - outColor = vColor; - } - - `).concat(t.picking?`if(outColor.a == 0.0) discard; - else outColor = vIndex;`:"",` - } - `),o=Hy(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:wa.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===Bn.IGNORE)return;if(u==Bn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p=this.maxInstances&&this.endBatch()}}}}catch(B){v.e(B)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;Hl(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;gn(t,t,[v,f]),Wl(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;gn(t,t,[s,o]),Gs(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);wt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=o,o===an||o===da){var l=i.getBoundingBox(t),v=this._getCornerRadius(t,s.radius,l),f=this.cornerRadiusBuffer.getView(u);f[0]=v,f[1]=v,f[2]=v,f[3]=v,o===da&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(u);Ft(a,c);var h=this.renderTarget.picking?1:n==="node-body"?t.effectiveOpacity():1,d=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h,y=t.pstyle(s.color).value,g=this.colorBuffer.getView(u);wt(y,d,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,s.border){var m=t.pstyle("border-width").value;if(m>0){var b=t.pstyle("border-color").value,w=h*t.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(u);wt(b,w,E);var C=t.pstyle("border-position").value;if(C==="inside")p[0]=0,p[1]=-m;else if(C==="outside")p[0]=m,p[1]=0;else{var x=m/2;p[0]=x,p[1]=-x}}}var T=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,T,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return Vt;case"ellipse":return ha;case"roundrectangle":case"round-rectangle":return an;case"bottom-round-rectangle":return da;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,s=n.h;if(t.pstyle(a).value==="auto")return lt(i,s);var o=t.pstyle(a).pfValue,u=i/2,l=s/2;return Math.min(o,l,u)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,s,o,u;if(n==="source"?(s=i.arrowStartX,o=i.arrowStartY,u=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(u)||u==null)){var l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,h=f*c,d=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,g=this.r.getArrowWidth(d,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);Hl(m),gn(m,m,[s,o]),Gs(m,m,[g,g]),Wl(m,m,u),this.vertTypeBuffer.getView(p)[0]=Es;var b=this.indexBuffer.getView(p);Ft(a,b);var w=this.colorBuffer.getView(p);wt(v,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*s;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=$l;var f=this.indexBuffer.getView(v);Ft(a,f);var c=this.colorBuffer.getView(v);wt(u,l,c);var h=this.lineWidthBuffer.getView(v);h[0]=o;var d=this.pointAPointBBuffer.getView(v);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var s=i/a;this._setCurvePoint(t,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?Bn.USE_BB:Bn.IGNORE},u=function(f){var c=f.position(),h=c.x,d=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:h-y/2,y1:d-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:Ky,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getLabelKey,null),getBoundingBox:Ts(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getSourceLabelKey,"source"),getBoundingBox:Ts(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Cs(e.getTargetLabelKey,"target"),getBoundingBox:Ts(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Na(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&l()}),hm(t)};function dm(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return av(t)}function Mf(r,e){var t=r._private.rscratch;return xr(t,"labelWrapCachedLines",e)||[]}var Cs=function(e,t){return function(a){var n=e(a),i=Mf(a,t);return i.length>1?i.map(function(s,o){return"".concat(n,"_").concat(o)}):n}},Ts=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),u=Mf(a,t),l=i.h/u.length,v=l*o,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:l,yOffset:v}}}return i}};function hm(r){{var e=r.render;r.render=function(i){i=i||{};var s=r.cy;r.webgl&&(s.zoom()>Tf?(gm(r),e.call(r,i)):(pm(r),If(r,i,wa.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,s,o,u){return Em(r,i,s)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,s){n.call(r,i,s),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function gm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function pm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function ym(r){var e=r.canvasWidth,t=r.canvasHeight,a=yo(r),n=a.pan,i=a.zoom,s=ws();gn(s,s,[n.x,n.y]),Gs(s,s,[i,i]);var o=ws();tm(o,e,t);var u=ws();return rm(u,o,s),u}function Lf(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=yo(r),i=n.pan,s=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(s,s)}function mm(r,e){r.drawSelectionRectangle(e,function(t){return Lf(r,t)})}function bm(r){var e=r.data.contexts[r.NODE];e.save(),Lf(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function wm(r){var e=function(n,i,s){for(var o=n.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=o.atlases,v=0;v=0&&w.add(x)}return w}function Em(r,e,t){var a=xm(r,e,t),n=r.getCachedZSortedEles(),i,s,o=Cr(a),u;try{for(o.s();!(u=o.n()).done;){var l=u.value,v=n[l];if(!i&&v.isNode()&&(i=v),!s&&v.isEdge()&&(s=v),i&&s)break}}catch(f){o.e(f)}finally{o.f()}return[i,s].filter(Boolean)}function Ss(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function If(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&mm(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=ym(r),u=r.getCachedZSortedEles();if(i=u.length,n.startFrame(o,t),t.screen){for(var l=0;l0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*l,-a.y1*l),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(a.x1*l,a.y1*l);else{var y=e.pan(),g={x:y.x*l,y:y.y*l};l*=e.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return c};function Cm(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i"u"?"undefined":rr(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[kf,Hr,Qr,po,Mt,pt,mr,Rf,yt,Ga,zf].forEach(function(r){ye(Te,r)});var km=[{name:"null",impl:ff},{name:"base",impl:Ef},{name:"canvas",impl:Tm}],Dm=[{type:"layout",extensions:Zp},{type:"renderer",extensions:km}],Vf={},qf={};function _f(r,e,t){var a=t,n=function(T){ze("Can not register `"+e+"` for `"+r+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(Pa.prototype[e])return n(e);Pa.prototype[e]=t}else if(r==="collection"){if(lr.prototype[e])return n(e);lr.prototype[e]=t}else if(r==="layout"){for(var i=function(T){this.options=T,t.call(this,T),Me(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],u=0;uMath.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),U=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),K=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Q=m((t,e,r,d,a)=>{const f=[],u=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&u.add(i),o!==d&&u.add(o)}),u.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,u=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+u;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-u;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}case"top":default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const u=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:u,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};case"top":default:return{x:u,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(u=>{const c=t.edge(u);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:u.v,end:u.w})}else a.push({edge:c,start:u.v,end:u.w})}),d.forEach(u=>{if(u.length!==3){u.forEach(h=>a.push(h));return}u.sort((h,E)=>h.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=u,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){u.forEach(h=>a.push(h));return}const n={width:l.edge.width,height:l.edge.height},L=Q(t,o,u,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const u=e.graph().rankdir;p.trace("Dir in recursive render - dir:",u);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=U(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const h=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX + Node.id = `,y,` + data=`,h.height,` +Parent cluster`,a.height),e.setNode(a.id,h),e.parent(y)||(p.trace("Setting parent",y,a.id),e.setParent(y,a.id,h))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){p.info("Cluster identified XBX",y,g.width,e.node(y));const{ranksep:h,nodesep:E}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:h+25,nodesep:E});const S=await oe({element:i,graph:g.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),N=S.elem;z(g,N),g.diff=S.diff||0,p.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),H(N,g)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),p.trace(D(g.id,e)),b.set(g.id,{id:D(g.id,e),node:g})):(p.trace("Node - the non recursive path XAX",y,i,e.node(y),u),await J(i,e.node(y),{config:f,dir:u}))})),await m(async()=>{const y=e.edges().map(async function(g){const h=e.edge(g.v,g.w,g.name);if(p.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),p.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),p.info("Fix",b,"ids:",g.v,g.w,"Translating: ",b.get(g.v),b.get(g.w)),n&&h.selfLoop){if(h.selfLoop.order!==1)return;const E={...h.originalEdge,...h,id:h.selfLoop.id,startLabelLeft:h.originalEdge?.startLabelLeft??h.startLabelLeft,startLabelRight:h.originalEdge?.startLabelRight??h.startLabelRight,endLabelLeft:h.originalEdge?.endLabelLeft??h.endLabelLeft,endLabelRight:h.originalEdge?.endLabelRight??h.endLabelRight};await X(s,E),h.width=E.width,h.height=E.height,h.labelStyle=E.labelStyle;return}await X(s,h)});await Promise.all(y)},"processEdges")();const{subGraphTitleTotalMargin:w}=T(f);return{elem:o,graph:e,groups:{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:n,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),j(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{const d=t.node(e);if(!d)return;const a={...d};return d?.clusterNode?a.y=(d.y??0)+r:t.children(e).length>0?a.height=(d.height??0)+r:a.y=(d.y??0)+r/2,a},"normalizeDagreNode"),v=m((t,e)=>{K.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+d:a.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{const{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:a=0}=e,f=new Map(t.nodes.map(c=>[c.id,c]));x(r).forEach(c=>{const l=$(r,c,a);if(!l)return;v(r.node(c),l);const s=f.get(c);s&&v(s,l)});const u=a/2;return t.edges=B(r,u,{mergeSelfLoops:d}).map(({edge:c,start:l,end:s})=>ee(c,l,s,u)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:a,id:f,mergeSelfLoops:u,subGraphTitleTotalMargin:c})=>{let l=0;await Promise.all(x(e).map(async function(o){const n=e.node(o);if(p.info("Position XBX => "+o+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,p.info("A tainted cluster node XBX1",o,n.id,n.width,n.height,n.x,n.y,e.parent(o)),b.get(n.id).node=n,R(n);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,n.id,n.x,n.y,n.width,n.height,e.parent(o)),n.height+=c,e.node(n.parentId);const L=n?.padding/2||0,w=n?.labelBBox?.height||0,y=w-L||0;p.debug("OffsetY",y,"labelHeight",w,"halfPadding",L),await F(r,n),b.get(n.id).node=n}else{const L=e.node(n.parentId);n.y+=c/2,p.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",L,L?.offsetY,n),R(n)}}));const s=c/2;return B(e,s,{mergeSelfLoops:u}).forEach(function({edge:o,start:n,end:L}){p.info("Edge "+n+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(h=>h.y+=s);const w=e.node(n),y=e.node(L),g=q(d,o,b,a,w,y,f);W(o,g)}),e.nodes().forEach(function(o){const n=e.node(o);p.info(o,n.type,n.diff),n.isGroup&&(l=n.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{const e=await I(t);return M(e.graph),await re(e)},"renderDagreSubgraph"),G=m(t=>{const e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){const d=r.start,a=d+"---"+d+"---1",f=d+"---"+d+"---2",u=e.node(d);e.setNode(a,{domId:a,id:a,parentId:u.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,u.parentId),e.setNode(f,{domId:f,id:f,parentId:u.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,u.parentId);const c=structuredClone(r),l=structuredClone(r),s=structuredClone(r),i=structuredClone(r);l.originalEdge=c,l.selfLoop={id:c.id,order:0},s.originalEdge=c,s.selfLoop={id:c.id,order:1},i.originalEdge=c,i.selfLoop={id:c.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",s.startLabelRight="",s.startLabelLeft="",s.endLabelLeft="",s.endLabelRight="",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=d+"-cyclic-special-mid",i.label="",i.startLabelRight="",i.startLabelLeft="",i.arrowTypeStart="none",u.isGroup&&(l.fromCluster=d,i.toCluster=d),i.id=d+"-cyclic-special-2",i.arrowTypeStart="none",e.setEdge(d,a,l,d+"-cyclic-special-0"),e.setEdge(a,f,s,d+"-cyclic-special-1"),e.setEdge(f,d,i,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),A(e),{graph:e}},"prepareLayoutForDagre"),ae=m(async(t,{element:e,preparedLayout:r})=>{const d=r??G(t),a=k(),f=await I({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:a});return d.measuredLayout=f,f},"measureDagreLayout"),ne=m((t,e)=>{const r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return M(r.graph),te(t,r),r},"runDagreLayoutCore"),se=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),ie=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),fe=Y({prepareLayout:G,measureLayout:ae,runLayoutCore:ne,paintOptions:{clusterDb:b,getNodes:se,getEdgeNode:ie,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,B as getEdgesToRender,ae as measureDagreLayout,G as prepareLayoutForDagre,fe as render,ne as runDagreLayoutCore}; diff --git a/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-_WUM64Jb.js b/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-_WUM64Jb.js new file mode 100644 index 000000000..443004b96 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-_WUM64Jb.js @@ -0,0 +1,4 @@ +import{_ as m,ao as x,c as k,Q as O,l as p,ap as A,aq as Y,ar as b,as as _,at as z,au as H,av as D,aw as J,ax as T,ay as X,ah as R,af as F,az as q,aA as W}from"./mermaidParser.worker-DimdFOud.js";import{l as j}from"./layout-0mnwPCmk.js";var C=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Q=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),U=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],K=m((t,e,r,d,a)=>{const f=[],h=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&h.add(i),o!==d&&h.add(o)}),h.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,h=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+h;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-h;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}case"top":default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const h=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};case"top":default:return{x:h,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{const c=t.edge(h);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:h.v,end:h.w})}else a.push({edge:c,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>a.push(u));return}h.sort((u,E)=>u.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=h,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){h.forEach(u=>a.push(u));return}const n={width:l.edge.width,height:l.edge.height},L=K(t,o,h,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=Q(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX + Node.id = `,y,` + data=`,u.height,` +Parent cluster`,a.height),e.setNode(a.id,u),e.parent(y)||(p.trace("Setting parent",y,a.id),e.setParent(y,a.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){p.info("Cluster identified XBX",y,g.width,e.node(y));const{ranksep:u,nodesep:E}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:u+25,nodesep:E});const S=await oe({element:i,graph:g.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),N=S.elem;z(g,N),g.diff=S.diff||0,p.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),H(N,g)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),p.trace(D(g.id,e)),b.set(g.id,{id:D(g.id,e),node:g})):(p.trace("Node - the non recursive path XAX",y,i,e.node(y),h),await J(i,e.node(y),{config:f,dir:h}))})),await m(async()=>{const y=e.edges().map(async function(g){const u=e.edge(g.v,g.w,g.name);if(p.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),p.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),p.info("Fix",b,"ids:",g.v,g.w,"Translating: ",b.get(g.v),b.get(g.w)),n&&u.selfLoop){if(u.selfLoop.order!==1)return;const E={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await X(s,E),u.width=E.width,u.height=E.height,u.labelStyle=E.labelStyle;return}await X(s,u)});await Promise.all(y)},"processEdges")();const{subGraphTitleTotalMargin:w}=T(f);return{elem:o,graph:e,groups:{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:n,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),j(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{const d=t.node(e);if(!d)return;const a={...d};return d?.clusterNode?a.y=(d.y??0)+r:t.children(e).length>0?a.height=(d.height??0)+r:a.y=(d.y??0)+r/2,a},"normalizeDagreNode"),v=m((t,e)=>{U.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+d:a.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{const{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:a=0}=e,f=new Map(t.nodes.map(c=>[c.id,c]));x(r).forEach(c=>{const l=$(r,c,a);if(!l)return;v(r.node(c),l);const s=f.get(c);s&&v(s,l)});const h=a/2;return t.edges=B(r,h,{mergeSelfLoops:d}).map(({edge:c,start:l,end:s})=>ee(c,l,s,h)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:a,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:c})=>{let l=0;await Promise.all(x(e).map(async function(o){const n=e.node(o);if(p.info("Position XBX => "+o+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,p.info("A tainted cluster node XBX1",o,n.id,n.width,n.height,n.x,n.y,e.parent(o)),b.get(n.id).node=n,R(n);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,n.id,n.x,n.y,n.width,n.height,e.parent(o)),n.height+=c,e.node(n.parentId);const L=n?.padding/2||0,w=n?.labelBBox?.height||0,y=w-L||0;p.debug("OffsetY",y,"labelHeight",w,"halfPadding",L),await F(r,n),b.get(n.id).node=n}else{const L=e.node(n.parentId);n.y+=c/2,p.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",L,L?.offsetY,n),R(n)}}));const s=c/2;return B(e,s,{mergeSelfLoops:h}).forEach(function({edge:o,start:n,end:L}){p.info("Edge "+n+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=s);const w=e.node(n),y=e.node(L),g=q(d,o,b,a,w,y,f);W(o,g)}),e.nodes().forEach(function(o){const n=e.node(o);p.info(o,n.type,n.diff),n.isGroup&&(l=n.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{const e=await I(t);return M(e.graph),await re(e)},"renderDagreSubgraph"),G=m(t=>{const e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){const d=r.start,a=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(a,{domId:a,id:a,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.parentId);const c=structuredClone(r),l=structuredClone(r),s=structuredClone(r),i=structuredClone(r);l.originalEdge=c,l.selfLoop={id:c.id,order:0},s.originalEdge=c,s.selfLoop={id:c.id,order:1},i.originalEdge=c,i.selfLoop={id:c.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",s.startLabelRight="",s.startLabelLeft="",s.endLabelLeft="",s.endLabelRight="",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=d+"-cyclic-special-mid",i.label="",i.startLabelRight="",i.startLabelLeft="",i.arrowTypeStart="none",h.isGroup&&(l.fromCluster=d,i.toCluster=d),i.id=d+"-cyclic-special-2",i.arrowTypeStart="none",e.setEdge(d,a,l,d+"-cyclic-special-0"),e.setEdge(a,f,s,d+"-cyclic-special-1"),e.setEdge(f,d,i,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),A(e),{graph:e}},"prepareLayoutForDagre"),ae=m(async(t,{element:e,preparedLayout:r})=>{const d=r??G(t),a=k(),f=await I({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:a});return d.measuredLayout=f,f},"measureDagreLayout"),ne=m((t,e)=>{const r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return M(r.graph),te(t,r),r},"runDagreLayoutCore"),se=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),ie=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),ce=Y({prepareLayout:G,measureLayout:ae,runLayoutCore:ne,paintOptions:{clusterDb:b,getNodes:se,getEdgeNode:ie,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,B as getEdgesToRender,ae as measureDagreLayout,G as prepareLayoutForDagre,ce as render,ne as runDagreLayoutCore}; diff --git a/apps/pythinker-code/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js b/apps/pythinker-code/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js deleted file mode 100644 index 42a94d795..000000000 --- a/apps/pythinker-code/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +++ /dev/null @@ -1,4 +0,0 @@ -import{_ as w,aV as _,aW as Y,aX as F,aY as j,l as r,c as H,aZ as V,a_ as $,ag as Q,aQ as U,ah as P,af as W,a$ as Z,b0 as q,b1 as z}from"./mermaidParser.worker-Dx4jPi9z.js";import{i as N,G as B}from"./graph-BwjfAU3j.js";import{b as K,m as R,l as I}from"./layout-C1ojF0zw.js";var ee=4;function ne(e){return K(e,ee)}function b(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:te(e),edges:se(e)};return N(e.graph())||(t.value=ne(e.graph())),t}function te(e){return R(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),i={v:t};return N(n)||(i.value=n),N(a)||(i.parent=a),i})}function se(e){return R(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return N(t.name)||(a.name=t.name),N(n)||(a.value=n),a})}var d=new Map,y=new Map,A=new Map,re=w(()=>{y.clear(),A.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return r.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),ie=w((e,t)=>{const n=y.get(t)||[];return r.info("Descendants of ",t," is ",n),r.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(r.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{r.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const i=t.children(e)||[];e!==a&&i.push(e),r.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);r.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(r.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(r.debug("Setting parent",o,e),n.setParent(o,e)):(r.info("In copy ",e,"root",a,"data",t.node(e),a),r.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);r.debug("Copying Edges",u),u.forEach(c=>{r.info("Edge",c);const m=t.edge(c.v,c.w,c.name);r.info("Edge data",m,a);try{ie(c,a)?(r.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),r.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):r.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(h){r.error(h)}})}r.debug("Removing node",o),t.removeNode(o)})},"copy"),J=w((e,t)=>{const n=t.children(e);let a=[...n];for(const i of n)A.set(i,e),a=[...a,...J(i,t)];return a},"extractDescendants"),oe=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),i=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=i.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(r.trace("Searching children of id ",e,a),a.length<1)return e;let i;for(const o of a){const l=C(o,t,n),u=oe(t,n,l);if(l)if(u.length>0)i=l;else return l}return i},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),ae=w((e,t)=>{if(!e||t>10){r.debug("Opting out, no graph ");return}else r.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(r.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,J(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),i=e.edges();a.length>0?(r.debug("Cluster identified",n,y),i.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(r.warn("Edge: ",o," leaves cluster ",n),r.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):r.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,i=e.parent(a);i!==n&&d.has(i)&&!d.get(i).externalConnections&&(d.get(n).id=i)}e.edges().forEach(function(n){const a=e.edge(n);r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,o=n.w;if(r.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(r.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),i=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const l=e.parent(i);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}r.warn("Fix Replacing with XXX",i,o,n.name),e.setEdge(i,o,a,n.name)}}),r.warn("Adjusted Graph",b(e)),T(e,0),r.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(r.warn("extractor - ",t,b(e),e.children("D")),t>10){r.error("Bailing out");return}let n=e.nodes(),a=!1;for(const i of n){const o=e.children(i);a=a||o.length>0}if(!a){r.debug("Done, no node has children",e.nodes());return}r.debug("Nodes = ",n,t);for(const i of n)if(r.debug("Extracting node",i,d,d.has(i)&&!d.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!d.has(i))r.debug("Not a cluster",i,t);else if(!d.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){r.warn("Cluster without external connections, without a parent and with children",i,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(i)?.clusterData?.dir&&(l=d.get(i).clusterData.dir,r.warn("Fixing dir",d.get(i).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});r.warn("Old graph before copy",b(e)),G(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:d.get(i).clusterData,label:d.get(i).label,graph:u}),r.warn("New graph after copy node: (",i,")",b(u)),r.debug("Old graph after copy",b(e))}else r.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!d.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),r.debug(d);n=e.nodes(),r.warn("New list of nodes",n);for(const i of n){const o=e.node(i);r.warn(" Now next level",i,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),L=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const i=e.children(a),o=L(e,i);n=[...n,...o]}),n},"sorter"),ce=w(e=>L(e,e.children()),"sortNodesByHierarchy"),M=w(async(e,t,n,a,i,o)=>{r.warn("Graph in recursive render:XAX",b(t),i);const l=t.graph().rankdir;r.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?r.info("Recursive render XXX",t.nodes()):r.info("No nodes found for",t),t.edges().length>0&&r.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),h=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(i!==void 0){const g=JSON.parse(JSON.stringify(i.clusterData));r.trace(`Setting data for parent cluster XXX - Node.id = `,f,` - data=`,g.height,` -Parent cluster`,i.height),t.setNode(i.id,g),t.parent(f)||(r.trace("Setting parent",f,i.id),t.setParent(f,i.id,g))}if(r.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){r.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const p=await M(v,s.graph,n,a,t.node(f),o),x=p.elem;V(s,x),s.diff=p.diff||0,r.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),$(x,s)}else t.children(f).length>0?(r.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),r.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(r.trace("Node - the non recursive path XAX",f,v,t.node(f),l),await Q(v,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);r.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),r.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),r.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await z(h,g)});await Promise.all(f)},"processEdges")(),r.info("Graph before layout:",JSON.stringify(b(t))),r.info("############################################# XXX"),r.info("### Layout ### XXX"),r.info("############################################# XXX"),I(t),r.info("Graph after layout:",JSON.stringify(b(t)));let O=0,{subGraphTitleTotalMargin:S}=U(o);return await Promise.all(ce(t).map(async function(f){const s=t.node(f);if(r.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,r.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){r.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,p=E-g||0;r.debug("OffsetY",p,"labelHeight",E,"halfPadding",g),await W(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,r.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);r.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const p=Z(m,s,d,n,g,E,a);q(s,p)}),t.nodes().forEach(function(f){const s=t.node(f);r.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),r.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ue=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");_(a,e.markers,e.type,e.diagramId),Y(),F(),j(),re(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),r.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const h=structuredClone(o),v=structuredClone(o),X=structuredClone(o);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=l+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-mid",X.label="",X.startLabelRight="",X.startLabelLeft="",X.arrowTypeStart="none",m.isGroup&&(h.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,h,l+"-cyclic-special-0"),n.setEdge(u,c,v,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cyc{y.clear(),A.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return r.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),ie=w((e,t)=>{const n=y.get(t)||[];return r.info("Descendants of ",t," is ",n),r.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(r.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{r.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const i=t.children(e)||[];e!==a&&i.push(e),r.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);r.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(r.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(r.debug("Setting parent",o,e),n.setParent(o,e)):(r.info("In copy ",e,"root",a,"data",t.node(e),a),r.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);r.debug("Copying Edges",u),u.forEach(c=>{r.info("Edge",c);const m=t.edge(c.v,c.w,c.name);r.info("Edge data",m,a);try{ie(c,a)?(r.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),r.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):r.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(h){r.error(h)}})}r.debug("Removing node",o),t.removeNode(o)})},"copy"),J=w((e,t)=>{const n=t.children(e);let a=[...n];for(const i of n)A.set(i,e),a=[...a,...J(i,t)];return a},"extractDescendants"),oe=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),i=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=i.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(r.trace("Searching children of id ",e,a),a.length<1)return e;let i;for(const o of a){const l=C(o,t,n),u=oe(t,n,l);if(l)if(u.length>0)i=l;else return l}return i},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),ae=w((e,t)=>{if(!e||t>10){r.debug("Opting out, no graph ");return}else r.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(r.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,J(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),i=e.edges();a.length>0?(r.debug("Cluster identified",n,y),i.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(r.warn("Edge: ",o," leaves cluster ",n),r.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):r.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,i=e.parent(a);i!==n&&d.has(i)&&!d.get(i).externalConnections&&(d.get(n).id=i)}e.edges().forEach(function(n){const a=e.edge(n);r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,o=n.w;if(r.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(r.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),i=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const l=e.parent(i);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}r.warn("Fix Replacing with XXX",i,o,n.name),e.setEdge(i,o,a,n.name)}}),r.warn("Adjusted Graph",b(e)),T(e,0),r.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(r.warn("extractor - ",t,b(e),e.children("D")),t>10){r.error("Bailing out");return}let n=e.nodes(),a=!1;for(const i of n){const o=e.children(i);a=a||o.length>0}if(!a){r.debug("Done, no node has children",e.nodes());return}r.debug("Nodes = ",n,t);for(const i of n)if(r.debug("Extracting node",i,d,d.has(i)&&!d.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!d.has(i))r.debug("Not a cluster",i,t);else if(!d.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){r.warn("Cluster without external connections, without a parent and with children",i,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(i)?.clusterData?.dir&&(l=d.get(i).clusterData.dir,r.warn("Fixing dir",d.get(i).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});r.warn("Old graph before copy",b(e)),G(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:d.get(i).clusterData,label:d.get(i).label,graph:u}),r.warn("New graph after copy node: (",i,")",b(u)),r.debug("Old graph after copy",b(e))}else r.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!d.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),r.debug(d);n=e.nodes(),r.warn("New list of nodes",n);for(const i of n){const o=e.node(i);r.warn(" Now next level",i,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),L=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const i=e.children(a),o=L(e,i);n=[...n,...o]}),n},"sorter"),ce=w(e=>L(e,e.children()),"sortNodesByHierarchy"),M=w(async(e,t,n,a,i,o)=>{r.warn("Graph in recursive render:XAX",b(t),i);const l=t.graph().rankdir;r.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?r.info("Recursive render XXX",t.nodes()):r.info("No nodes found for",t),t.edges().length>0&&r.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),h=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(i!==void 0){const g=JSON.parse(JSON.stringify(i.clusterData));r.trace(`Setting data for parent cluster XXX - Node.id = `,f,` - data=`,g.height,` -Parent cluster`,i.height),t.setNode(i.id,g),t.parent(f)||(r.trace("Setting parent",f,i.id),t.setParent(f,i.id,g))}if(r.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){r.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const p=await M(v,s.graph,n,a,t.node(f),o),x=p.elem;V(s,x),s.diff=p.diff||0,r.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),$(x,s)}else t.children(f).length>0?(r.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),r.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(r.trace("Node - the non recursive path XAX",f,v,t.node(f),l),await Q(v,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);r.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),r.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),r.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await z(h,g)});await Promise.all(f)},"processEdges")(),r.info("Graph before layout:",JSON.stringify(b(t))),r.info("############################################# XXX"),r.info("### Layout ### XXX"),r.info("############################################# XXX"),I(t),r.info("Graph after layout:",JSON.stringify(b(t)));let O=0,{subGraphTitleTotalMargin:S}=U(o);return await Promise.all(ce(t).map(async function(f){const s=t.node(f);if(r.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,r.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){r.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,p=E-g||0;r.debug("OffsetY",p,"labelHeight",E,"halfPadding",g),await W(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,r.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);r.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const p=Z(m,s,d,n,g,E,a);q(s,p)}),t.nodes().forEach(function(f){const s=t.node(f);r.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),r.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ge=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");_(a,e.markers,e.type,e.diagramId),Y(),j(),F(),re(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),r.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const h=structuredClone(o),v=structuredClone(o),X=structuredClone(o);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=l+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-mid",X.label="",X.startLabelRight="",X.startLabelLeft="",X.arrowTypeStart="none",m.isGroup&&(h.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,h,l+"-cyclic-special-0"),n.setEdge(u,c,v,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cycy({...j,...C().radar}),"getConfig"),b=l(()=>x.axes,"getAxes"),N=l(()=>x.curves,"getCurves"),U=l(()=>x.options,"getOptions"),X=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=l(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:N,getOptions:U,setAxes:X,setCurves:Y,setOptions:J,getConfig:q,clear:K,setAccTitle:E,getAccTitle:_,setDiagramTitle:F,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},Q=l(a=>{H(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await V("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=D(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,h,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` - .radarTitle { - font-size: ${t.fontSize}; - color: ${t.titleColor}; - dominant-baseline: hanging; - text-anchor: middle; - } - .radarAxisLine { - stroke: ${e.axisColor}; - stroke-width: ${e.axisStrokeWidth}; - } - .radarAxisLabel { - dominant-baseline: middle; - text-anchor: middle; - font-size: ${e.axisLabelFontSize}px; - color: ${e.axisColor}; - } - .radarGraticule { - fill: ${e.graticuleColor}; - fill-opacity: ${e.graticuleOpacity}; - stroke: ${e.graticuleColor}; - stroke-width: ${e.graticuleStrokeWidth}; - } - .radarLegendText { - text-anchor: start; - font-size: ${e.legendFontSize}px; - dominant-baseline: hanging; - } - ${ot(t,e)} - `},"styles"),gt={parser:tt,db:$,renderer:nt,styles:lt};export{gt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js b/apps/pythinker-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js deleted file mode 100644 index 74395e997..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +++ /dev/null @@ -1,43 +0,0 @@ -import{s as k,g as I,q as R,p as F,a as _,b as D,_ as l,I as E,z,F as y,D as C,G,l as P,K as W,e as B}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as V}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as H}from"./wardley-L42UT6IY-BJFn8eDD.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:h},x=structuredClone(w),j=G.radar,q=l(()=>y({...j,...C().radar}),"getConfig"),b=l(()=>x.axes,"getAxes"),K=l(()=>x.curves,"getCurves"),N=l(()=>x.options,"getOptions"),U=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Z=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule}},"setOptions"),J=l(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:K,getOptions:N,setAxes:U,setCurves:X,setOptions:Z,getConfig:q,clear:J,setAccTitle:D,getAccTitle:_,setDiagramTitle:F,getDiagramTitle:R,getAccDescription:I,setAccDescription:k},Q=l(a=>{V(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await H("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=E(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),m=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,m,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),m=n*Math.sin(u);return`${g},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const u=d.entries.map((g,m)=>{const v=2*Math.PI*m/n-Math.PI/2,f=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` - .radarTitle { - font-size: ${t.fontSize}; - color: ${t.titleColor}; - dominant-baseline: hanging; - text-anchor: middle; - } - .radarAxisLine { - stroke: ${e.axisColor}; - stroke-width: ${e.axisStrokeWidth}; - } - .radarAxisLabel { - dominant-baseline: middle; - text-anchor: middle; - font-size: ${e.axisLabelFontSize}px; - color: ${e.axisColor}; - } - .radarGraticule { - fill: ${e.graticuleColor}; - fill-opacity: ${e.graticuleOpacity}; - stroke: ${e.graticuleColor}; - stroke-width: ${e.graticuleStrokeWidth}; - } - .radarLegendText { - text-anchor: start; - font-size: ${e.legendFontSize}px; - dominant-baseline: hanging; - } - ${ot(t,e)} - `},"styles"),pt={parser:tt,db:$,renderer:nt,styles:lt};export{pt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DADFx60c.js b/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DADFx60c.js deleted file mode 100644 index be45e82e4..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DADFx60c.js +++ /dev/null @@ -1,10 +0,0 @@ -import{q as x,b as f,s as C,t as B,g as T,a as y,_ as s,H as u,l as k,L as V,e as _,F as N,A as S,I as A}from"./mermaid.core-Bt2TZ_t_.js";import{p as D}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{I}from"./chunk-QZHKN3VN-B-qKGIEB.js";import{p as $}from"./wardley-L42UT6IY-7UoWEQ2c.js";import"./index-C-zUV3mO.js";var d=new I(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),H=s(()=>{d.reset(),S()},"clear"),L=s(()=>d.records.stack[0],"getRoot"),X=s(()=>d.records.cnt,"getCount"),z=A.treeView,R=s(()=>u(z,N().treeView),"getConfig"),W=s((e,t)=>{for(;e<=d.records.stack[d.records.stack.length-1].level;)d.records.stack.pop();const a={id:d.records.cnt++,level:e,name:t,children:[]};d.records.stack[d.records.stack.length-1].children.push(a),d.records.stack.push(a)},"addNode"),E={clear:H,addNode:W,getRoot:L,getCount:X,getConfig:R,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},m=E,F=s(e=>{D(e,m),e.nodes.map(t=>m.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await $("treeView",e);k.debug(t),F(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),l=g+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+l/2),a.BBox={x:e,y:t,width:i,height:l}},"positionLabel"),b=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,a)=>{let n=0,o=0;const c=s((r,l,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,l,r,i);const{height:p,width:w}=l.BBox;b(r,v-i.rowIndent,n+p/2,v,n+p/2,i.lineThickness),o=Math.max(o,v+w),n+=p},"drawNode"),g=s((r,l=0)=>{c(e,r,a,l),r.children.forEach(p=>{g(p,l+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:p,height:w}=r.children[r.children.length-1].BBox;b(e,i+a.paddingX,h+v,i+a.paddingX,p+w/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),j=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram -`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),r=V(t),l=r.append("g");l.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(l,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),_(r,i,h,g.useMaxWidth)},"draw"),G={draw:j},J=G,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return` - .treeView-node-label { - font-size: ${t}; - fill: ${a}; - } - .treeView-node-line { - stroke: ${n}; - } - `},"styles"),P=O,ae={db:m,renderer:J,parser:M,styles:P};export{ae as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js b/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js deleted file mode 100644 index 0d4ba27b0..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +++ /dev/null @@ -1,10 +0,0 @@ -import{p as x,b as f,s as C,q as B,g as T,a as y,_ as s,F as u,l as k,I as V,e as _,D,z as N,G as S}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as I}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{I as $}from"./chunk-QZHKN3VN-_Rz9_NuS.js";import{p as z}from"./wardley-L42UT6IY-BJFn8eDD.js";var d=new $(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),A=s(()=>{d.reset(),N()},"clear"),X=s(()=>d.records.stack[0],"getRoot"),H=s(()=>d.records.cnt,"getCount"),L=S.treeView,R=s(()=>u(L,D().treeView),"getConfig"),W=s((e,t)=>{for(;e<=d.records.stack[d.records.stack.length-1].level;)d.records.stack.pop();const a={id:d.records.cnt++,level:e,name:t,children:[]};d.records.stack[d.records.stack.length-1].children.push(a),d.records.stack.push(a)},"addNode"),E={clear:A,addNode:W,getRoot:X,getCount:H,getConfig:R,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},m=E,F=s(e=>{I(e,m),e.nodes.map(t=>m.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await z("treeView",e);k.debug(t),F(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),l=g+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+l/2),a.BBox={x:e,y:t,width:i,height:l}},"positionLabel"),b=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,a)=>{let n=0,o=0;const c=s((r,l,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,l,r,i);const{height:p,width:w}=l.BBox;b(r,v-i.rowIndent,n+p/2,v,n+p/2,i.lineThickness),o=Math.max(o,v+w),n+=p},"drawNode"),g=s((r,l=0)=>{c(e,r,a,l),r.children.forEach(p=>{g(p,l+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:p,height:w}=r.children[r.children.length-1].BBox;b(e,i+a.paddingX,h+v,i+a.paddingX,p+w/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),G=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram -`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),r=V(t),l=r.append("g");l.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(l,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),_(r,i,h,g.useMaxWidth)},"draw"),j={draw:G},J=j,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return` - .treeView-node-label { - font-size: ${t}; - fill: ${a}; - } - .treeView-node-line { - stroke: ${n}; - } - `},"styles"),P=O,te={db:m,renderer:J,parser:M,styles:P};export{te as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-pPjzS6D9.js b/apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-pPjzS6D9.js deleted file mode 100644 index 3db22dc0c..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-pPjzS6D9.js +++ /dev/null @@ -1,3 +0,0 @@ -import{p as re}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{t as oe,q as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,G as xe,A as fe,H as ge,F as M,I as he,i as y,w as P,ak as pe}from"./mermaid.core-Bt2TZ_t_.js";import{p as be,i as ve}from"./wardley-L42UT6IY-7UoWEQ2c.js";import"./index-C-zUV3mO.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function G(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(G,"calculateEntityVisualProps");function L(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ -`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function V(e,n){const t=n,i=G(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` -`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,He={parser:Ee,db:F,renderer:$e,styles:Ne};export{He as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-B54EfHBU.js b/apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-B54EfHBU.js deleted file mode 100644 index eebf46cb7..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-B54EfHBU.js +++ /dev/null @@ -1,24 +0,0 @@ -import{_ as b,H as u,L as $,e as B,l as m,b as C,a as S,q as D,t as T,g as F,s as P,F as z,I as A,A as E}from"./mermaid.core-Bt2TZ_t_.js";import{p as W}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{p as _}from"./wardley-L42UT6IY-7UoWEQ2c.js";import"./index-C-zUV3mO.js";var L=A.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=F,this.setAccDescription=P}static{b(this,"PacketDB")}getConfig(){const t=u({...L,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){E(),this.packet=[]}},N=1e4,I=b((t,e)=>{W(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),I(e,r)},"parse")},Y=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())H(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:Y},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=u(j,t);return` - .packetByte { - font-size: ${e.byteFontSize}; - } - .packetByte.start { - fill: ${e.startByteColor}; - } - .packetByte.end { - fill: ${e.endByteColor}; - } - .packetLabel { - fill: ${e.labelColor}; - font-size: ${e.labelFontSize}; - } - .packetTitle { - fill: ${e.titleColor}; - font-size: ${e.titleFontSize}; - } - .packetBlock { - stroke: ${e.blockStrokeColor}; - stroke-width: ${e.blockStrokeWidth}; - fill: ${e.blockFillColor}; - } - `},"styles"),X={parser:v,get db(){return new w},renderer:O,styles:q};export{X as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-BDwqGV4K.js b/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-BDwqGV4K.js deleted file mode 100644 index 923281660..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-BDwqGV4K.js +++ /dev/null @@ -1,24 +0,0 @@ -import{_ as w,a1 as de,F as Q,H as J,L as he,e as ue,l as K,bd as P,d as Y,b as pe,a as fe,q as me,t as ge,g as ye,s as Se,I as ve,be as xe,A as be}from"./mermaid.core-Bt2TZ_t_.js";import{s as we}from"./chunk-2J33WTMH-C5fSlY2E.js";import{p as Ce}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{p as Te}from"./wardley-L42UT6IY-7UoWEQ2c.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as Z}from"./ordinal-Cboi1Yqb.js";import"./index-C-zUV3mO.js";import"./init-Gi6I4Gst.js";function Le(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function $e(){return this.eachAfter(Le)}function Ae(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function Fe(e,a){for(var n=this,l=[n],r,o,d=-1;n=l.pop();)if(e.call(a,n,++d,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ne(e,a){for(var n=this,l=[n],r=[],o,d,h,m=-1;n=l.pop();)if(r.push(n),o=n.children)for(d=0,h=o.length;d=0;)n+=l[r].value;a.value=n})}function _e(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function ke(e){for(var a=this,n=ze(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function ze(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function De(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Pe(){return Array.from(this)}function Be(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Re(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ee(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--h)r.push(o=d[h]=new j(d[h])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(qe)}function We(){return ee(this).eachBefore(Oe)}function He(e){return e.children}function Ie(e){return Array.isArray(e)?e[1]:null}function Oe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function qe(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=ee.prototype={constructor:j,count:$e,each:Ae,eachAfter:Ne,eachBefore:Fe,find:Me,sum:Ve,sort:_e,path:ke,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function Ge(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function q(e){return function(){return e}}function Xe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ye(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(l-a)/e.value;++hM&&(M=c),V=p*p*R,N=Math.max(M/V,V/g),N>z){p-=c;break}z=N}d.push(m={value:p,dice:x1?l:1)},n})(Ue);function Ke(){var e=Je,a=!1,n=1,l=1,r=[0],o=O,d=O,h=O,m=O,c=O;function u(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Xe),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,p=s.x1-x,g=s.y1-x;p{xe(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ne(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(ne,"buildHierarchy");var Qe=w((e,a)=>{Ce(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const d=o.item;if(!d)continue;const h=o.indent?parseInt(o.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};n.push(b)}const l=ne(n),r=w((o,d)=>{for(const h of o)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(l,0)},"populate"),et=w(e=>e.name?String(e.name):"","getItemName"),le={parser:{yy:void 0},parse:w(async e=>{try{const n=await Te("treemap",e);K.debug("Treemap AST:",n);const l=le.parser?.yy;if(!(l instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(n,l)}catch(a){throw K.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,G=25,at=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),d=o.padding??tt,h=r.getDiagramTitle(),m=r.getRoot(),{themeVariables:c}=Q();if(!m)return;const u=h?30:0,b=he(a),s=o.nodeWidth?o.nodeWidth*B:960,x=o.nodeHeight?o.nodeHeight*B:500,S=s,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,o.useMaxWidth);let p;try{const t=o.valueFormat||",";if(t==="$0,0")p=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";p=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);p=w(f=>"$"+I(i||"")(f),"valueFormat")}else p=I(t)}catch(t){K.error("Error creating format function:",t),p=I(",")}const g=Z().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=Z().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),N=Z().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ee(m).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),te=Ke().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?G+B:0).paddingInner(d).paddingLeft(t=>t.children&&t.children.length>0?B:0).paddingRight(t=>t.children&&t.children.length>0?B:0).paddingBottom(t=>t.children&&t.children.length>0?B:0).round(!0)(R),re=te.descendants().filter(t=>t.children&&t.children.length>0),E=z.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);E.append("rect").attr("width",t=>t.x1-t.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),E.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",G),E.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>g(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>M(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=P({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let $;o.showValues!==!1&&t.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),o.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?p(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const se=te.leaves(),X=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);X.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("style",t=>P({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+N(t.data.name)+";",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,k=6,W=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let H=Math.max(k,Math.min(F,Math.round(y*T))),U=y+W+H;for(;U>A&&y>_&&(y--,H=Math.max(k,Math.min(F,Math.round(y*T))),!(HD||y<_||A(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+N(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(i.y1-i.y0)/2+$/2+_;f.attr("y",k);const W=i.x1-i.x0,oe=i.y1-i.y0-4,ce=W-8;f.node().getComputedTextLength()>ce||k+F>oe||F{const a=de(),n=Q(),l=J(a,n.themeVariables),r=J(rt,e),o=r.titleColor??l.titleColor,d=r.labelColor??l.textColor,h=r.valueColor??l.textColor;return` - .treemapNode.section { - stroke: ${r.sectionStrokeColor}; - stroke-width: ${r.sectionStrokeWidth}; - fill: ${r.sectionFillColor}; - } - .treemapNode.leaf { - stroke: ${r.leafStrokeColor}; - stroke-width: ${r.leafStrokeWidth}; - fill: ${r.leafFillColor}; - } - .treemapLabel { - fill: ${d}; - font-size: ${r.labelFontSize}; - } - .treemapValue { - fill: ${h}; - font-size: ${r.valueFontSize}; - } - .treemapTitle { - fill: ${o}; - font-size: ${r.titleFontSize}; - } - `},"getStyles"),it=st,yt={parser:le,get db(){return new ae},renderer:lt,styles:it};export{yt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js b/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js deleted file mode 100644 index 93677522a..000000000 --- a/apps/pythinker-code/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +++ /dev/null @@ -1,24 +0,0 @@ -import{_ as w,K as de,D as Q,F as Z,I as he,e as ue,l as J,bd as P,d as Y,b as pe,a as fe,p as me,q as ge,g as ye,s as Se,G as ve,be as xe,z as be}from"./mermaidParser.worker-Dx4jPi9z.js";import{s as we}from"./chunk-2J33WTMH-w4sdiKFO.js";import{p as Ce}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as Te}from"./wardley-L42UT6IY-BJFn8eDD.js";import{b as H}from"./defaultLocale-CCNgq9ws.js";import{o as U}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function Le(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function $e(){return this.eachAfter(Le)}function Ae(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function Fe(e,a){for(var n=this,l=[n],r,o,d=-1;n=l.pop();)if(e.call(a,n,++d,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ne(e,a){for(var n=this,l=[n],r=[],o,d,h,m=-1;n=l.pop();)if(r.push(n),o=n.children)for(d=0,h=o.length;d=0;)n+=l[r].value;a.value=n})}function _e(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function ke(e){for(var a=this,n=ze(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function ze(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function De(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Pe(){return Array.from(this)}function Be(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Re(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ee(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--h)r.push(o=d[h]=new j(d[h])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ge)}function We(){return ee(this).eachBefore(Oe)}function Ie(e){return e.children}function He(e){return Array.isArray(e)?e[1]:null}function Oe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ge(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=ee.prototype={constructor:j,count:$e,each:Ae,eachAfter:Ne,eachBefore:Fe,find:Me,sum:Ve,sort:_e,path:ke,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function qe(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Xe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ye(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(l-a)/e.value;++hM&&(M=c),V=p*p*R,N=Math.max(M/V,V/g),N>z){p-=c;break}z=N}d.push(m={value:p,dice:x1?l:1)},n})(Ke);function Je(){var e=Ze,a=!1,n=1,l=1,r=[0],o=O,d=O,h=O,m=O,c=O;function u(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Xe),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,p=s.x1-x,g=s.y1-x;p{xe(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ne(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(ne,"buildHierarchy");var Qe=w((e,a)=>{Ce(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const d=o.item;if(!d)continue;const h=o.indent?parseInt(o.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};n.push(b)}const l=ne(n),r=w((o,d)=>{for(const h of o)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(l,0)},"populate"),et=w(e=>e.name?String(e.name):"","getItemName"),le={parser:{yy:void 0},parse:w(async e=>{try{const n=await Te("treemap",e);J.debug("Treemap AST:",n);const l=le.parser?.yy;if(!(l instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(n,l)}catch(a){throw J.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,q=25,at=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),d=o.padding??tt,h=r.getDiagramTitle(),m=r.getRoot(),{themeVariables:c}=Q();if(!m)return;const u=h?30:0,b=he(a),s=o.nodeWidth?o.nodeWidth*B:960,x=o.nodeHeight?o.nodeHeight*B:500,S=s,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,o.useMaxWidth);let p;try{const t=o.valueFormat||",";if(t==="$0,0")p=w(i=>"$"+H(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";p=w(C=>"$"+H(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);p=w(f=>"$"+H(i||"")(f),"valueFormat")}else p=H(t)}catch(t){J.error("Error creating format function:",t),p=H(",")}const g=U().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=U().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),N=U().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ee(m).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),te=Je().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+B:0).paddingInner(d).paddingLeft(t=>t.children&&t.children.length>0?B:0).paddingRight(t=>t.children&&t.children.length>0?B:0).paddingBottom(t=>t.children&&t.children.length>0?B:0).round(!0)(R),re=te.descendants().filter(t=>t.children&&t.children.length>0),E=z.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);E.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),E.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),E.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>g(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>M(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=P({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let $;o.showValues!==!1&&t.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),o.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?p(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const se=te.leaves(),X=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);X.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("style",t=>P({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+N(t.data.name)+";",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,k=6,W=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(k,Math.min(F,Math.round(y*T))),K=y+W+I;for(;K>A&&y>_&&(y--,I=Math.max(k,Math.min(F,Math.round(y*T))),!(ID||y<_||A(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+N(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(i.y1-i.y0)/2+$/2+_;f.attr("y",k);const W=i.x1-i.x0,oe=i.y1-i.y0-4,ce=W-8;f.node().getComputedTextLength()>ce||k+F>oe||F{const a=de(),n=Q(),l=Z(a,n.themeVariables),r=Z(rt,e),o=r.titleColor??l.titleColor,d=r.labelColor??l.textColor,h=r.valueColor??l.textColor;return` - .treemapNode.section { - stroke: ${r.sectionStrokeColor}; - stroke-width: ${r.sectionStrokeWidth}; - fill: ${r.sectionFillColor}; - } - .treemapNode.leaf { - stroke: ${r.leafStrokeColor}; - stroke-width: ${r.leafStrokeWidth}; - fill: ${r.leafFillColor}; - } - .treemapLabel { - fill: ${d}; - font-size: ${r.labelFontSize}; - } - .treemapValue { - fill: ${h}; - font-size: ${r.valueFontSize}; - } - .treemapTitle { - fill: ${o}; - font-size: ${r.titleFontSize}; - } - `},"getStyles"),it=st,gt={parser:le,get db(){return new ae},renderer:lt,styles:it};export{gt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-B0ALSF6V.js b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-B0ALSF6V.js new file mode 100644 index 000000000..f6226238a --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-B0ALSF6V.js @@ -0,0 +1,30 @@ +import{I as X}from"./chunk-2Q5K7J3B-CTeS1k9U.js";import{p as z}from"./chunk-JWPE2WC7-CM6UswKM.js";import{p as O,b as G,s as Y,q as P,g as F,a as q,_ as g,D as N,l as A,G as Z,d as j,A as E,r as U,i as J,aj as K,E as Q,ak as ee}from"./mermaid.core-CM2luXFy.js";import{p as te}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re=" ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(` +`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),U()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:q,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(n=>{z(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),$=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;$(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;$(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram +`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=Z(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),j(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return` + .treeView-node-label { + font-size: ${t}; + fill: ${e}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; + } + .treeView-node-line { + stroke: ${r}; + } + .treeView-node-icon { + color: ${s}; + } + .treeView-node-description { + font-size: ${t}; + fill: ${i}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${o}; + stroke: ${a}; + stroke-width: 1; + } + `},"styles"),ye=Ce,Ae={db:I,renderer:be,parser:pe,styles:ye};export{Ae as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CJtzWWk1.js b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CJtzWWk1.js new file mode 100644 index 000000000..28b743fd5 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CJtzWWk1.js @@ -0,0 +1,30 @@ +import{I as X}from"./chunk-2Q5K7J3B-Fw0ursww.js";import{p as z}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{n as O,b as G,s as Y,o as P,g as F,a as Z,_ as g,A as N,l as A,D as q,d as U,y as E,p as j,i as J,ak as K,B as Q,al as ee}from"./mermaidParser.worker-DimdFOud.js";import{p as te}from"./cynefin-OW5HDTMX-CZChzy6K.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re=" ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(` +`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(n=>{z(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),$=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;$(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;$(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram +`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return` + .treeView-node-label { + font-size: ${t}; + fill: ${e}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; + } + .treeView-node-line { + stroke: ${r}; + } + .treeView-node-icon { + color: ${s}; + } + .treeView-node-description { + font-size: ${t}; + fill: ${i}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${o}; + stroke: ${a}; + stroke-width: 1; + } + `},"styles"),ye=Ce,$e={db:I,renderer:be,parser:pe,styles:ye};export{$e as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-DGT16fis.js b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-DGT16fis.js new file mode 100644 index 000000000..854462187 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-DGT16fis.js @@ -0,0 +1,41 @@ +import{p as I}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{s as _,g as E,o as D,n as F,a as P,b as z,_ as c,D as G,p as B,A as w,y as C,B as W,l as b,E as V,d as H}from"./mermaidParser.worker-DimdFOud.js";import{p as j}from"./cynefin-OW5HDTMX-CZChzy6K.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:m},x=structuredClone(A),U=W.radar,X=c(()=>w({...U,...C().radar}),"getConfig"),M=c(()=>x.axes,"getAxes"),K=c(()=>x.curves,"getCurves"),N=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule},x.options.ticks>y&&(b.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),x.options.ticks=y)},"setOptions"),Q=c(()=>{B(),x=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${it(t,e)} + `},"styles"),gt={parser:et,db:$,renderer:ot,styles:ct};export{gt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-G5T6ytbm.js b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-G5T6ytbm.js new file mode 100644 index 000000000..f6cacad34 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-G5T6ytbm.js @@ -0,0 +1,41 @@ +import{p as I}from"./chunk-JWPE2WC7-CM6UswKM.js";import{s as _,g as E,q as D,p as F,a as G,b as P,_ as c,G as z,r as B,D as w,A as C,E as W,l as b,X as V,d as H}from"./mermaid.core-CM2luXFy.js";import{p as X}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),j=W.radar,U=c(()=>w({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),q=c(()=>m.curves,"getCurves"),K=c(()=>m.options,"getOptions"),N=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:q,getOptions:K,setAxes:N,setCurves:Y,setOptions:J,getConfig:U,clear:Q,setAccTitle:P,getAccTitle:G,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${it(t,e)} + `},"styles"),xt={parser:et,db:$,renderer:ot,styles:ct};export{xt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js b/apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-CNAgJCU-.js similarity index 88% rename from apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js rename to apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-CNAgJCU-.js index dabd85654..96a3a4450 100644 --- a/apps/pythinker-code/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js +++ b/apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-CNAgJCU-.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{q as oe,p as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as D,d as ue,E as xe,z as fe,F as ge,D as M,G as he,i as y,w as P,ak as pe}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as be,i as ve}from"./wardley-L42UT6IY-BJFn8eDD.js";var T="position frame",$="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function G(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(G,"calculateEntityVisualProps");function L(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ -`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function V(e,n){const t=n,i=G(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:$,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[T]:V,[S]:J},Be={[$]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=D(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var De=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` -`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=D(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,We={parser:Ee,db:F,renderer:Te,styles:Ne};export{We as diagram}; +import{p as re}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,j as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,am as pe}from"./mermaidParser.worker-DimdFOud.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-CZChzy6K.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` +`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,We={parser:Ee,db:F,renderer:$e,styles:Ne};export{We as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-DJYRW0Gs.js b/apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-DJYRW0Gs.js new file mode 100644 index 000000000..28b9f8ed7 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-VSXAHHWV-DJYRW0Gs.js @@ -0,0 +1,3 @@ +import{p as re}from"./chunk-JWPE2WC7-CM6UswKM.js";import{q as oe,p as se,s as le,g as de,a as ce,b as me,_ as o,l as g,c as D,j as ue,B as xe,r as fe,D as ge,A as M,E as he,i as y,w as P,al as pe}from"./mermaid.core-CM2luXFy.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var T="position frame",$="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let l;K(i)?(g.debug("source frame",i.sourceFrames),l=n.frames.filter(d=>i.sourceFrames.some(c=>c.$refText===d.name)),l.forEach(d=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:d})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const l={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,l)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,l),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,l),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:$,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,l=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,l,r),m=c+d.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+d.width,a.maxHeight=Math.max(a.maxHeight,d.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:d,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[T]:V,[S]:J},Be={[$]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:de,setAccDescription:le,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=D(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,l=a.targetBox.swimlane.y+n.swimlanePadding,d=ne(r,l),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${d} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),d?(x=r,u=l+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=l);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),l=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",l).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var De=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` +`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:l}=D(),d=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(d,m.maxR,c,r)),m.boxes.forEach(te(d,c)),m.relations.forEach(ie(d,c,x,r)),d.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,d,l?.padding??30,l?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,Ue={parser:Ee,db:F,renderer:Te,styles:Ne};export{Ue as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-B6ZYWMRE.js b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-B6ZYWMRE.js new file mode 100644 index 000000000..2edc8c1a3 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-B6ZYWMRE.js @@ -0,0 +1,24 @@ +import{p as me}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{_ as w,E as ge,y as te,A as Q,D as ye,d as Se,l as ee,be as B,j as Y,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaidParser.worker-DimdFOud.js";import{s as Fe}from"./chunk-POPQ4Y6H-ClOHKyvb.js";import{p as Ne}from"./cynefin-OW5HDTMX-CZChzy6K.js";import{b as I}from"./defaultLocale-CCNgq9ws.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(Ye)}function Xe(e){return e.children}function je(e){return Array.isArray(e)?e[1]:null}function Ye(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);j.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` + .treemapNode.section { + stroke: ${r.sectionStrokeColor}; + stroke-width: ${r.sectionStrokeWidth}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${h}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${d}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),pt=dt,bt={parser:ce,get db(){return new ie},renderer:ct,styles:pt};export{bt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-C4ywS35g.js b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-C4ywS35g.js new file mode 100644 index 000000000..c9026bac8 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-C4ywS35g.js @@ -0,0 +1,24 @@ +import{p as me}from"./chunk-JWPE2WC7-CM6UswKM.js";import{_ as w,X as ge,A as te,D as Q,G as ye,d as Se,l as ee,bd as B,j as Y,b as ve,a as xe,p as be,q as we,g as Ce,s as Te,E as Le,be as $e,r as Ae}from"./mermaid.core-CM2luXFy.js";import{s as Fe}from"./chunk-POPQ4Y6H-Enw1vTgw.js";import{p as Ne}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(Ye)}function Xe(e){return e.children}function je(e){return Array.isArray(e)?e[1]:null}function Ye(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);j.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` + .treemapNode.section { + stroke: ${r.sectionStrokeColor}; + stroke-width: ${r.sectionStrokeWidth}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${h}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${d}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),pt=dt,Ct={parser:ce,get db(){return new ie},renderer:ct,styles:pt};export{Ct as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D6P8_UB8.js similarity index 68% rename from apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js rename to apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D6P8_UB8.js index 51e443ce9..20910aaa1 100644 --- a/apps/pythinker-code/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js +++ b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D6P8_UB8.js @@ -1,4 +1,4 @@ -import{_ as b,F as u,I as $,e as B,l as m,b as C,a as S,p as D,q as T,g as z,s as F,D as P,G as E,z as A}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as W}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{p as _}from"./wardley-L42UT6IY-BJFn8eDD.js";var N=E.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=z,this.setAccDescription=F}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...P().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){A(),this.packet=[]}},I=1e4,L=b((t,e)=>{W(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),L(e,r)},"parse")},Y=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())G(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),G=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:Y},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=u(j,t);return` +import{p as B}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{_ as b,A as u,D as $,d as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaidParser.worker-DimdFOud.js";import{p as _}from"./cynefin-OW5HDTMX-CZChzy6K.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -21,4 +21,4 @@ import{_ as b,F as u,I as $,e as B,l as m,b as C,a as S,p as D,q as T,g as z,s a stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),U={parser:v,get db(){return new w},renderer:O,styles:q};export{U as diagram}; + `},"styles"),X={parser:v,get db(){return new w},renderer:j,styles:H};export{X as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D_WNFbDS.js b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D_WNFbDS.js new file mode 100644 index 000000000..42752cb9c --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-D_WNFbDS.js @@ -0,0 +1,24 @@ +import{p as $}from"./chunk-JWPE2WC7-CM6UswKM.js";import{_ as b,D as u,G as B,d as C,l as m,b as S,a as D,p as T,q as E,g as P,s as z,A,E as F,r as W}from"./mermaid.core-CM2luXFy.js";import{p as _}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=E,this.getAccDescription=P,this.setAccDescription=z}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{$(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},G=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=B(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())I(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:G},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=u(j,t);return` + .packetByte { + font-size: ${e.byteFontSize}; + } + .packetByte.start { + fill: ${e.startByteColor}; + } + .packetByte.end { + fill: ${e.endByteColor}; + } + .packetLabel { + fill: ${e.labelColor}; + font-size: ${e.labelFontSize}; + } + .packetTitle { + fill: ${e.titleColor}; + font-size: ${e.titleFontSize}; + } + .packetBlock { + stroke: ${e.blockStrokeColor}; + stroke-width: ${e.blockStrokeWidth}; + fill: ${e.blockFillColor}; + } + `},"styles"),J={parser:v,get db(){return new w},renderer:O,styles:q};export{J as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Bk08WD3m.js b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Bk08WD3m.js new file mode 100644 index 000000000..cd821ee59 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Bk08WD3m.js @@ -0,0 +1 @@ +import{g as l,r as m,d as n}from"./chunk-SVP7TREG-Ch8YtWzR.js";import{p}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{_ as t,l as o}from"./mermaidParser.worker-DimdFOud.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-CZChzy6K.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Dd5PiLFs.js b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Dd5PiLFs.js new file mode 100644 index 000000000..1d8d6b3fd --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Dd5PiLFs.js @@ -0,0 +1 @@ +import{g as l,r as m,d as n}from"./chunk-SVP7TREG-B7jXwGMz.js";import{p}from"./chunk-JWPE2WC7-CM6UswKM.js";import{_ as t,l as o}from"./mermaid.core-CM2luXFy.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/editor.main-PjnZnl8g.js b/apps/pythinker-code/dist-web/assets/editor.main-CYqrlDj5.js similarity index 52% rename from apps/pythinker-code/dist-web/assets/editor.main-PjnZnl8g.js rename to apps/pythinker-code/dist-web/assets/editor.main-CYqrlDj5.js index 7048dae86..5ed0955bb 100644 --- a/apps/pythinker-code/dist-web/assets/editor.main-PjnZnl8g.js +++ b/apps/pythinker-code/dist-web/assets/editor.main-CYqrlDj5.js @@ -1,17 +1,17 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cssMode-9bWh8C7-.js","assets/lspLanguageFeatures-BqLYp7da.js","assets/index-C-zUV3mO.js","assets/index-qbGiRbdE.css","assets/htmlMode-DzKTVOy0.js","assets/jsonMode-BWwbZhu8.js","assets/tsMode-D0gNUxS2.js","assets/freemarker2-C_dr9LiI.js","assets/handlebars-C3vjJ5wA.js","assets/html-BG3YQOlK.js","assets/javascript-Dkp43T8T.js","assets/typescript-DPgjF7mr.js","assets/liquid-C_k_bMvD.js","assets/mdx-B0qq4UAz.js","assets/python-BQPyZP7x.js","assets/razor-CW3YV4Fr.js","assets/xml-DnfXpm1w.js","assets/yaml-C7wg11Lz.js"])))=>i.map(i=>d[i]); -import{bR as Se}from"./index-C-zUV3mO.js";function eU(){return globalThis._VSCODE_NLS_MESSAGES}function KO(){return globalThis._VSCODE_NLS_LANGUAGE}const kJ=KO()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function ly(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),kJ&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(o,e,...t){return ly(typeof o=="number"?tU(o,e):e,t)}function tU(o,e){const t=eU()?.[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function H(o,e,...t){let i;typeof o=="number"?i=tU(o,e):i=e;const n=ly(i,t);return{value:n,original:e===i?n:ly(e,t)}}function IJ(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const kt=window;class GO{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new GO}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function iU(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function $N(o){return GO.INSTANCE.getZoomFactor(o)}const k_=navigator.userAgent,so=k_.indexOf("Firefox")>=0,tD=k_.indexOf("AppleWebKit")>=0,zw=k_.indexOf("Chrome")>=0,Ug=!zw&&k_.indexOf("Safari")>=0,nU=!zw&&!Ug&&tD;k_.indexOf("Electron/")>=0;const i7=k_.indexOf("Android")>=0;let wI=!1;if(typeof kt.matchMedia=="function"){const o=kt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=kt.matchMedia("(display-mode: fullscreen)");wI=o.matches,iU(kt,o,({matches:t})=>{wI&&e.matches||(wI=t)})}function ZO(){return globalThis.MonacoEnvironment}class EJ{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Hm.isErrorNoTelemetry(e)?new Hm(e.message+` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cssMode-k4cBIe4o.js","assets/lspLanguageFeatures-CQG5isp7.js","assets/index-rMXX6Fbt.js","assets/index-qbGiRbdE.css","assets/purify.es-5AjVNlXF.js","assets/htmlMode-B2JxHnrC.js","assets/jsonMode-1xqDoFsh.js","assets/tsMode-D10OTffV.js","assets/freemarker2-C0l6anS_.js","assets/handlebars-CrwlbXzI.js","assets/html-Clnn5ww4.js","assets/javascript-CO6b1bN1.js","assets/typescript-BF2N5gRo.js","assets/liquid-BL1JohJf.js","assets/mdx-BtwBPXgy.js","assets/python-Cg60ZTQb.js","assets/razor-B77IdrOm.js","assets/xml-CKVlGCVv.js","assets/yaml-D9hqJrzJ.js"])))=>i.map(i=>d[i]); +import{bR as we}from"./index-rMXX6Fbt.js";import{p as Gf}from"./purify.es-5AjVNlXF.js";function pV(){return globalThis._VSCODE_NLS_MESSAGES}function AA(){return globalThis._VSCODE_NLS_LANGUAGE}const TX=AA()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function g0(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),TX&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(o,e,...t){return g0(typeof o=="number"?mV(o,e):e,t)}function mV(o,e){const t=pV()?.[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function H(o,e,...t){let i;typeof o=="number"?i=mV(o,e):i=e;const n=g0(i,t);return{value:n,original:e===i?n:g0(e,t)}}function RX(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const wt=window;class OA{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new OA}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function _V(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function PE(o){return OA.INSTANCE.getZoomFactor(o)}const Xm=navigator.userAgent,Ks=Xm.indexOf("Firefox")>=0,rL=Xm.indexOf("AppleWebKit")>=0,sw=Xm.indexOf("Chrome")>=0,vg=!sw&&Xm.indexOf("Safari")>=0,bV=!sw&&!vg&&rL;Xm.indexOf("Electron/")>=0;const L3=Xm.indexOf("Android")>=0;let _D=!1;if(typeof wt.matchMedia=="function"){const o=wt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=wt.matchMedia("(display-mode: fullscreen)");_D=o.matches,_V(wt,o,({matches:t})=>{_D&&e.matches||(_D=t)})}function FA(){return globalThis.MonacoEnvironment}class MX{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dm.isErrorNoTelemetry(e)?new dm(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const YO=new EJ;function cy(o){YO.onUnexpectedError(o)}function Te(o){hr(o)||YO.onUnexpectedError(o)}function Bi(o){hr(o)||YO.onUnexpectedExternalError(o)}function jN(o){if(o instanceof Error){const{name:e,message:t,cause:i}=o,n=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:Hm.isErrorNoTelemetry(o),cause:i?jN(i):void 0,code:o.code}}return o}const dy="Canceled";function hr(o){return o instanceof Ar?!0:o instanceof Error&&o.name===dy&&o.message===dy}class Ar extends Error{constructor(){super(dy),this.name=this.message}}function NJ(){const o=new Error(dy);return o.name=o.message,o}function Rr(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function hy(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class TJ extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Hm extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Hm)return e;const t=new Hm;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class ve extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ve.prototype)}}function SI(o,e){if(!o)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Uw(o,e="Unreachable"){throw new Error(e)}function nv(o,e="unexpected state"){if(!o)throw typeof e=="string"?new ve(`Assertion Failed: ${e}`):e}function n7(o,e="Soft Assertion Failed"){o||Te(new ve(e))}function Wh(o){if(!o()){debugger;o(),Te(new ve("Assertion Failed"))}}function $w(o,e){let t=0;for(;t"u"}function Cn(o){return!Sr(o)}function Sr(o){return ss(o)||o===null}function rt(o,e){if(!o)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function dh(o){return nv(o!=null,"Argument is `undefined` or `null`."),o}function $g(o){return typeof o=="function"}function PJ(o,e){const t=Math.min(o.length,e.length);for(let i=0;i=0,ov=xc.indexOf("Macintosh")>=0,QO=(xc.indexOf("Macintosh")>=0||xc.indexOf("iPad")>=0||xc.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,aC=xc.indexOf("Linux")>=0,oU=xc?.indexOf("Mobi")>=0,XO=!0,b0=KO()||ag,$1=navigator.language.toLowerCase(),s7=$1):console.error("Unable to resolve platform.");let C0=0;ov?C0=1:sv?C0=3:aC&&(C0=2);const Rn=sv,je=ov,oo=aC,Za=sU,ic=XO,BJ=XO&&typeof id.importScripts=="function",HJ=BJ?id.origin:void 0,Or=QO,rU=oU,yI=C0,jl=xc,VJ=b0,zJ=typeof id.postMessage=="function"&&!id.importScripts,jw=(()=>{if(zJ){const o=[];id.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i{const i=++e;o.push({id:i,callback:t}),id.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),wo=ov||QO?2:sv?1:3;let o7=!0,r7=!1;function aU(){if(!r7){r7=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,o7=new Uint16Array(o.buffer)[0]===513}return o7}const JO=!!(jl&&jl.indexOf("Chrome")>=0),UJ=!!(jl&&jl.indexOf("Firefox")>=0),$J=!!(!JO&&jl&&jl.indexOf("Safari")>=0),lU=!!(jl&&jl.indexOf("Edg/")>=0),jJ=!!(jl&&jl.indexOf("Android")>=0),qw={clipboard:{writeText:Za||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Za||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:kt.PointerEvent&&("ontouchstart"in kt||navigator.maxTouchPoints>0)};class e4{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const v0=new e4,GN=new e4,ZN=new e4,cU=new Array(230),qJ=Object.create(null),KJ=Object.create(null),t4=[];for(let o=0;o<=193;o++)t4[o]=-1;(function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],i=[];for(const n of e){const[s,r,a,l,c,d,h,u,g]=n;if(i[r]||(i[r]=!0,qJ[a]=r,KJ[a.toLowerCase()]=r,s&&(t4[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);v0.define(l,c),GN.define(l,u||c),ZN.define(l,g||u||c)}d&&(cU[d]=l)}})();var Vc;(function(o){function e(a){return v0.keyCodeToStr(a)}o.toString=e;function t(a){return v0.strToKeyCode(a)}o.fromString=t;function i(a){return GN.keyCodeToStr(a)}o.toUserSettingsUS=i;function n(a){return ZN.keyCodeToStr(a)}o.toUserSettingsGeneral=n;function s(a){return GN.strToKeyCode(a)||ZN.strToKeyCode(a)}o.fromUserSettings=s;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return v0.keyCodeToStr(a)}o.toElectronAccelerator=r})(Vc||(Vc={}));function Hi(o,e){const t=(e&65535)<<16>>>0;return(o|t)>>>0}function YN(o,e){if(typeof o=="number"){if(o===0)return null;const t=(o&65535)>>>0,i=(o&4294901760)>>>16;return i!==0?new LI([j1(t,e),j1(i,e)]):new LI([j1(t,e)])}else{const t=[];for(let i=0;i=0;k--)yield x[k]}o.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}o.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}o.first=c;function d(x,k){let I=0;for(const T of x)if(k(T,I++))return!0;return!1}o.some=d;function h(x,k){let I=0;for(const T of x)if(!k(T,I++))return!1;return!0}o.every=h;function u(x,k){for(const I of x)if(k(I))return I}o.find=u;function*g(x,k){for(const I of x)k(I)&&(yield I)}o.filter=g;function*f(x,k){let I=0;for(const T of x)yield k(T,I++)}o.map=f;function*p(x,k){let I=0;for(const T of x)yield*k(T,I++)}o.flatMap=p;function*_(...x){for(const k of x)qN(k)?yield*k:yield k}o.concat=_;function b(x,k,I){let T=I;for(const A of x)T=k(T,A);return T}o.reduce=b;function C(x){let k=0;for(const I of x)k++;return k}o.length=C;function*w(x,k,I=x.length){for(k<-x.length&&(k=0),k<0&&(k+=x.length),I<0?I+=x.length:I>x.length&&(I=x.length);k1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function da(...o){return ge(()=>vt(o))}class nee{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function ge(o){return new nee(o)}let z=class dU{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{vt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===F.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?dU.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}},F=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new z,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};class _t{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class see{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class oee{constructor(e){this.object=e}dispose(){}}class iD{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{vt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let sn=class w0{static{this.Undefined=new w0(void 0)}constructor(e){this.element=e,this.next=w0.Undefined,this.prev=w0.Undefined}};class bs{constructor(){this._first=sn.Undefined,this._last=sn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===sn.Undefined}clear(){let e=this._first;for(;e!==sn.Undefined;){const t=e.next;e.prev=sn.Undefined,e.next=sn.Undefined,e=t}this._first=sn.Undefined,this._last=sn.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new sn(e);if(this._first===sn.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==sn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==sn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==sn.Undefined&&e.next!==sn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===sn.Undefined&&e.next===sn.Undefined?(this._first=sn.Undefined,this._last=sn.Undefined):e.next===sn.Undefined?(this._last=this._last.prev,this._last.next=sn.Undefined):e.prev===sn.Undefined&&(this._first=this._first.next,this._first.prev=sn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==sn.Undefined;)yield e.element,e=e.next}}const ree=globalThis.performance.now.bind(globalThis.performance);class fn{static create(e){return new fn(e)}constructor(e){this._now=e===!1?Date.now:ree,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var se;(function(o){o.None=()=>F.None;function e(O,W){return u(O,()=>{},0,void 0,!0,void 0,W)}o.defer=e;function t(O){return(W,U=null,q)=>{let ie=!1,Q;return Q=O(ne=>{if(!ie)return Q?Q.dispose():ie=!0,W.call(U,ne)},null,q),ie&&Q.dispose(),Q}}o.once=t;function i(O,W){return o.once(o.filter(O,W))}o.onceIf=i;function n(O,W,U){return d((q,ie=null,Q)=>O(ne=>q.call(ie,W(ne)),null,Q),U)}o.map=n;function s(O,W,U){return d((q,ie=null,Q)=>O(ne=>{W(ne),q.call(ie,ne)},null,Q),U)}o.forEach=s;function r(O,W,U){return d((q,ie=null,Q)=>O(ne=>W(ne)&&q.call(ie,ne),null,Q),U)}o.filter=r;function a(O){return O}o.signal=a;function l(...O){return(W,U=null,q)=>{const ie=da(...O.map(Q=>Q(ne=>W.call(U,ne))));return h(ie,q)}}o.any=l;function c(O,W,U,q){let ie=U;return n(O,Q=>(ie=W(ie,Q),ie),q)}o.reduce=c;function d(O,W){let U;const q={onWillAddFirstListener(){U=O(ie.fire,ie)},onDidRemoveLastListener(){U?.dispose()}},ie=new P(q);return W?.add(ie),ie.event}function h(O,W){return W instanceof Array?W.push(O):W&&W.add(O),O}function u(O,W,U=100,q=!1,ie=!1,Q,ne){let ce,De,We,st=0,Ye;const Ft={leakWarningThreshold:Q,onWillAddFirstListener(){ce=O(nn=>{st++,De=W(De,nn),q&&!We&&(yt.fire(De),De=void 0),Ye=()=>{const Pi=De;De=void 0,We=void 0,(!q||st>1)&&yt.fire(Pi),st=0},typeof U=="number"?(We&&clearTimeout(We),We=setTimeout(Ye,U)):We===void 0&&(We=null,queueMicrotask(Ye))})},onWillRemoveListener(){ie&&st>0&&Ye?.()},onDidRemoveLastListener(){Ye=void 0,ce.dispose()}},yt=new P(Ft);return ne?.add(yt),yt.event}o.debounce=u;function g(O,W=0,U){return o.debounce(O,(q,ie)=>q?(q.push(ie),q):[ie],W,void 0,!0,void 0,U)}o.accumulate=g;function f(O,W=(q,ie)=>q===ie,U){let q=!0,ie;return r(O,Q=>{const ne=q||!W(Q,ie);return q=!1,ie=Q,ne},U)}o.latch=f;function p(O,W,U){return[o.filter(O,W,U),o.filter(O,q=>!W(q),U)]}o.split=p;function _(O,W=!1,U=[],q){let ie=U.slice(),Q=O(De=>{ie?ie.push(De):ce.fire(De)});q&&q.add(Q);const ne=()=>{ie?.forEach(De=>ce.fire(De)),ie=null},ce=new P({onWillAddFirstListener(){Q||(Q=O(De=>ce.fire(De)),q&&q.add(Q))},onDidAddFirstListener(){ie&&(W?setTimeout(ne):ne())},onDidRemoveLastListener(){Q&&Q.dispose(),Q=null}});return q&&q.add(ce),ce.event}o.buffer=_;function b(O,W){return(q,ie,Q)=>{const ne=W(new w);return O(function(ce){const De=ne.evaluate(ce);De!==C&&q.call(ie,De)},void 0,Q)}}o.chain=b;const C=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(U=>(W(U),U)),this}filter(W){return this.steps.push(U=>W(U)?U:C),this}reduce(W,U){let q=U;return this.steps.push(ie=>(q=W(q,ie),q)),this}latch(W=(U,q)=>U===q){let U=!0,q;return this.steps.push(ie=>{const Q=U||!W(ie,q);return U=!1,q=ie,Q?ie:C}),this}evaluate(W){for(const U of this.steps)if(W=U(W),W===C)break;return W}}function v(O,W,U=q=>q){const q=(...ce)=>ne.fire(U(...ce)),ie=()=>O.on(W,q),Q=()=>O.removeListener(W,q),ne=new P({onWillAddFirstListener:ie,onDidRemoveLastListener:Q});return ne.event}o.fromNodeEventEmitter=v;function S(O,W,U=q=>q){const q=(...ce)=>ne.fire(U(...ce)),ie=()=>O.addEventListener(W,q),Q=()=>O.removeEventListener(W,q),ne=new P({onWillAddFirstListener:ie,onDidRemoveLastListener:Q});return ne.event}o.fromDOMEventEmitter=S;function L(O,W){let U;const q=new Promise((ie,Q)=>{const ne=t(O)(ie,null,W);U=()=>ne.dispose()});return q.cancel=U,q}o.toPromise=L;function x(O,W){return O(U=>W.fire(U))}o.forward=x;function k(O,W,U){return W(U),O(q=>W(q))}o.runAndSubscribe=k;class I{constructor(W,U){this._observable=W,this._counter=0,this._hasChanged=!1;const q={onWillAddFirstListener:()=>{W.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new P(q),U&&U.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,U){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(O,W){return new I(O,W).emitter.event}o.fromObservable=T;function A(O){return(W,U,q)=>{let ie=0,Q=!1;const ne={beginUpdate(){ie++},endUpdate(){ie--,ie===0&&(O.reportChanges(),Q&&(Q=!1,W.call(U)))},handlePossibleChange(){},handleChange(){Q=!0}};O.addObserver(ne),O.reportChanges();const ce={dispose(){O.removeObserver(ne)}};return q instanceof z?q.add(ce):Array.isArray(q)&&q.push(ce),ce}}o.fromObservableLight=A})(se||(se={}));class uy{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${uy._idPool++}`,uy.all.add(this)}start(e){this._stopWatch=new fn,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}let aee=-1;class i4{static{this._idPool=1}constructor(e,t,i=(i4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,n]of this._stacks)(!e||t{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const WA=new MX;function f0(o){WA.onUnexpectedError(o)}function Ee(o){Xo(o)||WA.onUnexpectedError(o)}function Ri(o){Xo(o)||WA.onUnexpectedExternalError(o)}function AE(o){if(o instanceof Error){const{name:e,message:t,cause:i}=o,n=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:dm.isErrorNoTelemetry(o),cause:i?AE(i):void 0,code:o.code}}return o}const p0="Canceled";function Xo(o){return o instanceof wr?!0:o instanceof Error&&o.name===p0&&o.message===p0}class wr extends Error{constructor(){super(p0),this.name=this.message}}function PX(){const o=new Error(p0);return o.name=o.message,o}function br(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function m0(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class AX extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class dm extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof dm)return e;const t=new dm;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ce extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ce.prototype)}}function bD(o,e){if(!o)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function ow(o,e="Unreachable"){throw new Error(e)}function CC(o,e="unexpected state"){if(!o)throw typeof e=="string"?new Ce(`Assertion Failed: ${e}`):e}function k3(o,e="Soft Assertion Failed"){o||Ee(new Ce(e))}function _h(o){if(!o()){debugger;o(),Ee(new Ce("Assertion Failed"))}}function rw(o,e){let t=0;for(;t"u"}function hn(o){return!lr(o)}function lr(o){return Yn(o)||o===null}function Je(o,e){if(!o)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Ud(o){return CC(o!=null,"Argument is `undefined` or `null`."),o}function wg(o){return typeof o=="function"}function WX(o,e){const t=Math.min(o.length,e.length);for(let i=0;i=0,wC=oc.indexOf("Macintosh")>=0,HA=(oc.indexOf("Macintosh")>=0||oc.indexOf("iPad")>=0||oc.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,yb=oc.indexOf("Linux")>=0,vV=oc?.indexOf("Mobi")>=0,BA=!0,xS=AA()||Wu,Qw=navigator.language.toLowerCase(),D3=Qw):console.error("Unable to resolve platform.");let LS=0;wC?LS=1:vC?LS=3:yb&&(LS=2);const Ln=vC,ze=wC,Gs=yb,Ma=CV,Bl=BA,UX=BA&&typeof Ac.importScripts=="function",$X=UX?Ac.origin:void 0,Sr=HA,wV=vV,CD=LS,Il=oc,jX=xS,qX=typeof Ac.postMessage=="function"&&!Ac.importScripts,aw=(()=>{if(qX){const o=[];Ac.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=o.length;i{const i=++e;o.push({id:i,callback:t}),Ac.postMessage({vscodeScheduleAsyncWork:i},"*")}}return o=>setTimeout(o)})(),lo=wC||HA?2:vC?1:3;let I3=!0,E3=!1;function SV(){if(!E3){E3=!0;const o=new Uint8Array(2);o[0]=1,o[1]=2,I3=new Uint16Array(o.buffer)[0]===513}return I3}const VA=!!(Il&&Il.indexOf("Chrome")>=0),KX=!!(Il&&Il.indexOf("Firefox")>=0),GX=!!(!VA&&Il&&Il.indexOf("Safari")>=0),yV=!!(Il&&Il.indexOf("Edg/")>=0),ZX=!!(Il&&Il.indexOf("Android")>=0),lw={clipboard:{writeText:Ma||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Ma||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:wt.PointerEvent&&("ontouchstart"in wt||navigator.maxTouchPoints>0)};class zA{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const kS=new zA,WE=new zA,BE=new zA,xV=new Array(230),YX=Object.create(null),XX=Object.create(null),UA=[];for(let o=0;o<=193;o++)UA[o]=-1;(function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],i=[];for(const n of e){const[s,r,a,l,c,d,h,u,g]=n;if(i[r]||(i[r]=!0,YX[a]=r,XX[a.toLowerCase()]=r,s&&(UA[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);kS.define(l,c),WE.define(l,u||c),BE.define(l,g||u||c)}d&&(xV[d]=l)}})();var vc;(function(o){function e(a){return kS.keyCodeToStr(a)}o.toString=e;function t(a){return kS.strToKeyCode(a)}o.fromString=t;function i(a){return WE.keyCodeToStr(a)}o.toUserSettingsUS=i;function n(a){return BE.keyCodeToStr(a)}o.toUserSettingsGeneral=n;function s(a){return WE.strToKeyCode(a)||BE.strToKeyCode(a)}o.fromUserSettings=s;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return kS.keyCodeToStr(a)}o.toElectronAccelerator=r})(vc||(vc={}));function Mi(o,e){const t=(e&65535)<<16>>>0;return(o|t)>>>0}function HE(o,e){if(typeof o=="number"){if(o===0)return null;const t=(o&65535)>>>0,i=(o&4294901760)>>>16;return i!==0?new vD([Jw(t,e),Jw(i,e)]):new vD([Jw(t,e)])}else{const t=[];for(let i=0;i=0;D--)yield k[D]}o.reverse=a;function l(k){return!k||k[Symbol.iterator]().next().done===!0}o.isEmpty=l;function c(k){return k[Symbol.iterator]().next().value}o.first=c;function d(k,D){let I=0;for(const T of k)if(D(T,I++))return!0;return!1}o.some=d;function h(k,D){let I=0;for(const T of k)if(!D(T,I++))return!1;return!0}o.every=h;function u(k,D){for(const I of k)if(D(I))return I}o.find=u;function*g(k,D){for(const I of k)D(I)&&(yield I)}o.filter=g;function*f(k,D){let I=0;for(const T of k)yield D(T,I++)}o.map=f;function*p(k,D){let I=0;for(const T of k)yield*D(T,I++)}o.flatMap=p;function*_(...k){for(const D of k)OE(D)?yield*D:yield D}o.concat=_;function b(k,D,I){let T=I;for(const F of k)T=D(T,F);return T}o.reduce=b;function C(k){let D=0;for(const I of k)D++;return D}o.length=C;function*w(k,D,I=k.length){for(D<-k.length&&(D=0),D<0&&(D+=k.length),I<0?I+=k.length:I>k.length&&(I=k.length);D1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function Yr(...o){return ue(()=>pt(o))}class aQ{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function ue(o){return new aQ(o)}let z=class LV{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{pt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===A.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?LV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}},A=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new z,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};class ut{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class lQ{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class cQ{constructor(e){this.object=e}dispose(){}}class aL{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{pt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let Zi=class DS{static{this.Undefined=new DS(void 0)}constructor(e){this.element=e,this.next=DS.Undefined,this.prev=DS.Undefined}};class cs{constructor(){this._first=Zi.Undefined,this._last=Zi.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Zi.Undefined}clear(){let e=this._first;for(;e!==Zi.Undefined;){const t=e.next;e.prev=Zi.Undefined,e.next=Zi.Undefined,e=t}this._first=Zi.Undefined,this._last=Zi.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Zi(e);if(this._first===Zi.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Zi.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Zi.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Zi.Undefined&&e.next!==Zi.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Zi.Undefined&&e.next===Zi.Undefined?(this._first=Zi.Undefined,this._last=Zi.Undefined):e.next===Zi.Undefined?(this._last=this._last.prev,this._last.next=Zi.Undefined):e.prev===Zi.Undefined&&(this._first=this._first.next,this._first.prev=Zi.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Zi.Undefined;)yield e.element,e=e.next}}const dQ=globalThis.performance.now.bind(globalThis.performance);class rn{static create(e){return new rn(e)}constructor(e){this._now=e===!1?Date.now:dQ,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var te;(function(o){o.None=()=>A.None;function e(O,B){return u(O,()=>{},0,void 0,!0,void 0,B)}o.defer=e;function t(O){return(B,U=null,K)=>{let ie=!1,X;return X=O(ne=>{if(!ie)return X?X.dispose():ie=!0,B.call(U,ne)},null,K),ie&&X.dispose(),X}}o.once=t;function i(O,B){return o.once(o.filter(O,B))}o.onceIf=i;function n(O,B,U){return d((K,ie=null,X)=>O(ne=>K.call(ie,B(ne)),null,X),U)}o.map=n;function s(O,B,U){return d((K,ie=null,X)=>O(ne=>{B(ne),K.call(ie,ne)},null,X),U)}o.forEach=s;function r(O,B,U){return d((K,ie=null,X)=>O(ne=>B(ne)&&K.call(ie,ne),null,X),U)}o.filter=r;function a(O){return O}o.signal=a;function l(...O){return(B,U=null,K)=>{const ie=Yr(...O.map(X=>X(ne=>B.call(U,ne))));return h(ie,K)}}o.any=l;function c(O,B,U,K){let ie=U;return n(O,X=>(ie=B(ie,X),ie),K)}o.reduce=c;function d(O,B){let U;const K={onWillAddFirstListener(){U=O(ie.fire,ie)},onDidRemoveLastListener(){U?.dispose()}},ie=new P(K);return B?.add(ie),ie.event}function h(O,B){return B instanceof Array?B.push(O):B&&B.add(O),O}function u(O,B,U=100,K=!1,ie=!1,X,ne){let ce,ke,it,ot=0,Lt;const Zt={leakWarningThreshold:X,onWillAddFirstListener(){ce=O(ms=>{ot++,ke=B(ke,ms),K&&!it&&(mn.fire(ke),ke=void 0),Lt=()=>{const Gi=ke;ke=void 0,it=void 0,(!K||ot>1)&&mn.fire(Gi),ot=0},typeof U=="number"?(it&&clearTimeout(it),it=setTimeout(Lt,U)):it===void 0&&(it=null,queueMicrotask(Lt))})},onWillRemoveListener(){ie&&ot>0&&Lt?.()},onDidRemoveLastListener(){Lt=void 0,ce.dispose()}},mn=new P(Zt);return ne?.add(mn),mn.event}o.debounce=u;function g(O,B=0,U){return o.debounce(O,(K,ie)=>K?(K.push(ie),K):[ie],B,void 0,!0,void 0,U)}o.accumulate=g;function f(O,B=(K,ie)=>K===ie,U){let K=!0,ie;return r(O,X=>{const ne=K||!B(X,ie);return K=!1,ie=X,ne},U)}o.latch=f;function p(O,B,U){return[o.filter(O,B,U),o.filter(O,K=>!B(K),U)]}o.split=p;function _(O,B=!1,U=[],K){let ie=U.slice(),X=O(ke=>{ie?ie.push(ke):ce.fire(ke)});K&&K.add(X);const ne=()=>{ie?.forEach(ke=>ce.fire(ke)),ie=null},ce=new P({onWillAddFirstListener(){X||(X=O(ke=>ce.fire(ke)),K&&K.add(X))},onDidAddFirstListener(){ie&&(B?setTimeout(ne):ne())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return K&&K.add(ce),ce.event}o.buffer=_;function b(O,B){return(K,ie,X)=>{const ne=B(new w);return O(function(ce){const ke=ne.evaluate(ce);ke!==C&&K.call(ie,ke)},void 0,X)}}o.chain=b;const C=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(U=>(B(U),U)),this}filter(B){return this.steps.push(U=>B(U)?U:C),this}reduce(B,U){let K=U;return this.steps.push(ie=>(K=B(K,ie),K)),this}latch(B=(U,K)=>U===K){let U=!0,K;return this.steps.push(ie=>{const X=U||!B(ie,K);return U=!1,K=ie,X?ie:C}),this}evaluate(B){for(const U of this.steps)if(B=U(B),B===C)break;return B}}function v(O,B,U=K=>K){const K=(...ce)=>ne.fire(U(...ce)),ie=()=>O.on(B,K),X=()=>O.removeListener(B,K),ne=new P({onWillAddFirstListener:ie,onDidRemoveLastListener:X});return ne.event}o.fromNodeEventEmitter=v;function S(O,B,U=K=>K){const K=(...ce)=>ne.fire(U(...ce)),ie=()=>O.addEventListener(B,K),X=()=>O.removeEventListener(B,K),ne=new P({onWillAddFirstListener:ie,onDidRemoveLastListener:X});return ne.event}o.fromDOMEventEmitter=S;function x(O,B){let U;const K=new Promise((ie,X)=>{const ne=t(O)(ie,null,B);U=()=>ne.dispose()});return K.cancel=U,K}o.toPromise=x;function k(O,B){return O(U=>B.fire(U))}o.forward=k;function D(O,B,U){return B(U),O(K=>B(K))}o.runAndSubscribe=D;class I{constructor(B,U){this._observable=B,this._counter=0,this._hasChanged=!1;const K={onWillAddFirstListener:()=>{B.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new P(K),U&&U.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,U){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(O,B){return new I(O,B).emitter.event}o.fromObservable=T;function F(O){return(B,U,K)=>{let ie=0,X=!1;const ne={beginUpdate(){ie++},endUpdate(){ie--,ie===0&&(O.reportChanges(),X&&(X=!1,B.call(U)))},handlePossibleChange(){},handleChange(){X=!0}};O.addObserver(ne),O.reportChanges();const ce={dispose(){O.removeObserver(ne)}};return K instanceof z?K.add(ce):Array.isArray(K)&&K.push(ce),ce}}o.fromObservableLight=F})(te||(te={}));class _0{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${_0._idPool++}`,_0.all.add(this)}start(e){this._stopWatch=new rn,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}let hQ=-1;class $A{static{this._idPool=1}constructor(e,t,i=($A._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,n]of this._stacks)(!e||t{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new cee(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Te)(c),F.None}if(this._disposed)return F.None;t&&(e=e.bind(t));const n=new xI(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=n4.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof xI?(this._deliveryQueue??=new hU,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const r=ge(()=>{s?.(),this._removeListener(n)});return i instanceof z?i.add(r):Array.isArray(i)&&i.push(r),r},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(this._size*dee<=t.length){let s=0;for(let r=0;r0}};const hee=()=>new hU;class hU{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Kg extends P{constructor(e){super(e),this._isPaused=0,this._eventQueue=new bs,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class uU extends Kg{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class uee extends P{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class gee{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new P({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),ge(qg(()=>{this.hasListeners&&this.unhook(t);const n=this.events.indexOf(t);this.events.splice(n,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}}class Kw{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,s,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>n.call(s,a)):n.call(s,a);return}const c=l;if(!c){n.call(s,t(i,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=i?c.items.reduce(t,i):c.items.reduce(t),n.call(s,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(n=>n()),i}}class sb{constructor(){this.listening=!1,this.inputEvent=se.None,this.inputEventListener=F.None,this.emitter=new P({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const gU=Object.freeze(function(o,e){const t=setTimeout(o.bind(e),0);return{dispose(){clearTimeout(t)}}});var $e;(function(o){function e(t){return t===o.None||t===o.Cancelled||t instanceof S0?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}o.isCancellationToken=e,o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:se.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gU})})($e||($e={}));class S0{constructor(){this._isCancelled=!1,this._emitter=null}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?gU:(this._emitter||(this._emitter=new P),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Jt=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new S0),this._token}cancel(){this._token?this._token instanceof S0&&this._token.cancel():this._token=$e.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof S0&&this._token.dispose():this._token=$e.None}};function XN(o){const e=new Jt;return o.add({dispose(){e.cancel()}}),e.token}const fU=Symbol("MicrotaskDelay");function QN(o){return!!o&&typeof o.then=="function"}function Qi(o){const e=new Jt,t=o(e.token);let i=!1;const n=new Promise((s,r)=>{const a=e.token.onCancellationRequested(()=>{i=!0,a.dispose(),r(new Ar)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),i?Lf(l)&&l.dispose():s(l)},l=>{a.dispose(),e.dispose(),r(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,r){return n.then(s,r)}catch(s){return this.then(void 0,s)}finally(s){return n.finally(s)}}}function Vm(o,e,t){return new Promise((i,n)=>{const s=e.onCancellationRequested(()=>{s.dispose(),i(t)});o.then(i,n).finally(()=>s.dispose())})}function fee(o,e){return new Promise((t,i)=>{const n=e.onCancellationRequested(()=>{n.dispose(),i(new Ar)});o.then(t,i).finally(()=>n.dispose())})}let pee=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new Jt}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((t,i)=>{this.activePromise.then(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.cancellationTokenSource.cancel()}};const mee=(o,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},o);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},_ee=o=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,o())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Fr{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((n,s)=>{this.doResolve=n,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===fU?_ee(i):mee(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Ar),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}class pU{constructor(e){this.delayer=new Fr(e),this.throttler=new pee}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function ql(o,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{s.dispose(),t()},o),s=e.onCancellationRequested(()=>{clearTimeout(n),s.dispose(),i(new Ar)})}):Qi(t=>ql(o,t))}function pd(o,e=0,t){const i=setTimeout(()=>{o(),t&&n.dispose()},e),n=ge(()=>{clearTimeout(i),t?.delete(n)});return t?.add(n),n}function s4(o,e=i=>!!i,t=null){let i=0;const n=o.length,s=()=>{if(i>=n)return Promise.resolve(t);const r=o[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):s())};return s()}let bee=class{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new xf;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new ve;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new Ar)}};class Io{constructor(e,t){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new ve("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ve("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}}class o4{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new ve("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=ge(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class It{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}}let r4,lC;(function(){const o=globalThis;typeof o.requestIdleCallback!="function"||typeof o.cancelIdleCallback!="function"?lC=(e,t,i)=>{jw(()=>{if(n)return;const s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let n=!1;return{dispose(){n||(n=!0)}}}:lC=(e,t,i)=>{const n=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0);let s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(n))}}},r4=(e,t)=>lC(globalThis,e,t)})();class mU{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=lC(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class Cee extends mU{constructor(e){super(globalThis,e)}}class xf{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Ar)}}var rv;(function(o){async function e(i){let n;const s=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return s}o.settled=e;function t(i){return new Promise(async(n,s)=>{try{await i(n,s)}catch(r){s(r)}})}o.withAsyncBody=t})(rv||(rv={}));function vee(o){const e=new Jt,t=o(e.token);return new See(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new Ar)});try{for await(const s of t){if(e.token.isCancellationRequested)return;i.emitOne(s)}n.dispose(),e.dispose()}catch(s){n.dispose(),e.dispose(),i.reject(s)}})}class wee{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new ve("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new xf;return this._unsatisfiedConsumers.push(e),e.p}}}class on{constructor(e,t){this._onReturn=t,this._producerConsumer=new wee,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async i=>(this._finishError(i),{done:!0,value:void 0})},queueMicrotask(async()=>{const i=e({emitOne:n=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:n}}),emitMany:n=>{for(const s of n)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:n=>this._finishError(n)});if(!this._producerConsumer.hasFinalValue)try{await i,this._finishOk()}catch(n){this._finishError(n)}})}static fromArray(e){return new on(t=>{t.emitMany(e)})}static fromPromise(e){return new on(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new on(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new on(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}static{this.EMPTY=on.fromArray([])}static map(e,t){return new on(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return on.map(this,e)}static coalesce(e){return on.filter(e,t=>!!t)}coalesce(){return on.coalesce(this)}static filter(e,t){return new on(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return on.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}}class See extends on{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function _U(o){return o}class yee{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=_U):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class JN{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=_U):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}var Vu;(function(o){o[o.Uninitialized=0]="Uninitialized",o[o.Running=1]="Running",o[o.Completed=2]="Completed"})(Vu||(Vu={}));class $n{constructor(e){this.executor=e,this._state=Vu.Uninitialized}get value(){if(this._state===Vu.Uninitialized){this._state=Vu.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Vu.Completed}}else if(this._state===Vu.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function bU(o){return!o||typeof o!="string"?!0:o.trim().length===0}const Lee=/{(\d+)}/g;function Gg(o,...e){return e.length===0?o:o.replace(Lee,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function xee(o){return o.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function ha(o){return o.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Eo(o){return o.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Dee(o,e=" "){const t=Gw(o,e);return CU(t,e)}function Gw(o,e){if(!o||!e)return o;const t=e.length;if(t===0||o.length===0)return o;let i=0;for(;o.indexOf(e,i)===i;)i=i+t;return o.substring(i)}function CU(o,e){if(!o||!e)return o;const t=e.length,i=o.length;if(t===0||i===0)return o;let n=i,s=-1;for(;s=o.lastIndexOf(e,n-1),!(s===-1||s+t!==n);){if(s===0)return"";n=s}return o.substring(0,n)}function kee(o){return o.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function vU(o,e,t={}){if(!o)throw new Error("Cannot create regex from empty string");e||(o=Eo(o)),t.wholeWord&&(/\B/.test(o.charAt(0))||(o="\\b"+o),/\B/.test(o.charAt(o.length-1))||(o=o+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(o,i)}function wU(o){return o.source==="^"||o.source==="^$"||o.source==="$"||o.source==="^\\s*$"?!1:!!(o.exec("")&&o.lastIndex===0)}function No(o){return o.split(/\r\n|\r|\n/)}function vs(o){for(let e=0,t=o.length;e=0;t--){const i=o.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function av(o,e){return oe?1:0}function a4(o,e,t=0,i=o.length,n=0,s=e.length){for(;tc)return 1}const r=i-t,a=s-n;return ra?1:0}function eT(o,e){return I_(o,e,0,o.length,0,e.length)}function I_(o,e,t=0,i=o.length,n=0,s=e.length){for(;t=128||c>=128)return a4(o.toLowerCase(),e.toLowerCase(),t,i,n,s);hh(l)&&(l-=32),hh(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=s-n;return ra?1:0}function q1(o){return o>=48&&o<=57}function hh(o){return o>=97&&o<=122}function Dl(o){return o>=65&&o<=90}function lg(o,e){return o.length===e.length&&I_(o,e)===0}function l4(o,e){const t=e.length;return t<=o.length&&I_(o,e,0,t)===0}function Iee(o,e){const t=o.length,i=t-e.length;return i>=0&&I_(o,e,i,t)===0}function pa(o,e){const t=Math.min(o.length,e.length);let i;for(i=0;i1){const i=o.charCodeAt(e-2);if(Zi(i))return c4(i,t)}return t}class d4{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=Eee(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=gy(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class fy{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new d4(e,t)}nextGraphemeLength(){const e=cg.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const s=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(l7(n,r)){t.setOffset(s);break}n=r}return t.offset-i}prevGraphemeLength(){const e=cg.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const s=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(l7(r,n)){t.setOffset(s);break}n=r}return i-t.offset}eol(){return this._iterator.eol()}}function h4(o,e){return new fy(o,e).nextGraphemeLength()}function SU(o,e){return new fy(o,e).prevGraphemeLength()}function Nee(o,e){e>0&&Bh(o.charCodeAt(e))&&e--;const t=e+h4(o,e);return[t-SU(o,t),t]}let DI;function Tee(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function zm(o){return DI||(DI=Tee()),DI.test(o)}const Ree=/^[\t\n\r\x20-\x7E]*$/;function Zw(o){return Ree.test(o)}const yU=/[\u2028\u2029]/;function LU(o){return yU.test(o)}function _d(o){return o>=11904&&o<=55215||o>=63744&&o<=64255||o>=65281&&o<=65374}function u4(o){return o>=127462&&o<=127487||o===8986||o===8987||o===9200||o===9203||o>=9728&&o<=10175||o===11088||o===11093||o>=127744&&o<=128591||o>=128640&&o<=128764||o>=128992&&o<=129008||o>=129280&&o<=129535||o>=129648&&o<=129782}const Mee="\uFEFF";function g4(o){return!!(o&&o.length>0&&o.charCodeAt(0)===65279)}function Pee(o,e=!1){return o?(e&&(o=o.replace(/\\./g,"")),o.toLowerCase()!==o):!1}function xU(o){return o=o%52,o<26?String.fromCharCode(97+o):String.fromCharCode(65+o-26)}function l7(o,e){return o===0?e!==5&&e!==7:o===2&&e===3?!1:o===4||o===2||o===3||e===4||e===2||e===3?!0:!(o===8&&(e===8||e===9||e===11||e===12)||(o===11||o===9)&&(e===9||e===10)||(o===12||o===10)&&e===10||e===5||e===13||e===7||o===1||o===13&&e===14||o===6&&e===6)}class cg{static{this._INSTANCE=null}static getInstance(){return cg._INSTANCE||(cg._INSTANCE=new cg),cg._INSTANCE}constructor(){this._data=Aee()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1])n=2*n+1;else return t[3*n+2];return 0}}function Aee(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function Oee(o,e){if(o===0)return 0;const t=Fee(o,e);if(t!==void 0)return t;const i=new d4(e,o);return i.prevCodePoint(),i.offset}function Fee(o,e){const t=new d4(e,o);let i=t.prevCodePoint();for(;Wee(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!u4(i))return;let n=t.offset;return n>0&&t.prevCodePoint()===8205&&(n=t.offset),n}function Wee(o){return 127995<=o&&o<=127999}const DU=" ";class uh{static{this.ambiguousCharacterData=new $n(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new yee({getCacheKey:JSON.stringify},e=>{function t(d){const h=new Map;for(let u=0;u!d.startsWith("_")&&Object.hasOwn(s,d));r.length===0&&(r=["_default"]);let a;for(const d of r){const h=t(s[d]);a=n(a,h)}const l=t(s._common),c=i(l,a);return new uh(c)})}static getInstance(e){return uh.cache.get(Array.from(e))}static{this._locales=new $n(()=>Object.keys(uh.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return uh._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}class nd{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(nd.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return nd.getData().has(e)}static get codePoints(){return nd.getData()}}var c7={};let nm;const kI=globalThis.vscode;if(typeof kI<"u"&&typeof kI.process<"u"){const o=kI.process;nm={get platform(){return o.platform},get arch(){return o.arch},get env(){return o.env},cwd(){return o.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?nm={get platform(){return process.platform},get arch(){return process.arch},get env(){return c7},cwd(){return c7.VSCODE_CWD||process.cwd()}}:nm={get platform(){return Rn?"win32":je?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const py=nm.cwd,my=nm.env,Bee=nm.platform,Hee=65,Vee=97,zee=90,Uee=122,Dg=46,us=47,Ho=92,gc=58,$ee=63;class kU extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const s=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${s} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function jee(o,e){if(o===null||typeof o!="object")throw new kU(e,"Object",o)}function bn(o,e){if(typeof o!="string")throw new kU(e,"string",o)}const nu=Bee==="win32";function xt(o){return o===us||o===Ho}function tT(o){return o===us}function fc(o){return o>=Hee&&o<=zee||o>=Vee&&o<=Uee}function _y(o,e,t,i){let n="",s=0,r=-1,a=0,l=0;for(let c=0;c<=o.length;++c){if(c2){const d=n.lastIndexOf(t);d===-1?(n="",s=0):(n=n.slice(0,d),s=n.length-1-n.lastIndexOf(t)),r=c,a=0;continue}else if(n.length!==0){n="",s=0,r=c,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",s=2)}else n.length>0?n+=`${t}${o.slice(r+1,c)}`:n=o.slice(r+1,c),s=c-r-1;r=c,a=0}else l===Dg&&a!==-1?++a:a=-1}return n}function qee(o){return o?`${o[0]==="."?"":"."}${o}`:""}function IU(o,e){jee(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${qee(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${o}${i}`:i}const So={resolve(...o){let e="",t="",i=!1;for(let n=o.length-1;n>=-1;n--){let s;if(n>=0){if(s=o[n],bn(s,`paths[${n}]`),s.length===0)continue}else e.length===0?s=py():(s=my[`=${e}`]||py(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Ho)&&(s=`${e}\\`));const r=s.length;let a=0,l="",c=!1;const d=s.charCodeAt(0);if(r===1)xt(d)&&(a=1,c=!0);else if(xt(d))if(c=!0,xt(s.charCodeAt(1))){let h=2,u=h;for(;h2&&xt(s.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${s.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=_y(t,!i,"\\",xt),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(o){bn(o,"path");const e=o.length;if(e===0)return".";let t=0,i,n=!1;const s=o.charCodeAt(0);if(e===1)return tT(s)?"\\":o;if(xt(s))if(n=!0,xt(o.charCodeAt(1))){let a=2,l=a;for(;a2&&xt(o.charCodeAt(2))&&(n=!0,t=3));let r=t0&&xt(o.charCodeAt(e-1))&&(r+="\\"),!n&&i===void 0&&o.includes(":")){if(r.length>=2&&fc(r.charCodeAt(0))&&r.charCodeAt(1)===gc)return`.\\${r}`;let a=o.indexOf(":");do if(a===e-1||xt(o.charCodeAt(a+1)))return`.\\${r}`;while((a=o.indexOf(":",a+1))!==-1)}return i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(o){bn(o,"path");const e=o.length;if(e===0)return!1;const t=o.charCodeAt(0);return xt(t)||e>2&&fc(t)&&o.charCodeAt(1)===gc&&xt(o.charCodeAt(2))},join(...o){if(o.length===0)return".";let e,t;for(let s=0;s0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&xt(t.charCodeAt(0))){++n;const s=t.length;s>1&&xt(t.charCodeAt(1))&&(++n,s>2&&(xt(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return So.normalize(e)},relative(o,e){if(bn(o,"from"),bn(e,"to"),o===e)return"";const t=So.resolve(o),i=So.resolve(e);if(t===i||(o=t.toLowerCase(),e=i.toLowerCase(),o===e))return"";if(t.length!==o.length||i.length!==e.length){const f=t.split("\\"),p=i.split("\\");f[f.length-1]===""&&f.pop(),p[p.length-1]===""&&p.pop();const _=f.length,b=p.length,C=_C?p.slice(w).join("\\"):_>C?"..\\".repeat(_-1-w)+"..":"":"..\\".repeat(_-w)+p.slice(w).join("\\")}let n=0;for(;nn&&o.charCodeAt(s-1)===Ho;)s--;const r=s-n;let a=0;for(;aa&&e.charCodeAt(l-1)===Ho;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+u)===Ho)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>d&&(o.charCodeAt(n+u)===Ho?h=u:u===2&&(h=3)),h===-1&&(h=0)}let g="";for(u=n+h+1;u<=s;++u)(u===s||o.charCodeAt(u)===Ho)&&(g+=g.length===0?"..":"\\..");return a+=h,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===Ho&&++a,i.slice(a,l))},toNamespacedPath(o){if(typeof o!="string"||o.length===0)return o;const e=So.resolve(o);if(e.length<=2)return o;if(e.charCodeAt(0)===Ho){if(e.charCodeAt(1)===Ho){const t=e.charCodeAt(2);if(t!==$ee&&t!==Dg)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fc(e.charCodeAt(0))&&e.charCodeAt(1)===gc&&e.charCodeAt(2)===Ho)return`\\\\?\\${e}`;return e},dirname(o){bn(o,"path");const e=o.length;if(e===0)return".";let t=-1,i=0;const n=o.charCodeAt(0);if(e===1)return xt(n)?o:".";if(xt(n)){if(t=i=1,xt(o.charCodeAt(1))){let a=2,l=a;for(;a2&&xt(o.charCodeAt(2))?3:2,i=t);let s=-1,r=!0;for(let a=e-1;a>=i;--a)if(xt(o.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(s===-1){if(t===-1)return".";s=t}return o.slice(0,s)},basename(o,e){e!==void 0&&bn(e,"suffix"),bn(o,"path");let t=0,i=-1,n=!0,s;if(o.length>=2&&fc(o.charCodeAt(0))&&o.charCodeAt(1)===gc&&(t=2),e!==void 0&&e.length>0&&e.length<=o.length){if(e===o)return"";let r=e.length-1,a=-1;for(s=o.length-1;s>=t;--s){const l=o.charCodeAt(s);if(xt(l)){if(!n){t=s+1;break}}else a===-1&&(n=!1,a=s+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=s):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=o.length),o.slice(t,i)}for(s=o.length-1;s>=t;--s)if(xt(o.charCodeAt(s))){if(!n){t=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":o.slice(t,i)},extname(o){bn(o,"path");let e=0,t=-1,i=0,n=-1,s=!0,r=0;o.length>=2&&o.charCodeAt(1)===gc&&fc(o.charCodeAt(0))&&(e=i=2);for(let a=o.length-1;a>=e;--a){const l=o.charCodeAt(a);if(xt(l)){if(!s){i=a+1;break}continue}n===-1&&(s=!1,n=a+1),l===Dg?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":o.slice(t,n)},format:IU.bind(null,"\\"),parse(o){bn(o,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return e;const t=o.length;let i=0,n=o.charCodeAt(0);if(t===1)return xt(n)?(e.root=e.dir=o,e):(e.base=e.name=o,e);if(xt(n)){if(i=1,xt(o.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=o.slice(0,i));let s=-1,r=i,a=-1,l=!0,c=o.length-1,d=0;for(;c>=i;--c){if(n=o.charCodeAt(c),xt(n)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),n===Dg?s===-1?s=c:d!==1&&(d=1):s!==-1&&(d=-1)}return a!==-1&&(s===-1||d===0||d===1&&s===a-1&&s===r+1?e.base=e.name=o.slice(r,a):(e.name=o.slice(r,s),e.base=o.slice(r,a),e.ext=o.slice(s,a))),r>0&&r!==i?e.dir=o.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Kee=(()=>{if(nu){const o=/\\/g;return()=>{const e=py().replace(o,"/");return e.slice(e.indexOf("/"))}}return()=>py()})(),zi={resolve(...o){let e="",t=!1;for(let i=o.length-1;i>=0&&!t;i--){const n=o[i];bn(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===us)}if(!t){const i=Kee();e=`${i}/${e}`,t=i.charCodeAt(0)===us}return e=_y(e,!t,"/",tT),t?`/${e}`:e.length>0?e:"."},normalize(o){if(bn(o,"path"),o.length===0)return".";const e=o.charCodeAt(0)===us,t=o.charCodeAt(o.length-1)===us;return o=_y(o,!e,"/",tT),o.length===0?e?"/":t?"./":".":(t&&(o+="/"),e?`/${o}`:o)},isAbsolute(o){return bn(o,"path"),o.length>0&&o.charCodeAt(0)===us},join(...o){if(o.length===0)return".";const e=[];for(let t=0;t0&&e.push(i)}return e.length===0?".":zi.normalize(e.join("/"))},relative(o,e){if(bn(o,"from"),bn(e,"to"),o===e||(o=zi.resolve(o),e=zi.resolve(e),o===e))return"";const t=1,i=o.length,n=i-t,s=1,r=e.length-s,a=na){if(e.charCodeAt(s+c)===us)return e.slice(s+c+1);if(c===0)return e.slice(s+c)}else n>a&&(o.charCodeAt(t+c)===us?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||o.charCodeAt(c)===us)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(s+l)}`},toNamespacedPath(o){return o},dirname(o){if(bn(o,"path"),o.length===0)return".";const e=o.charCodeAt(0)===us;let t=-1,i=!0;for(let n=o.length-1;n>=1;--n)if(o.charCodeAt(n)===us){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":o.slice(0,t)},basename(o,e){e!==void 0&&bn(e,"suffix"),bn(o,"path");let t=0,i=-1,n=!0,s;if(e!==void 0&&e.length>0&&e.length<=o.length){if(e===o)return"";let r=e.length-1,a=-1;for(s=o.length-1;s>=0;--s){const l=o.charCodeAt(s);if(l===us){if(!n){t=s+1;break}}else a===-1&&(n=!1,a=s+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=s):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=o.length),o.slice(t,i)}for(s=o.length-1;s>=0;--s)if(o.charCodeAt(s)===us){if(!n){t=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":o.slice(t,i)},extname(o){bn(o,"path");let e=-1,t=0,i=-1,n=!0,s=0;for(let r=o.length-1;r>=0;--r){const a=o[r];if(a==="/"){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a==="."?e===-1?e=r:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===t+1?"":o.slice(e,i)},format:IU.bind(null,"/"),parse(o){bn(o,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return e;const t=o.charCodeAt(0)===us;let i;t?(e.root="/",i=1):i=0;let n=-1,s=0,r=-1,a=!0,l=o.length-1,c=0;for(;l>=i;--l){const d=o.charCodeAt(l);if(d===us){if(!a){s=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===Dg?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}if(r!==-1){const d=s===0&&t?1:s;n===-1||c===0||c===1&&n===r-1&&n===s+1?e.base=e.name=o.slice(d,r):(e.name=o.slice(d,n),e.base=o.slice(d,r),e.ext=o.slice(n,r))}return s>0?e.dir=o.slice(0,s-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};zi.win32=So.win32=So;zi.posix=So.posix=zi;const EU=nu?So.normalize:zi.normalize,Gee=nu?So.resolve:zi.resolve,Zee=nu?So.relative:zi.relative,y0=nu?So.dirname:zi.dirname,sd=nu?So.basename:zi.basename,Yee=nu?So.extname:zi.extname,Ua=nu?So.sep:zi.sep,Xee=/^\w[\w\d+.-]*$/,Qee=/^\//,Jee=/^\/\//;function ete(o,e){if(!o.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${o.authority}", path: "${o.path}", query: "${o.query}", fragment: "${o.fragment}"}`);if(o.scheme&&!Xee.test(o.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(o.path){if(o.authority){if(!Qee.test(o.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Jee.test(o.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function tte(o,e){return!o&&!e?"file":o}function ite(o,e){switch(o){case"https":case"http":case"file":e?e[0]!==Oa&&(e=Oa+e):e=Oa;break}return e}const Ai="",Oa="/",nte=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class be{static isUri(e){return e instanceof be?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,i,n,s,r=!1){typeof e=="object"?(this.scheme=e.scheme||Ai,this.authority=e.authority||Ai,this.path=e.path||Ai,this.query=e.query||Ai,this.fragment=e.fragment||Ai):(this.scheme=tte(e,r),this.authority=t||Ai,this.path=ite(this.scheme,i||Ai),this.query=n||Ai,this.fragment=s||Ai,ete(this,r))}get fsPath(){return by(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Ai),i===void 0?i=this.authority:i===null&&(i=Ai),n===void 0?n=this.path:n===null&&(n=Ai),s===void 0?s=this.query:s===null&&(s=Ai),r===void 0?r=this.fragment:r===null&&(r=Ai),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&r===this.fragment?this:new Jf(t,i,n,s,r)}static parse(e,t=!1){const i=nte.exec(e);return i?new Jf(i[2]||Ai,K1(i[4]||Ai),K1(i[5]||Ai),K1(i[7]||Ai),K1(i[9]||Ai),t):new Jf(Ai,Ai,Ai,Ai,Ai)}static file(e){let t=Ai;if(Rn&&(e=e.replace(/\\/g,Oa)),e[0]===Oa&&e[1]===Oa){const i=e.indexOf(Oa,2);i===-1?(t=e.substring(2),e=Oa):(t=e.substring(2,i),e=e.substring(i)||Oa)}return new Jf("file",t,e,Ai,Ai)}static from(e,t){return new Jf(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Rn&&e.scheme==="file"?i=be.file(So.join(by(e,!0),...t)).path:i=zi.join(e.path,...t),e.with({path:i})}toString(e=!1){return iT(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof be)return e;{const t=new Jf(e);return t._formatted=e.external??null,t._fsPath=e._sep===NU?e.fsPath??null:null,t}}else return e}}const NU=Rn?1:void 0;let Jf=class extends be{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=by(this,!1)),this._fsPath}toString(e=!1){return e?iT(this,!0):(this._formatted||(this._formatted=iT(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=NU),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const TU={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function d7(o,e,t){let i,n=-1;for(let s=0;s=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)n!==-1&&(i+=encodeURIComponent(o.substring(n,s)),n=-1),i!==void 0&&(i+=o.charAt(s));else{i===void 0&&(i=o.substr(0,s));const a=TU[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(o.substring(n,s)),n=-1),i+=a):n===-1&&(n=s)}}return n!==-1&&(i+=encodeURIComponent(o.substring(n))),i!==void 0?i:o}function ste(o){let e;for(let t=0;t1&&o.scheme==="file"?t=`//${o.authority}${o.path}`:o.path.charCodeAt(0)===47&&(o.path.charCodeAt(1)>=65&&o.path.charCodeAt(1)<=90||o.path.charCodeAt(1)>=97&&o.path.charCodeAt(1)<=122)&&o.path.charCodeAt(2)===58?e?t=o.path.substr(1):t=o.path[1].toLowerCase()+o.path.substr(2):t=o.path,Rn&&(t=t.replace(/\//g,"\\")),t}function iT(o,e){const t=e?ste:d7;let i="",{scheme:n,authority:s,path:r,query:a,fragment:l}=o;if(n&&(i+=n,i+=":"),(s||n==="file")&&(i+=Oa,i+=Oa),s){let c=s.indexOf("@");if(c!==-1){const d=s.substr(0,c);s=s.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}s=s.toLowerCase(),c=s.lastIndexOf(":"),c===-1?i+=t(s,!1,!0):(i+=t(s.substr(0,c),!1,!0),i+=s.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:d7(l,!1,!1)),i}function RU(o){try{return decodeURIComponent(o)}catch{return o.length>3?o.substr(0,3)+RU(o.substr(3)):o}}const h7=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function K1(o){return o.match(h7)?o.replace(h7,e=>RU(e)):o}var Ie;(function(o){o.inMemory="inmemory",o.vscode="vscode",o.internal="private",o.walkThrough="walkThrough",o.walkThroughSnippet="walkThroughSnippet",o.http="http",o.https="https",o.file="file",o.mailto="mailto",o.untitled="untitled",o.data="data",o.command="command",o.vscodeRemote="vscode-remote",o.vscodeRemoteResource="vscode-remote-resource",o.vscodeManagedRemoteResource="vscode-managed-remote-resource",o.vscodeUserData="vscode-userdata",o.vscodeCustomEditor="vscode-custom-editor",o.vscodeNotebookCell="vscode-notebook-cell",o.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",o.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",o.vscodeNotebookCellOutput="vscode-notebook-cell-output",o.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",o.vscodeNotebookMetadata="vscode-notebook-metadata",o.vscodeInteractiveInput="vscode-interactive-input",o.vscodeSettings="vscode-settings",o.vscodeWorkspaceTrust="vscode-workspace-trust",o.vscodeTerminal="vscode-terminal",o.vscodeChatCodeBlock="vscode-chat-code-block",o.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",o.vscodeChatEditor="vscode-chat-editor",o.vscodeChatInput="chatSessionInput",o.vscodeLocalChatSession="vscode-chat-session",o.webviewPanel="webview-panel",o.vscodeWebview="vscode-webview",o.extension="extension",o.vscodeFileResource="vscode-file",o.tmp="tmp",o.vsls="vsls",o.vscodeSourceControl="vscode-scm",o.commentsInput="comment",o.codeSetting="code-setting",o.outputChannel="output",o.accessibleView="accessible-view",o.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",o.chatEditingModel="chat-editing-text-model",o.copilotPr="copilot-pr"})(Ie||(Ie={}));function nD(o,e){return be.isUri(o)?lg(o.scheme,e):l4(o,e+":")}function nT(o,...e){return e.some(t=>nD(o,t))}const ote="tkn";class rte{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return zi.join(this._serverRootPath,Ie.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Te(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(r+=`&${ote}=${encodeURIComponent(s)}`),be.from({scheme:ic?this._preferredWebSchema:Ie.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const MU=new rte,ate="vscode-app";class Cy{static{this.FALLBACK_AUTHORITY=ate}uriToBrowserUri(e){return e.scheme===Ie.vscodeRemote?MU.rewrite(e):e.scheme===Ie.file&&(Za||HJ===`${Ie.vscodeFileResource}://${Cy.FALLBACK_AUTHORITY}`)?e.with({scheme:Ie.vscodeFileResource,authority:e.authority||Cy.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}const PU=new Cy;var sT;(function(o){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);o.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(s){let r;typeof s=="string"?r=new URL(s).searchParams:s instanceof URL?r=s.searchParams:be.isUri(s)&&(r=new URL(s.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}o.getHeadersFromQuery=i;function n(s,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}o.addSearchParam=n})(sT||(sT={}));const u7=typeof Buffer<"u";new $n(()=>new Uint8Array(256));let II;class Eh{static wrap(e){return u7&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Eh(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return u7?this.buffer.toString():(II||(II=new TextDecoder),II.decode(this.buffer))}}function lte(o,e){return o[e+0]<<0>>>0|o[e+1]<<8>>>0}function cte(o,e,t){o[t+0]=e&255,e=e>>>8,o[t+1]=e&255}function Ta(o,e){return o[e]*2**24+o[e+1]*2**16+o[e+2]*2**8+o[e+3]}function Ra(o,e,t){o[t+3]=e,e=e>>>8,o[t+2]=e,e=e>>>8,o[t+1]=e,e=e>>>8,o[t]=e}function g7(o,e){return o[e]}function f7(o,e,t){o[t]=e}const p7="0123456789abcdef";function dte({buffer:o}){let e="";for(let t=0;t>>4],e+=p7[i&15]}return e}function Yw(o){return sD(o,0)}function sD(o,e){switch(typeof o){case"object":return o===null?qc(349,e):Array.isArray(o)?ute(o,e):gte(o,e);case"string":return f4(o,e);case"boolean":return hte(o,e);case"number":return qc(o,e);case"undefined":return qc(937,e);default:return qc(617,e)}}function qc(o,e){return(e<<5)-e+o|0}function hte(o,e){return qc(o?433:863,e)}function f4(o,e){e=qc(149417,e);for(let t=0,i=o.length;tsD(i,t),e)}function gte(o,e){return e=qc(181387,e),Object.keys(o).sort().reduce((t,i)=>(t=f4(i,t),sD(o[i],t)),e)}function EI(o,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function ob(o,e=32){return o instanceof ArrayBuffer?dte(Eh.wrap(new Uint8Array(o))):(o>>>0).toString(16).padStart(e/4,"0")}class p4{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let n=this._buffLen,s=this._leftoverHighSurrogate,r,a;for(s!==0?(r=s,a=-1,s=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(Zi(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),ob(this._h0)+ob(this._h1)+ob(this._h2)+ob(this._h3)+ob(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=p4._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,EI(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,n=this._h1,s=this._h2,r=this._h3,a=this._h4,l,c,d;for(let h=0;h<80;h++)h<20?(l=n&s|~n&r,c=1518500249):h<40?(l=n^s^r,c=1859775393):h<60?(l=n&s|n&r|s&r,c=2400959708):(l=n^s^r,c=3395469782),d=EI(i,5)+l+a+c+e.getUint32(h*4,!1)&4294967295,a=r,r=s,s=EI(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}function fte(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Qt(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;it(o[i],e))}function m4(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function oT(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o!!e)}function _7(o){let e=0;for(let t=0;t0}function bd(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function Ns(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function oD(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function NI(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function G1(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function rT(o,e){for(const t of e)o.push(t)}function _te(o,e){const t=[];for(const i of o){const n=e(i);n!==void 0&&t.push(n)}return t}function b4(o){return Array.isArray(o)?o:[o]}function bte(o,e,t){const i=FU(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(Nh||(Nh={}));function Kn(o,e){return(t,i)=>e(o(t),o(i))}function Cte(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!Nh.isNeitherLessOrGreaterThan(n))return n}return Nh.neitherLessOrGreaterThan}}const Lo=(o,e)=>o-e,WU=(o,e)=>Lo(o?1:0,e?1:0);function BU(o){return(e,t)=>-o(e,t)}function vte(o){return(e,t)=>e===void 0?t===void 0?Nh.neitherLessOrGreaterThan:Nh.lessThan:t===void 0?Nh.greaterThan:o(e,t)}class Cd{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class od{static{this.empty=new od(e=>{})}constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new od(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new od(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||Nh.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}class Sy{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,s)=>t(e[n],e[s]));return new Sy(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;te+t,0)}let Nu;function wte(o){Nu?Nu instanceof b7?Nu.loggers.push(o):Nu=new b7([Nu,o]):Nu=o}function ns(){return Nu}class b7{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const i of this.loggers)i.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const i of this.loggers)i.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const n of this.loggers)n.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const n of this.loggers)n.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}var en;(function(o){let e=!1;function t(){e=!0}o.enable=t;function i(){if(!e)return;const n=Error,s=n.stackTraceLimit;n.stackTraceLimit=3;const r=new Error().stack;return n.stackTraceLimit=s,C4.fromStack(r,2)}o.ofCaller=i})(en||(en={}));class C4{static fromStack(e,t){const i=e.split(` -`),n=Ste(i[t+1]);if(n)return new C4(n.fileName,n.line,n.column,n.id)}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}}function Ste(o){const e=o.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:o};const t=o.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:o}}const lr=(o,e)=>o===e;function lv(o=lr){return(e,t)=>Qt(e,t,o)}function v4(){return(o,e)=>o.equals(e)}function dg(o,e,t){if(t!==void 0){const i=o;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=o;return(n,s)=>n==null||s===void 0||s===null?s===n:i(n,s)}}function aT(o,e){if(o===e)return!0;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t{const r=w4(s);if(r!==void 0)return r;const l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(l)return`${this.debugName}.${l[2]}`;if(!n)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r),i)}flatten(){return cT({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(VU(this,t)),this}}class E_ extends zU{constructor(e){super(),this._observers=new Set,ns()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&ns()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&ns()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function Ete(o){switch(o){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class Cr extends E_{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n=void 0,s,r){super(r),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=n,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,ns()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let t;try{this._isReaderValid=!0;let i;this._changeTracker&&(i=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,i)),t=this._computeFn(this,i)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),t}else{do{if(this._state===1){for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const i=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,i),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(i));const n=this._state!==0,s=this._value;this._state=3;const r=this._delayedStore;r!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,i)}finally{this._isReaderValid=!1;for(const a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),r!==void 0&&r.dispose()}e=this._didReportChange||n&&!this._equalityComparator(s,this._value),ns()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:n})}catch(i){cy(i)}if(this._isComputing=!1,!this._didReportChange&&e)for(const i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new ve("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===3&&(this._state=1,!t))for(const i of this._observers)i.handlePossibleChange(this);if(t)for(const i of this._observers)i.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const i of t)i.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const i=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const n of i)n.endUpdate(this)}}Wh(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){ns()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:s=>s===e},this._changeSummary):!0}catch(s){cy(s)}const n=this._state===3;if(i&&(this._state===1||n)&&(this._state=2,n))for(const s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new ve("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new z),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:Ete(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,i){this._value=e;const n=this._observers;t.updateObserver(this,this);for(const s of n)s.handleChange(this,i)}}class UU extends Cr{constructor(e,t,i,n=void 0,s,r,a){super(e,t,i,n,s,a),this.set=r}}function $(o,e,t=en.ofCaller()){return e!==void 0?new Cr(new Zn(o,void 0,e),e,void 0,void 0,lr,t):new Cr(new Zn(void 0,void 0,o),o,void 0,void 0,lr,t)}function S4(o,e,t,i=en.ofCaller()){return new UU(new Zn(o,void 0,e),e,void 0,void 0,lr,t,i)}function Un(o,e,t=en.ofCaller()){return new Cr(new Zn(o.owner,o.debugName,o.debugReferenceFn),e,void 0,o.onLastObserverRemoved,o.equalsFn??lr,t)}kte(Un);function S7(o,e,t=en.ofCaller()){return new Cr(new Zn(o.owner,o.debugName,void 0),e,o.changeTracker,void 0,o.equalityComparer??lr,t)}function br(o,e,t=en.ofCaller()){let i,n;e===void 0?(i=o,n=void 0):(n=o,i=e);let s;return new Cr(new Zn(n,void 0,i),r=>{s?s.clear():s=new z;const a=i(r);return a&&s.add(a),a},void 0,()=>{s&&(s.dispose(),s=void 0)},lr,t)}function Nte(o){switch(o){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class cv{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),ns()?.handleAutorunCreated(this,n),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),ns()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){ns()?.handleAutorunStarted(this);const t=this._changeSummary,i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(n){cy(n)}finally{this._isRunning=!1,i!==void 0&&i.dispose()}}}finally{this._disposed||ns()?.handleAutorunFinished(this);for(const t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===1){this._state=3;for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state!==3&&this._run()}while(this._state!==3)}finally{this._updateCount--}Wh(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){ns()?.handleAutorunDependencyChanged(this,e,t);try{(this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:n=>n===e},this._changeSummary):!0)&&(this._state=2)}catch(i){cy(i)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new ve("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new ve("Cannot access store after dispose");return this._store===void 0&&(this._store=new z),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Nte(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function ke(o,e=en.ofCaller()){return new cv(new Zn(void 0,void 0,o),o,void 0,e)}function rD(o,e,t=en.ofCaller()){return new cv(new Zn(o.owner,o.debugName,o.debugReferenceFn??e),e,void 0,t)}function N_(o,e,t=en.ofCaller()){return new cv(new Zn(o.owner,o.debugName,o.debugReferenceFn??e),e,o.changeTracker,t)}function Tte(o,e){const t=new z,i=N_({owner:o.owner,debugName:o.debugName,debugReferenceFn:o.debugReferenceFn??e,changeTracker:o.changeTracker},(n,s)=>{t.clear(),e(n,s,t)});return ge(()=>{i.dispose(),t.dispose()})}function os(o){const e=new z,t=rD({owner:void 0,debugName:void 0,debugReferenceFn:o},i=>{e.clear(),o(i,e)});return ge(()=>{t.dispose(),e.dispose()})}function Rte(o,e){let t;return rD({debugReferenceFn:e},i=>{const n=o.read(i),s=t;t=n,e({lastValue:s,newValue:n})})}function y7(o){const e=new Error("BugIndicatingErrorRecovery: "+o);Te(e),console.error("recovered from an error that indicates a bug",e)}function At(o,e){const t=new T_(o,e);try{o(t)}finally{t.finish()}}let Z1;function Bb(o){if(Z1)o(Z1);else{const e=new T_(o,void 0);Z1=e;try{o(e)}finally{e.finish(),Z1=void 0}}}async function Mte(o,e){const t=new T_(o,e);try{await o(t)}finally{t.finish()}}function Um(o,e,t){o?e(o):At(e,t)}class T_{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],ns()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():w4(this._fn)}updateObserver(e,t){if(!this._updatingObservers){y7("Transaction already finished!"),At(i=>{i.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(!e){y7("transaction.finish() has already been called!");return}for(let t=0;tKc.globalTransaction,lr,n??en.ofCaller())}function $U(o,e,t,i=en.ofCaller()){return new Kc(new Zn(o.owner,o.debugName,o.debugReferenceFn??t),e,t,()=>Kc.globalTransaction,o.equalsFn??lr,i)}class Kc extends E_{constructor(e,t,i,n,s,r){super(r),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=a=>{const l=this._getValue(a),c=this._value,d=!this._hasValue||!this._equalityComparator(c,l);let h=!1;d&&(this._value=l,this._hasValue&&(h=!0,Um(this._getTransaction(),u=>{ns()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue});for(const g of this._observers)u.updateObserver(g,this),g.handleChange(this,void 0)},()=>{const u=this.getDebugName();return"Event fired"+(u?`: ${u}`:"")})),this._hasValue=!0),h||ns()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}(function(o){o.Observer=Kc;function e(t,i){let n=!1;Kc.globalTransaction===void 0&&(Kc.globalTransaction=t,n=!0);try{i()}finally{n&&(Kc.globalTransaction=void 0)}}o.batchEventsGlobally=e})(pt||(pt={}));function L7(o,e){let t=!1,i,n;return pt(s=>{const r=ke(a=>{const l=o.read(a);t?(n&&clearTimeout(n),n=setTimeout(()=>{i=l,s()},e)):(t=!0,i=l)});return{dispose(){r.dispose(),t=!1,i=void 0}}},()=>t?i:o.get())}function $m(o,e){const t=new Pte(!0,e);o.addObserver(t);try{t.beginUpdate(o)}finally{t.endUpdate(o)}return ge(()=>{o.removeObserver(t)})}Ite($m);class Pte{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function Ed(o,e){let t;return Un({owner:o,debugReferenceFn:e},n=>(t=e(n,t),t))}function y4(o,e,t,i){let n=new x7(t,i);return Un({debugReferenceFn:t,owner:o,onLastObserverRemoved:()=>{n.dispose(),n=new x7(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}let x7=class{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const s=this._keySelector?this._keySelector(n):n;let r=this._cache.get(s);if(r)i.delete(s);else{const a=new z;r={out:this._map(n,a),store:a},this._cache.set(s,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}};function Mp(o,e){switch(typeof o){case"number":return""+o;case"string":return o.length+2<=e?`"${o}"`:`"${o.substr(0,e-7)}"+...`;case"boolean":return o?"true":"false";case"undefined":return"undefined";case"object":return o===null?"null":Array.isArray(o)?Ate(o,e):Ote(o,e);case"symbol":return o.toString();case"function":return`[[Function${o.name?" "+o.name:""}]]`;default:return""+o}}function Ate(o,e){let t="[ ",i=!0;for(const n of o){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${Mp(n,e-t.length)}`}return t+=" ]",t}function Ote(o,e){if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString){const s=o.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}const t=HU(o);let i=t?t+"(":"{ ",n=!0;for(const[s,r]of Object.entries(o)){if(n||(i+=", "),i.length-5>e){i+="...";break}n=!1,i+=`${s}: ${Mp(r,e-i.length)}`}return i+=t?")":" }",i}class L4{static createClient(e,t){return new L4(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:s=>{const r=s,a=this._getHandler().notifications[r[0]];if(!a)throw new Error(`Unknown notification "${r[0]}"!`);a(...r[1])},handleRequest:s=>{const r=s;try{return{type:"result",value:this._getHandler().requests[r[0]](...r[1])}}catch(a){return{type:"error",value:a}}}});const i=new Proxy({},{get:(s,r)=>async(...a)=>{const l=await this._channel.sendRequest([r,a]);if(l.type==="error")throw l.value;return l.value}}),n=new Proxy({},{get:(s,r)=>(...a)=>{this._channel.sendNotification([r,a])}});this.api={notifications:n,requests:i}}}function Fte(o,e){const t=globalThis;let i=[],n;const{channel:s,handler:r}=Wte({sendNotification:l=>{n?n.sendNotification(l):i.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[o]=l=>{a=e(),n=l;for(const c of i)l.sendNotification(c);return i=[],r},L4.createClient(s,()=>{if(!a)throw new Error("Not supported");return a})}function Wte(o){let e;return{channel:i=>(e=i,{sendNotification:n=>{o.sendNotification(n)},sendRequest:n=>{throw new Error("not supported")}}),handler:{handleRequest:i=>i.type==="notification"?e?.handleNotification(i.data):e?.handleRequest(i.data)}}}class Bte{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}function jU(o,e){for(const t in e)o[t]&&typeof o[t]=="object"&&e[t]&&typeof e[t]=="object"?jU(o[t],e[t]):o[t]=e[t]}function qU(o,e){for(const t in e)e[t]===null?delete o[t]:o[t]&&typeof o[t]=="object"&&e[t]&&typeof e[t]=="object"?qU(o[t],e[t]):o[t]=e[t]}function Ee(o,e,t=en.ofCaller()){let i;return typeof o=="string"?i=new Zn(void 0,o,void 0):i=new Zn(o,void 0,void 0),new dv(i,e,lr,t)}class dv extends E_{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,ns()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new T_(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),ns()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this._observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function x4(o,e,t=en.ofCaller()){let i;return typeof o=="string"?i=new Zn(void 0,o,void 0):i=new Zn(o,void 0,void 0),new Hte(i,e,lr,t)}class Hte extends dv{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class Pp{static{this._instance=void 0}static getInstance(){return Pp._instance===void 0&&(Pp._instance=new Pp),Pp._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(t.length===0)return;const i=t.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),n=new Set;for(;i.length>0;){const s=i.shift();if(n.has(s))continue;n.add(s);const r=this._getInfo(s,a=>{n.has(a)||i.push(a)});r&&e.push(r)}return{names:t.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(!t){Te(new ve("No info found"));return}return t}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(!t){Te(new ve("No info found"));return}return t}_getInfo(e,t){if(e instanceof Cr){const i=[...e.debugGetObservers()];for(const l of i)t(l);const n=this._getObservableInfo(e);if(!n)return;const s=e.debugGetState(),r={name:e.debugName,instanceId:n.instanceId,updateCount:s.updateCount},a=[...n.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(Cn);if(s.isComputing)return{...r,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(s.state){case 0:return{...r,type:"observable/derived",state:"noValue"};case 3:return{...r,type:"observable/derived",state:"upToDate"};case 2:return{...r,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...r,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof cv){const i=this._getAutorunInfo(e);if(!i)return;const n={name:e.debugName,instanceId:i.instanceId,updateCount:i.updateCount},s=[...i.changedObservables].map(r=>this._instanceInfos.get(r).instanceId);if(e.debugGetState().isRunning)return{...n,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...n,type:"autorun",state:"upToDate"};case 2:return{...n,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...n,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof Cr)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=Fte("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(i=>this._formatObserver(i)).filter(Cn)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(Cn),observers:[...t.debugGetObservers()].map(i=>this._formatObserver(i)).filter(Cn)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(Cn)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const i=this._aliveInstances.get(e);if(i instanceof Cr)i.debugSetValue(t);else if(i instanceof dv)i.debugSetValue(t);else if(i instanceof Kc)i.debugSetValue(t);else throw new ve("Observable is not supported");const n=[...i.debugGetObservers()];for(const s of n)s.beginUpdate(i);for(const s of n)s.handleChange(i,void 0);for(const s of n)s.endUpdate(i)},getValue:e=>{const t=this._aliveInstances.get(e);if(t instanceof Cr)return Mp(t.debugGetState().value,200);if(t instanceof dv)return Mp(t.debugGetState().value,200)},logValue:e=>{const t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new ve("Observable is not supported")},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof Cr)t.debugRecompute();else if(t instanceof cv)t.debugRerun();else throw new ve("Observable is not supported")}}})),this._pendingChanges=null,this._changeThrottler=new Bte,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},en.enable()}_handleChange(e){qU(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:jU(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let i=this._declarations.get(t.id);return i===void 0&&(i={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,i),this._handleChange({decls:{[i.id]:i}})),i.id}handleObservableCreated(e,t){const n={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n)}handleOnListenerCountChanged(e,t){const i=this._getObservableInfo(e);if(i){if(i.listenerCount===0&&t>0){const n=e instanceof Cr?"observable/derived":"observable/value";this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:n,name:e.debugName}}})}else i.listenerCount>0&&t===0&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId));i.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof Cr){this._handleDerivedRecomputed(e,t);return}const i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=Mp(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e,t){const n={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n),this._aliveInstances.set(n.instanceId,e),n&&this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){const n=this._getAutorunInfo(e);n&&n.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){const n=this._getObservableInfo(e);n&&n.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const i=this._getObservableInfo(e);if(!i)return;const n=Mp(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=n,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:n,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}}my&&my.VSCODE_DEV_DEBUG_OBSERVABLES&&wte(Pp.getInstance());const{getWindow:me,getDocument:Vte,getWindows:KU,getWindowsCount:zte,getWindowId:hv,getWindowById:D7,onDidRegisterWindow:Xw,onWillUnregisterWindow:Ute,onDidUnregisterWindow:$te}=(function(){const o=new Map;IJ(kt,1);const e={window:kt,disposables:new z};o.set(kt.vscodeWindowId,e);const t=new P,i=new P,n=new P;function s(r,a){return(typeof r=="number"?o.get(r):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(r){if(o.has(r.vscodeWindowId))return F.None;const a=new z,l={window:r,disposables:a.add(new z)};return o.set(r.vscodeWindowId,l),a.add(ge(()=>{o.delete(r.vscodeWindowId),i.fire(r)})),a.add(B(r,te.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(l),a},getWindows(){return o.values()},getWindowsCount(){return o.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return o.has(r)},getWindowById:s,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const l=r;return l?.view?l.view.window:kt},getDocument(r){return me(r).document}}})();function Tn(o){for(;o.firstChild;)o.firstChild.remove()}class jte{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function B(o,e,t,i){return new jte(o,e,t,i)}function GU(o,e){return function(t){return e(new qn(o,t))}}function qte(o){return function(e){return o(new Et(e))}}const Ti=function(e,t,i,n){let s=i;return t==="click"||t==="mousedown"||t==="contextmenu"?s=GU(me(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(s=qte(i)),B(e,t,s,n)},Kte=function(e,t,i){const n=GU(me(e),t);return ZU(e,n,i)};function ZU(o,e,t){return B(o,Or&&qw.pointerEvents?te.POINTER_DOWN:te.MOUSE_DOWN,e,t)}function Gte(o,e,t){return B(o,Or&&qw.pointerEvents?te.POINTER_MOVE:te.MOUSE_MOVE,e,t)}function k7(o,e,t){return B(o,Or&&qw.pointerEvents?te.POINTER_UP:te.MOUSE_UP,e,t)}function Hb(o,e,t){return lC(o,e,t)}class TI extends mU{constructor(e,t){super(e,t)}}let Ly,ro;class D4 extends o4{constructor(e){super(),this.defaultTarget=e&&me(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class RI{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Te(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const o=new Map,e=new Map,t=new Map,i=new Map,n=s=>{t.set(s,!1);const r=o.get(s)??[];for(e.set(s,r),o.set(s,[]),i.set(s,!0);r.length>0;)r.sort(RI.sort),r.shift().execute();i.set(s,!1)};ro=(s,r,a=0)=>{const l=hv(s),c=new RI(r,a);let d=o.get(l);return d||(d=[],o.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),s.requestAnimationFrame(()=>n(l))),c},Ly=(s,r,a)=>{const l=hv(s);if(i.get(l)){const c=new RI(r,a);let d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return ro(s,r,a)}})();function aD(o){return me(o).getComputedStyle(o,null)}function Hh(o,e,t){const i=me(o),n=i.document;if(o!==n.body)return new ut(o.clientWidth,o.clientHeight);if(Or&&i?.visualViewport)return new ut(i.visualViewport.width,i.visualViewport.height);if(i?.innerWidth&&i.innerHeight)return new ut(i.innerWidth,i.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new ut(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new ut(n.documentElement.clientWidth,n.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Ni{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){const i=aD(e),n=i?i.getPropertyValue(t):"0";return Ni.convertToPixels(e,n)}static getBorderLeftWidth(e){return Ni.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return Ni.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return Ni.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return Ni.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return Ni.getDimension(e,"padding-left")}static getPaddingRight(e){return Ni.getDimension(e,"padding-right")}static getPaddingTop(e){return Ni.getDimension(e,"padding-top")}static getPaddingBottom(e){return Ni.getDimension(e,"padding-bottom")}static getMarginLeft(e){return Ni.getDimension(e,"margin-left")}static getMarginTop(e){return Ni.getDimension(e,"margin-top")}static getMarginRight(e){return Ni.getDimension(e,"margin-right")}static getMarginBottom(e){return Ni.getDimension(e,"margin-bottom")}}class ut{static{this.None=new ut(0,0)}constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ut(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof ut?e:new ut(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function YU(o){let e=o.offsetParent,t=o.offsetTop,i=o.offsetLeft;for(;(o=o.parentNode)!==null&&o!==o.ownerDocument.body&&o!==o.ownerDocument.documentElement;){t-=o.scrollTop;const n=QU(o)?null:aD(o);n&&(i-=n.direction!=="rtl"?o.scrollLeft:-o.scrollLeft),o===e&&(i+=Ni.getBorderLeftWidth(o),t+=Ni.getBorderTopWidth(o),t+=o.offsetTop,i+=o.offsetLeft,e=o.offsetParent)}return{left:i,top:t}}function Zte(o,e,t){typeof e=="number"&&(o.style.width=`${e}px`),typeof t=="number"&&(o.style.height=`${t}px`)}function wi(o){const e=o.getBoundingClientRect(),t=me(o);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function XU(o){let e=o,t=1;do{const i=aD(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function _o(o){const e=Ni.getMarginLeft(o)+Ni.getMarginRight(o);return o.offsetWidth+e}function MI(o){const e=Ni.getBorderLeftWidth(o)+Ni.getBorderRightWidth(o),t=Ni.getPaddingLeft(o)+Ni.getPaddingRight(o);return o.offsetWidth-e-t}function Yte(o){const e=Ni.getBorderTopWidth(o)+Ni.getBorderBottomWidth(o),t=Ni.getPaddingTop(o)+Ni.getPaddingBottom(o);return o.offsetHeight-e-t}function Gc(o){const e=Ni.getMarginTop(o)+Ni.getMarginBottom(o);return o.offsetHeight+e}function un(o,e){return!!e?.contains(o)}function Xte(o,e,t){for(;o&&o.nodeType===o.ELEMENT_NODE;){if(o.classList.contains(e))return o;if(t){if(typeof t=="string"){if(o.classList.contains(t))return null}else if(o===t)return null}o=o.parentNode}return null}function PI(o,e,t){return!!Xte(o,e,t)}function QU(o){return o&&!!o.host&&!!o.mode}function xy(o){return!!Vh(o)}function Vh(o){for(;o.parentNode;){if(o===o.ownerDocument?.body)return null;o=o.parentNode}return QU(o)?o:null}function Ji(){let o=Qw().activeElement;for(;o?.shadowRoot;)o=o.shadowRoot.activeElement;return o}function lD(o){return Ji()===o}function JU(o){return un(Ji(),o)}function Qw(){return zte()<=1?kt.document:Array.from(KU()).map(({window:e})=>e.document).find(e=>e.hasFocus())??kt.document}function St(){return Qw().defaultView?.window??kt}const Qte=new class{constructor(){this.mutationObservers=new Map}observe(o,e,t){let i=this.mutationObservers.get(o);i||(i=new Map,this.mutationObservers.set(o,i));const n=Yw(t);let s=i.get(n);if(s)s.users+=1;else{const r=new P,a=new MutationObserver(c=>r.fire(c));a.observe(o,t);const l=s={users:1,observer:a,onDidMutate:r.event};e.add(ge(()=>{l.users-=1,l.users===0&&(r.dispose(),a.disconnect(),i?.delete(n),i?.size===0&&this.mutationObservers.delete(o))})),i.set(n,s)}return s.onDidMutate}};function Si(o){return o instanceof HTMLElement||o instanceof me(o).HTMLElement}function I7(o){return o instanceof HTMLAnchorElement||o instanceof me(o).HTMLAnchorElement}function e$(o){return o instanceof SVGElement||o instanceof me(o).SVGElement}function k4(o){return o instanceof MouseEvent||o instanceof me(o).MouseEvent}function Oc(o){return o instanceof KeyboardEvent||o instanceof me(o).KeyboardEvent}const te={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function Jte(o){const e=o;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const ct={stop:(o,e)=>(o.preventDefault(),e&&o.stopPropagation(),o)};function eie(o){const e=[];for(let t=0;o&&o.nodeType===o.ELEMENT_NODE;t++)e[t]=o.scrollTop,o=o.parentNode;return e}function tie(o,e){for(let t=0;o&&o.nodeType===o.ELEMENT_NODE;t++)o.scrollTop!==e[t]&&(o.scrollTop=e[t]),o=o.parentNode}let iie=class dT extends F{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(Si(e)){const t=Vh(e),i=t?t.activeElement:e.ownerDocument.activeElement;return un(i,e)}else{const t=e;return un(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new P),this._onDidBlur=this._register(new P);let t=dT.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(Si(e)?me(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{dT.hasFocusWithin(e)!==t&&(t?s():n())},this._register(B(e,te.FOCUS,n,!0)),this._register(B(e,te.BLUR,s,!0)),Si(e)&&(this._register(B(e,te.FOCUS_IN,()=>this._refreshStateHandler())),this._register(B(e,te.FOCUS_OUT,()=>this._refreshStateHandler())))}};function Wr(o){return new iie(o)}function nie(o,e){return o.after(e),e}function Y(o,...e){if(o.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function cD(o,e){return o.insertBefore(e,o.firstChild),e}function gn(o,...e){o.textContent="",Y(o,...e)}const sie=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var uv;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.SVG="http://www.w3.org/2000/svg"})(uv||(uv={}));function t$(o,e,t,...i){const n=sie.exec(e);if(!n)throw new Error("Bad use of emmet");const s=n[1]||"div";let r;return o!==uv.HTML?r=document.createElementNS(o,s):r=document.createElement(s),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function ee(o,e,...t){return t$(uv.HTML,o,e,...t)}ee.SVG=function(o,e,...t){return t$(uv.SVG,o,e,...t)};function oie(o,...e){o?Co(...e):Rs(...e)}function Co(...o){for(const e of o)e.style.display="",e.removeAttribute("aria-hidden")}function Rs(...o){for(const e of o)e.style.display="none",e.setAttribute("aria-hidden","true")}function E7(o,e){const t=o.devicePixelRatio*e;return Math.max(1,Math.floor(t))/o.devicePixelRatio}function i$(o){kt.open(o,"_blank","noopener")}function rie(o,e){const t=()=>{e(),i=ro(o,t)};let i=ro(o,t);return ge(()=>i.dispose())}MU.setPreferredWebSchema(/^https:/.test(kt.location.href)?"https":"http");class Zc extends P{constructor(){super(),this._subscriptions=new z,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(se.runAndSubscribe(Xw,({window:e,disposables:t})=>this.registerListeners(e,t),{window:kt,disposables:this._subscriptions}))}registerListeners(e,t){t.add(B(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new Et(i);if(!(n.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(n.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(B(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(B(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(B(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(B(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(B(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Zc.instance||(Zc.instance=new Zc),Zc.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class aie extends F{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(B(this.element,te.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(B(this.element,te.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(B(this.element,te.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(B(this.element,te.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(B(this.element,te.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(B(this.element,te.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(B(this.element,te.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const lie=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function ot(o,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=lie.exec(o);if(!n||!n.groups)throw new Error("Bad use of h");const s=n.groups.tag||"div",r=document.createElement(s);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const c of n.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(n.groups.name&&(l[n.groups.name]=r),i)for(const c of i)Si(c)?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(gv(h),typeof u=="number"?u+"px":""+u);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(gv(c),d.toString());return l.root=r,l}function gv(o){return o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $a(o){return o.tagName.toLowerCase()==="input"||o.tagName.toLowerCase()==="textarea"||Si(o)&&!!o.editContext}var Fe;(function(o){function e(n=void 0){return(s,r,a)=>{const l=r.class;delete r.class;const c=r.ref;delete r.ref;const d=r.obsRef;return delete r.obsRef,new die(s,c,d,n,l,r,a)}}function t(n,s=void 0){const r=e(s);return(a,l)=>r(n,a,l)}o.div=t("div"),o.elem=e(void 0),o.svg=t("svg","http://www.w3.org/2000/svg"),o.svgElem=e("http://www.w3.org/2000/svg");function i(){let n;const s=function(r){n=r};return Object.defineProperty(s,"element",{get(){if(!n)throw new ve("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return n}}),s}o.ref=i})(Fe||(Fe={}));class I4{constructor(e,t,i,n,s,r,a){this._deriveds=[],this._element=n?document.createElementNS(n,e):document.createElement(e),t&&t(this._element),i&&this._deriveds.push($(l=>{i(this),l.store.add({dispose:()=>{i(null)}})})),s&&(s$(s)?this._deriveds.push($(this,l=>{N7(this._element,T7(s,l))})):N7(this._element,T7(s,void 0)));for(const[l,c]of Object.entries(r))if(l==="style")for(const[d,h]of Object.entries(c)){const u=gv(d);hg(h)?this._deriveds.push(Un({owner:this,debugName:()=>`set.style.${u}`},g=>{this._element.style.setProperty(u,R7(h.read(g)))})):this._element.style.setProperty(u,R7(h))}else l==="tabIndex"?hg(c)?this._deriveds.push($(this,d=>{this._element.tabIndex=c.read(d)})):this._element.tabIndex=c:l.startsWith("on")?this._element[l]=c:hg(c)?this._deriveds.push(Un({owner:this,debugName:()=>`set.${l}`},d=>{M7(this._element,l,c.read(d))})):M7(this._element,l,c);if(a){let l=function(d,h){return hg(h)?l(d,h.read(d)):Array.isArray(h)?h.flatMap(u=>l(d,u)):h instanceof I4?(d&&h.readEffect(d),[h._element]):h?[h]:[]};const c=$(this,d=>{this._element.replaceChildren(...l(d,a))});this._deriveds.push(c),o$(a)||c.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return $(t=>{this.readEffect(t)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new z;return this.keepUpdated(e),new cie(this._element,e)}}function N7(o,e){e$(o)?o.setAttribute("class",e):o.className=e}function n$(o,e,t){if(hg(o)){t(o.read(e));return}if(Array.isArray(o)){for(const i of o)n$(i,e,t);return}t(o)}function T7(o,e){let t="";return n$(o,e,i=>{i&&(t.length===0?t=i:t+=" "+i)}),t}function s$(o){return hg(o)?!0:Array.isArray(o)?o.some(e=>s$(e)):!1}function R7(o){return typeof o=="number"?o+"px":o}function o$(o){return hg(o)?!0:Array.isArray(o)?o.some(e=>o$(e)):!1}class cie{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class die extends I4{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=Ee("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=Ee("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",i=>{e=!0}),this._element.addEventListener("mousemove",i=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",i=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function M7(o,e,t){t==null?o.removeAttribute(gv(e)):o.setAttribute(gv(e),String(t))}function hg(o){return!!o&&o.read!==void 0&&o.reportChanges!==void 0}const P7=2e4;let zu,L0,hT,x0,uT;function hie(o){zu=document.createElement("div"),zu.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),zu.appendChild(i),i};L0=e(),hT=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),zu.appendChild(i),i};x0=t(),uT=t(),o.appendChild(zu)}function Ws(o){zu&&(L0.textContent!==o?(Tn(hT),Dy(L0,o)):(Tn(L0),Dy(hT,o)))}function Ya(o){zu&&(x0.textContent!==o?(Tn(uT),Dy(x0,o)):(Tn(x0),Dy(uT,o)))}function Dy(o,e){Tn(o),e.length>P7&&(e=e.substr(0,P7)),o.textContent=e,o.style.visibility="hidden",o.style.visibility="visible"}var Ha;(function(o){o.serviceIds=new Map,o.DI_TARGET="$di$target",o.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[o.DI_DEPENDENCIES]||[]}o.getServiceDependencies=e})(Ha||(Ha={}));const pe=Ve("instantiationService");function uie(o,e,t){e[Ha.DI_TARGET]===e?e[Ha.DI_DEPENDENCIES].push({id:o,index:t}):(e[Ha.DI_DEPENDENCIES]=[{id:o,index:t}],e[Ha.DI_TARGET]=e)}function Ve(o){if(Ha.serviceIds.has(o))return Ha.serviceIds.get(o);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");uie(e,t,n)};return e.toString=()=>o,Ha.serviceIds.set(o,e),e}const at=Ve("codeEditorService");let R=class Tu{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Tu(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return Tu.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Tu.isBefore(this,e)}static isBefore(e,t){return e.lineNumbero.run(...e)}}const gT=Object.create(null);function y(o,e){if(hn(e)){const t=gT[e];if(t===void 0)throw new Error(`${o} references an unknown codicon: ${e}`);e=t}return gT[o]=e,{id:o}}function r$(){return gT}const gie={add:y("add",6e4),plus:y("plus",6e4),gistNew:y("gist-new",6e4),repoCreate:y("repo-create",6e4),lightbulb:y("lightbulb",60001),lightBulb:y("light-bulb",60001),repo:y("repo",60002),repoDelete:y("repo-delete",60002),gistFork:y("gist-fork",60003),repoForked:y("repo-forked",60003),gitPullRequest:y("git-pull-request",60004),gitPullRequestAbandoned:y("git-pull-request-abandoned",60004),recordKeys:y("record-keys",60005),keyboard:y("keyboard",60005),tag:y("tag",60006),gitPullRequestLabel:y("git-pull-request-label",60006),tagAdd:y("tag-add",60006),tagRemove:y("tag-remove",60006),person:y("person",60007),personFollow:y("person-follow",60007),personOutline:y("person-outline",60007),personFilled:y("person-filled",60007),sourceControl:y("source-control",60008),mirror:y("mirror",60009),mirrorPublic:y("mirror-public",60009),star:y("star",60010),starAdd:y("star-add",60010),starDelete:y("star-delete",60010),starEmpty:y("star-empty",60010),comment:y("comment",60011),commentAdd:y("comment-add",60011),alert:y("alert",60012),warning:y("warning",60012),search:y("search",60013),searchSave:y("search-save",60013),logOut:y("log-out",60014),signOut:y("sign-out",60014),logIn:y("log-in",60015),signIn:y("sign-in",60015),eye:y("eye",60016),eyeUnwatch:y("eye-unwatch",60016),eyeWatch:y("eye-watch",60016),circleFilled:y("circle-filled",60017),primitiveDot:y("primitive-dot",60017),closeDirty:y("close-dirty",60017),debugBreakpoint:y("debug-breakpoint",60017),debugBreakpointDisabled:y("debug-breakpoint-disabled",60017),debugHint:y("debug-hint",60017),terminalDecorationSuccess:y("terminal-decoration-success",60017),primitiveSquare:y("primitive-square",60018),edit:y("edit",60019),pencil:y("pencil",60019),info:y("info",60020),issueOpened:y("issue-opened",60020),gistPrivate:y("gist-private",60021),gitForkPrivate:y("git-fork-private",60021),lock:y("lock",60021),mirrorPrivate:y("mirror-private",60021),close:y("close",60022),removeClose:y("remove-close",60022),x:y("x",60022),repoSync:y("repo-sync",60023),sync:y("sync",60023),clone:y("clone",60024),desktopDownload:y("desktop-download",60024),beaker:y("beaker",60025),microscope:y("microscope",60025),vm:y("vm",60026),deviceDesktop:y("device-desktop",60026),file:y("file",60027),more:y("more",60028),ellipsis:y("ellipsis",60028),kebabHorizontal:y("kebab-horizontal",60028),mailReply:y("mail-reply",60029),reply:y("reply",60029),organization:y("organization",60030),organizationFilled:y("organization-filled",60030),organizationOutline:y("organization-outline",60030),newFile:y("new-file",60031),fileAdd:y("file-add",60031),newFolder:y("new-folder",60032),fileDirectoryCreate:y("file-directory-create",60032),trash:y("trash",60033),trashcan:y("trashcan",60033),history:y("history",60034),clock:y("clock",60034),folder:y("folder",60035),fileDirectory:y("file-directory",60035),symbolFolder:y("symbol-folder",60035),logoGithub:y("logo-github",60036),markGithub:y("mark-github",60036),github:y("github",60036),terminal:y("terminal",60037),console:y("console",60037),repl:y("repl",60037),zap:y("zap",60038),symbolEvent:y("symbol-event",60038),error:y("error",60039),stop:y("stop",60039),variable:y("variable",60040),symbolVariable:y("symbol-variable",60040),array:y("array",60042),symbolArray:y("symbol-array",60042),symbolModule:y("symbol-module",60043),symbolPackage:y("symbol-package",60043),symbolNamespace:y("symbol-namespace",60043),symbolObject:y("symbol-object",60043),symbolMethod:y("symbol-method",60044),symbolFunction:y("symbol-function",60044),symbolConstructor:y("symbol-constructor",60044),symbolBoolean:y("symbol-boolean",60047),symbolNull:y("symbol-null",60047),symbolNumeric:y("symbol-numeric",60048),symbolNumber:y("symbol-number",60048),symbolStructure:y("symbol-structure",60049),symbolStruct:y("symbol-struct",60049),symbolParameter:y("symbol-parameter",60050),symbolTypeParameter:y("symbol-type-parameter",60050),symbolKey:y("symbol-key",60051),symbolText:y("symbol-text",60051),symbolReference:y("symbol-reference",60052),goToFile:y("go-to-file",60052),symbolEnum:y("symbol-enum",60053),symbolValue:y("symbol-value",60053),symbolRuler:y("symbol-ruler",60054),symbolUnit:y("symbol-unit",60054),activateBreakpoints:y("activate-breakpoints",60055),archive:y("archive",60056),arrowBoth:y("arrow-both",60057),arrowDown:y("arrow-down",60058),arrowLeft:y("arrow-left",60059),arrowRight:y("arrow-right",60060),arrowSmallDown:y("arrow-small-down",60061),arrowSmallLeft:y("arrow-small-left",60062),arrowSmallRight:y("arrow-small-right",60063),arrowSmallUp:y("arrow-small-up",60064),arrowUp:y("arrow-up",60065),bell:y("bell",60066),bold:y("bold",60067),book:y("book",60068),bookmark:y("bookmark",60069),debugBreakpointConditionalUnverified:y("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:y("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:y("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:y("debug-breakpoint-data-unverified",60072),debugBreakpointData:y("debug-breakpoint-data",60073),debugBreakpointDataDisabled:y("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:y("debug-breakpoint-log-unverified",60074),debugBreakpointLog:y("debug-breakpoint-log",60075),debugBreakpointLogDisabled:y("debug-breakpoint-log-disabled",60075),briefcase:y("briefcase",60076),broadcast:y("broadcast",60077),browser:y("browser",60078),bug:y("bug",60079),calendar:y("calendar",60080),caseSensitive:y("case-sensitive",60081),check:y("check",60082),checklist:y("checklist",60083),chevronDown:y("chevron-down",60084),chevronLeft:y("chevron-left",60085),chevronRight:y("chevron-right",60086),chevronUp:y("chevron-up",60087),chromeClose:y("chrome-close",60088),chromeMaximize:y("chrome-maximize",60089),chromeMinimize:y("chrome-minimize",60090),chromeRestore:y("chrome-restore",60091),circleOutline:y("circle-outline",60092),circle:y("circle",60092),debugBreakpointUnverified:y("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:y("terminal-decoration-incomplete",60092),circleSlash:y("circle-slash",60093),circuitBoard:y("circuit-board",60094),clearAll:y("clear-all",60095),clippy:y("clippy",60096),closeAll:y("close-all",60097),cloudDownload:y("cloud-download",60098),cloudUpload:y("cloud-upload",60099),code:y("code",60100),collapseAll:y("collapse-all",60101),colorMode:y("color-mode",60102),commentDiscussion:y("comment-discussion",60103),creditCard:y("credit-card",60105),dash:y("dash",60108),dashboard:y("dashboard",60109),database:y("database",60110),debugContinue:y("debug-continue",60111),debugDisconnect:y("debug-disconnect",60112),debugPause:y("debug-pause",60113),debugRestart:y("debug-restart",60114),debugStart:y("debug-start",60115),debugStepInto:y("debug-step-into",60116),debugStepOut:y("debug-step-out",60117),debugStepOver:y("debug-step-over",60118),debugStop:y("debug-stop",60119),debug:y("debug",60120),deviceCameraVideo:y("device-camera-video",60121),deviceCamera:y("device-camera",60122),deviceMobile:y("device-mobile",60123),diffAdded:y("diff-added",60124),diffIgnored:y("diff-ignored",60125),diffModified:y("diff-modified",60126),diffRemoved:y("diff-removed",60127),diffRenamed:y("diff-renamed",60128),diff:y("diff",60129),diffSidebyside:y("diff-sidebyside",60129),discard:y("discard",60130),editorLayout:y("editor-layout",60131),emptyWindow:y("empty-window",60132),exclude:y("exclude",60133),extensions:y("extensions",60134),eyeClosed:y("eye-closed",60135),fileBinary:y("file-binary",60136),fileCode:y("file-code",60137),fileMedia:y("file-media",60138),filePdf:y("file-pdf",60139),fileSubmodule:y("file-submodule",60140),fileSymlinkDirectory:y("file-symlink-directory",60141),fileSymlinkFile:y("file-symlink-file",60142),fileZip:y("file-zip",60143),files:y("files",60144),filter:y("filter",60145),flame:y("flame",60146),foldDown:y("fold-down",60147),foldUp:y("fold-up",60148),fold:y("fold",60149),folderActive:y("folder-active",60150),folderOpened:y("folder-opened",60151),gear:y("gear",60152),gift:y("gift",60153),gistSecret:y("gist-secret",60154),gist:y("gist",60155),gitCommit:y("git-commit",60156),gitCompare:y("git-compare",60157),compareChanges:y("compare-changes",60157),gitMerge:y("git-merge",60158),githubAction:y("github-action",60159),githubAlt:y("github-alt",60160),globe:y("globe",60161),grabber:y("grabber",60162),graph:y("graph",60163),gripper:y("gripper",60164),heart:y("heart",60165),home:y("home",60166),horizontalRule:y("horizontal-rule",60167),hubot:y("hubot",60168),inbox:y("inbox",60169),issueReopened:y("issue-reopened",60171),issues:y("issues",60172),italic:y("italic",60173),jersey:y("jersey",60174),json:y("json",60175),kebabVertical:y("kebab-vertical",60176),key:y("key",60177),law:y("law",60178),lightbulbAutofix:y("lightbulb-autofix",60179),linkExternal:y("link-external",60180),link:y("link",60181),listOrdered:y("list-ordered",60182),listUnordered:y("list-unordered",60183),liveShare:y("live-share",60184),loading:y("loading",60185),location:y("location",60186),mailRead:y("mail-read",60187),mail:y("mail",60188),markdown:y("markdown",60189),megaphone:y("megaphone",60190),mention:y("mention",60191),milestone:y("milestone",60192),gitPullRequestMilestone:y("git-pull-request-milestone",60192),mortarBoard:y("mortar-board",60193),move:y("move",60194),multipleWindows:y("multiple-windows",60195),mute:y("mute",60196),noNewline:y("no-newline",60197),note:y("note",60198),octoface:y("octoface",60199),openPreview:y("open-preview",60200),package:y("package",60201),paintcan:y("paintcan",60202),pin:y("pin",60203),play:y("play",60204),run:y("run",60204),plug:y("plug",60205),preserveCase:y("preserve-case",60206),preview:y("preview",60207),project:y("project",60208),pulse:y("pulse",60209),question:y("question",60210),quote:y("quote",60211),radioTower:y("radio-tower",60212),reactions:y("reactions",60213),references:y("references",60214),refresh:y("refresh",60215),regex:y("regex",60216),remoteExplorer:y("remote-explorer",60217),remote:y("remote",60218),remove:y("remove",60219),replaceAll:y("replace-all",60220),replace:y("replace",60221),repoClone:y("repo-clone",60222),repoForcePush:y("repo-force-push",60223),repoPull:y("repo-pull",60224),repoPush:y("repo-push",60225),report:y("report",60226),requestChanges:y("request-changes",60227),rocket:y("rocket",60228),rootFolderOpened:y("root-folder-opened",60229),rootFolder:y("root-folder",60230),rss:y("rss",60231),ruby:y("ruby",60232),saveAll:y("save-all",60233),saveAs:y("save-as",60234),save:y("save",60235),screenFull:y("screen-full",60236),screenNormal:y("screen-normal",60237),searchStop:y("search-stop",60238),server:y("server",60240),settingsGear:y("settings-gear",60241),settings:y("settings",60242),shield:y("shield",60243),smiley:y("smiley",60244),sortPrecedence:y("sort-precedence",60245),splitHorizontal:y("split-horizontal",60246),splitVertical:y("split-vertical",60247),squirrel:y("squirrel",60248),starFull:y("star-full",60249),starHalf:y("star-half",60250),symbolClass:y("symbol-class",60251),symbolColor:y("symbol-color",60252),symbolConstant:y("symbol-constant",60253),symbolEnumMember:y("symbol-enum-member",60254),symbolField:y("symbol-field",60255),symbolFile:y("symbol-file",60256),symbolInterface:y("symbol-interface",60257),symbolKeyword:y("symbol-keyword",60258),symbolMisc:y("symbol-misc",60259),symbolOperator:y("symbol-operator",60260),symbolProperty:y("symbol-property",60261),wrench:y("wrench",60261),wrenchSubaction:y("wrench-subaction",60261),symbolSnippet:y("symbol-snippet",60262),tasklist:y("tasklist",60263),telescope:y("telescope",60264),textSize:y("text-size",60265),threeBars:y("three-bars",60266),thumbsdown:y("thumbsdown",60267),thumbsup:y("thumbsup",60268),tools:y("tools",60269),triangleDown:y("triangle-down",60270),triangleLeft:y("triangle-left",60271),triangleRight:y("triangle-right",60272),triangleUp:y("triangle-up",60273),twitter:y("twitter",60274),unfold:y("unfold",60275),unlock:y("unlock",60276),unmute:y("unmute",60277),unverified:y("unverified",60278),verified:y("verified",60279),versions:y("versions",60280),vmActive:y("vm-active",60281),vmOutline:y("vm-outline",60282),vmRunning:y("vm-running",60283),watch:y("watch",60284),whitespace:y("whitespace",60285),wholeWord:y("whole-word",60286),window:y("window",60287),wordWrap:y("word-wrap",60288),zoomIn:y("zoom-in",60289),zoomOut:y("zoom-out",60290),listFilter:y("list-filter",60291),listFlat:y("list-flat",60292),listSelection:y("list-selection",60293),selection:y("selection",60293),listTree:y("list-tree",60294),debugBreakpointFunctionUnverified:y("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:y("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:y("debug-breakpoint-function-disabled",60296),debugStackframeActive:y("debug-stackframe-active",60297),circleSmallFilled:y("circle-small-filled",60298),debugStackframeDot:y("debug-stackframe-dot",60298),terminalDecorationMark:y("terminal-decoration-mark",60298),debugStackframe:y("debug-stackframe",60299),debugStackframeFocused:y("debug-stackframe-focused",60299),debugBreakpointUnsupported:y("debug-breakpoint-unsupported",60300),symbolString:y("symbol-string",60301),debugReverseContinue:y("debug-reverse-continue",60302),debugStepBack:y("debug-step-back",60303),debugRestartFrame:y("debug-restart-frame",60304),debugAlt:y("debug-alt",60305),callIncoming:y("call-incoming",60306),callOutgoing:y("call-outgoing",60307),menu:y("menu",60308),expandAll:y("expand-all",60309),feedback:y("feedback",60310),gitPullRequestReviewer:y("git-pull-request-reviewer",60310),groupByRefType:y("group-by-ref-type",60311),ungroupByRefType:y("ungroup-by-ref-type",60312),account:y("account",60313),gitPullRequestAssignee:y("git-pull-request-assignee",60313),bellDot:y("bell-dot",60314),debugConsole:y("debug-console",60315),library:y("library",60316),output:y("output",60317),runAll:y("run-all",60318),syncIgnored:y("sync-ignored",60319),pinned:y("pinned",60320),githubInverted:y("github-inverted",60321),serverProcess:y("server-process",60322),serverEnvironment:y("server-environment",60323),pass:y("pass",60324),issueClosed:y("issue-closed",60324),stopCircle:y("stop-circle",60325),playCircle:y("play-circle",60326),record:y("record",60327),debugAltSmall:y("debug-alt-small",60328),vmConnect:y("vm-connect",60329),cloud:y("cloud",60330),merge:y("merge",60331),export:y("export",60332),graphLeft:y("graph-left",60333),magnet:y("magnet",60334),notebook:y("notebook",60335),redo:y("redo",60336),checkAll:y("check-all",60337),pinnedDirty:y("pinned-dirty",60338),passFilled:y("pass-filled",60339),circleLargeFilled:y("circle-large-filled",60340),circleLarge:y("circle-large",60341),circleLargeOutline:y("circle-large-outline",60341),combine:y("combine",60342),gather:y("gather",60342),table:y("table",60343),variableGroup:y("variable-group",60344),typeHierarchy:y("type-hierarchy",60345),typeHierarchySub:y("type-hierarchy-sub",60346),typeHierarchySuper:y("type-hierarchy-super",60347),gitPullRequestCreate:y("git-pull-request-create",60348),runAbove:y("run-above",60349),runBelow:y("run-below",60350),notebookTemplate:y("notebook-template",60351),debugRerun:y("debug-rerun",60352),workspaceTrusted:y("workspace-trusted",60353),workspaceUntrusted:y("workspace-untrusted",60354),workspaceUnknown:y("workspace-unknown",60355),terminalCmd:y("terminal-cmd",60356),terminalDebian:y("terminal-debian",60357),terminalLinux:y("terminal-linux",60358),terminalPowershell:y("terminal-powershell",60359),terminalTmux:y("terminal-tmux",60360),terminalUbuntu:y("terminal-ubuntu",60361),terminalBash:y("terminal-bash",60362),arrowSwap:y("arrow-swap",60363),copy:y("copy",60364),personAdd:y("person-add",60365),filterFilled:y("filter-filled",60366),wand:y("wand",60367),debugLineByLine:y("debug-line-by-line",60368),inspect:y("inspect",60369),layers:y("layers",60370),layersDot:y("layers-dot",60371),layersActive:y("layers-active",60372),compass:y("compass",60373),compassDot:y("compass-dot",60374),compassActive:y("compass-active",60375),azure:y("azure",60376),issueDraft:y("issue-draft",60377),gitPullRequestClosed:y("git-pull-request-closed",60378),gitPullRequestDraft:y("git-pull-request-draft",60379),debugAll:y("debug-all",60380),debugCoverage:y("debug-coverage",60381),runErrors:y("run-errors",60382),folderLibrary:y("folder-library",60383),debugContinueSmall:y("debug-continue-small",60384),beakerStop:y("beaker-stop",60385),graphLine:y("graph-line",60386),graphScatter:y("graph-scatter",60387),pieChart:y("pie-chart",60388),bracket:y("bracket",60175),bracketDot:y("bracket-dot",60389),bracketError:y("bracket-error",60390),lockSmall:y("lock-small",60391),azureDevops:y("azure-devops",60392),verifiedFilled:y("verified-filled",60393),newline:y("newline",60394),layout:y("layout",60395),layoutActivitybarLeft:y("layout-activitybar-left",60396),layoutActivitybarRight:y("layout-activitybar-right",60397),layoutPanelLeft:y("layout-panel-left",60398),layoutPanelCenter:y("layout-panel-center",60399),layoutPanelJustify:y("layout-panel-justify",60400),layoutPanelRight:y("layout-panel-right",60401),layoutPanel:y("layout-panel",60402),layoutSidebarLeft:y("layout-sidebar-left",60403),layoutSidebarRight:y("layout-sidebar-right",60404),layoutStatusbar:y("layout-statusbar",60405),layoutMenubar:y("layout-menubar",60406),layoutCentered:y("layout-centered",60407),target:y("target",60408),indent:y("indent",60409),recordSmall:y("record-small",60410),errorSmall:y("error-small",60411),terminalDecorationError:y("terminal-decoration-error",60411),arrowCircleDown:y("arrow-circle-down",60412),arrowCircleLeft:y("arrow-circle-left",60413),arrowCircleRight:y("arrow-circle-right",60414),arrowCircleUp:y("arrow-circle-up",60415),layoutSidebarRightOff:y("layout-sidebar-right-off",60416),layoutPanelOff:y("layout-panel-off",60417),layoutSidebarLeftOff:y("layout-sidebar-left-off",60418),blank:y("blank",60419),heartFilled:y("heart-filled",60420),map:y("map",60421),mapHorizontal:y("map-horizontal",60421),foldHorizontal:y("fold-horizontal",60421),mapFilled:y("map-filled",60422),mapHorizontalFilled:y("map-horizontal-filled",60422),foldHorizontalFilled:y("fold-horizontal-filled",60422),circleSmall:y("circle-small",60423),bellSlash:y("bell-slash",60424),bellSlashDot:y("bell-slash-dot",60425),commentUnresolved:y("comment-unresolved",60426),gitPullRequestGoToChanges:y("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:y("git-pull-request-new-changes",60428),searchFuzzy:y("search-fuzzy",60429),commentDraft:y("comment-draft",60430),send:y("send",60431),sparkle:y("sparkle",60432),insert:y("insert",60433),mic:y("mic",60434),thumbsdownFilled:y("thumbsdown-filled",60435),thumbsupFilled:y("thumbsup-filled",60436),coffee:y("coffee",60437),snake:y("snake",60438),game:y("game",60439),vr:y("vr",60440),chip:y("chip",60441),piano:y("piano",60442),music:y("music",60443),micFilled:y("mic-filled",60444),repoFetch:y("repo-fetch",60445),copilot:y("copilot",60446),lightbulbSparkle:y("lightbulb-sparkle",60447),robot:y("robot",60448),sparkleFilled:y("sparkle-filled",60449),diffSingle:y("diff-single",60450),diffMultiple:y("diff-multiple",60451),surroundWith:y("surround-with",60452),share:y("share",60453),gitStash:y("git-stash",60454),gitStashApply:y("git-stash-apply",60455),gitStashPop:y("git-stash-pop",60456),vscode:y("vscode",60457),vscodeInsiders:y("vscode-insiders",60458),codeOss:y("code-oss",60459),runCoverage:y("run-coverage",60460),runAllCoverage:y("run-all-coverage",60461),coverage:y("coverage",60462),githubProject:y("github-project",60463),mapVertical:y("map-vertical",60464),foldVertical:y("fold-vertical",60464),mapVerticalFilled:y("map-vertical-filled",60465),foldVerticalFilled:y("fold-vertical-filled",60465),goToSearch:y("go-to-search",60466),percentage:y("percentage",60467),sortPercentage:y("sort-percentage",60467),attach:y("attach",60468),goToEditingSession:y("go-to-editing-session",60469),editSession:y("edit-session",60470),codeReview:y("code-review",60471),copilotWarning:y("copilot-warning",60472),python:y("python",60473),copilotLarge:y("copilot-large",60474),copilotWarningLarge:y("copilot-warning-large",60475),keyboardTab:y("keyboard-tab",60476),copilotBlocked:y("copilot-blocked",60477),copilotNotConnected:y("copilot-not-connected",60478),flag:y("flag",60479),lightbulbEmpty:y("lightbulb-empty",60480),symbolMethodArrow:y("symbol-method-arrow",60481),copilotUnavailable:y("copilot-unavailable",60482),repoPinned:y("repo-pinned",60483),keyboardTabAbove:y("keyboard-tab-above",60484),keyboardTabBelow:y("keyboard-tab-below",60485),gitPullRequestDone:y("git-pull-request-done",60486),mcp:y("mcp",60487),extensionsLarge:y("extensions-large",60488),layoutPanelDock:y("layout-panel-dock",60489),layoutSidebarLeftDock:y("layout-sidebar-left-dock",60490),layoutSidebarRightDock:y("layout-sidebar-right-dock",60491),copilotInProgress:y("copilot-in-progress",60492),copilotError:y("copilot-error",60493),copilotSuccess:y("copilot-success",60494),chatSparkle:y("chat-sparkle",60495),searchSparkle:y("search-sparkle",60496),editSparkle:y("edit-sparkle",60497),copilotSnooze:y("copilot-snooze",60498),sendToRemoteAgent:y("send-to-remote-agent",60499),commentDiscussionSparkle:y("comment-discussion-sparkle",60500),chatSparkleWarning:y("chat-sparkle-warning",60501),chatSparkleError:y("chat-sparkle-error",60502),collection:y("collection",60503),newCollection:y("new-collection",60504),thinking:y("thinking",60505),build:y("build",60506),commentDiscussionQuote:y("comment-discussion-quote",60507),cursor:y("cursor",60508),eraser:y("eraser",60509),fileText:y("file-text",60510),gitLens:y("git-lens",60511),quotes:y("quotes",60512),rename:y("rename",60513),runWithDeps:y("run-with-deps",60514),debugConnected:y("debug-connected",60515),strikethrough:y("strikethrough",60516),openInProduct:y("open-in-product",60517),indexZero:y("index-zero",60518),agent:y("agent",60519),editCode:y("edit-code",60520),repoSelected:y("repo-selected",60521),skip:y("skip",60522),mergeInto:y("merge-into",60523),gitBranchChanges:y("git-branch-changes",60524),gitBranchStagedChanges:y("git-branch-staged-changes",60525),gitBranchConflicts:y("git-branch-conflicts",60526),gitBranch:y("git-branch",60527),gitBranchCreate:y("git-branch-create",60527),gitBranchDelete:y("git-branch-delete",60527),searchLarge:y("search-large",60528),terminalGitBash:y("terminal-git-bash",60529)},fie={dialogError:y("dialog-error","error"),dialogWarning:y("dialog-warning","warning"),dialogInfo:y("dialog-info","info"),dialogClose:y("dialog-close","close"),treeItemExpanded:y("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:y("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:y("tree-filter-on-type-off","list-selection"),treeFilterClear:y("tree-filter-clear","close"),treeItemLoading:y("tree-item-loading","loading"),menuSelection:y("menu-selection","check"),menuSubmenu:y("menu-submenu","chevron-right"),menuBarMore:y("menubar-more","more"),scrollbarButtonLeft:y("scrollbar-button-left","triangle-left"),scrollbarButtonRight:y("scrollbar-button-right","triangle-right"),scrollbarButtonUp:y("scrollbar-button-up","triangle-up"),scrollbarButtonDown:y("scrollbar-button-down","triangle-down"),toolBarMore:y("toolbar-more","more"),quickInputBack:y("quick-input-back","arrow-left"),dropDownButton:y("drop-down-button",60084),symbolCustomColor:y("symbol-customcolor",60252),exportIcon:y("export",60332),workspaceUnspecified:y("workspace-unspecified",60355),newLine:y("newline",60394),thumbsDownFilled:y("thumbsdown-filled",60435),thumbsUpFilled:y("thumbsup-filled",60436),gitFetch:y("git-fetch",60445),lightbulbSparkleAutofix:y("lightbulb-sparkle-autofix",60447),debugBreakpointPending:y("debug-breakpoint-pending",60377)},Z={...gie,...fie};var fT;(function(o){function e(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}o.isThemeColor=e})(fT||(fT={}));var ye;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9-]+",o.iconModifierExpression="~[A-Za-z]+",o.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function t(f){const p=e.exec(f.id);if(!p)return t(Z.error);const[,_,b]=p,C=["codicon","codicon-"+_];return b&&C.push("codicon-modifier-"+b.substring(1)),C}o.asClassNameArray=t;function i(f){return t(f).join(" ")}o.asClassName=i;function n(f){return"."+t(f).join(".")}o.asCSSSelector=n;function s(f){return!!f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||fT.isThemeColor(f.color))}o.isThemeIcon=s;const r=new RegExp(`^\\$\\((${o.iconNameExpression}(?:${o.iconModifierExpression})?)\\)$`);function a(f){const p=r.exec(f);if(!p)return;const[,_]=p;return{id:_}}o.fromString=a;function l(f){return{id:f}}o.fromId=l;function c(f,p){let _=f.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),p&&(_=`${_}~${p}`),{id:_}}o.modify=c;function d(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}o.getModifier=d;function h(f,p){return f.id===p.id&&f.color?.id===p.color?.id}o.isEqual=h;function u(f){return f?.id===Z.file.id}o.isFile=u;function g(f){return f?.id===Z.folder.id}o.isFolder=g})(ye||(ye={}));const Vt=Ve("commandService"),it=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new P,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,e){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:o,handler:e})}if(o.metadata&&Array.isArray(o.metadata.args)){const r=[];for(const l of o.metadata.args)r.push(l.constraint);const a=o.handler;o.handler=function(l,...c){return PJ(c,r),a(l,...c)}}const{id:t}=o;let i=this._commands.get(t);i||(i=new bs,this._commands.set(t,i));const n=i.unshift(o),s=ge(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),s}registerCommandAlias(o,e){return it.registerCommand(o,(t,...i)=>t.get(Vt).executeCommand(e,...i))}getCommand(o){const e=this._commands.get(o);if(!(!e||e.isEmpty()))return Je.first(e)}getCommands(){const o=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&o.set(e,t)}return o}};it.registerCommand("noop",()=>{});function AI(...o){switch(o.length){case 1:return m(1693,"Did you mean {0}?",o[0]);case 2:return m(1694,"Did you mean {0} or {1}?",o[0],o[1]);case 3:return m(1695,"Did you mean {0}, {1} or {2}?",o[0],o[1],o[2]);default:return}}const pie=m(1696,"Did you forget to open or close the quote?"),mie=m(1697,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let rb=class pT{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw hy(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(AI("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(AI("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(AI("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=pT._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(pie);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(mie);return}const s=this._input.charCodeAt(e);if(t)t=!1;else if(s===47&&!i){e++;break}else s===91?i=!0:s===92?t=!0:s===93&&(i=!1);e++}for(;e=this._input.length}};const rs=new Map;rs.set("false",!1);rs.set("true",!0);rs.set("isMac",je);rs.set("isLinux",oo);rs.set("isWindows",Rn);rs.set("isWeb",ic);rs.set("isMacNative",je&&!ic);rs.set("isEdge",lU);rs.set("isFirefox",UJ);rs.set("isChrome",JO);rs.set("isSafari",$J);const _ie=Object.prototype.hasOwnProperty,bie={regexParsingWithErrorRecovery:!0},Cie=m(1675,"Empty context key expression"),vie=m(1676,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),wie=m(1677,"'in' after 'not'."),A7=m(1678,"closing parenthesis ')'"),Sie=m(1679,"Unexpected token"),yie=m(1680,"Did you forget to put && or || before the token?"),Lie=m(1681,"Unexpected end of expression"),xie=m(1682,"Did you forget to put a context key?");let Die=class Vb{static{this._parseError=new Error}constructor(e=bie){this._config=e,this._scanner=new rb,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Cie,offset:0,lexeme:"",additionalInfo:vie});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),n=i.type===17?yie:void 0;throw this._parsingErrors.push({message:Sie,offset:i.offset,lexeme:rb.getLexeme(i),additionalInfo:n}),Vb._parseError}return t}catch(t){if(t!==Vb._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:K.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:K.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Bs.INSTANCE;case 12:return this._advance(),ao.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,A7),t?.negate()}case 17:return this._advance(),kf.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),K.true();case 12:return this._advance(),K.false();case 0:{this._advance();const t=this._expr();return this._consume(1,A7),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const n=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),n.type!==10)throw this._errExpectedButGot("REGEX",n);const s=n.lexeme,r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1));let l;try{l=new RegExp(s.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",n)}return fv.create(t,l)}switch(n.type){case 10:case 19:{const s=[n.lexeme];this._advance();let r=this._peek(),a=0;for(let u=0;u=0){const c=s.slice(a+1,l),d=s[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",n)}}}if(r===null)throw this._errExpectedButGot("REGEX",n);return fv.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,wie);const n=this._value();return K.notIn(t,n)}switch(this._peek().type){case 3:{this._advance();const n=this._value();if(this._previous().type===18)return K.equals(t,n);switch(n){case"true":return K.has(t);case"false":return K.not(t);default:return K.equals(t,n)}}case 4:{this._advance();const n=this._value();if(this._previous().type===18)return K.notEquals(t,n);switch(n){case"true":return K.not(t);case"false":return K.has(t);default:return K.notEquals(t,n)}}case 5:return this._advance(),mD.create(t,this._value());case 6:return this._advance(),_D.create(t,this._value());case 7:return this._advance(),fD.create(t,this._value());case 8:return this._advance(),pD.create(t,this._value());case 13:return this._advance(),K.in(t,this._value());default:return K.has(t)}}case 20:throw this._parsingErrors.push({message:Lie,offset:e.offset,lexeme:"",additionalInfo:xie}),Vb._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class uQ extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class gQ extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class wD{constructor(e){this.value=e}}const fQ=2;let P=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new $A(e?.onListenerError??Ee,this._options?.leakWarningThreshold??hQ):void 0,this._perfMon=this._options?._profName?new _0(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new gQ(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Ee)(c),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));const n=new wD(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=jA.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof wD?(this._deliveryQueue??=new kV,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const r=ue(()=>{s?.(),this._removeListener(n)});return i instanceof z?i.add(r):Array.isArray(i)&&i.push(r),r},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(this._size*fQ<=t.length){let s=0;for(let r=0;r0}};const pQ=()=>new kV;class kV{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class xg extends P{constructor(e){super(e),this._isPaused=0,this._eventQueue=new cs,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class DV extends xg{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class mQ extends P{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class _Q{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new P({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),ue(yg(()=>{this.hasListeners&&this.unhook(t);const n=this.events.indexOf(t);this.events.splice(n,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}}class cw{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,s,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>n.call(s,a)):n.call(s,a);return}const c=l;if(!c){n.call(s,t(i,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=i?c.items.reduce(t,i):c.items.reduce(t),n.call(s,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(n=>n()),i}}class L_{constructor(){this.listening=!1,this.inputEvent=te.None,this.inputEventListener=A.None,this.emitter=new P({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const IV=Object.freeze(function(o,e){const t=setTimeout(o.bind(e),0);return{dispose(){clearTimeout(t)}}});var Ve;(function(o){function e(t){return t===o.None||t===o.Cancelled||t instanceof IS?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}o.isCancellationToken=e,o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:te.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:IV})})(Ve||(Ve={}));class IS{constructor(){this._isCancelled=!1,this._emitter=null}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?IV:(this._emitter||(this._emitter=new P),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let qt=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new IS),this._token}cancel(){this._token?this._token instanceof IS&&this._token.cancel():this._token=Ve.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof IS&&this._token.dispose():this._token=Ve.None}};function VE(o){const e=new qt;return o.add({dispose(){e.cancel()}}),e.token}const EV=Symbol("MicrotaskDelay");function zE(o){return!!o&&typeof o.then=="function"}function $i(o){const e=new qt,t=o(e.token);let i=!1;const n=new Promise((s,r)=>{const a=e.token.onCancellationRequested(()=>{i=!0,a.dispose(),r(new wr)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),i?ef(l)&&l.dispose():s(l)},l=>{a.dispose(),e.dispose(),r(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,r){return n.then(s,r)}catch(s){return this.then(void 0,s)}finally(s){return n.finally(s)}}}function hm(o,e,t){return new Promise((i,n)=>{const s=e.onCancellationRequested(()=>{s.dispose(),i(t)});o.then(i,n).finally(()=>s.dispose())})}function bQ(o,e){return new Promise((t,i)=>{const n=e.onCancellationRequested(()=>{n.dispose(),i(new wr)});o.then(t,i).finally(()=>n.dispose())})}let CQ=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new qt}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((t,i)=>{this.activePromise.then(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.cancellationTokenSource.cancel()}};const vQ=(o,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},o);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},wQ=o=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,o())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class yr{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((n,s)=>{this.doResolve=n,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===EV?wQ(i):vQ(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new wr),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}class NV{constructor(e){this.delayer=new yr(e),this.throttler=new CQ}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function El(o,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{s.dispose(),t()},o),s=e.onCancellationRequested(()=>{clearTimeout(n),s.dispose(),i(new wr)})}):$i(t=>El(o,t))}function Gc(o,e=0,t){const i=setTimeout(()=>{o(),t&&n.dispose()},e),n=ue(()=>{clearTimeout(i),t?.delete(n)});return t?.add(n),n}function qA(o,e=i=>!!i,t=null){let i=0;const n=o.length,s=()=>{if(i>=n)return Promise.resolve(t);const r=o[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):s())};return s()}let SQ=class{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new tf;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new Ce;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new wr)}};class mo{constructor(e,t){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new Ce("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ce("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}}class KA{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Ce("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=ue(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class St{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}}let GA,xb;(function(){const o=globalThis;typeof o.requestIdleCallback!="function"||typeof o.cancelIdleCallback!="function"?xb=(e,t,i)=>{aw(()=>{if(n)return;const s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let n=!1;return{dispose(){n||(n=!0)}}}:xb=(e,t,i)=>{const n=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0);let s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(n))}}},GA=(e,t)=>xb(globalThis,e,t)})();class TV{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=xb(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class yQ extends TV{constructor(e){super(globalThis,e)}}class tf{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new wr)}}var SC;(function(o){async function e(i){let n;const s=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return s}o.settled=e;function t(i){return new Promise(async(n,s)=>{try{await i(n,s)}catch(r){s(r)}})}o.withAsyncBody=t})(SC||(SC={}));function xQ(o){const e=new qt,t=o(e.token);return new kQ(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new wr)});try{for await(const s of t){if(e.token.isCancellationRequested)return;i.emitOne(s)}n.dispose(),e.dispose()}catch(s){n.dispose(),e.dispose(),i.reject(s)}})}class LQ{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new Ce("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new tf;return this._unsatisfiedConsumers.push(e),e.p}}}class Yi{constructor(e,t){this._onReturn=t,this._producerConsumer=new LQ,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async i=>(this._finishError(i),{done:!0,value:void 0})},queueMicrotask(async()=>{const i=e({emitOne:n=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:n}}),emitMany:n=>{for(const s of n)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:n=>this._finishError(n)});if(!this._producerConsumer.hasFinalValue)try{await i,this._finishOk()}catch(n){this._finishError(n)}})}static fromArray(e){return new Yi(t=>{t.emitMany(e)})}static fromPromise(e){return new Yi(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new Yi(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Yi(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}static{this.EMPTY=Yi.fromArray([])}static map(e,t){return new Yi(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return Yi.map(this,e)}static coalesce(e){return Yi.filter(e,t=>!!t)}coalesce(){return Yi.coalesce(this)}static filter(e,t){return new Yi(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return Yi.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}}class kQ extends Yi{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function RV(o){return o}class DQ{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=RV):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class UE{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=RV):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}var bu;(function(o){o[o.Uninitialized=0]="Uninitialized",o[o.Running=1]="Running",o[o.Completed=2]="Completed"})(bu||(bu={}));class On{constructor(e){this.executor=e,this._state=bu.Uninitialized}get value(){if(this._state===bu.Uninitialized){this._state=bu.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=bu.Completed}}else if(this._state===bu.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function MV(o){return!o||typeof o!="string"?!0:o.trim().length===0}const IQ=/{(\d+)}/g;function Lg(o,...e){return e.length===0?o:o.replace(IQ,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function EQ(o){return o.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function Xr(o){return o.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function _o(o){return o.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function NQ(o,e=" "){const t=dw(o,e);return PV(t,e)}function dw(o,e){if(!o||!e)return o;const t=e.length;if(t===0||o.length===0)return o;let i=0;for(;o.indexOf(e,i)===i;)i=i+t;return o.substring(i)}function PV(o,e){if(!o||!e)return o;const t=e.length,i=o.length;if(t===0||i===0)return o;let n=i,s=-1;for(;s=o.lastIndexOf(e,n-1),!(s===-1||s+t!==n);){if(s===0)return"";n=s}return o.substring(0,n)}function TQ(o){return o.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function AV(o,e,t={}){if(!o)throw new Error("Cannot create regex from empty string");e||(o=_o(o)),t.wholeWord&&(/\B/.test(o.charAt(0))||(o="\\b"+o),/\B/.test(o.charAt(o.length-1))||(o=o+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(o,i)}function OV(o){return o.source==="^"||o.source==="^$"||o.source==="$"||o.source==="^\\s*$"?!1:!!(o.exec("")&&o.lastIndex===0)}function bo(o){return o.split(/\r\n|\r|\n/)}function hs(o){for(let e=0,t=o.length;e=0;t--){const i=o.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function yC(o,e){return oe?1:0}function ZA(o,e,t=0,i=o.length,n=0,s=e.length){for(;tc)return 1}const r=i-t,a=s-n;return ra?1:0}function $E(o,e){return Qm(o,e,0,o.length,0,e.length)}function Qm(o,e,t=0,i=o.length,n=0,s=e.length){for(;t=128||c>=128)return ZA(o.toLowerCase(),e.toLowerCase(),t,i,n,s);$d(l)&&(l-=32),$d(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=s-n;return ra?1:0}function e1(o){return o>=48&&o<=57}function $d(o){return o>=97&&o<=122}function cl(o){return o>=65&&o<=90}function Bu(o,e){return o.length===e.length&&Qm(o,e)===0}function YA(o,e){const t=e.length;return t<=o.length&&Qm(o,e,0,t)===0}function RQ(o,e){const t=o.length,i=t-e.length;return i>=0&&Qm(o,e,i,t)===0}function ta(o,e){const t=Math.min(o.length,e.length);let i;for(i=0;i1){const i=o.charCodeAt(e-2);if(Vi(i))return XA(i,t)}return t}class QA{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=MQ(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=b0(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class C0{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new QA(e,t)}nextGraphemeLength(){const e=Hu.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const s=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(T3(n,r)){t.setOffset(s);break}n=r}return t.offset-i}prevGraphemeLength(){const e=Hu.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const s=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(T3(r,n)){t.setOffset(s);break}n=r}return i-t.offset}eol(){return this._iterator.eol()}}function JA(o,e){return new C0(o,e).nextGraphemeLength()}function FV(o,e){return new C0(o,e).prevGraphemeLength()}function PQ(o,e){e>0&&bh(o.charCodeAt(e))&&e--;const t=e+JA(o,e);return[t-FV(o,t),t]}let SD;function AQ(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function um(o){return SD||(SD=AQ()),SD.test(o)}const OQ=/^[\t\n\r\x20-\x7E]*$/;function hw(o){return OQ.test(o)}const WV=/[\u2028\u2029]/;function BV(o){return WV.test(o)}function Yc(o){return o>=11904&&o<=55215||o>=63744&&o<=64255||o>=65281&&o<=65374}function eO(o){return o>=127462&&o<=127487||o===8986||o===8987||o===9200||o===9203||o>=9728&&o<=10175||o===11088||o===11093||o>=127744&&o<=128591||o>=128640&&o<=128764||o>=128992&&o<=129008||o>=129280&&o<=129535||o>=129648&&o<=129782}const FQ="\uFEFF";function tO(o){return!!(o&&o.length>0&&o.charCodeAt(0)===65279)}function WQ(o,e=!1){return o?(e&&(o=o.replace(/\\./g,"")),o.toLowerCase()!==o):!1}function HV(o){return o=o%52,o<26?String.fromCharCode(97+o):String.fromCharCode(65+o-26)}function T3(o,e){return o===0?e!==5&&e!==7:o===2&&e===3?!1:o===4||o===2||o===3||e===4||e===2||e===3?!0:!(o===8&&(e===8||e===9||e===11||e===12)||(o===11||o===9)&&(e===9||e===10)||(o===12||o===10)&&e===10||e===5||e===13||e===7||o===1||o===13&&e===14||o===6&&e===6)}class Hu{static{this._INSTANCE=null}static getInstance(){return Hu._INSTANCE||(Hu._INSTANCE=new Hu),Hu._INSTANCE}constructor(){this._data=BQ()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1])n=2*n+1;else return t[3*n+2];return 0}}function BQ(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function HQ(o,e){if(o===0)return 0;const t=VQ(o,e);if(t!==void 0)return t;const i=new QA(e,o);return i.prevCodePoint(),i.offset}function VQ(o,e){const t=new QA(e,o);let i=t.prevCodePoint();for(;zQ(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!eO(i))return;let n=t.offset;return n>0&&t.prevCodePoint()===8205&&(n=t.offset),n}function zQ(o){return 127995<=o&&o<=127999}const VV=" ";class jd{static{this.ambiguousCharacterData=new On(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new DQ({getCacheKey:JSON.stringify},e=>{function t(d){const h=new Map;for(let u=0;u!d.startsWith("_")&&Object.hasOwn(s,d));r.length===0&&(r=["_default"]);let a;for(const d of r){const h=t(s[d]);a=n(a,h)}const l=t(s._common),c=i(l,a);return new jd(c)})}static getInstance(e){return jd.cache.get(Array.from(e))}static{this._locales=new On(()=>Object.keys(jd.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return jd._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}class Oc{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(Oc.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return Oc.getData().has(e)}static get codePoints(){return Oc.getData()}}var R3={};let Dp;const yD=globalThis.vscode;if(typeof yD<"u"&&typeof yD.process<"u"){const o=yD.process;Dp={get platform(){return o.platform},get arch(){return o.arch},get env(){return o.env},cwd(){return o.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Dp={get platform(){return process.platform},get arch(){return process.arch},get env(){return R3},cwd(){return R3.VSCODE_CWD||process.cwd()}}:Dp={get platform(){return Ln?"win32":ze?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const v0=Dp.cwd,w0=Dp.env,UQ=Dp.platform,$Q=65,jQ=97,qQ=90,KQ=122,ng=46,ns=47,ko=92,Kl=58,GQ=63;class zV extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const s=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${s} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function ZQ(o,e){if(o===null||typeof o!="object")throw new zV(e,"Object",o)}function dn(o,e){if(typeof o!="string")throw new zV(e,"string",o)}const Oh=UQ==="win32";function Ct(o){return o===ns||o===ko}function jE(o){return o===ns}function Gl(o){return o>=$Q&&o<=qQ||o>=jQ&&o<=KQ}function S0(o,e,t,i){let n="",s=0,r=-1,a=0,l=0;for(let c=0;c<=o.length;++c){if(c2){const d=n.lastIndexOf(t);d===-1?(n="",s=0):(n=n.slice(0,d),s=n.length-1-n.lastIndexOf(t)),r=c,a=0;continue}else if(n.length!==0){n="",s=0,r=c,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",s=2)}else n.length>0?n+=`${t}${o.slice(r+1,c)}`:n=o.slice(r+1,c),s=c-r-1;r=c,a=0}else l===ng&&a!==-1?++a:a=-1}return n}function YQ(o){return o?`${o[0]==="."?"":"."}${o}`:""}function UV(o,e){ZQ(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${YQ(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${o}${i}`:i}const co={resolve(...o){let e="",t="",i=!1;for(let n=o.length-1;n>=-1;n--){let s;if(n>=0){if(s=o[n],dn(s,`paths[${n}]`),s.length===0)continue}else e.length===0?s=v0():(s=w0[`=${e}`]||v0(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===ko)&&(s=`${e}\\`));const r=s.length;let a=0,l="",c=!1;const d=s.charCodeAt(0);if(r===1)Ct(d)&&(a=1,c=!0);else if(Ct(d))if(c=!0,Ct(s.charCodeAt(1))){let h=2,u=h;for(;h2&&Ct(s.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${s.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=S0(t,!i,"\\",Ct),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(o){dn(o,"path");const e=o.length;if(e===0)return".";let t=0,i,n=!1;const s=o.charCodeAt(0);if(e===1)return jE(s)?"\\":o;if(Ct(s))if(n=!0,Ct(o.charCodeAt(1))){let a=2,l=a;for(;a2&&Ct(o.charCodeAt(2))&&(n=!0,t=3));let r=t0&&Ct(o.charCodeAt(e-1))&&(r+="\\"),!n&&i===void 0&&o.includes(":")){if(r.length>=2&&Gl(r.charCodeAt(0))&&r.charCodeAt(1)===Kl)return`.\\${r}`;let a=o.indexOf(":");do if(a===e-1||Ct(o.charCodeAt(a+1)))return`.\\${r}`;while((a=o.indexOf(":",a+1))!==-1)}return i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(o){dn(o,"path");const e=o.length;if(e===0)return!1;const t=o.charCodeAt(0);return Ct(t)||e>2&&Gl(t)&&o.charCodeAt(1)===Kl&&Ct(o.charCodeAt(2))},join(...o){if(o.length===0)return".";let e,t;for(let s=0;s0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&Ct(t.charCodeAt(0))){++n;const s=t.length;s>1&&Ct(t.charCodeAt(1))&&(++n,s>2&&(Ct(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return co.normalize(e)},relative(o,e){if(dn(o,"from"),dn(e,"to"),o===e)return"";const t=co.resolve(o),i=co.resolve(e);if(t===i||(o=t.toLowerCase(),e=i.toLowerCase(),o===e))return"";if(t.length!==o.length||i.length!==e.length){const f=t.split("\\"),p=i.split("\\");f[f.length-1]===""&&f.pop(),p[p.length-1]===""&&p.pop();const _=f.length,b=p.length,C=_C?p.slice(w).join("\\"):_>C?"..\\".repeat(_-1-w)+"..":"":"..\\".repeat(_-w)+p.slice(w).join("\\")}let n=0;for(;nn&&o.charCodeAt(s-1)===ko;)s--;const r=s-n;let a=0;for(;aa&&e.charCodeAt(l-1)===ko;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+u)===ko)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>d&&(o.charCodeAt(n+u)===ko?h=u:u===2&&(h=3)),h===-1&&(h=0)}let g="";for(u=n+h+1;u<=s;++u)(u===s||o.charCodeAt(u)===ko)&&(g+=g.length===0?"..":"\\..");return a+=h,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===ko&&++a,i.slice(a,l))},toNamespacedPath(o){if(typeof o!="string"||o.length===0)return o;const e=co.resolve(o);if(e.length<=2)return o;if(e.charCodeAt(0)===ko){if(e.charCodeAt(1)===ko){const t=e.charCodeAt(2);if(t!==GQ&&t!==ng)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Gl(e.charCodeAt(0))&&e.charCodeAt(1)===Kl&&e.charCodeAt(2)===ko)return`\\\\?\\${e}`;return e},dirname(o){dn(o,"path");const e=o.length;if(e===0)return".";let t=-1,i=0;const n=o.charCodeAt(0);if(e===1)return Ct(n)?o:".";if(Ct(n)){if(t=i=1,Ct(o.charCodeAt(1))){let a=2,l=a;for(;a2&&Ct(o.charCodeAt(2))?3:2,i=t);let s=-1,r=!0;for(let a=e-1;a>=i;--a)if(Ct(o.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(s===-1){if(t===-1)return".";s=t}return o.slice(0,s)},basename(o,e){e!==void 0&&dn(e,"suffix"),dn(o,"path");let t=0,i=-1,n=!0,s;if(o.length>=2&&Gl(o.charCodeAt(0))&&o.charCodeAt(1)===Kl&&(t=2),e!==void 0&&e.length>0&&e.length<=o.length){if(e===o)return"";let r=e.length-1,a=-1;for(s=o.length-1;s>=t;--s){const l=o.charCodeAt(s);if(Ct(l)){if(!n){t=s+1;break}}else a===-1&&(n=!1,a=s+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=s):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=o.length),o.slice(t,i)}for(s=o.length-1;s>=t;--s)if(Ct(o.charCodeAt(s))){if(!n){t=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":o.slice(t,i)},extname(o){dn(o,"path");let e=0,t=-1,i=0,n=-1,s=!0,r=0;o.length>=2&&o.charCodeAt(1)===Kl&&Gl(o.charCodeAt(0))&&(e=i=2);for(let a=o.length-1;a>=e;--a){const l=o.charCodeAt(a);if(Ct(l)){if(!s){i=a+1;break}continue}n===-1&&(s=!1,n=a+1),l===ng?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":o.slice(t,n)},format:UV.bind(null,"\\"),parse(o){dn(o,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return e;const t=o.length;let i=0,n=o.charCodeAt(0);if(t===1)return Ct(n)?(e.root=e.dir=o,e):(e.base=e.name=o,e);if(Ct(n)){if(i=1,Ct(o.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=o.slice(0,i));let s=-1,r=i,a=-1,l=!0,c=o.length-1,d=0;for(;c>=i;--c){if(n=o.charCodeAt(c),Ct(n)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),n===ng?s===-1?s=c:d!==1&&(d=1):s!==-1&&(d=-1)}return a!==-1&&(s===-1||d===0||d===1&&s===a-1&&s===r+1?e.base=e.name=o.slice(r,a):(e.name=o.slice(r,s),e.base=o.slice(r,a),e.ext=o.slice(s,a))),r>0&&r!==i?e.dir=o.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},XQ=(()=>{if(Oh){const o=/\\/g;return()=>{const e=v0().replace(o,"/");return e.slice(e.indexOf("/"))}}return()=>v0()})(),Ai={resolve(...o){let e="",t=!1;for(let i=o.length-1;i>=0&&!t;i--){const n=o[i];dn(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===ns)}if(!t){const i=XQ();e=`${i}/${e}`,t=i.charCodeAt(0)===ns}return e=S0(e,!t,"/",jE),t?`/${e}`:e.length>0?e:"."},normalize(o){if(dn(o,"path"),o.length===0)return".";const e=o.charCodeAt(0)===ns,t=o.charCodeAt(o.length-1)===ns;return o=S0(o,!e,"/",jE),o.length===0?e?"/":t?"./":".":(t&&(o+="/"),e?`/${o}`:o)},isAbsolute(o){return dn(o,"path"),o.length>0&&o.charCodeAt(0)===ns},join(...o){if(o.length===0)return".";const e=[];for(let t=0;t0&&e.push(i)}return e.length===0?".":Ai.normalize(e.join("/"))},relative(o,e){if(dn(o,"from"),dn(e,"to"),o===e||(o=Ai.resolve(o),e=Ai.resolve(e),o===e))return"";const t=1,i=o.length,n=i-t,s=1,r=e.length-s,a=na){if(e.charCodeAt(s+c)===ns)return e.slice(s+c+1);if(c===0)return e.slice(s+c)}else n>a&&(o.charCodeAt(t+c)===ns?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||o.charCodeAt(c)===ns)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(s+l)}`},toNamespacedPath(o){return o},dirname(o){if(dn(o,"path"),o.length===0)return".";const e=o.charCodeAt(0)===ns;let t=-1,i=!0;for(let n=o.length-1;n>=1;--n)if(o.charCodeAt(n)===ns){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":o.slice(0,t)},basename(o,e){e!==void 0&&dn(e,"suffix"),dn(o,"path");let t=0,i=-1,n=!0,s;if(e!==void 0&&e.length>0&&e.length<=o.length){if(e===o)return"";let r=e.length-1,a=-1;for(s=o.length-1;s>=0;--s){const l=o.charCodeAt(s);if(l===ns){if(!n){t=s+1;break}}else a===-1&&(n=!1,a=s+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=s):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=o.length),o.slice(t,i)}for(s=o.length-1;s>=0;--s)if(o.charCodeAt(s)===ns){if(!n){t=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":o.slice(t,i)},extname(o){dn(o,"path");let e=-1,t=0,i=-1,n=!0,s=0;for(let r=o.length-1;r>=0;--r){const a=o[r];if(a==="/"){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a==="."?e===-1?e=r:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===t+1?"":o.slice(e,i)},format:UV.bind(null,"/"),parse(o){dn(o,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return e;const t=o.charCodeAt(0)===ns;let i;t?(e.root="/",i=1):i=0;let n=-1,s=0,r=-1,a=!0,l=o.length-1,c=0;for(;l>=i;--l){const d=o.charCodeAt(l);if(d===ns){if(!a){s=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===ng?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}if(r!==-1){const d=s===0&&t?1:s;n===-1||c===0||c===1&&n===r-1&&n===s+1?e.base=e.name=o.slice(d,r):(e.name=o.slice(d,n),e.base=o.slice(d,r),e.ext=o.slice(n,r))}return s>0?e.dir=o.slice(0,s-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Ai.win32=co.win32=co;Ai.posix=co.posix=Ai;const $V=Oh?co.normalize:Ai.normalize,QQ=Oh?co.resolve:Ai.resolve,JQ=Oh?co.relative:Ai.relative,ES=Oh?co.dirname:Ai.dirname,Fc=Oh?co.basename:Ai.basename,eJ=Oh?co.extname:Ai.extname,Da=Oh?co.sep:Ai.sep,tJ=/^\w[\w\d+.-]*$/,iJ=/^\//,nJ=/^\/\//;function sJ(o,e){if(!o.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${o.authority}", path: "${o.path}", query: "${o.query}", fragment: "${o.fragment}"}`);if(o.scheme&&!tJ.test(o.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(o.path){if(o.authority){if(!iJ.test(o.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(nJ.test(o.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function oJ(o,e){return!o&&!e?"file":o}function rJ(o,e){switch(o){case"https":case"http":case"file":e?e[0]!==va&&(e=va+e):e=va;break}return e}const Ii="",va="/",aJ=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class _e{static isUri(e){return e instanceof _e?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,i,n,s,r=!1){typeof e=="object"?(this.scheme=e.scheme||Ii,this.authority=e.authority||Ii,this.path=e.path||Ii,this.query=e.query||Ii,this.fragment=e.fragment||Ii):(this.scheme=oJ(e,r),this.authority=t||Ii,this.path=rJ(this.scheme,i||Ii),this.query=n||Ii,this.fragment=s||Ii,sJ(this,r))}get fsPath(){return y0(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Ii),i===void 0?i=this.authority:i===null&&(i=Ii),n===void 0?n=this.path:n===null&&(n=Ii),s===void 0?s=this.query:s===null&&(s=Ii),r===void 0?r=this.fragment:r===null&&(r=Ii),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&r===this.fragment?this:new yf(t,i,n,s,r)}static parse(e,t=!1){const i=aJ.exec(e);return i?new yf(i[2]||Ii,t1(i[4]||Ii),t1(i[5]||Ii),t1(i[7]||Ii),t1(i[9]||Ii),t):new yf(Ii,Ii,Ii,Ii,Ii)}static file(e){let t=Ii;if(Ln&&(e=e.replace(/\\/g,va)),e[0]===va&&e[1]===va){const i=e.indexOf(va,2);i===-1?(t=e.substring(2),e=va):(t=e.substring(2,i),e=e.substring(i)||va)}return new yf("file",t,e,Ii,Ii)}static from(e,t){return new yf(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Ln&&e.scheme==="file"?i=_e.file(co.join(y0(e,!0),...t)).path:i=Ai.join(e.path,...t),e.with({path:i})}toString(e=!1){return qE(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof _e)return e;{const t=new yf(e);return t._formatted=e.external??null,t._fsPath=e._sep===jV?e.fsPath??null:null,t}}else return e}}const jV=Ln?1:void 0;let yf=class extends _e{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=y0(this,!1)),this._fsPath}toString(e=!1){return e?qE(this,!0):(this._formatted||(this._formatted=qE(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=jV),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const qV={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function M3(o,e,t){let i,n=-1;for(let s=0;s=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)n!==-1&&(i+=encodeURIComponent(o.substring(n,s)),n=-1),i!==void 0&&(i+=o.charAt(s));else{i===void 0&&(i=o.substr(0,s));const a=qV[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(o.substring(n,s)),n=-1),i+=a):n===-1&&(n=s)}}return n!==-1&&(i+=encodeURIComponent(o.substring(n))),i!==void 0?i:o}function lJ(o){let e;for(let t=0;t1&&o.scheme==="file"?t=`//${o.authority}${o.path}`:o.path.charCodeAt(0)===47&&(o.path.charCodeAt(1)>=65&&o.path.charCodeAt(1)<=90||o.path.charCodeAt(1)>=97&&o.path.charCodeAt(1)<=122)&&o.path.charCodeAt(2)===58?e?t=o.path.substr(1):t=o.path[1].toLowerCase()+o.path.substr(2):t=o.path,Ln&&(t=t.replace(/\//g,"\\")),t}function qE(o,e){const t=e?lJ:M3;let i="",{scheme:n,authority:s,path:r,query:a,fragment:l}=o;if(n&&(i+=n,i+=":"),(s||n==="file")&&(i+=va,i+=va),s){let c=s.indexOf("@");if(c!==-1){const d=s.substr(0,c);s=s.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}s=s.toLowerCase(),c=s.lastIndexOf(":"),c===-1?i+=t(s,!1,!0):(i+=t(s.substr(0,c),!1,!0),i+=s.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:M3(l,!1,!1)),i}function KV(o){try{return decodeURIComponent(o)}catch{return o.length>3?o.substr(0,3)+KV(o.substr(3)):o}}const P3=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function t1(o){return o.match(P3)?o.replace(P3,e=>KV(e)):o}var Le;(function(o){o.inMemory="inmemory",o.vscode="vscode",o.internal="private",o.walkThrough="walkThrough",o.walkThroughSnippet="walkThroughSnippet",o.http="http",o.https="https",o.file="file",o.mailto="mailto",o.untitled="untitled",o.data="data",o.command="command",o.vscodeRemote="vscode-remote",o.vscodeRemoteResource="vscode-remote-resource",o.vscodeManagedRemoteResource="vscode-managed-remote-resource",o.vscodeUserData="vscode-userdata",o.vscodeCustomEditor="vscode-custom-editor",o.vscodeNotebookCell="vscode-notebook-cell",o.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",o.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",o.vscodeNotebookCellOutput="vscode-notebook-cell-output",o.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",o.vscodeNotebookMetadata="vscode-notebook-metadata",o.vscodeInteractiveInput="vscode-interactive-input",o.vscodeSettings="vscode-settings",o.vscodeWorkspaceTrust="vscode-workspace-trust",o.vscodeTerminal="vscode-terminal",o.vscodeChatCodeBlock="vscode-chat-code-block",o.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",o.vscodeChatEditor="vscode-chat-editor",o.vscodeChatInput="chatSessionInput",o.vscodeLocalChatSession="vscode-chat-session",o.webviewPanel="webview-panel",o.vscodeWebview="vscode-webview",o.extension="extension",o.vscodeFileResource="vscode-file",o.tmp="tmp",o.vsls="vsls",o.vscodeSourceControl="vscode-scm",o.commentsInput="comment",o.codeSetting="code-setting",o.outputChannel="output",o.accessibleView="accessible-view",o.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",o.chatEditingModel="chat-editing-text-model",o.copilotPr="copilot-pr"})(Le||(Le={}));function lL(o,e){return _e.isUri(o)?Bu(o.scheme,e):YA(o,e+":")}function KE(o,...e){return e.some(t=>lL(o,t))}const cJ="tkn";class dJ{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return Ai.join(this._serverRootPath,Le.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Ee(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(r+=`&${cJ}=${encodeURIComponent(s)}`),_e.from({scheme:Bl?this._preferredWebSchema:Le.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const GV=new dJ,hJ="vscode-app";class x0{static{this.FALLBACK_AUTHORITY=hJ}uriToBrowserUri(e){return e.scheme===Le.vscodeRemote?GV.rewrite(e):e.scheme===Le.file&&(Ma||$X===`${Le.vscodeFileResource}://${x0.FALLBACK_AUTHORITY}`)?e.with({scheme:Le.vscodeFileResource,authority:e.authority||x0.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}const ZV=new x0;var GE;(function(o){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);o.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(s){let r;typeof s=="string"?r=new URL(s).searchParams:s instanceof URL?r=s.searchParams:_e.isUri(s)&&(r=new URL(s.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}o.getHeadersFromQuery=i;function n(s,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}o.addSearchParam=n})(GE||(GE={}));const A3=typeof Buffer<"u";new On(()=>new Uint8Array(256));let xD;class lh{static wrap(e){return A3&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new lh(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return A3?this.buffer.toString():(xD||(xD=new TextDecoder),xD.decode(this.buffer))}}function uJ(o,e){return o[e+0]<<0>>>0|o[e+1]<<8>>>0}function gJ(o,e,t){o[t+0]=e&255,e=e>>>8,o[t+1]=e&255}function pa(o,e){return o[e]*2**24+o[e+1]*2**16+o[e+2]*2**8+o[e+3]}function ma(o,e,t){o[t+3]=e,e=e>>>8,o[t+2]=e,e=e>>>8,o[t+1]=e,e=e>>>8,o[t]=e}function O3(o,e){return o[e]}function F3(o,e,t){o[t]=e}const W3="0123456789abcdef";function fJ({buffer:o}){let e="";for(let t=0;t>>4],e+=W3[i&15]}return e}function uw(o){return cL(o,0)}function cL(o,e){switch(typeof o){case"object":return o===null?Lc(349,e):Array.isArray(o)?mJ(o,e):_J(o,e);case"string":return iO(o,e);case"boolean":return pJ(o,e);case"number":return Lc(o,e);case"undefined":return Lc(937,e);default:return Lc(617,e)}}function Lc(o,e){return(e<<5)-e+o|0}function pJ(o,e){return Lc(o?433:863,e)}function iO(o,e){e=Lc(149417,e);for(let t=0,i=o.length;tcL(i,t),e)}function _J(o,e){return e=Lc(181387,e),Object.keys(o).sort().reduce((t,i)=>(t=iO(i,t),cL(o[i],t)),e)}function LD(o,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function k_(o,e=32){return o instanceof ArrayBuffer?fJ(lh.wrap(new Uint8Array(o))):(o>>>0).toString(16).padStart(e/4,"0")}class nO{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let n=this._buffLen,s=this._leftoverHighSurrogate,r,a;for(s!==0?(r=s,a=-1,s=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(Vi(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),k_(this._h0)+k_(this._h1)+k_(this._h2)+k_(this._h3)+k_(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=nO._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,LD(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,n=this._h1,s=this._h2,r=this._h3,a=this._h4,l,c,d;for(let h=0;h<80;h++)h<20?(l=n&s|~n&r,c=1518500249):h<40?(l=n^s^r,c=1859775393):h<60?(l=n&s|n&r|s&r,c=2400959708):(l=n^s^r,c=3395469782),d=LD(i,5)+l+a+c+e.getUint32(h*4,!1)&4294967295,a=r,r=s,s=LD(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}function bJ(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function jt(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;it(o[i],e))}function sO(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function ZE(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o!!e)}function H3(o){let e=0;for(let t=0;t0}function Xc(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function vs(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function dL(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function kD(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function i1(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function YE(o,e){for(const t of e)o.push(t)}function wJ(o,e){const t=[];for(const i of o){const n=e(i);n!==void 0&&t.push(n)}return t}function rO(o){return Array.isArray(o)?o:[o]}function SJ(o,e,t){const i=QV(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(ch||(ch={}));function Bn(o,e){return(t,i)=>e(o(t),o(i))}function yJ(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!ch.isNeitherLessOrGreaterThan(n))return n}return ch.neitherLessOrGreaterThan}}const uo=(o,e)=>o-e,JV=(o,e)=>uo(o?1:0,e?1:0);function ez(o){return(e,t)=>-o(e,t)}function xJ(o){return(e,t)=>e===void 0?t===void 0?ch.neitherLessOrGreaterThan:ch.lessThan:t===void 0?ch.greaterThan:o(e,t)}class Qc{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Wc{static{this.empty=new Wc(e=>{})}constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Wc(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Wc(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||ch.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}class D0{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,s)=>t(e[n],e[s]));return new D0(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;te+t,0)}let au;function LJ(o){au?au instanceof V3?au.loggers.push(o):au=new V3([au,o]):au=o}function Zn(){return au}class V3{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const i of this.loggers)i.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const i of this.loggers)i.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const n of this.loggers)n.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const n of this.loggers)n.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}var qi;(function(o){let e=!1;function t(){e=!0}o.enable=t;function i(){if(!e)return;const n=Error,s=n.stackTraceLimit;n.stackTraceLimit=3;const r=new Error().stack;return n.stackTraceLimit=s,aO.fromStack(r,2)}o.ofCaller=i})(qi||(qi={}));class aO{static fromStack(e,t){const i=e.split(` +`),n=kJ(i[t+1]);if(n)return new aO(n.fileName,n.line,n.column,n.id)}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}}function kJ(o){const e=o.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:o};const t=o.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:o}}const Go=(o,e)=>o===e;function xC(o=Go){return(e,t)=>jt(e,t,o)}function lO(){return(o,e)=>o.equals(e)}function Vu(o,e,t){if(t!==void 0){const i=o;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=o;return(n,s)=>n==null||s===void 0||s===null?s===n:i(n,s)}}function XE(o,e){if(o===e)return!0;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0;t{const r=cO(s);if(r!==void 0)return r;const l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(l)return`${this.debugName}.${l[2]}`;if(!n)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r),i)}flatten(){return JE({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(iz(this,t)),this}}class Jm extends nz{constructor(e){super(),this._observers=new Set,Zn()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&Zn()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&Zn()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function MJ(o){switch(o){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class or extends Jm{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n=void 0,s,r){super(r),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=n,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,Zn()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let t;try{this._isReaderValid=!0;let i;this._changeTracker&&(i=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,i)),t=this._computeFn(this,i)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),t}else{do{if(this._state===1){for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const i=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,i),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(i));const n=this._state!==0,s=this._value;this._state=3;const r=this._delayedStore;r!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,i)}finally{this._isReaderValid=!1;for(const a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),r!==void 0&&r.dispose()}e=this._didReportChange||n&&!this._equalityComparator(s,this._value),Zn()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:n})}catch(i){f0(i)}if(this._isComputing=!1,!this._didReportChange&&e)for(const i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Ce("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===3&&(this._state=1,!t))for(const i of this._observers)i.handlePossibleChange(this);if(t)for(const i of this._observers)i.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const i of t)i.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const i=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const n of i)n.endUpdate(this)}}_h(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){Zn()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:s=>s===e},this._changeSummary):!0}catch(s){f0(s)}const n=this._state===3;if(i&&(this._state===1||n)&&(this._state=2,n))for(const s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Ce("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new z),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:MJ(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,i){this._value=e;const n=this._observers;t.updateObserver(this,this);for(const s of n)s.handleChange(this,i)}}class sz extends or{constructor(e,t,i,n=void 0,s,r,a){super(e,t,i,n,s,a),this.set=r}}function $(o,e,t=qi.ofCaller()){return e!==void 0?new or(new Vn(o,void 0,e),e,void 0,void 0,Go,t):new or(new Vn(void 0,void 0,o),o,void 0,void 0,Go,t)}function dO(o,e,t,i=qi.ofCaller()){return new sz(new Vn(o,void 0,e),e,void 0,void 0,Go,t,i)}function An(o,e,t=qi.ofCaller()){return new or(new Vn(o.owner,o.debugName,o.debugReferenceFn),e,void 0,o.onLastObserverRemoved,o.equalsFn??Go,t)}TJ(An);function j3(o,e,t=qi.ofCaller()){return new or(new Vn(o.owner,o.debugName,void 0),e,o.changeTracker,void 0,o.equalityComparer??Go,t)}function sr(o,e,t=qi.ofCaller()){let i,n;e===void 0?(i=o,n=void 0):(n=o,i=e);let s;return new or(new Vn(n,void 0,i),r=>{s?s.clear():s=new z;const a=i(r);return a&&s.add(a),a},void 0,()=>{s&&(s.dispose(),s=void 0)},Go,t)}function PJ(o){switch(o){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}class LC{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),Zn()?.handleAutorunCreated(this,n),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),Zn()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){Zn()?.handleAutorunStarted(this);const t=this._changeSummary,i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(n){f0(n)}finally{this._isRunning=!1,i!==void 0&&i.dispose()}}}finally{this._disposed||Zn()?.handleAutorunFinished(this);for(const t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===1){this._state=3;for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state!==3&&this._run()}while(this._state!==3)}finally{this._updateCount--}_h(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){Zn()?.handleAutorunDependencyChanged(this,e,t);try{(this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:n=>n===e},this._changeSummary):!0)&&(this._state=2)}catch(i){f0(i)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Ce("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new Ce("Cannot access store after dispose");return this._store===void 0&&(this._store=new z),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:PJ(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function xe(o,e=qi.ofCaller()){return new LC(new Vn(void 0,void 0,o),o,void 0,e)}function hL(o,e,t=qi.ofCaller()){return new LC(new Vn(o.owner,o.debugName,o.debugReferenceFn??e),e,void 0,t)}function e_(o,e,t=qi.ofCaller()){return new LC(new Vn(o.owner,o.debugName,o.debugReferenceFn??e),e,o.changeTracker,t)}function AJ(o,e){const t=new z,i=e_({owner:o.owner,debugName:o.debugName,debugReferenceFn:o.debugReferenceFn??e,changeTracker:o.changeTracker},(n,s)=>{t.clear(),e(n,s,t)});return ue(()=>{i.dispose(),t.dispose()})}function Xn(o){const e=new z,t=hL({owner:void 0,debugName:void 0,debugReferenceFn:o},i=>{e.clear(),o(i,e)});return ue(()=>{t.dispose(),e.dispose()})}function OJ(o,e){let t;return hL({debugReferenceFn:e},i=>{const n=o.read(i),s=t;t=n,e({lastValue:s,newValue:n})})}function q3(o){const e=new Error("BugIndicatingErrorRecovery: "+o);Ee(e),console.error("recovered from an error that indicates a bug",e)}function Et(o,e){const t=new t_(o,e);try{o(t)}finally{t.finish()}}let n1;function tb(o){if(n1)o(n1);else{const e=new t_(o,void 0);n1=e;try{o(e)}finally{e.finish(),n1=void 0}}}async function FJ(o,e){const t=new t_(o,e);try{await o(t)}finally{t.finish()}}function gm(o,e,t){o?e(o):Et(e,t)}class t_{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],Zn()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():cO(this._fn)}updateObserver(e,t){if(!this._updatingObservers){q3("Transaction already finished!"),Et(i=>{i.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(!e){q3("transaction.finish() has already been called!");return}for(let t=0;tkc.globalTransaction,Go,n??qi.ofCaller())}function oz(o,e,t,i=qi.ofCaller()){return new kc(new Vn(o.owner,o.debugName,o.debugReferenceFn??t),e,t,()=>kc.globalTransaction,o.equalsFn??Go,i)}class kc extends Jm{constructor(e,t,i,n,s,r){super(r),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=a=>{const l=this._getValue(a),c=this._value,d=!this._hasValue||!this._equalityComparator(c,l);let h=!1;d&&(this._value=l,this._hasValue&&(h=!0,gm(this._getTransaction(),u=>{Zn()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue});for(const g of this._observers)u.updateObserver(g,this),g.handleChange(this,void 0)},()=>{const u=this.getDebugName();return"Event fired"+(u?`: ${u}`:"")})),this._hasValue=!0),h||Zn()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}(function(o){o.Observer=kc;function e(t,i){let n=!1;kc.globalTransaction===void 0&&(kc.globalTransaction=t,n=!0);try{i()}finally{n&&(kc.globalTransaction=void 0)}}o.batchEventsGlobally=e})(dt||(dt={}));function K3(o,e){let t=!1,i,n;return dt(s=>{const r=xe(a=>{const l=o.read(a);t?(n&&clearTimeout(n),n=setTimeout(()=>{i=l,s()},e)):(t=!0,i=l)});return{dispose(){r.dispose(),t=!1,i=void 0}}},()=>t?i:o.get())}function fm(o,e){const t=new WJ(!0,e);o.addObserver(t);try{t.beginUpdate(o)}finally{t.endUpdate(o)}return ue(()=>{o.removeObserver(t)})}RJ(fm);class WJ{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function ld(o,e){let t;return An({owner:o,debugReferenceFn:e},n=>(t=e(n,t),t))}function hO(o,e,t,i){let n=new G3(t,i);return An({debugReferenceFn:t,owner:o,onLastObserverRemoved:()=>{n.dispose(),n=new G3(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}let G3=class{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const s=this._keySelector?this._keySelector(n):n;let r=this._cache.get(s);if(r)i.delete(s);else{const a=new z;r={out:this._map(n,a),store:a},this._cache.set(s,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}};function np(o,e){switch(typeof o){case"number":return""+o;case"string":return o.length+2<=e?`"${o}"`:`"${o.substr(0,e-7)}"+...`;case"boolean":return o?"true":"false";case"undefined":return"undefined";case"object":return o===null?"null":Array.isArray(o)?BJ(o,e):HJ(o,e);case"symbol":return o.toString();case"function":return`[[Function${o.name?" "+o.name:""}]]`;default:return""+o}}function BJ(o,e){let t="[ ",i=!0;for(const n of o){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${np(n,e-t.length)}`}return t+=" ]",t}function HJ(o,e){if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString){const s=o.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}const t=tz(o);let i=t?t+"(":"{ ",n=!0;for(const[s,r]of Object.entries(o)){if(n||(i+=", "),i.length-5>e){i+="...";break}n=!1,i+=`${s}: ${np(r,e-i.length)}`}return i+=t?")":" }",i}class uO{static createClient(e,t){return new uO(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:s=>{const r=s,a=this._getHandler().notifications[r[0]];if(!a)throw new Error(`Unknown notification "${r[0]}"!`);a(...r[1])},handleRequest:s=>{const r=s;try{return{type:"result",value:this._getHandler().requests[r[0]](...r[1])}}catch(a){return{type:"error",value:a}}}});const i=new Proxy({},{get:(s,r)=>async(...a)=>{const l=await this._channel.sendRequest([r,a]);if(l.type==="error")throw l.value;return l.value}}),n=new Proxy({},{get:(s,r)=>(...a)=>{this._channel.sendNotification([r,a])}});this.api={notifications:n,requests:i}}}function VJ(o,e){const t=globalThis;let i=[],n;const{channel:s,handler:r}=zJ({sendNotification:l=>{n?n.sendNotification(l):i.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[o]=l=>{a=e(),n=l;for(const c of i)l.sendNotification(c);return i=[],r},uO.createClient(s,()=>{if(!a)throw new Error("Not supported");return a})}function zJ(o){let e;return{channel:i=>(e=i,{sendNotification:n=>{o.sendNotification(n)},sendRequest:n=>{throw new Error("not supported")}}),handler:{handleRequest:i=>i.type==="notification"?e?.handleNotification(i.data):e?.handleRequest(i.data)}}}class UJ{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}function rz(o,e){for(const t in e)o[t]&&typeof o[t]=="object"&&e[t]&&typeof e[t]=="object"?rz(o[t],e[t]):o[t]=e[t]}function az(o,e){for(const t in e)e[t]===null?delete o[t]:o[t]&&typeof o[t]=="object"&&e[t]&&typeof e[t]=="object"?az(o[t],e[t]):o[t]=e[t]}function De(o,e,t=qi.ofCaller()){let i;return typeof o=="string"?i=new Vn(void 0,o,void 0):i=new Vn(o,void 0,void 0),new kC(i,e,Go,t)}class kC extends Jm{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,Zn()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new t_(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),Zn()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this._observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function gO(o,e,t=qi.ofCaller()){let i;return typeof o=="string"?i=new Vn(void 0,o,void 0):i=new Vn(o,void 0,void 0),new $J(i,e,Go,t)}class $J extends kC{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class sp{static{this._instance=void 0}static getInstance(){return sp._instance===void 0&&(sp._instance=new sp),sp._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(t.length===0)return;const i=t.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),n=new Set;for(;i.length>0;){const s=i.shift();if(n.has(s))continue;n.add(s);const r=this._getInfo(s,a=>{n.has(a)||i.push(a)});r&&e.push(r)}return{names:t.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(!t){Ee(new Ce("No info found"));return}return t}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(!t){Ee(new Ce("No info found"));return}return t}_getInfo(e,t){if(e instanceof or){const i=[...e.debugGetObservers()];for(const l of i)t(l);const n=this._getObservableInfo(e);if(!n)return;const s=e.debugGetState(),r={name:e.debugName,instanceId:n.instanceId,updateCount:s.updateCount},a=[...n.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(hn);if(s.isComputing)return{...r,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(s.state){case 0:return{...r,type:"observable/derived",state:"noValue"};case 3:return{...r,type:"observable/derived",state:"upToDate"};case 2:return{...r,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...r,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof LC){const i=this._getAutorunInfo(e);if(!i)return;const n={name:e.debugName,instanceId:i.instanceId,updateCount:i.updateCount},s=[...i.changedObservables].map(r=>this._instanceInfos.get(r).instanceId);if(e.debugGetState().isRunning)return{...n,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...n,type:"autorun",state:"upToDate"};case 2:return{...n,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...n,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof or)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=VJ("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(i=>this._formatObserver(i)).filter(hn)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(hn),observers:[...t.debugGetObservers()].map(i=>this._formatObserver(i)).filter(hn)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(hn)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const i=this._aliveInstances.get(e);if(i instanceof or)i.debugSetValue(t);else if(i instanceof kC)i.debugSetValue(t);else if(i instanceof kc)i.debugSetValue(t);else throw new Ce("Observable is not supported");const n=[...i.debugGetObservers()];for(const s of n)s.beginUpdate(i);for(const s of n)s.handleChange(i,void 0);for(const s of n)s.endUpdate(i)},getValue:e=>{const t=this._aliveInstances.get(e);if(t instanceof or)return np(t.debugGetState().value,200);if(t instanceof kC)return np(t.debugGetState().value,200)},logValue:e=>{const t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new Ce("Observable is not supported")},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof or)t.debugRecompute();else if(t instanceof LC)t.debugRerun();else throw new Ce("Observable is not supported")}}})),this._pendingChanges=null,this._changeThrottler=new UJ,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},qi.enable()}_handleChange(e){az(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:rz(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let i=this._declarations.get(t.id);return i===void 0&&(i={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,i),this._handleChange({decls:{[i.id]:i}})),i.id}handleObservableCreated(e,t){const n={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n)}handleOnListenerCountChanged(e,t){const i=this._getObservableInfo(e);if(i){if(i.listenerCount===0&&t>0){const n=e instanceof or?"observable/derived":"observable/value";this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:n,name:e.debugName}}})}else i.listenerCount>0&&t===0&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId));i.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof or){this._handleDerivedRecomputed(e,t);return}const i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=np(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e,t){const n={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n),this._aliveInstances.set(n.instanceId,e),n&&this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){const n=this._getAutorunInfo(e);n&&n.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){const n=this._getObservableInfo(e);n&&n.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const i=this._getObservableInfo(e);if(!i)return;const n=np(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=n,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:n,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}}w0&&w0.VSCODE_DEV_DEBUG_OBSERVABLES&&LJ(sp.getInstance());const{getWindow:pe,getDocument:jJ,getWindows:lz,getWindowsCount:qJ,getWindowId:DC,getWindowById:Z3,onDidRegisterWindow:gw,onWillUnregisterWindow:KJ,onDidUnregisterWindow:GJ}=(function(){const o=new Map;RX(wt,1);const e={window:wt,disposables:new z};o.set(wt.vscodeWindowId,e);const t=new P,i=new P,n=new P;function s(r,a){return(typeof r=="number"?o.get(r):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(r){if(o.has(r.vscodeWindowId))return A.None;const a=new z,l={window:r,disposables:a.add(new z)};return o.set(r.vscodeWindowId,l),a.add(ue(()=>{o.delete(r.vscodeWindowId),i.fire(r)})),a.add(W(r,ee.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(l),a},getWindows(){return o.values()},getWindowsCount(){return o.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return o.has(r)},getWindowById:s,getWindow(r){const a=r;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const l=r;return l?.view?l.view.window:wt},getDocument(r){return pe(r).document}}})();function xn(o){for(;o.firstChild;)o.firstChild.remove()}class ZJ{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function W(o,e,t,i){return new ZJ(o,e,t,i)}function cz(o,e){return function(t){return e(new Wn(o,t))}}function YJ(o){return function(e){return o(new yt(e))}}const Li=function(e,t,i,n){let s=i;return t==="click"||t==="mousedown"||t==="contextmenu"?s=cz(pe(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(s=YJ(i)),W(e,t,s,n)},XJ=function(e,t,i){const n=cz(pe(e),t);return dz(e,n,i)};function dz(o,e,t){return W(o,Sr&&lw.pointerEvents?ee.POINTER_DOWN:ee.MOUSE_DOWN,e,t)}function QJ(o,e,t){return W(o,Sr&&lw.pointerEvents?ee.POINTER_MOVE:ee.MOUSE_MOVE,e,t)}function Y3(o,e,t){return W(o,Sr&&lw.pointerEvents?ee.POINTER_UP:ee.MOUSE_UP,e,t)}function ib(o,e,t){return xb(o,e,t)}class DD extends TV{constructor(e,t){super(e,t)}}let E0,Zs;class fO extends KA{constructor(e){super(),this.defaultTarget=e&&pe(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class ID{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ee(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const o=new Map,e=new Map,t=new Map,i=new Map,n=s=>{t.set(s,!1);const r=o.get(s)??[];for(e.set(s,r),o.set(s,[]),i.set(s,!0);r.length>0;)r.sort(ID.sort),r.shift().execute();i.set(s,!1)};Zs=(s,r,a=0)=>{const l=DC(s),c=new ID(r,a);let d=o.get(l);return d||(d=[],o.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),s.requestAnimationFrame(()=>n(l))),c},E0=(s,r,a)=>{const l=DC(s);if(i.get(l)){const c=new ID(r,a);let d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return Zs(s,r,a)}})();function uL(o){return pe(o).getComputedStyle(o,null)}function Ch(o,e,t){const i=pe(o),n=i.document;if(o!==n.body)return new at(o.clientWidth,o.clientHeight);if(Sr&&i?.visualViewport)return new at(i.visualViewport.width,i.visualViewport.height);if(i?.innerWidth&&i.innerHeight)return new at(i.innerWidth,i.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new at(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new at(n.documentElement.clientWidth,n.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class xi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){const i=uL(e),n=i?i.getPropertyValue(t):"0";return xi.convertToPixels(e,n)}static getBorderLeftWidth(e){return xi.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return xi.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return xi.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return xi.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return xi.getDimension(e,"padding-left")}static getPaddingRight(e){return xi.getDimension(e,"padding-right")}static getPaddingTop(e){return xi.getDimension(e,"padding-top")}static getPaddingBottom(e){return xi.getDimension(e,"padding-bottom")}static getMarginLeft(e){return xi.getDimension(e,"margin-left")}static getMarginTop(e){return xi.getDimension(e,"margin-top")}static getMarginRight(e){return xi.getDimension(e,"margin-right")}static getMarginBottom(e){return xi.getDimension(e,"margin-bottom")}}class at{static{this.None=new at(0,0)}constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new at(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof at?e:new at(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function hz(o){let e=o.offsetParent,t=o.offsetTop,i=o.offsetLeft;for(;(o=o.parentNode)!==null&&o!==o.ownerDocument.body&&o!==o.ownerDocument.documentElement;){t-=o.scrollTop;const n=gz(o)?null:uL(o);n&&(i-=n.direction!=="rtl"?o.scrollLeft:-o.scrollLeft),o===e&&(i+=xi.getBorderLeftWidth(o),t+=xi.getBorderTopWidth(o),t+=o.offsetTop,i+=o.offsetLeft,e=o.offsetParent)}return{left:i,top:t}}function JJ(o,e,t){typeof e=="number"&&(o.style.width=`${e}px`),typeof t=="number"&&(o.style.height=`${t}px`)}function pi(o){const e=o.getBoundingClientRect(),t=pe(o);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function uz(o){let e=o,t=1;do{const i=uL(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function so(o){const e=xi.getMarginLeft(o)+xi.getMarginRight(o);return o.offsetWidth+e}function ED(o){const e=xi.getBorderLeftWidth(o)+xi.getBorderRightWidth(o),t=xi.getPaddingLeft(o)+xi.getPaddingRight(o);return o.offsetWidth-e-t}function eee(o){const e=xi.getBorderTopWidth(o)+xi.getBorderBottomWidth(o),t=xi.getPaddingTop(o)+xi.getPaddingBottom(o);return o.offsetHeight-e-t}function Dc(o){const e=xi.getMarginTop(o)+xi.getMarginBottom(o);return o.offsetHeight+e}function sn(o,e){return!!e?.contains(o)}function tee(o,e,t){for(;o&&o.nodeType===o.ELEMENT_NODE;){if(o.classList.contains(e))return o;if(t){if(typeof t=="string"){if(o.classList.contains(t))return null}else if(o===t)return null}o=o.parentNode}return null}function ND(o,e,t){return!!tee(o,e,t)}function gz(o){return o&&!!o.host&&!!o.mode}function N0(o){return!!vh(o)}function vh(o){for(;o.parentNode;){if(o===o.ownerDocument?.body)return null;o=o.parentNode}return gz(o)?o:null}function ji(){let o=fw().activeElement;for(;o?.shadowRoot;)o=o.shadowRoot.activeElement;return o}function gL(o){return ji()===o}function fz(o){return sn(ji(),o)}function fw(){return qJ()<=1?wt.document:Array.from(lz()).map(({window:e})=>e.document).find(e=>e.hasFocus())??wt.document}function _t(){return fw().defaultView?.window??wt}const iee=new class{constructor(){this.mutationObservers=new Map}observe(o,e,t){let i=this.mutationObservers.get(o);i||(i=new Map,this.mutationObservers.set(o,i));const n=uw(t);let s=i.get(n);if(s)s.users+=1;else{const r=new P,a=new MutationObserver(c=>r.fire(c));a.observe(o,t);const l=s={users:1,observer:a,onDidMutate:r.event};e.add(ue(()=>{l.users-=1,l.users===0&&(r.dispose(),a.disconnect(),i?.delete(n),i?.size===0&&this.mutationObservers.delete(o))})),i.set(n,s)}return s.onDidMutate}};function mi(o){return o instanceof HTMLElement||o instanceof pe(o).HTMLElement}function X3(o){return o instanceof HTMLAnchorElement||o instanceof pe(o).HTMLAnchorElement}function pz(o){return o instanceof SVGElement||o instanceof pe(o).SVGElement}function pO(o){return o instanceof MouseEvent||o instanceof pe(o).MouseEvent}function pc(o){return o instanceof KeyboardEvent||o instanceof pe(o).KeyboardEvent}const ee={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function nee(o){const e=o;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const nt={stop:(o,e)=>(o.preventDefault(),e&&o.stopPropagation(),o)};function see(o){const e=[];for(let t=0;o&&o.nodeType===o.ELEMENT_NODE;t++)e[t]=o.scrollTop,o=o.parentNode;return e}function oee(o,e){for(let t=0;o&&o.nodeType===o.ELEMENT_NODE;t++)o.scrollTop!==e[t]&&(o.scrollTop=e[t]),o=o.parentNode}let ree=class eN extends A{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(mi(e)){const t=vh(e),i=t?t.activeElement:e.ownerDocument.activeElement;return sn(i,e)}else{const t=e;return sn(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new P),this._onDidBlur=this._register(new P);let t=eN.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(mi(e)?pe(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{eN.hasFocusWithin(e)!==t&&(t?s():n())},this._register(W(e,ee.FOCUS,n,!0)),this._register(W(e,ee.BLUR,s,!0)),mi(e)&&(this._register(W(e,ee.FOCUS_IN,()=>this._refreshStateHandler())),this._register(W(e,ee.FOCUS_OUT,()=>this._refreshStateHandler())))}};function xr(o){return new ree(o)}function aee(o,e){return o.after(e),e}function Z(o,...e){if(o.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function fL(o,e){return o.insertBefore(e,o.firstChild),e}function on(o,...e){o.textContent="",Z(o,...e)}const lee=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var IC;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.SVG="http://www.w3.org/2000/svg"})(IC||(IC={}));function mz(o,e,t,...i){const n=lee.exec(e);if(!n)throw new Error("Bad use of emmet");const s=n[1]||"div";let r;return o!==IC.HTML?r=document.createElementNS(o,s):r=document.createElement(s),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function J(o,e,...t){return mz(IC.HTML,o,e,...t)}J.SVG=function(o,e,...t){return mz(IC.SVG,o,e,...t)};function cee(o,...e){o?ro(...e):Ss(...e)}function ro(...o){for(const e of o)e.style.display="",e.removeAttribute("aria-hidden")}function Ss(...o){for(const e of o)e.style.display="none",e.setAttribute("aria-hidden","true")}function Q3(o,e){const t=o.devicePixelRatio*e;return Math.max(1,Math.floor(t))/o.devicePixelRatio}function _z(o){wt.open(o,"_blank","noopener")}function dee(o,e){const t=()=>{e(),i=Zs(o,t)};let i=Zs(o,t);return ue(()=>i.dispose())}GV.setPreferredWebSchema(/^https:/.test(wt.location.href)?"https":"http");class Ic extends P{constructor(){super(),this._subscriptions=new z,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(te.runAndSubscribe(gw,({window:e,disposables:t})=>this.registerListeners(e,t),{window:wt,disposables:this._subscriptions}))}registerListeners(e,t){t.add(W(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new yt(i);if(!(n.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(n.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(W(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(W(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(W(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(W(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(W(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Ic.instance||(Ic.instance=new Ic),Ic.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class hee extends A{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(W(this.element,ee.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(W(this.element,ee.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(W(this.element,ee.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(W(this.element,ee.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(W(this.element,ee.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(W(this.element,ee.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(W(this.element,ee.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const uee=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Qe(o,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=uee.exec(o);if(!n||!n.groups)throw new Error("Bad use of h");const s=n.groups.tag||"div",r=document.createElement(s);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const c of n.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(n.groups.name&&(l[n.groups.name]=r),i)for(const c of i)mi(c)?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[h,u]of Object.entries(d))r.style.setProperty(EC(h),typeof u=="number"?u+"px":""+u);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(EC(c),d.toString());return l.root=r,l}function EC(o){return o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ia(o){return o.tagName.toLowerCase()==="input"||o.tagName.toLowerCase()==="textarea"||mi(o)&&!!o.editContext}var Ae;(function(o){function e(n=void 0){return(s,r,a)=>{const l=r.class;delete r.class;const c=r.ref;delete r.ref;const d=r.obsRef;return delete r.obsRef,new fee(s,c,d,n,l,r,a)}}function t(n,s=void 0){const r=e(s);return(a,l)=>r(n,a,l)}o.div=t("div"),o.elem=e(void 0),o.svg=t("svg","http://www.w3.org/2000/svg"),o.svgElem=e("http://www.w3.org/2000/svg");function i(){let n;const s=function(r){n=r};return Object.defineProperty(s,"element",{get(){if(!n)throw new Ce("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return n}}),s}o.ref=i})(Ae||(Ae={}));class mO{constructor(e,t,i,n,s,r,a){this._deriveds=[],this._element=n?document.createElementNS(n,e):document.createElement(e),t&&t(this._element),i&&this._deriveds.push($(l=>{i(this),l.store.add({dispose:()=>{i(null)}})})),s&&(Cz(s)?this._deriveds.push($(this,l=>{J3(this._element,e7(s,l))})):J3(this._element,e7(s,void 0)));for(const[l,c]of Object.entries(r))if(l==="style")for(const[d,h]of Object.entries(c)){const u=EC(d);zu(h)?this._deriveds.push(An({owner:this,debugName:()=>`set.style.${u}`},g=>{this._element.style.setProperty(u,t7(h.read(g)))})):this._element.style.setProperty(u,t7(h))}else l==="tabIndex"?zu(c)?this._deriveds.push($(this,d=>{this._element.tabIndex=c.read(d)})):this._element.tabIndex=c:l.startsWith("on")?this._element[l]=c:zu(c)?this._deriveds.push(An({owner:this,debugName:()=>`set.${l}`},d=>{i7(this._element,l,c.read(d))})):i7(this._element,l,c);if(a){let l=function(d,h){return zu(h)?l(d,h.read(d)):Array.isArray(h)?h.flatMap(u=>l(d,u)):h instanceof mO?(d&&h.readEffect(d),[h._element]):h?[h]:[]};const c=$(this,d=>{this._element.replaceChildren(...l(d,a))});this._deriveds.push(c),vz(a)||c.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return $(t=>{this.readEffect(t)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new z;return this.keepUpdated(e),new gee(this._element,e)}}function J3(o,e){pz(o)?o.setAttribute("class",e):o.className=e}function bz(o,e,t){if(zu(o)){t(o.read(e));return}if(Array.isArray(o)){for(const i of o)bz(i,e,t);return}t(o)}function e7(o,e){let t="";return bz(o,e,i=>{i&&(t.length===0?t=i:t+=" "+i)}),t}function Cz(o){return zu(o)?!0:Array.isArray(o)?o.some(e=>Cz(e)):!1}function t7(o){return typeof o=="number"?o+"px":o}function vz(o){return zu(o)?!0:Array.isArray(o)?o.some(e=>vz(e)):!1}class gee{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class fee extends mO{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=De("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=De("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",i=>{e=!0}),this._element.addEventListener("mousemove",i=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",i=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function i7(o,e,t){t==null?o.removeAttribute(EC(e)):o.setAttribute(EC(e),String(t))}function zu(o){return!!o&&o.read!==void 0&&o.reportChanges!==void 0}const n7=2e4;let Cu,NS,tN,TS,iN;function pee(o){Cu=document.createElement("div"),Cu.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),Cu.appendChild(i),i};NS=e(),tN=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),Cu.appendChild(i),i};TS=t(),iN=t(),o.appendChild(Cu)}function Is(o){Cu&&(NS.textContent!==o?(xn(tN),T0(NS,o)):(xn(NS),T0(tN,o)))}function Pa(o){Cu&&(TS.textContent!==o?(xn(iN),T0(TS,o)):(xn(TS),T0(iN,o)))}function T0(o,e){xn(o),e.length>n7&&(e=e.substr(0,n7)),o.textContent=e,o.style.visibility="hidden",o.style.visibility="visible"}var xa;(function(o){o.serviceIds=new Map,o.DI_TARGET="$di$target",o.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[o.DI_DEPENDENCIES]||[]}o.getServiceDependencies=e})(xa||(xa={}));const fe=We("instantiationService");function mee(o,e,t){e[xa.DI_TARGET]===e?e[xa.DI_DEPENDENCIES].push({id:o,index:t}):(e[xa.DI_DEPENDENCIES]=[{id:o,index:t}],e[xa.DI_TARGET]=e)}function We(o){if(xa.serviceIds.has(o))return xa.serviceIds.get(o);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");mee(e,t,n)};return e.toString=()=>o,xa.serviceIds.set(o,e),e}const et=We("codeEditorService");let R=class lu{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new lu(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return lu.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return lu.isBefore(this,e)}static isBefore(e,t){return e.lineNumbero.run(...e)}}const nN=Object.create(null);function y(o,e){if(nn(e)){const t=nN[e];if(t===void 0)throw new Error(`${o} references an unknown codicon: ${e}`);e=t}return nN[o]=e,{id:o}}function wz(){return nN}const _ee={add:y("add",6e4),plus:y("plus",6e4),gistNew:y("gist-new",6e4),repoCreate:y("repo-create",6e4),lightbulb:y("lightbulb",60001),lightBulb:y("light-bulb",60001),repo:y("repo",60002),repoDelete:y("repo-delete",60002),gistFork:y("gist-fork",60003),repoForked:y("repo-forked",60003),gitPullRequest:y("git-pull-request",60004),gitPullRequestAbandoned:y("git-pull-request-abandoned",60004),recordKeys:y("record-keys",60005),keyboard:y("keyboard",60005),tag:y("tag",60006),gitPullRequestLabel:y("git-pull-request-label",60006),tagAdd:y("tag-add",60006),tagRemove:y("tag-remove",60006),person:y("person",60007),personFollow:y("person-follow",60007),personOutline:y("person-outline",60007),personFilled:y("person-filled",60007),sourceControl:y("source-control",60008),mirror:y("mirror",60009),mirrorPublic:y("mirror-public",60009),star:y("star",60010),starAdd:y("star-add",60010),starDelete:y("star-delete",60010),starEmpty:y("star-empty",60010),comment:y("comment",60011),commentAdd:y("comment-add",60011),alert:y("alert",60012),warning:y("warning",60012),search:y("search",60013),searchSave:y("search-save",60013),logOut:y("log-out",60014),signOut:y("sign-out",60014),logIn:y("log-in",60015),signIn:y("sign-in",60015),eye:y("eye",60016),eyeUnwatch:y("eye-unwatch",60016),eyeWatch:y("eye-watch",60016),circleFilled:y("circle-filled",60017),primitiveDot:y("primitive-dot",60017),closeDirty:y("close-dirty",60017),debugBreakpoint:y("debug-breakpoint",60017),debugBreakpointDisabled:y("debug-breakpoint-disabled",60017),debugHint:y("debug-hint",60017),terminalDecorationSuccess:y("terminal-decoration-success",60017),primitiveSquare:y("primitive-square",60018),edit:y("edit",60019),pencil:y("pencil",60019),info:y("info",60020),issueOpened:y("issue-opened",60020),gistPrivate:y("gist-private",60021),gitForkPrivate:y("git-fork-private",60021),lock:y("lock",60021),mirrorPrivate:y("mirror-private",60021),close:y("close",60022),removeClose:y("remove-close",60022),x:y("x",60022),repoSync:y("repo-sync",60023),sync:y("sync",60023),clone:y("clone",60024),desktopDownload:y("desktop-download",60024),beaker:y("beaker",60025),microscope:y("microscope",60025),vm:y("vm",60026),deviceDesktop:y("device-desktop",60026),file:y("file",60027),more:y("more",60028),ellipsis:y("ellipsis",60028),kebabHorizontal:y("kebab-horizontal",60028),mailReply:y("mail-reply",60029),reply:y("reply",60029),organization:y("organization",60030),organizationFilled:y("organization-filled",60030),organizationOutline:y("organization-outline",60030),newFile:y("new-file",60031),fileAdd:y("file-add",60031),newFolder:y("new-folder",60032),fileDirectoryCreate:y("file-directory-create",60032),trash:y("trash",60033),trashcan:y("trashcan",60033),history:y("history",60034),clock:y("clock",60034),folder:y("folder",60035),fileDirectory:y("file-directory",60035),symbolFolder:y("symbol-folder",60035),logoGithub:y("logo-github",60036),markGithub:y("mark-github",60036),github:y("github",60036),terminal:y("terminal",60037),console:y("console",60037),repl:y("repl",60037),zap:y("zap",60038),symbolEvent:y("symbol-event",60038),error:y("error",60039),stop:y("stop",60039),variable:y("variable",60040),symbolVariable:y("symbol-variable",60040),array:y("array",60042),symbolArray:y("symbol-array",60042),symbolModule:y("symbol-module",60043),symbolPackage:y("symbol-package",60043),symbolNamespace:y("symbol-namespace",60043),symbolObject:y("symbol-object",60043),symbolMethod:y("symbol-method",60044),symbolFunction:y("symbol-function",60044),symbolConstructor:y("symbol-constructor",60044),symbolBoolean:y("symbol-boolean",60047),symbolNull:y("symbol-null",60047),symbolNumeric:y("symbol-numeric",60048),symbolNumber:y("symbol-number",60048),symbolStructure:y("symbol-structure",60049),symbolStruct:y("symbol-struct",60049),symbolParameter:y("symbol-parameter",60050),symbolTypeParameter:y("symbol-type-parameter",60050),symbolKey:y("symbol-key",60051),symbolText:y("symbol-text",60051),symbolReference:y("symbol-reference",60052),goToFile:y("go-to-file",60052),symbolEnum:y("symbol-enum",60053),symbolValue:y("symbol-value",60053),symbolRuler:y("symbol-ruler",60054),symbolUnit:y("symbol-unit",60054),activateBreakpoints:y("activate-breakpoints",60055),archive:y("archive",60056),arrowBoth:y("arrow-both",60057),arrowDown:y("arrow-down",60058),arrowLeft:y("arrow-left",60059),arrowRight:y("arrow-right",60060),arrowSmallDown:y("arrow-small-down",60061),arrowSmallLeft:y("arrow-small-left",60062),arrowSmallRight:y("arrow-small-right",60063),arrowSmallUp:y("arrow-small-up",60064),arrowUp:y("arrow-up",60065),bell:y("bell",60066),bold:y("bold",60067),book:y("book",60068),bookmark:y("bookmark",60069),debugBreakpointConditionalUnverified:y("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:y("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:y("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:y("debug-breakpoint-data-unverified",60072),debugBreakpointData:y("debug-breakpoint-data",60073),debugBreakpointDataDisabled:y("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:y("debug-breakpoint-log-unverified",60074),debugBreakpointLog:y("debug-breakpoint-log",60075),debugBreakpointLogDisabled:y("debug-breakpoint-log-disabled",60075),briefcase:y("briefcase",60076),broadcast:y("broadcast",60077),browser:y("browser",60078),bug:y("bug",60079),calendar:y("calendar",60080),caseSensitive:y("case-sensitive",60081),check:y("check",60082),checklist:y("checklist",60083),chevronDown:y("chevron-down",60084),chevronLeft:y("chevron-left",60085),chevronRight:y("chevron-right",60086),chevronUp:y("chevron-up",60087),chromeClose:y("chrome-close",60088),chromeMaximize:y("chrome-maximize",60089),chromeMinimize:y("chrome-minimize",60090),chromeRestore:y("chrome-restore",60091),circleOutline:y("circle-outline",60092),circle:y("circle",60092),debugBreakpointUnverified:y("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:y("terminal-decoration-incomplete",60092),circleSlash:y("circle-slash",60093),circuitBoard:y("circuit-board",60094),clearAll:y("clear-all",60095),clippy:y("clippy",60096),closeAll:y("close-all",60097),cloudDownload:y("cloud-download",60098),cloudUpload:y("cloud-upload",60099),code:y("code",60100),collapseAll:y("collapse-all",60101),colorMode:y("color-mode",60102),commentDiscussion:y("comment-discussion",60103),creditCard:y("credit-card",60105),dash:y("dash",60108),dashboard:y("dashboard",60109),database:y("database",60110),debugContinue:y("debug-continue",60111),debugDisconnect:y("debug-disconnect",60112),debugPause:y("debug-pause",60113),debugRestart:y("debug-restart",60114),debugStart:y("debug-start",60115),debugStepInto:y("debug-step-into",60116),debugStepOut:y("debug-step-out",60117),debugStepOver:y("debug-step-over",60118),debugStop:y("debug-stop",60119),debug:y("debug",60120),deviceCameraVideo:y("device-camera-video",60121),deviceCamera:y("device-camera",60122),deviceMobile:y("device-mobile",60123),diffAdded:y("diff-added",60124),diffIgnored:y("diff-ignored",60125),diffModified:y("diff-modified",60126),diffRemoved:y("diff-removed",60127),diffRenamed:y("diff-renamed",60128),diff:y("diff",60129),diffSidebyside:y("diff-sidebyside",60129),discard:y("discard",60130),editorLayout:y("editor-layout",60131),emptyWindow:y("empty-window",60132),exclude:y("exclude",60133),extensions:y("extensions",60134),eyeClosed:y("eye-closed",60135),fileBinary:y("file-binary",60136),fileCode:y("file-code",60137),fileMedia:y("file-media",60138),filePdf:y("file-pdf",60139),fileSubmodule:y("file-submodule",60140),fileSymlinkDirectory:y("file-symlink-directory",60141),fileSymlinkFile:y("file-symlink-file",60142),fileZip:y("file-zip",60143),files:y("files",60144),filter:y("filter",60145),flame:y("flame",60146),foldDown:y("fold-down",60147),foldUp:y("fold-up",60148),fold:y("fold",60149),folderActive:y("folder-active",60150),folderOpened:y("folder-opened",60151),gear:y("gear",60152),gift:y("gift",60153),gistSecret:y("gist-secret",60154),gist:y("gist",60155),gitCommit:y("git-commit",60156),gitCompare:y("git-compare",60157),compareChanges:y("compare-changes",60157),gitMerge:y("git-merge",60158),githubAction:y("github-action",60159),githubAlt:y("github-alt",60160),globe:y("globe",60161),grabber:y("grabber",60162),graph:y("graph",60163),gripper:y("gripper",60164),heart:y("heart",60165),home:y("home",60166),horizontalRule:y("horizontal-rule",60167),hubot:y("hubot",60168),inbox:y("inbox",60169),issueReopened:y("issue-reopened",60171),issues:y("issues",60172),italic:y("italic",60173),jersey:y("jersey",60174),json:y("json",60175),kebabVertical:y("kebab-vertical",60176),key:y("key",60177),law:y("law",60178),lightbulbAutofix:y("lightbulb-autofix",60179),linkExternal:y("link-external",60180),link:y("link",60181),listOrdered:y("list-ordered",60182),listUnordered:y("list-unordered",60183),liveShare:y("live-share",60184),loading:y("loading",60185),location:y("location",60186),mailRead:y("mail-read",60187),mail:y("mail",60188),markdown:y("markdown",60189),megaphone:y("megaphone",60190),mention:y("mention",60191),milestone:y("milestone",60192),gitPullRequestMilestone:y("git-pull-request-milestone",60192),mortarBoard:y("mortar-board",60193),move:y("move",60194),multipleWindows:y("multiple-windows",60195),mute:y("mute",60196),noNewline:y("no-newline",60197),note:y("note",60198),octoface:y("octoface",60199),openPreview:y("open-preview",60200),package:y("package",60201),paintcan:y("paintcan",60202),pin:y("pin",60203),play:y("play",60204),run:y("run",60204),plug:y("plug",60205),preserveCase:y("preserve-case",60206),preview:y("preview",60207),project:y("project",60208),pulse:y("pulse",60209),question:y("question",60210),quote:y("quote",60211),radioTower:y("radio-tower",60212),reactions:y("reactions",60213),references:y("references",60214),refresh:y("refresh",60215),regex:y("regex",60216),remoteExplorer:y("remote-explorer",60217),remote:y("remote",60218),remove:y("remove",60219),replaceAll:y("replace-all",60220),replace:y("replace",60221),repoClone:y("repo-clone",60222),repoForcePush:y("repo-force-push",60223),repoPull:y("repo-pull",60224),repoPush:y("repo-push",60225),report:y("report",60226),requestChanges:y("request-changes",60227),rocket:y("rocket",60228),rootFolderOpened:y("root-folder-opened",60229),rootFolder:y("root-folder",60230),rss:y("rss",60231),ruby:y("ruby",60232),saveAll:y("save-all",60233),saveAs:y("save-as",60234),save:y("save",60235),screenFull:y("screen-full",60236),screenNormal:y("screen-normal",60237),searchStop:y("search-stop",60238),server:y("server",60240),settingsGear:y("settings-gear",60241),settings:y("settings",60242),shield:y("shield",60243),smiley:y("smiley",60244),sortPrecedence:y("sort-precedence",60245),splitHorizontal:y("split-horizontal",60246),splitVertical:y("split-vertical",60247),squirrel:y("squirrel",60248),starFull:y("star-full",60249),starHalf:y("star-half",60250),symbolClass:y("symbol-class",60251),symbolColor:y("symbol-color",60252),symbolConstant:y("symbol-constant",60253),symbolEnumMember:y("symbol-enum-member",60254),symbolField:y("symbol-field",60255),symbolFile:y("symbol-file",60256),symbolInterface:y("symbol-interface",60257),symbolKeyword:y("symbol-keyword",60258),symbolMisc:y("symbol-misc",60259),symbolOperator:y("symbol-operator",60260),symbolProperty:y("symbol-property",60261),wrench:y("wrench",60261),wrenchSubaction:y("wrench-subaction",60261),symbolSnippet:y("symbol-snippet",60262),tasklist:y("tasklist",60263),telescope:y("telescope",60264),textSize:y("text-size",60265),threeBars:y("three-bars",60266),thumbsdown:y("thumbsdown",60267),thumbsup:y("thumbsup",60268),tools:y("tools",60269),triangleDown:y("triangle-down",60270),triangleLeft:y("triangle-left",60271),triangleRight:y("triangle-right",60272),triangleUp:y("triangle-up",60273),twitter:y("twitter",60274),unfold:y("unfold",60275),unlock:y("unlock",60276),unmute:y("unmute",60277),unverified:y("unverified",60278),verified:y("verified",60279),versions:y("versions",60280),vmActive:y("vm-active",60281),vmOutline:y("vm-outline",60282),vmRunning:y("vm-running",60283),watch:y("watch",60284),whitespace:y("whitespace",60285),wholeWord:y("whole-word",60286),window:y("window",60287),wordWrap:y("word-wrap",60288),zoomIn:y("zoom-in",60289),zoomOut:y("zoom-out",60290),listFilter:y("list-filter",60291),listFlat:y("list-flat",60292),listSelection:y("list-selection",60293),selection:y("selection",60293),listTree:y("list-tree",60294),debugBreakpointFunctionUnverified:y("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:y("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:y("debug-breakpoint-function-disabled",60296),debugStackframeActive:y("debug-stackframe-active",60297),circleSmallFilled:y("circle-small-filled",60298),debugStackframeDot:y("debug-stackframe-dot",60298),terminalDecorationMark:y("terminal-decoration-mark",60298),debugStackframe:y("debug-stackframe",60299),debugStackframeFocused:y("debug-stackframe-focused",60299),debugBreakpointUnsupported:y("debug-breakpoint-unsupported",60300),symbolString:y("symbol-string",60301),debugReverseContinue:y("debug-reverse-continue",60302),debugStepBack:y("debug-step-back",60303),debugRestartFrame:y("debug-restart-frame",60304),debugAlt:y("debug-alt",60305),callIncoming:y("call-incoming",60306),callOutgoing:y("call-outgoing",60307),menu:y("menu",60308),expandAll:y("expand-all",60309),feedback:y("feedback",60310),gitPullRequestReviewer:y("git-pull-request-reviewer",60310),groupByRefType:y("group-by-ref-type",60311),ungroupByRefType:y("ungroup-by-ref-type",60312),account:y("account",60313),gitPullRequestAssignee:y("git-pull-request-assignee",60313),bellDot:y("bell-dot",60314),debugConsole:y("debug-console",60315),library:y("library",60316),output:y("output",60317),runAll:y("run-all",60318),syncIgnored:y("sync-ignored",60319),pinned:y("pinned",60320),githubInverted:y("github-inverted",60321),serverProcess:y("server-process",60322),serverEnvironment:y("server-environment",60323),pass:y("pass",60324),issueClosed:y("issue-closed",60324),stopCircle:y("stop-circle",60325),playCircle:y("play-circle",60326),record:y("record",60327),debugAltSmall:y("debug-alt-small",60328),vmConnect:y("vm-connect",60329),cloud:y("cloud",60330),merge:y("merge",60331),export:y("export",60332),graphLeft:y("graph-left",60333),magnet:y("magnet",60334),notebook:y("notebook",60335),redo:y("redo",60336),checkAll:y("check-all",60337),pinnedDirty:y("pinned-dirty",60338),passFilled:y("pass-filled",60339),circleLargeFilled:y("circle-large-filled",60340),circleLarge:y("circle-large",60341),circleLargeOutline:y("circle-large-outline",60341),combine:y("combine",60342),gather:y("gather",60342),table:y("table",60343),variableGroup:y("variable-group",60344),typeHierarchy:y("type-hierarchy",60345),typeHierarchySub:y("type-hierarchy-sub",60346),typeHierarchySuper:y("type-hierarchy-super",60347),gitPullRequestCreate:y("git-pull-request-create",60348),runAbove:y("run-above",60349),runBelow:y("run-below",60350),notebookTemplate:y("notebook-template",60351),debugRerun:y("debug-rerun",60352),workspaceTrusted:y("workspace-trusted",60353),workspaceUntrusted:y("workspace-untrusted",60354),workspaceUnknown:y("workspace-unknown",60355),terminalCmd:y("terminal-cmd",60356),terminalDebian:y("terminal-debian",60357),terminalLinux:y("terminal-linux",60358),terminalPowershell:y("terminal-powershell",60359),terminalTmux:y("terminal-tmux",60360),terminalUbuntu:y("terminal-ubuntu",60361),terminalBash:y("terminal-bash",60362),arrowSwap:y("arrow-swap",60363),copy:y("copy",60364),personAdd:y("person-add",60365),filterFilled:y("filter-filled",60366),wand:y("wand",60367),debugLineByLine:y("debug-line-by-line",60368),inspect:y("inspect",60369),layers:y("layers",60370),layersDot:y("layers-dot",60371),layersActive:y("layers-active",60372),compass:y("compass",60373),compassDot:y("compass-dot",60374),compassActive:y("compass-active",60375),azure:y("azure",60376),issueDraft:y("issue-draft",60377),gitPullRequestClosed:y("git-pull-request-closed",60378),gitPullRequestDraft:y("git-pull-request-draft",60379),debugAll:y("debug-all",60380),debugCoverage:y("debug-coverage",60381),runErrors:y("run-errors",60382),folderLibrary:y("folder-library",60383),debugContinueSmall:y("debug-continue-small",60384),beakerStop:y("beaker-stop",60385),graphLine:y("graph-line",60386),graphScatter:y("graph-scatter",60387),pieChart:y("pie-chart",60388),bracket:y("bracket",60175),bracketDot:y("bracket-dot",60389),bracketError:y("bracket-error",60390),lockSmall:y("lock-small",60391),azureDevops:y("azure-devops",60392),verifiedFilled:y("verified-filled",60393),newline:y("newline",60394),layout:y("layout",60395),layoutActivitybarLeft:y("layout-activitybar-left",60396),layoutActivitybarRight:y("layout-activitybar-right",60397),layoutPanelLeft:y("layout-panel-left",60398),layoutPanelCenter:y("layout-panel-center",60399),layoutPanelJustify:y("layout-panel-justify",60400),layoutPanelRight:y("layout-panel-right",60401),layoutPanel:y("layout-panel",60402),layoutSidebarLeft:y("layout-sidebar-left",60403),layoutSidebarRight:y("layout-sidebar-right",60404),layoutStatusbar:y("layout-statusbar",60405),layoutMenubar:y("layout-menubar",60406),layoutCentered:y("layout-centered",60407),target:y("target",60408),indent:y("indent",60409),recordSmall:y("record-small",60410),errorSmall:y("error-small",60411),terminalDecorationError:y("terminal-decoration-error",60411),arrowCircleDown:y("arrow-circle-down",60412),arrowCircleLeft:y("arrow-circle-left",60413),arrowCircleRight:y("arrow-circle-right",60414),arrowCircleUp:y("arrow-circle-up",60415),layoutSidebarRightOff:y("layout-sidebar-right-off",60416),layoutPanelOff:y("layout-panel-off",60417),layoutSidebarLeftOff:y("layout-sidebar-left-off",60418),blank:y("blank",60419),heartFilled:y("heart-filled",60420),map:y("map",60421),mapHorizontal:y("map-horizontal",60421),foldHorizontal:y("fold-horizontal",60421),mapFilled:y("map-filled",60422),mapHorizontalFilled:y("map-horizontal-filled",60422),foldHorizontalFilled:y("fold-horizontal-filled",60422),circleSmall:y("circle-small",60423),bellSlash:y("bell-slash",60424),bellSlashDot:y("bell-slash-dot",60425),commentUnresolved:y("comment-unresolved",60426),gitPullRequestGoToChanges:y("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:y("git-pull-request-new-changes",60428),searchFuzzy:y("search-fuzzy",60429),commentDraft:y("comment-draft",60430),send:y("send",60431),sparkle:y("sparkle",60432),insert:y("insert",60433),mic:y("mic",60434),thumbsdownFilled:y("thumbsdown-filled",60435),thumbsupFilled:y("thumbsup-filled",60436),coffee:y("coffee",60437),snake:y("snake",60438),game:y("game",60439),vr:y("vr",60440),chip:y("chip",60441),piano:y("piano",60442),music:y("music",60443),micFilled:y("mic-filled",60444),repoFetch:y("repo-fetch",60445),copilot:y("copilot",60446),lightbulbSparkle:y("lightbulb-sparkle",60447),robot:y("robot",60448),sparkleFilled:y("sparkle-filled",60449),diffSingle:y("diff-single",60450),diffMultiple:y("diff-multiple",60451),surroundWith:y("surround-with",60452),share:y("share",60453),gitStash:y("git-stash",60454),gitStashApply:y("git-stash-apply",60455),gitStashPop:y("git-stash-pop",60456),vscode:y("vscode",60457),vscodeInsiders:y("vscode-insiders",60458),codeOss:y("code-oss",60459),runCoverage:y("run-coverage",60460),runAllCoverage:y("run-all-coverage",60461),coverage:y("coverage",60462),githubProject:y("github-project",60463),mapVertical:y("map-vertical",60464),foldVertical:y("fold-vertical",60464),mapVerticalFilled:y("map-vertical-filled",60465),foldVerticalFilled:y("fold-vertical-filled",60465),goToSearch:y("go-to-search",60466),percentage:y("percentage",60467),sortPercentage:y("sort-percentage",60467),attach:y("attach",60468),goToEditingSession:y("go-to-editing-session",60469),editSession:y("edit-session",60470),codeReview:y("code-review",60471),copilotWarning:y("copilot-warning",60472),python:y("python",60473),copilotLarge:y("copilot-large",60474),copilotWarningLarge:y("copilot-warning-large",60475),keyboardTab:y("keyboard-tab",60476),copilotBlocked:y("copilot-blocked",60477),copilotNotConnected:y("copilot-not-connected",60478),flag:y("flag",60479),lightbulbEmpty:y("lightbulb-empty",60480),symbolMethodArrow:y("symbol-method-arrow",60481),copilotUnavailable:y("copilot-unavailable",60482),repoPinned:y("repo-pinned",60483),keyboardTabAbove:y("keyboard-tab-above",60484),keyboardTabBelow:y("keyboard-tab-below",60485),gitPullRequestDone:y("git-pull-request-done",60486),mcp:y("mcp",60487),extensionsLarge:y("extensions-large",60488),layoutPanelDock:y("layout-panel-dock",60489),layoutSidebarLeftDock:y("layout-sidebar-left-dock",60490),layoutSidebarRightDock:y("layout-sidebar-right-dock",60491),copilotInProgress:y("copilot-in-progress",60492),copilotError:y("copilot-error",60493),copilotSuccess:y("copilot-success",60494),chatSparkle:y("chat-sparkle",60495),searchSparkle:y("search-sparkle",60496),editSparkle:y("edit-sparkle",60497),copilotSnooze:y("copilot-snooze",60498),sendToRemoteAgent:y("send-to-remote-agent",60499),commentDiscussionSparkle:y("comment-discussion-sparkle",60500),chatSparkleWarning:y("chat-sparkle-warning",60501),chatSparkleError:y("chat-sparkle-error",60502),collection:y("collection",60503),newCollection:y("new-collection",60504),thinking:y("thinking",60505),build:y("build",60506),commentDiscussionQuote:y("comment-discussion-quote",60507),cursor:y("cursor",60508),eraser:y("eraser",60509),fileText:y("file-text",60510),gitLens:y("git-lens",60511),quotes:y("quotes",60512),rename:y("rename",60513),runWithDeps:y("run-with-deps",60514),debugConnected:y("debug-connected",60515),strikethrough:y("strikethrough",60516),openInProduct:y("open-in-product",60517),indexZero:y("index-zero",60518),agent:y("agent",60519),editCode:y("edit-code",60520),repoSelected:y("repo-selected",60521),skip:y("skip",60522),mergeInto:y("merge-into",60523),gitBranchChanges:y("git-branch-changes",60524),gitBranchStagedChanges:y("git-branch-staged-changes",60525),gitBranchConflicts:y("git-branch-conflicts",60526),gitBranch:y("git-branch",60527),gitBranchCreate:y("git-branch-create",60527),gitBranchDelete:y("git-branch-delete",60527),searchLarge:y("search-large",60528),terminalGitBash:y("terminal-git-bash",60529)},bee={dialogError:y("dialog-error","error"),dialogWarning:y("dialog-warning","warning"),dialogInfo:y("dialog-info","info"),dialogClose:y("dialog-close","close"),treeItemExpanded:y("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:y("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:y("tree-filter-on-type-off","list-selection"),treeFilterClear:y("tree-filter-clear","close"),treeItemLoading:y("tree-item-loading","loading"),menuSelection:y("menu-selection","check"),menuSubmenu:y("menu-submenu","chevron-right"),menuBarMore:y("menubar-more","more"),scrollbarButtonLeft:y("scrollbar-button-left","triangle-left"),scrollbarButtonRight:y("scrollbar-button-right","triangle-right"),scrollbarButtonUp:y("scrollbar-button-up","triangle-up"),scrollbarButtonDown:y("scrollbar-button-down","triangle-down"),toolBarMore:y("toolbar-more","more"),quickInputBack:y("quick-input-back","arrow-left"),dropDownButton:y("drop-down-button",60084),symbolCustomColor:y("symbol-customcolor",60252),exportIcon:y("export",60332),workspaceUnspecified:y("workspace-unspecified",60355),newLine:y("newline",60394),thumbsDownFilled:y("thumbsdown-filled",60435),thumbsUpFilled:y("thumbsup-filled",60436),gitFetch:y("git-fetch",60445),lightbulbSparkleAutofix:y("lightbulb-sparkle-autofix",60447),debugBreakpointPending:y("debug-breakpoint-pending",60377)},G={..._ee,...bee};var sN;(function(o){function e(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}o.isThemeColor=e})(sN||(sN={}));var Se;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9-]+",o.iconModifierExpression="~[A-Za-z]+",o.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function t(f){const p=e.exec(f.id);if(!p)return t(G.error);const[,_,b]=p,C=["codicon","codicon-"+_];return b&&C.push("codicon-modifier-"+b.substring(1)),C}o.asClassNameArray=t;function i(f){return t(f).join(" ")}o.asClassName=i;function n(f){return"."+t(f).join(".")}o.asCSSSelector=n;function s(f){return!!f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||sN.isThemeColor(f.color))}o.isThemeIcon=s;const r=new RegExp(`^\\$\\((${o.iconNameExpression}(?:${o.iconModifierExpression})?)\\)$`);function a(f){const p=r.exec(f);if(!p)return;const[,_]=p;return{id:_}}o.fromString=a;function l(f){return{id:f}}o.fromId=l;function c(f,p){let _=f.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),p&&(_=`${_}~${p}`),{id:_}}o.modify=c;function d(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}o.getModifier=d;function h(f,p){return f.id===p.id&&f.color?.id===p.color?.id}o.isEqual=h;function u(f){return f?.id===G.file.id}o.isFile=u;function g(f){return f?.id===G.folder.id}o.isFolder=g})(Se||(Se={}));const Pt=We("commandService"),Ye=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new P,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,e){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:o,handler:e})}if(o.metadata&&Array.isArray(o.metadata.args)){const r=[];for(const l of o.metadata.args)r.push(l.constraint);const a=o.handler;o.handler=function(l,...c){return WX(c,r),a(l,...c)}}const{id:t}=o;let i=this._commands.get(t);i||(i=new cs,this._commands.set(t,i));const n=i.unshift(o),s=ue(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),s}registerCommandAlias(o,e){return Ye.registerCommand(o,(t,...i)=>t.get(Pt).executeCommand(e,...i))}getCommand(o){const e=this._commands.get(o);if(!(!e||e.isEmpty()))return Ke.first(e)}getCommands(){const o=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&o.set(e,t)}return o}};Ye.registerCommand("noop",()=>{});function TD(...o){switch(o.length){case 1:return m(1693,"Did you mean {0}?",o[0]);case 2:return m(1694,"Did you mean {0} or {1}?",o[0],o[1]);case 3:return m(1695,"Did you mean {0}, {1} or {2}?",o[0],o[1],o[2]);default:return}}const Cee=m(1696,"Did you forget to open or close the quote?"),vee=m(1697,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let D_=class oN{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw m0(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(TD("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(TD("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(TD("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=oN._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Cee);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(vee);return}const s=this._input.charCodeAt(e);if(t)t=!1;else if(s===47&&!i){e++;break}else s===91?i=!0:s===92?t=!0:s===93&&(i=!1);e++}for(;e=this._input.length}};const Qn=new Map;Qn.set("false",!1);Qn.set("true",!0);Qn.set("isMac",ze);Qn.set("isLinux",Gs);Qn.set("isWindows",Ln);Qn.set("isWeb",Bl);Qn.set("isMacNative",ze&&!Bl);Qn.set("isEdge",yV);Qn.set("isFirefox",KX);Qn.set("isChrome",VA);Qn.set("isSafari",GX);const wee=Object.prototype.hasOwnProperty,See={regexParsingWithErrorRecovery:!0},yee=m(1675,"Empty context key expression"),xee=m(1676,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Lee=m(1677,"'in' after 'not'."),s7=m(1678,"closing parenthesis ')'"),kee=m(1679,"Unexpected token"),Dee=m(1680,"Did you forget to put && or || before the token?"),Iee=m(1681,"Unexpected end of expression"),Eee=m(1682,"Did you forget to put a context key?");let Nee=class nb{static{this._parseError=new Error}constructor(e=See){this._config=e,this._scanner=new D_,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:yee,offset:0,lexeme:"",additionalInfo:xee});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),n=i.type===17?Dee:void 0;throw this._parsingErrors.push({message:kee,offset:i.offset,lexeme:D_.getLexeme(i),additionalInfo:n}),nb._parseError}return t}catch(t){if(t!==nb._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:q.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:q.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Es.INSTANCE;case 12:return this._advance(),Ys.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,s7),t?.negate()}case 17:return this._advance(),sf.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),q.true();case 12:return this._advance(),q.false();case 0:{this._advance();const t=this._expr();return this._consume(1,s7),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const n=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),n.type!==10)throw this._errExpectedButGot("REGEX",n);const s=n.lexeme,r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1));let l;try{l=new RegExp(s.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",n)}return NC.create(t,l)}switch(n.type){case 10:case 19:{const s=[n.lexeme];this._advance();let r=this._peek(),a=0;for(let u=0;u=0){const c=s.slice(a+1,l),d=s[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",n)}}}if(r===null)throw this._errExpectedButGot("REGEX",n);return NC.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Lee);const n=this._value();return q.notIn(t,n)}switch(this._peek().type){case 3:{this._advance();const n=this._value();if(this._previous().type===18)return q.equals(t,n);switch(n){case"true":return q.has(t);case"false":return q.not(t);default:return q.equals(t,n)}}case 4:{this._advance();const n=this._value();if(this._previous().type===18)return q.notEquals(t,n);switch(n){case"true":return q.not(t);case"false":return q.has(t);default:return q.notEquals(t,n)}}case 5:return this._advance(),wL.create(t,this._value());case 6:return this._advance(),SL.create(t,this._value());case 7:return this._advance(),CL.create(t,this._value());case 8:return this._advance(),vL.create(t,this._value());case 13:return this._advance(),q.in(t,this._value());default:return q.has(t)}}case 20:throw this._parsingErrors.push({message:Iee,offset:e.offset,lexeme:"",additionalInfo:Eee}),nb._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=m(1683,`Expected: {0} -Received: '{1}'.`,e,rb.getLexeme(t)),s=t.offset,r=rb.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),Vb._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};class K{static false(){return Bs.INSTANCE}static true(){return ao.INSTANCE}static has(e){return Df.create(e)}static equals(e,t){return R_.create(e,t)}static notEquals(e,t){return uD.create(e,t)}static regex(e,t){return fv.create(e,t)}static in(e,t){return dD.create(e,t)}static notIn(e,t){return hD.create(e,t)}static not(e){return kf.create(e)}static and(...e){return ug.create(e,null,!0)}static or(...e){return zc.create(e,null,!0)}static{this._parser=new Die({regexParsingWithErrorRecovery:!1})}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}function kie(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function cC(o,e){return o.cmp(e)}class Bs{static{this.INSTANCE=new Bs}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return ao.INSTANCE}}class ao{static{this.INSTANCE=new ao}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Bs.INSTANCE}}class Df{static create(e,t=null){const i=rs.get(e);return typeof i=="boolean"?i?ao.INSTANCE:Bs.INSTANCE:new Df(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:l$(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=rs.get(this.key);return typeof e=="boolean"?e?ao.INSTANCE:Bs.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=kf.create(this.key,this)),this.negated}}class R_{static create(e,t,i=null){if(typeof t=="boolean")return t?Df.create(e,i):kf.create(e,i);const n=rs.get(e);return typeof n=="boolean"?t===(n?"true":"false")?ao.INSTANCE:Bs.INSTANCE:new R_(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=rs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ao.INSTANCE:Bs.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uD.create(this.key,this.value,this)),this.negated}}class dD{static create(e,t){return new dD(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?_ie.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=hD.create(this.key,this.valueKey)),this.negated}}class hD{static create(e,t){return new hD(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=dD.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class uD{static create(e,t,i=null){if(typeof t=="boolean")return t?kf.create(e,i):Df.create(e,i);const n=rs.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Bs.INSTANCE:ao.INSTANCE:new uD(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=rs.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Bs.INSTANCE:ao.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R_.create(this.key,this.value,this)),this.negated}}class kf{static create(e,t=null){const i=rs.get(e);return typeof i=="boolean"?i?Bs.INSTANCE:ao.INSTANCE:new kf(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:l$(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=rs.get(this.key);return typeof e=="boolean"?e?Bs.INSTANCE:ao.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Df.create(this.key,this)),this.negated}}function gD(o,e){if(typeof o=="string"){const t=parseFloat(o);isNaN(t)||(o=t)}return typeof o=="string"||typeof o=="number"?e(o):Bs.INSTANCE}class fD{static create(e,t,i=null){return gD(t,n=>new fD(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_D.create(this.key,this.value,this)),this.negated}}class pD{static create(e,t,i=null){return gD(t,n=>new pD(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=mD.create(this.key,this.value,this)),this.negated}}class mD{static create(e,t,i=null){return gD(t,n=>new mD(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new _D(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:If(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=fD.create(this.key,this.value,this)),this.negated}}class fv{static create(e,t){return new fv(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=N4.create(this)),this.negated}}class N4{static create(e){return new N4(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function a$(o){let e=null;for(let t=0,i=o.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=n[n.length-1];if(r.type!==9)break;n.pop();const a=n.pop(),l=n.length===0,c=zc.create(r.expr.map(d=>ug.create([d,a],null,i)),null,l);c&&(n.push(c),n.sort(cC))}if(n.length===1)return n[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=zc.create(e,this,!0)}return this.negated}}class zc{static create(e,t,i){return zc._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const s of F7(t))for(const r of F7(i))n.push(ug.create([s,r],null,!1));e.unshift(zc.create(n,null,!1))}this.negated=zc.create(e,this,!0)}return this.negated}}class re extends Df{static{this._info=[]}static all(){return re._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?re._info.push({...i,key:e}):i!==!0&&re._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return R_.create(this.key,e)}}const Ne=Ve("contextKeyService");function l$(o,e){return oe?1:0}function If(o,e,t,i){return ot?1:ei?1:0}function mT(o,e){if(o.type===0||e.type===1)return!0;if(o.type===9)return e.type===9?O7(o.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(mT(o,t))return!0;return!1}if(o.type===6){if(e.type===6)return O7(e.expr,o.expr);for(const t of o.expr)if(mT(t,e))return!0;return!1}return o.equals(e)}function O7(o,e){let t=0,i=0;for(;t{$g(e.dispose)&&e.dispose()}),this.data.clear()}}const fi=new Iie;class T4{constructor(){this._coreKeybindings=new bs,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(wo===1){if(e&&e.win)return e.win}else if(wo===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=T4.bindToCurrentPlatform(e),i=new z;if(t&&t.primary){const n=YN(t.primary,wo);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,s=t.secondary.length;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Nie)),this._cachedMergedKeybindings.slice(0)}}const Sn=new T4,Eie={EditorModes:"platform.keybindingsRegistry"};fi.add(Eie.EditorModes,Sn);function Nie(o,e){if(o.weight1!==e.weight1)return o.weight1-e.weight1;if(o.command&&e.command){if(o.commande.command)return 1}return o.weight2-e.weight2}var Tie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},W7=function(o,e){return function(t,i){e(t,i,o)}},D0;function sm(o){return o.command!==void 0}function Rie(o){return o.submenu!==void 0}class M{static{this._instances=new Map}static{this.CommandPalette=new M("CommandPalette")}static{this.DebugBreakpointsContext=new M("DebugBreakpointsContext")}static{this.DebugCallStackContext=new M("DebugCallStackContext")}static{this.DebugConsoleContext=new M("DebugConsoleContext")}static{this.DebugVariablesContext=new M("DebugVariablesContext")}static{this.NotebookVariablesContext=new M("NotebookVariablesContext")}static{this.DebugHoverContext=new M("DebugHoverContext")}static{this.DebugWatchContext=new M("DebugWatchContext")}static{this.DebugToolBar=new M("DebugToolBar")}static{this.DebugToolBarStop=new M("DebugToolBarStop")}static{this.DebugDisassemblyContext=new M("DebugDisassemblyContext")}static{this.DebugCallStackToolbar=new M("DebugCallStackToolbar")}static{this.DebugCreateConfiguration=new M("DebugCreateConfiguration")}static{this.EditorContext=new M("EditorContext")}static{this.SimpleEditorContext=new M("SimpleEditorContext")}static{this.EditorContent=new M("EditorContent")}static{this.EditorLineNumberContext=new M("EditorLineNumberContext")}static{this.EditorContextCopy=new M("EditorContextCopy")}static{this.EditorContextPeek=new M("EditorContextPeek")}static{this.EditorContextShare=new M("EditorContextShare")}static{this.EditorTitle=new M("EditorTitle")}static{this.CompactWindowEditorTitle=new M("CompactWindowEditorTitle")}static{this.EditorTitleRun=new M("EditorTitleRun")}static{this.EditorTitleContext=new M("EditorTitleContext")}static{this.EditorTitleContextShare=new M("EditorTitleContextShare")}static{this.EmptyEditorGroup=new M("EmptyEditorGroup")}static{this.EmptyEditorGroupContext=new M("EmptyEditorGroupContext")}static{this.EditorTabsBarContext=new M("EditorTabsBarContext")}static{this.EditorTabsBarShowTabsSubmenu=new M("EditorTabsBarShowTabsSubmenu")}static{this.EditorTabsBarShowTabsZenModeSubmenu=new M("EditorTabsBarShowTabsZenModeSubmenu")}static{this.EditorActionsPositionSubmenu=new M("EditorActionsPositionSubmenu")}static{this.EditorSplitMoveSubmenu=new M("EditorSplitMoveSubmenu")}static{this.ExplorerContext=new M("ExplorerContext")}static{this.ExplorerContextShare=new M("ExplorerContextShare")}static{this.ExtensionContext=new M("ExtensionContext")}static{this.ExtensionEditorContextMenu=new M("ExtensionEditorContextMenu")}static{this.GlobalActivity=new M("GlobalActivity")}static{this.CommandCenter=new M("CommandCenter")}static{this.CommandCenterCenter=new M("CommandCenterCenter")}static{this.LayoutControlMenuSubmenu=new M("LayoutControlMenuSubmenu")}static{this.LayoutControlMenu=new M("LayoutControlMenu")}static{this.MenubarMainMenu=new M("MenubarMainMenu")}static{this.MenubarAppearanceMenu=new M("MenubarAppearanceMenu")}static{this.MenubarDebugMenu=new M("MenubarDebugMenu")}static{this.MenubarEditMenu=new M("MenubarEditMenu")}static{this.MenubarCopy=new M("MenubarCopy")}static{this.MenubarFileMenu=new M("MenubarFileMenu")}static{this.MenubarGoMenu=new M("MenubarGoMenu")}static{this.MenubarHelpMenu=new M("MenubarHelpMenu")}static{this.MenubarLayoutMenu=new M("MenubarLayoutMenu")}static{this.MenubarNewBreakpointMenu=new M("MenubarNewBreakpointMenu")}static{this.PanelAlignmentMenu=new M("PanelAlignmentMenu")}static{this.PanelPositionMenu=new M("PanelPositionMenu")}static{this.ActivityBarPositionMenu=new M("ActivityBarPositionMenu")}static{this.MenubarPreferencesMenu=new M("MenubarPreferencesMenu")}static{this.MenubarRecentMenu=new M("MenubarRecentMenu")}static{this.MenubarSelectionMenu=new M("MenubarSelectionMenu")}static{this.MenubarShare=new M("MenubarShare")}static{this.MenubarSwitchEditorMenu=new M("MenubarSwitchEditorMenu")}static{this.MenubarSwitchGroupMenu=new M("MenubarSwitchGroupMenu")}static{this.MenubarTerminalMenu=new M("MenubarTerminalMenu")}static{this.MenubarTerminalSuggestStatusMenu=new M("MenubarTerminalSuggestStatusMenu")}static{this.MenubarViewMenu=new M("MenubarViewMenu")}static{this.MenubarHomeMenu=new M("MenubarHomeMenu")}static{this.OpenEditorsContext=new M("OpenEditorsContext")}static{this.OpenEditorsContextShare=new M("OpenEditorsContextShare")}static{this.ProblemsPanelContext=new M("ProblemsPanelContext")}static{this.SCMInputBox=new M("SCMInputBox")}static{this.SCMChangeContext=new M("SCMChangeContext")}static{this.SCMResourceContext=new M("SCMResourceContext")}static{this.SCMResourceContextShare=new M("SCMResourceContextShare")}static{this.SCMResourceFolderContext=new M("SCMResourceFolderContext")}static{this.SCMResourceGroupContext=new M("SCMResourceGroupContext")}static{this.SCMSourceControl=new M("SCMSourceControl")}static{this.SCMSourceControlInline=new M("SCMSourceControlInline")}static{this.SCMSourceControlTitle=new M("SCMSourceControlTitle")}static{this.SCMHistoryTitle=new M("SCMHistoryTitle")}static{this.SCMHistoryItemContext=new M("SCMHistoryItemContext")}static{this.SCMHistoryItemChangeContext=new M("SCMHistoryItemChangeContext")}static{this.SCMHistoryItemRefContext=new M("SCMHistoryItemRefContext")}static{this.SCMArtifactGroupContext=new M("SCMArtifactGroupContext")}static{this.SCMArtifactContext=new M("SCMArtifactContext")}static{this.SCMQuickDiffDecorations=new M("SCMQuickDiffDecorations")}static{this.SCMTitle=new M("SCMTitle")}static{this.SearchContext=new M("SearchContext")}static{this.SearchActionMenu=new M("SearchActionContext")}static{this.StatusBarWindowIndicatorMenu=new M("StatusBarWindowIndicatorMenu")}static{this.StatusBarRemoteIndicatorMenu=new M("StatusBarRemoteIndicatorMenu")}static{this.StickyScrollContext=new M("StickyScrollContext")}static{this.TestItem=new M("TestItem")}static{this.TestItemGutter=new M("TestItemGutter")}static{this.TestProfilesContext=new M("TestProfilesContext")}static{this.TestMessageContext=new M("TestMessageContext")}static{this.TestMessageContent=new M("TestMessageContent")}static{this.TestPeekElement=new M("TestPeekElement")}static{this.TestPeekTitle=new M("TestPeekTitle")}static{this.TestCallStack=new M("TestCallStack")}static{this.TestCoverageFilterItem=new M("TestCoverageFilterItem")}static{this.TouchBarContext=new M("TouchBarContext")}static{this.TitleBar=new M("TitleBar")}static{this.TitleBarContext=new M("TitleBarContext")}static{this.TitleBarTitleContext=new M("TitleBarTitleContext")}static{this.TunnelContext=new M("TunnelContext")}static{this.TunnelPrivacy=new M("TunnelPrivacy")}static{this.TunnelProtocol=new M("TunnelProtocol")}static{this.TunnelPortInline=new M("TunnelInline")}static{this.TunnelTitle=new M("TunnelTitle")}static{this.TunnelLocalAddressInline=new M("TunnelLocalAddressInline")}static{this.TunnelOriginInline=new M("TunnelOriginInline")}static{this.ViewItemContext=new M("ViewItemContext")}static{this.ViewContainerTitle=new M("ViewContainerTitle")}static{this.ViewContainerTitleContext=new M("ViewContainerTitleContext")}static{this.ViewTitle=new M("ViewTitle")}static{this.ViewTitleContext=new M("ViewTitleContext")}static{this.CommentEditorActions=new M("CommentEditorActions")}static{this.CommentThreadTitle=new M("CommentThreadTitle")}static{this.CommentThreadActions=new M("CommentThreadActions")}static{this.CommentThreadAdditionalActions=new M("CommentThreadAdditionalActions")}static{this.CommentThreadTitleContext=new M("CommentThreadTitleContext")}static{this.CommentThreadCommentContext=new M("CommentThreadCommentContext")}static{this.CommentTitle=new M("CommentTitle")}static{this.CommentActions=new M("CommentActions")}static{this.CommentsViewThreadActions=new M("CommentsViewThreadActions")}static{this.InteractiveToolbar=new M("InteractiveToolbar")}static{this.InteractiveCellTitle=new M("InteractiveCellTitle")}static{this.InteractiveCellDelete=new M("InteractiveCellDelete")}static{this.InteractiveCellExecute=new M("InteractiveCellExecute")}static{this.InteractiveInputExecute=new M("InteractiveInputExecute")}static{this.InteractiveInputConfig=new M("InteractiveInputConfig")}static{this.ReplInputExecute=new M("ReplInputExecute")}static{this.IssueReporter=new M("IssueReporter")}static{this.NotebookToolbar=new M("NotebookToolbar")}static{this.NotebookToolbarContext=new M("NotebookToolbarContext")}static{this.NotebookStickyScrollContext=new M("NotebookStickyScrollContext")}static{this.NotebookCellTitle=new M("NotebookCellTitle")}static{this.NotebookCellDelete=new M("NotebookCellDelete")}static{this.NotebookCellInsert=new M("NotebookCellInsert")}static{this.NotebookCellBetween=new M("NotebookCellBetween")}static{this.NotebookCellListTop=new M("NotebookCellTop")}static{this.NotebookCellExecute=new M("NotebookCellExecute")}static{this.NotebookCellExecuteGoTo=new M("NotebookCellExecuteGoTo")}static{this.NotebookCellExecutePrimary=new M("NotebookCellExecutePrimary")}static{this.NotebookDiffCellInputTitle=new M("NotebookDiffCellInputTitle")}static{this.NotebookDiffDocumentMetadata=new M("NotebookDiffDocumentMetadata")}static{this.NotebookDiffCellMetadataTitle=new M("NotebookDiffCellMetadataTitle")}static{this.NotebookDiffCellOutputsTitle=new M("NotebookDiffCellOutputsTitle")}static{this.NotebookOutputToolbar=new M("NotebookOutputToolbar")}static{this.NotebookOutlineFilter=new M("NotebookOutlineFilter")}static{this.NotebookOutlineActionMenu=new M("NotebookOutlineActionMenu")}static{this.NotebookEditorLayoutConfigure=new M("NotebookEditorLayoutConfigure")}static{this.NotebookKernelSource=new M("NotebookKernelSource")}static{this.BulkEditTitle=new M("BulkEditTitle")}static{this.BulkEditContext=new M("BulkEditContext")}static{this.TimelineItemContext=new M("TimelineItemContext")}static{this.TimelineTitle=new M("TimelineTitle")}static{this.TimelineTitleContext=new M("TimelineTitleContext")}static{this.TimelineFilterSubMenu=new M("TimelineFilterSubMenu")}static{this.AccountsContext=new M("AccountsContext")}static{this.SidebarTitle=new M("SidebarTitle")}static{this.PanelTitle=new M("PanelTitle")}static{this.AuxiliaryBarTitle=new M("AuxiliaryBarTitle")}static{this.TerminalInstanceContext=new M("TerminalInstanceContext")}static{this.TerminalEditorInstanceContext=new M("TerminalEditorInstanceContext")}static{this.TerminalNewDropdownContext=new M("TerminalNewDropdownContext")}static{this.TerminalTabContext=new M("TerminalTabContext")}static{this.TerminalTabEmptyAreaContext=new M("TerminalTabEmptyAreaContext")}static{this.TerminalStickyScrollContext=new M("TerminalStickyScrollContext")}static{this.WebviewContext=new M("WebviewContext")}static{this.InlineCompletionsActions=new M("InlineCompletionsActions")}static{this.InlineEditsActions=new M("InlineEditsActions")}static{this.NewFile=new M("NewFile")}static{this.MergeInput1Toolbar=new M("MergeToolbar1Toolbar")}static{this.MergeInput2Toolbar=new M("MergeToolbar2Toolbar")}static{this.MergeBaseToolbar=new M("MergeBaseToolbar")}static{this.MergeInputResultToolbar=new M("MergeToolbarResultToolbar")}static{this.InlineSuggestionToolbar=new M("InlineSuggestionToolbar")}static{this.InlineEditToolbar=new M("InlineEditToolbar")}static{this.ChatContext=new M("ChatContext")}static{this.ChatCodeBlock=new M("ChatCodeblock")}static{this.ChatCompareBlock=new M("ChatCompareBlock")}static{this.ChatMessageTitle=new M("ChatMessageTitle")}static{this.ChatHistory=new M("ChatHistory")}static{this.ChatWelcomeContext=new M("ChatWelcomeContext")}static{this.ChatMessageFooter=new M("ChatMessageFooter")}static{this.ChatExecute=new M("ChatExecute")}static{this.ChatInput=new M("ChatInput")}static{this.ChatInputSide=new M("ChatInputSide")}static{this.ChatModePicker=new M("ChatModePicker")}static{this.ChatEditingWidgetToolbar=new M("ChatEditingWidgetToolbar")}static{this.ChatEditingEditorContent=new M("ChatEditingEditorContent")}static{this.ChatEditingEditorHunk=new M("ChatEditingEditorHunk")}static{this.ChatEditingDeletedNotebookCell=new M("ChatEditingDeletedNotebookCell")}static{this.ChatInputAttachmentToolbar=new M("ChatInputAttachmentToolbar")}static{this.ChatEditingWidgetModifiedFilesToolbar=new M("ChatEditingWidgetModifiedFilesToolbar")}static{this.ChatInputResourceAttachmentContext=new M("ChatInputResourceAttachmentContext")}static{this.ChatInputSymbolAttachmentContext=new M("ChatInputSymbolAttachmentContext")}static{this.ChatInlineResourceAnchorContext=new M("ChatInlineResourceAnchorContext")}static{this.ChatInlineSymbolAnchorContext=new M("ChatInlineSymbolAnchorContext")}static{this.ChatMessageCheckpoint=new M("ChatMessageCheckpoint")}static{this.ChatMessageRestoreCheckpoint=new M("ChatMessageRestoreCheckpoint")}static{this.ChatNewMenu=new M("ChatNewMenu")}static{this.ChatEditingCodeBlockContext=new M("ChatEditingCodeBlockContext")}static{this.ChatTitleBarMenu=new M("ChatTitleBarMenu")}static{this.ChatAttachmentsContext=new M("ChatAttachmentsContext")}static{this.ChatToolOutputResourceToolbar=new M("ChatToolOutputResourceToolbar")}static{this.ChatTextEditorMenu=new M("ChatTextEditorMenu")}static{this.ChatToolOutputResourceContext=new M("ChatToolOutputResourceContext")}static{this.ChatMultiDiffContext=new M("ChatMultiDiffContext")}static{this.ChatSessionsMenu=new M("ChatSessionsMenu")}static{this.ChatSessionsCreateSubMenu=new M("ChatSessionsCreateSubMenu")}static{this.ChatConfirmationMenu=new M("ChatConfirmationMenu")}static{this.ChatEditorInlineExecute=new M("ChatEditorInputExecute")}static{this.ChatEditorInlineInputSide=new M("ChatEditorInputSide")}static{this.AccessibleView=new M("AccessibleView")}static{this.MultiDiffEditorFileToolbar=new M("MultiDiffEditorFileToolbar")}static{this.DiffEditorHunkToolbar=new M("DiffEditorHunkToolbar")}static{this.DiffEditorSelectionToolbar=new M("DiffEditorSelectionToolbar")}constructor(e){if(M._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);M._instances.set(e,this),this.id=e}}const Ur=Ve("menuService");class eh{static{this._all=new Map}static for(e){let t=this._all.get(e);return t||(t=new eh(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof eh&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}const vn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new uee({merge:eh.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(o){return this._commands.set(o.id,o),this._onDidChangeMenu.fire(eh.for(M.CommandPalette)),ge(()=>{this._commands.delete(o.id)&&this._onDidChangeMenu.fire(eh.for(M.CommandPalette))})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((e,t)=>o.set(t,e)),o}appendMenuItem(o,e){let t=this._menuItems.get(o);t||(t=new bs,this._menuItems.set(o,t));const i=t.push(e);return this._onDidChangeMenu.fire(eh.for(o)),ge(()=>{i(),this._onDidChangeMenu.fire(eh.for(o))})}appendMenuItems(o){const e=new z;for(const{id:t,item:i}of o)e.add(this.appendMenuItem(t,i));return e}getMenuItems(o){let e;return this._menuItems.has(o)?e=[...this._menuItems.get(o)]:e=[],o===M.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(o){const e=new Set;for(const t of o)sm(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||o.push({command:t})})}};class Ig extends jm{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let sr=D0=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,n,s,r,a){this.hideActions=n,this.menuKeybinding=s,this._commandService=a,this.id=e.id,this.label=D0.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){const c=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),this.checked&&ye.isThemeIcon(c.icon)&&(l=c.icon),this.checked&&c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}l||(l=ye.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new D0(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=l&&ye.asClassName(l)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};sr=D0=Tie([W7(5,Ne),W7(6,Vt)],sr);class yn{constructor(e){this.desc=e}}function Lt(o){const e=[],t=new o,{f1:i,menu:n,keybinding:s,...r}=t.desc;if(it.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(it.registerCommand({id:r.id,handler:(a,...l)=>t.run(a,...l),metadata:r.metadata??{description:t.desc.title}})),Array.isArray(n))for(const a of n)e.push(vn.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(vn.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(vn.appendMenuItem(M.CommandPalette,{command:r,when:r.precondition})),e.push(vn.addCommand(r))),Array.isArray(s))for(const a of s)e.push(Sn.registerKeybindingRule({...a,id:r.id,when:r.precondition?K.and(r.precondition,a.when):a.when}));else s&&e.push(Sn.registerKeybindingRule({...s,id:r.id,when:r.precondition?K.and(r.precondition,s.when):s.when}));return{dispose(){vt(e)}}}const cs=Ve("telemetryService");var B7,H7,V7;class Mie{constructor(e,t){this.uri=e,this.value=t}}function Pie(o){return Array.isArray(o)}class gi{static{this.defaultToKey=e=>e.toString()}constructor(e,t){if(this[B7]="ResourceMap",e instanceof gi)this.map=new Map(e.map),this.toKey=t??gi.defaultToKey;else if(Pie(e)){this.map=new Map,this.toKey=t??gi.defaultToKey;for(const[i,n]of e)this.set(i,n)}else this.map=new Map,this.toKey=e??gi.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Mie(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(B7=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}class Aie{constructor(e,t){this[H7]="ResourceSet",!e||typeof e=="function"?this._map=new gi(e):(this._map=new gi(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((i,n)=>e.call(t,n,n,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(H7=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}class Oie{constructor(){this[V7]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,i!==0&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}[(V7=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=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 new 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 new 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 new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class Fie extends Oie{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class ba extends Fie{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class Wie{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class c${constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}class bD{constructor(){this._data=new Map}set(e,...t){let i=this._data;for(let n=0;n{let n="";for(const[s,r]of t)n+=`${" ".repeat(i)}${s}: `,r instanceof Map?n+=` +Received: '{1}'.`,e,D_.getLexeme(t)),s=t.offset,r=D_.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),nb._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};class q{static false(){return Es.INSTANCE}static true(){return Ys.INSTANCE}static has(e){return nf.create(e)}static equals(e,t){return i_.create(e,t)}static notEquals(e,t){return _L.create(e,t)}static regex(e,t){return NC.create(e,t)}static in(e,t){return pL.create(e,t)}static notIn(e,t){return mL.create(e,t)}static not(e){return sf.create(e)}static and(...e){return Uu.create(e,null,!0)}static or(...e){return wc.create(e,null,!0)}static{this._parser=new Nee({regexParsingWithErrorRecovery:!1})}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}function Tee(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function Lb(o,e){return o.cmp(e)}class Es{static{this.INSTANCE=new Es}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Ys.INSTANCE}}class Ys{static{this.INSTANCE=new Ys}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Es.INSTANCE}}class nf{static create(e,t=null){const i=Qn.get(e);return typeof i=="boolean"?i?Ys.INSTANCE:Es.INSTANCE:new nf(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:yz(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Qn.get(this.key);return typeof e=="boolean"?e?Ys.INSTANCE:Es.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=sf.create(this.key,this)),this.negated}}class i_{static create(e,t,i=null){if(typeof t=="boolean")return t?nf.create(e,i):sf.create(e,i);const n=Qn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Ys.INSTANCE:Es.INSTANCE:new i_(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Qn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ys.INSTANCE:Es.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_L.create(this.key,this.value,this)),this.negated}}class pL{static create(e,t){return new pL(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?wee.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=mL.create(this.key,this.valueKey)),this.negated}}class mL{static create(e,t){return new mL(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=pL.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class _L{static create(e,t,i=null){if(typeof t=="boolean")return t?sf.create(e,i):nf.create(e,i);const n=Qn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Es.INSTANCE:Ys.INSTANCE:new _L(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Qn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Es.INSTANCE:Ys.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i_.create(this.key,this.value,this)),this.negated}}class sf{static create(e,t=null){const i=Qn.get(e);return typeof i=="boolean"?i?Es.INSTANCE:Ys.INSTANCE:new sf(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:yz(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Qn.get(this.key);return typeof e=="boolean"?e?Es.INSTANCE:Ys.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=nf.create(this.key,this)),this.negated}}function bL(o,e){if(typeof o=="string"){const t=parseFloat(o);isNaN(t)||(o=t)}return typeof o=="string"||typeof o=="number"?e(o):Es.INSTANCE}class CL{static create(e,t,i=null){return bL(t,n=>new CL(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=SL.create(this.key,this.value,this)),this.negated}}class vL{static create(e,t,i=null){return bL(t,n=>new vL(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=wL.create(this.key,this.value,this)),this.negated}}class wL{static create(e,t,i=null){return bL(t,n=>new wL(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new SL(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:of(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=CL.create(this.key,this.value,this)),this.negated}}class NC{static create(e,t){return new NC(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=bO.create(this)),this.negated}}class bO{static create(e){return new bO(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function Sz(o){let e=null;for(let t=0,i=o.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=n[n.length-1];if(r.type!==9)break;n.pop();const a=n.pop(),l=n.length===0,c=wc.create(r.expr.map(d=>Uu.create([d,a],null,i)),null,l);c&&(n.push(c),n.sort(Lb))}if(n.length===1)return n[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=wc.create(e,this,!0)}return this.negated}}class wc{static create(e,t,i){return wc._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const s of r7(t))for(const r of r7(i))n.push(Uu.create([s,r],null,!1));e.unshift(wc.create(n,null,!1))}this.negated=wc.create(e,this,!0)}return this.negated}}class oe extends nf{static{this._info=[]}static all(){return oe._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?oe._info.push({...i,key:e}):i!==!0&&oe._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return i_.create(this.key,e)}}const Ie=We("contextKeyService");function yz(o,e){return oe?1:0}function of(o,e,t,i){return ot?1:ei?1:0}function rN(o,e){if(o.type===0||e.type===1)return!0;if(o.type===9)return e.type===9?o7(o.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(rN(o,t))return!0;return!1}if(o.type===6){if(e.type===6)return o7(e.expr,o.expr);for(const t of o.expr)if(rN(t,e))return!0;return!1}return o.equals(e)}function o7(o,e){let t=0,i=0;for(;t{wg(e.dispose)&&e.dispose()}),this.data.clear()}}const li=new Ree;class CO{constructor(){this._coreKeybindings=new cs,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(lo===1){if(e&&e.win)return e.win}else if(lo===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=CO.bindToCurrentPlatform(e),i=new z;if(t&&t.primary){const n=HE(t.primary,lo);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,s=t.secondary.length;n{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Pee)),this._cachedMergedKeybindings.slice(0)}}const fn=new CO,Mee={EditorModes:"platform.keybindingsRegistry"};li.add(Mee.EditorModes,fn);function Pee(o,e){if(o.weight1!==e.weight1)return o.weight1-e.weight1;if(o.command&&e.command){if(o.commande.command)return 1}return o.weight2-e.weight2}var Aee=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},a7=function(o,e){return function(t,i){e(t,i,o)}},RS;function Ip(o){return o.command!==void 0}function Oee(o){return o.submenu!==void 0}class M{static{this._instances=new Map}static{this.CommandPalette=new M("CommandPalette")}static{this.DebugBreakpointsContext=new M("DebugBreakpointsContext")}static{this.DebugCallStackContext=new M("DebugCallStackContext")}static{this.DebugConsoleContext=new M("DebugConsoleContext")}static{this.DebugVariablesContext=new M("DebugVariablesContext")}static{this.NotebookVariablesContext=new M("NotebookVariablesContext")}static{this.DebugHoverContext=new M("DebugHoverContext")}static{this.DebugWatchContext=new M("DebugWatchContext")}static{this.DebugToolBar=new M("DebugToolBar")}static{this.DebugToolBarStop=new M("DebugToolBarStop")}static{this.DebugDisassemblyContext=new M("DebugDisassemblyContext")}static{this.DebugCallStackToolbar=new M("DebugCallStackToolbar")}static{this.DebugCreateConfiguration=new M("DebugCreateConfiguration")}static{this.EditorContext=new M("EditorContext")}static{this.SimpleEditorContext=new M("SimpleEditorContext")}static{this.EditorContent=new M("EditorContent")}static{this.EditorLineNumberContext=new M("EditorLineNumberContext")}static{this.EditorContextCopy=new M("EditorContextCopy")}static{this.EditorContextPeek=new M("EditorContextPeek")}static{this.EditorContextShare=new M("EditorContextShare")}static{this.EditorTitle=new M("EditorTitle")}static{this.CompactWindowEditorTitle=new M("CompactWindowEditorTitle")}static{this.EditorTitleRun=new M("EditorTitleRun")}static{this.EditorTitleContext=new M("EditorTitleContext")}static{this.EditorTitleContextShare=new M("EditorTitleContextShare")}static{this.EmptyEditorGroup=new M("EmptyEditorGroup")}static{this.EmptyEditorGroupContext=new M("EmptyEditorGroupContext")}static{this.EditorTabsBarContext=new M("EditorTabsBarContext")}static{this.EditorTabsBarShowTabsSubmenu=new M("EditorTabsBarShowTabsSubmenu")}static{this.EditorTabsBarShowTabsZenModeSubmenu=new M("EditorTabsBarShowTabsZenModeSubmenu")}static{this.EditorActionsPositionSubmenu=new M("EditorActionsPositionSubmenu")}static{this.EditorSplitMoveSubmenu=new M("EditorSplitMoveSubmenu")}static{this.ExplorerContext=new M("ExplorerContext")}static{this.ExplorerContextShare=new M("ExplorerContextShare")}static{this.ExtensionContext=new M("ExtensionContext")}static{this.ExtensionEditorContextMenu=new M("ExtensionEditorContextMenu")}static{this.GlobalActivity=new M("GlobalActivity")}static{this.CommandCenter=new M("CommandCenter")}static{this.CommandCenterCenter=new M("CommandCenterCenter")}static{this.LayoutControlMenuSubmenu=new M("LayoutControlMenuSubmenu")}static{this.LayoutControlMenu=new M("LayoutControlMenu")}static{this.MenubarMainMenu=new M("MenubarMainMenu")}static{this.MenubarAppearanceMenu=new M("MenubarAppearanceMenu")}static{this.MenubarDebugMenu=new M("MenubarDebugMenu")}static{this.MenubarEditMenu=new M("MenubarEditMenu")}static{this.MenubarCopy=new M("MenubarCopy")}static{this.MenubarFileMenu=new M("MenubarFileMenu")}static{this.MenubarGoMenu=new M("MenubarGoMenu")}static{this.MenubarHelpMenu=new M("MenubarHelpMenu")}static{this.MenubarLayoutMenu=new M("MenubarLayoutMenu")}static{this.MenubarNewBreakpointMenu=new M("MenubarNewBreakpointMenu")}static{this.PanelAlignmentMenu=new M("PanelAlignmentMenu")}static{this.PanelPositionMenu=new M("PanelPositionMenu")}static{this.ActivityBarPositionMenu=new M("ActivityBarPositionMenu")}static{this.MenubarPreferencesMenu=new M("MenubarPreferencesMenu")}static{this.MenubarRecentMenu=new M("MenubarRecentMenu")}static{this.MenubarSelectionMenu=new M("MenubarSelectionMenu")}static{this.MenubarShare=new M("MenubarShare")}static{this.MenubarSwitchEditorMenu=new M("MenubarSwitchEditorMenu")}static{this.MenubarSwitchGroupMenu=new M("MenubarSwitchGroupMenu")}static{this.MenubarTerminalMenu=new M("MenubarTerminalMenu")}static{this.MenubarTerminalSuggestStatusMenu=new M("MenubarTerminalSuggestStatusMenu")}static{this.MenubarViewMenu=new M("MenubarViewMenu")}static{this.MenubarHomeMenu=new M("MenubarHomeMenu")}static{this.OpenEditorsContext=new M("OpenEditorsContext")}static{this.OpenEditorsContextShare=new M("OpenEditorsContextShare")}static{this.ProblemsPanelContext=new M("ProblemsPanelContext")}static{this.SCMInputBox=new M("SCMInputBox")}static{this.SCMChangeContext=new M("SCMChangeContext")}static{this.SCMResourceContext=new M("SCMResourceContext")}static{this.SCMResourceContextShare=new M("SCMResourceContextShare")}static{this.SCMResourceFolderContext=new M("SCMResourceFolderContext")}static{this.SCMResourceGroupContext=new M("SCMResourceGroupContext")}static{this.SCMSourceControl=new M("SCMSourceControl")}static{this.SCMSourceControlInline=new M("SCMSourceControlInline")}static{this.SCMSourceControlTitle=new M("SCMSourceControlTitle")}static{this.SCMHistoryTitle=new M("SCMHistoryTitle")}static{this.SCMHistoryItemContext=new M("SCMHistoryItemContext")}static{this.SCMHistoryItemChangeContext=new M("SCMHistoryItemChangeContext")}static{this.SCMHistoryItemRefContext=new M("SCMHistoryItemRefContext")}static{this.SCMArtifactGroupContext=new M("SCMArtifactGroupContext")}static{this.SCMArtifactContext=new M("SCMArtifactContext")}static{this.SCMQuickDiffDecorations=new M("SCMQuickDiffDecorations")}static{this.SCMTitle=new M("SCMTitle")}static{this.SearchContext=new M("SearchContext")}static{this.SearchActionMenu=new M("SearchActionContext")}static{this.StatusBarWindowIndicatorMenu=new M("StatusBarWindowIndicatorMenu")}static{this.StatusBarRemoteIndicatorMenu=new M("StatusBarRemoteIndicatorMenu")}static{this.StickyScrollContext=new M("StickyScrollContext")}static{this.TestItem=new M("TestItem")}static{this.TestItemGutter=new M("TestItemGutter")}static{this.TestProfilesContext=new M("TestProfilesContext")}static{this.TestMessageContext=new M("TestMessageContext")}static{this.TestMessageContent=new M("TestMessageContent")}static{this.TestPeekElement=new M("TestPeekElement")}static{this.TestPeekTitle=new M("TestPeekTitle")}static{this.TestCallStack=new M("TestCallStack")}static{this.TestCoverageFilterItem=new M("TestCoverageFilterItem")}static{this.TouchBarContext=new M("TouchBarContext")}static{this.TitleBar=new M("TitleBar")}static{this.TitleBarContext=new M("TitleBarContext")}static{this.TitleBarTitleContext=new M("TitleBarTitleContext")}static{this.TunnelContext=new M("TunnelContext")}static{this.TunnelPrivacy=new M("TunnelPrivacy")}static{this.TunnelProtocol=new M("TunnelProtocol")}static{this.TunnelPortInline=new M("TunnelInline")}static{this.TunnelTitle=new M("TunnelTitle")}static{this.TunnelLocalAddressInline=new M("TunnelLocalAddressInline")}static{this.TunnelOriginInline=new M("TunnelOriginInline")}static{this.ViewItemContext=new M("ViewItemContext")}static{this.ViewContainerTitle=new M("ViewContainerTitle")}static{this.ViewContainerTitleContext=new M("ViewContainerTitleContext")}static{this.ViewTitle=new M("ViewTitle")}static{this.ViewTitleContext=new M("ViewTitleContext")}static{this.CommentEditorActions=new M("CommentEditorActions")}static{this.CommentThreadTitle=new M("CommentThreadTitle")}static{this.CommentThreadActions=new M("CommentThreadActions")}static{this.CommentThreadAdditionalActions=new M("CommentThreadAdditionalActions")}static{this.CommentThreadTitleContext=new M("CommentThreadTitleContext")}static{this.CommentThreadCommentContext=new M("CommentThreadCommentContext")}static{this.CommentTitle=new M("CommentTitle")}static{this.CommentActions=new M("CommentActions")}static{this.CommentsViewThreadActions=new M("CommentsViewThreadActions")}static{this.InteractiveToolbar=new M("InteractiveToolbar")}static{this.InteractiveCellTitle=new M("InteractiveCellTitle")}static{this.InteractiveCellDelete=new M("InteractiveCellDelete")}static{this.InteractiveCellExecute=new M("InteractiveCellExecute")}static{this.InteractiveInputExecute=new M("InteractiveInputExecute")}static{this.InteractiveInputConfig=new M("InteractiveInputConfig")}static{this.ReplInputExecute=new M("ReplInputExecute")}static{this.IssueReporter=new M("IssueReporter")}static{this.NotebookToolbar=new M("NotebookToolbar")}static{this.NotebookToolbarContext=new M("NotebookToolbarContext")}static{this.NotebookStickyScrollContext=new M("NotebookStickyScrollContext")}static{this.NotebookCellTitle=new M("NotebookCellTitle")}static{this.NotebookCellDelete=new M("NotebookCellDelete")}static{this.NotebookCellInsert=new M("NotebookCellInsert")}static{this.NotebookCellBetween=new M("NotebookCellBetween")}static{this.NotebookCellListTop=new M("NotebookCellTop")}static{this.NotebookCellExecute=new M("NotebookCellExecute")}static{this.NotebookCellExecuteGoTo=new M("NotebookCellExecuteGoTo")}static{this.NotebookCellExecutePrimary=new M("NotebookCellExecutePrimary")}static{this.NotebookDiffCellInputTitle=new M("NotebookDiffCellInputTitle")}static{this.NotebookDiffDocumentMetadata=new M("NotebookDiffDocumentMetadata")}static{this.NotebookDiffCellMetadataTitle=new M("NotebookDiffCellMetadataTitle")}static{this.NotebookDiffCellOutputsTitle=new M("NotebookDiffCellOutputsTitle")}static{this.NotebookOutputToolbar=new M("NotebookOutputToolbar")}static{this.NotebookOutlineFilter=new M("NotebookOutlineFilter")}static{this.NotebookOutlineActionMenu=new M("NotebookOutlineActionMenu")}static{this.NotebookEditorLayoutConfigure=new M("NotebookEditorLayoutConfigure")}static{this.NotebookKernelSource=new M("NotebookKernelSource")}static{this.BulkEditTitle=new M("BulkEditTitle")}static{this.BulkEditContext=new M("BulkEditContext")}static{this.TimelineItemContext=new M("TimelineItemContext")}static{this.TimelineTitle=new M("TimelineTitle")}static{this.TimelineTitleContext=new M("TimelineTitleContext")}static{this.TimelineFilterSubMenu=new M("TimelineFilterSubMenu")}static{this.AccountsContext=new M("AccountsContext")}static{this.SidebarTitle=new M("SidebarTitle")}static{this.PanelTitle=new M("PanelTitle")}static{this.AuxiliaryBarTitle=new M("AuxiliaryBarTitle")}static{this.TerminalInstanceContext=new M("TerminalInstanceContext")}static{this.TerminalEditorInstanceContext=new M("TerminalEditorInstanceContext")}static{this.TerminalNewDropdownContext=new M("TerminalNewDropdownContext")}static{this.TerminalTabContext=new M("TerminalTabContext")}static{this.TerminalTabEmptyAreaContext=new M("TerminalTabEmptyAreaContext")}static{this.TerminalStickyScrollContext=new M("TerminalStickyScrollContext")}static{this.WebviewContext=new M("WebviewContext")}static{this.InlineCompletionsActions=new M("InlineCompletionsActions")}static{this.InlineEditsActions=new M("InlineEditsActions")}static{this.NewFile=new M("NewFile")}static{this.MergeInput1Toolbar=new M("MergeToolbar1Toolbar")}static{this.MergeInput2Toolbar=new M("MergeToolbar2Toolbar")}static{this.MergeBaseToolbar=new M("MergeBaseToolbar")}static{this.MergeInputResultToolbar=new M("MergeToolbarResultToolbar")}static{this.InlineSuggestionToolbar=new M("InlineSuggestionToolbar")}static{this.InlineEditToolbar=new M("InlineEditToolbar")}static{this.ChatContext=new M("ChatContext")}static{this.ChatCodeBlock=new M("ChatCodeblock")}static{this.ChatCompareBlock=new M("ChatCompareBlock")}static{this.ChatMessageTitle=new M("ChatMessageTitle")}static{this.ChatHistory=new M("ChatHistory")}static{this.ChatWelcomeContext=new M("ChatWelcomeContext")}static{this.ChatMessageFooter=new M("ChatMessageFooter")}static{this.ChatExecute=new M("ChatExecute")}static{this.ChatInput=new M("ChatInput")}static{this.ChatInputSide=new M("ChatInputSide")}static{this.ChatModePicker=new M("ChatModePicker")}static{this.ChatEditingWidgetToolbar=new M("ChatEditingWidgetToolbar")}static{this.ChatEditingEditorContent=new M("ChatEditingEditorContent")}static{this.ChatEditingEditorHunk=new M("ChatEditingEditorHunk")}static{this.ChatEditingDeletedNotebookCell=new M("ChatEditingDeletedNotebookCell")}static{this.ChatInputAttachmentToolbar=new M("ChatInputAttachmentToolbar")}static{this.ChatEditingWidgetModifiedFilesToolbar=new M("ChatEditingWidgetModifiedFilesToolbar")}static{this.ChatInputResourceAttachmentContext=new M("ChatInputResourceAttachmentContext")}static{this.ChatInputSymbolAttachmentContext=new M("ChatInputSymbolAttachmentContext")}static{this.ChatInlineResourceAnchorContext=new M("ChatInlineResourceAnchorContext")}static{this.ChatInlineSymbolAnchorContext=new M("ChatInlineSymbolAnchorContext")}static{this.ChatMessageCheckpoint=new M("ChatMessageCheckpoint")}static{this.ChatMessageRestoreCheckpoint=new M("ChatMessageRestoreCheckpoint")}static{this.ChatNewMenu=new M("ChatNewMenu")}static{this.ChatEditingCodeBlockContext=new M("ChatEditingCodeBlockContext")}static{this.ChatTitleBarMenu=new M("ChatTitleBarMenu")}static{this.ChatAttachmentsContext=new M("ChatAttachmentsContext")}static{this.ChatToolOutputResourceToolbar=new M("ChatToolOutputResourceToolbar")}static{this.ChatTextEditorMenu=new M("ChatTextEditorMenu")}static{this.ChatToolOutputResourceContext=new M("ChatToolOutputResourceContext")}static{this.ChatMultiDiffContext=new M("ChatMultiDiffContext")}static{this.ChatSessionsMenu=new M("ChatSessionsMenu")}static{this.ChatSessionsCreateSubMenu=new M("ChatSessionsCreateSubMenu")}static{this.ChatConfirmationMenu=new M("ChatConfirmationMenu")}static{this.ChatEditorInlineExecute=new M("ChatEditorInputExecute")}static{this.ChatEditorInlineInputSide=new M("ChatEditorInputSide")}static{this.AccessibleView=new M("AccessibleView")}static{this.MultiDiffEditorFileToolbar=new M("MultiDiffEditorFileToolbar")}static{this.DiffEditorHunkToolbar=new M("DiffEditorHunkToolbar")}static{this.DiffEditorSelectionToolbar=new M("DiffEditorSelectionToolbar")}constructor(e){if(M._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);M._instances.set(e,this),this.id=e}}const Er=We("menuService");class Md{static{this._all=new Map}static for(e){let t=this._all.get(e);return t||(t=new Md(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Md&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}const un=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new mQ({merge:Md.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(o){return this._commands.set(o.id,o),this._onDidChangeMenu.fire(Md.for(M.CommandPalette)),ue(()=>{this._commands.delete(o.id)&&this._onDidChangeMenu.fire(Md.for(M.CommandPalette))})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((e,t)=>o.set(t,e)),o}appendMenuItem(o,e){let t=this._menuItems.get(o);t||(t=new cs,this._menuItems.set(o,t));const i=t.push(e);return this._onDidChangeMenu.fire(Md.for(o)),ue(()=>{i(),this._onDidChangeMenu.fire(Md.for(o))})}appendMenuItems(o){const e=new z;for(const{id:t,item:i}of o)e.add(this.appendMenuItem(t,i));return e}getMenuItems(o){let e;return this._menuItems.has(o)?e=[...this._menuItems.get(o)]:e=[],o===M.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(o){const e=new Set;for(const t of o)Ip(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||o.push({command:t})})}};class og extends pm{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let $o=RS=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,n,s,r,a){this.hideActions=n,this.menuKeybinding=s,this._commandService=a,this.id=e.id,this.label=RS.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){const c=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),this.checked&&Se.isThemeIcon(c.icon)&&(l=c.icon),this.checked&&c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}l||(l=Se.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new RS(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=l&&Se.asClassName(l)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};$o=RS=Aee([a7(5,Ie),a7(6,Pt)],$o);class pn{constructor(e){this.desc=e}}function bt(o){const e=[],t=new o,{f1:i,menu:n,keybinding:s,...r}=t.desc;if(Ye.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(Ye.registerCommand({id:r.id,handler:(a,...l)=>t.run(a,...l),metadata:r.metadata??{description:t.desc.title}})),Array.isArray(n))for(const a of n)e.push(un.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(un.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(un.appendMenuItem(M.CommandPalette,{command:r,when:r.precondition})),e.push(un.addCommand(r))),Array.isArray(s))for(const a of s)e.push(fn.registerKeybindingRule({...a,id:r.id,when:r.precondition?q.and(r.precondition,a.when):a.when}));else s&&e.push(fn.registerKeybindingRule({...s,id:r.id,when:r.precondition?q.and(r.precondition,s.when):s.when}));return{dispose(){pt(e)}}}const ts=We("telemetryService");var l7,c7,d7;class Fee{constructor(e,t){this.uri=e,this.value=t}}function Wee(o){return Array.isArray(o)}class ai{static{this.defaultToKey=e=>e.toString()}constructor(e,t){if(this[l7]="ResourceMap",e instanceof ai)this.map=new Map(e.map),this.toKey=t??ai.defaultToKey;else if(Wee(e)){this.map=new Map,this.toKey=t??ai.defaultToKey;for(const[i,n]of e)this.set(i,n)}else this.map=new Map,this.toKey=e??ai.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Fee(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(l7=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}class Bee{constructor(e,t){this[c7]="ResourceSet",!e||typeof e=="function"?this._map=new ai(e):(this._map=new ai(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((i,n)=>e.call(t,n,n,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(c7=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}class Hee{constructor(){this[d7]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,i!==0&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}[(d7=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=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 new 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 new 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 new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class Vee extends Hee{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class na extends Vee{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class zee{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class xz{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}class yL{constructor(){this._data=new Map}set(e,...t){let i=this._data;for(let n=0;n{let n="";for(const[s,r]of t)n+=`${" ".repeat(i)}${s}: `,r instanceof Map?n+=` `+e(r,i+1):n+=`${r} -`;return n};return e(this._data,0)}}function Bd(o){return o===47||o===92}function d$(o){return o.replace(/[\\/]/g,zi.sep)}function Bie(o){return o.indexOf("/")===-1&&(o=d$(o)),/^[a-zA-Z]:(\/|$)/.test(o)&&(o="/"+o),o}function z7(o,e=zi.sep){if(!o)return"";const t=o.length,i=o.charCodeAt(0);if(Bd(i)){if(Bd(o.charCodeAt(1))&&!Bd(o.charCodeAt(2))){let s=3;const r=s;for(;so.length)return!1;if(t){if(!l4(o,e))return!1;if(e.length===o.length)return!0;let s=e.length;return e.charAt(e.length-1)===i&&s--,o.charAt(s)===i}return e.charAt(e.length-1)!==i&&(e+=i),o.indexOf(e)===0}function h$(o){return o>=65&&o<=90||o>=97&&o<=122}function Hie(o,e=Rn){return e?h$(o.charCodeAt(0))&&o.charCodeAt(1)===58:!1}function pl(o){return by(o,!0)}class Vie{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:av(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===Ie.file)return _T(pl(e),pl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if($7(e.authority,t.authority))return _T(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return be.joinPath(e,...t)}basenameOrAuthority(e){return Br(e)||e.authority}basename(e){return zi.basename(e.path)}extname(e){return zi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Ie.file?t=be.file(y0(pl(e))).path:(t=zi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Ie.file?t=be.file(EU(pl(e))).path:t=zi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!$7(e.authority,t.authority))return;if(e.scheme===Ie.file){const s=Zee(pl(e),pl(t));return Rn?d$(s):s}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let s=0;for(const r=Math.min(i.length,n.length);sz7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Ua){return j7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Ua){let i=!1;if(e.scheme===Ie.file){const n=pl(e);i=n!==void 0&&n.length===z7(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===47}return!i&&!j7(e,t)?e.with({path:e.path+"/"}):e}}const ei=new Vie(()=>!1),zh=ei.isEqual.bind(ei);ei.isEqualOrParent.bind(ei);ei.getComparisonKey.bind(ei);const zie=ei.basenameOrAuthority.bind(ei),Br=ei.basename.bind(ei),Uie=ei.extname.bind(ei),CD=ei.dirname.bind(ei),u$=ei.joinPath.bind(ei),$ie=ei.normalizePath.bind(ei),jie=ei.relativePath.bind(ei),U7=ei.resolvePath.bind(ei);ei.isAbsolutePath.bind(ei);const $7=ei.isEqualAuthority.bind(ei),j7=ei.hasTrailingPathSeparator.bind(ei);ei.removeTrailingPathSeparator.bind(ei);ei.addTrailingPathSeparator.bind(ei);var Uh;(function(o){o.META_DATA_LABEL="label",o.META_DATA_DESCRIPTION="description",o.META_DATA_SIZE="size",o.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const s=t.path.substring(0,t.path.indexOf(";"));return s&&i.set(o.META_DATA_MIME,s),i}o.parseMetaData=e})(Uh||(Uh={}));const Ht=Ve("logService"),g$=Ve("loggerService");var ln;(function(o){o[o.Off=0]="Off",o[o.Trace=1]="Trace",o[o.Debug=2]="Debug",o[o.Info=3]="Info",o[o.Warning=4]="Warning",o[o.Error=5]="Error"})(ln||(ln={}));const f$=ln.Info;function p$(o,e){return o!==ln.Off&&o<=e}class m$ extends F{constructor(){super(...arguments),this.level=f$,this._onDidChangeLogLevel=this._register(new P)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return p$(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}}class qie extends m${constructor(e=f$,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.canLog(ln.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.canLog(ln.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.canLog(ln.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.canLog(ln.Warning)&&(this.useColors?console.warn("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.canLog(ln.Error)&&(this.useColors?console.error("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class Kie extends m${constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class Gie extends F{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new gi,this._onDidChangeLoggers=this._register(new P),this._onDidChangeVisibility=this._register(new P),i)for(const n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return hn(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}createLogger(e,t){const i=this.toResource(e),n=hn(e)?e:t?.id??Yw(i.toString()).toString(16);let s=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?ln.Trace:t?.logLevel;s||(s=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:s,info:{resource:i,id:n,logLevel:r,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),s}toResource(e){return hn(e)?u$(this.logsHome,`${e}.log`):e}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}}class Zie{constructor(){this.onDidChangeLogLevel=new P().event}setLevel(e){}getLevel(){return ln.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}dispose(){}}class Yie extends Gie{constructor(){super(ln.Off,be.parse("log:///log"))}doCreateLogger(e,t,i){return new Zie}}function Xie(o){switch(o){case ln.Trace:return"trace";case ln.Debug:return"debug";case ln.Info:return"info";case ln.Warning:return"warn";case ln.Error:return"error";case ln.Off:return"off"}}new re("logLevel",Xie(ln.Info));class pv{static{this.REGISTERED_COMMANDS=new Set}static getRegisteredCommands(){return[...pv.REGISTERED_COMMANDS]}static registerCommand(e){pv.REGISTERED_COMMANDS.add(e)}}let vD=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata,this.canTriggerInlineEdits=e.canTriggerInlineEdits}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=K.and(i,this.precondition):i=this.precondition);const n={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Sn.registerKeybindingRule(n)}}it.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata}),this.canTriggerInlineEdits&&pv.registerCommand(this.id)}_registerMenuItem(e){vn.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class M_ extends vD{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((s,r)=>r.priority-s.priority),{dispose:()=>{for(let s=0;s{if(a.get(Ne).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return tn.runEditorCommand(e,t,this.precondition,(i,n,s)=>this.runEditorCommand(i,n,s))}}class de extends tn{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=M.EditorContext),n.title||(n.title=typeof e.label=="string"?e.label:e.label.value),n.when=K.and(e.precondition,n.when),n}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(de.convertOptions(e)),typeof e.label=="string"?(this.label=e.label,this.alias=e.alias??e.label):(this.label=e.label.value,this.alias=e.alias??e.label.original)}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(cs).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class wD extends de{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=s.get(Ne),a=s.get(Ht);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(s,n,...t)})}}function ho(o,e){it.registerCommand(o,function(t,...i){const n=t.get(pe),[s,r]=i;rt(be.isUri(s)),rt(R.isIPosition(r));const a=t.get(ri).getModel(s);if(a){const l=R.lift(r);return n.invokeFunction(e,a,l,...i.slice(2))}return t.get(ys).createModelReference(s).then(l=>new Promise((c,d)=>{try{const h=n.invokeFunction(e,l.object.textEditorModel,R.lift(r),i.slice(2));c(h)}catch(h){d(h)}}).finally(()=>{l.dispose()}))})}function ae(o){return yr.INSTANCE.registerEditorCommand(o),o}function oe(o){const e=new o;return yr.INSTANCE.registerEditorAction(e),e}function SD(o){return yr.INSTANCE.registerEditorAction(o),o}function Qie(o){yr.INSTANCE.registerEditorAction(o)}function nt(o,e,t){yr.INSTANCE.registerEditorContribution(o,e,t)}var om;(function(o){function e(r){return yr.INSTANCE.getEditorCommand(r)}o.getEditorCommand=e;function t(){return yr.INSTANCE.getEditorActions()}o.getEditorActions=t;function i(){return yr.INSTANCE.getEditorContributions()}o.getEditorContributions=i;function n(r){return yr.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}o.getSomeEditorContributions=n;function s(){return yr.INSTANCE.getDiffEditorContributions()}o.getDiffEditorContributions=s})(om||(om={}));const Jie={EditorCommonContributions:"editor.contributions"};class yr{static{this.INSTANCE=new yr}constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}fi.add(Jie.EditorCommonContributions,yr.INSTANCE);function Jw(o){return o.register(),o}const b$=Jw(new M_({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m(69,"&&Undo"),order:1},{menuId:M.CommandPalette,group:"",title:m(70,"Undo"),order:1},{menuId:M.SimpleEditorContext,group:"1_do",title:m(71,"Undo"),order:1}]}));Jw(new _$(b$,{id:"default:undo",precondition:void 0}));const C$=Jw(new M_({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m(72,"&&Redo"),order:2},{menuId:M.CommandPalette,group:"",title:m(73,"Redo"),order:1},{menuId:M.SimpleEditorContext,group:"1_do",title:m(74,"Redo"),order:2}]}));Jw(new _$(C$,{id:"default:redo",precondition:void 0}));const ene=Jw(new M_({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(75,"&&Select All"),order:1},{menuId:M.CommandPalette,group:"",title:m(76,"Select All"),order:1},{menuId:M.SimpleEditorContext,group:"9_select",title:m(77,"Select All"),order:1}]}));let D=class Ln{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return Ln.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ln.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Ln.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return Ln.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return Ln.plusRange(this,e)}static plusRange(e,t){let i,n,s,r;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,r=e.endColumn),new Ln(i,n,s,r)}intersectRanges(e){return Ln.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(s=c,r=d):s===c&&(r=Math.min(r,d)),i>s||i===s&&n>r?null:new Ln(i,n,s,r)}equalsRange(e){return Ln.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ln.getEndPosition(this)}static getEndPosition(e){return new R(e.endLineNumber,e.endColumn)}getStartPosition(){return Ln.getStartPosition(this)}static getStartPosition(e){return new R(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ln(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ln(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ln.collapseToStart(this)}static collapseToStart(e){return new Ln(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Ln.collapseToEnd(this)}static collapseToEnd(e){return new Ln(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Ln(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new Ln(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ln(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},le=class Zr extends D{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Zr.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Zr(this.startLineNumber,this.startColumn,e,t):new Zr(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new R(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new R(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Zr(e,t,this.endLineNumber,this.endColumn):new Zr(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Zr(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Zr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Zr(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Zr(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i0&&o.getLanguageId(r-1)===n;)r--;return new tne(o,n,r,s+1,o.getStartOffset(r),o.getEndOffset(s))}class tne{constructor(e,t,i,n,s,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function ml(o){return(o&3)!==0}class hi{static _nextVisibleColumn(e,t,i){return e===9?hi.nextRenderTabStop(t,i):_d(e)||u4(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),s=e.substring(0,n),r=new fy(s);let a=0;for(;!r.eol();){const l=gy(s,n,r.offset);r.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,s=new fy(e);let r=0,a=1;for(;!s.eol();){const l=gy(e,n,s.offset);s.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=s.offset+1;if(c>=t){const h=t-r;return c-t!0,one=()=>!1,rne=o=>o===" "||o===" ";class ep{static shouldRecreate(e){return e.hasChanged(165)||e.hasChanged(148)||e.hasChanged(45)||e.hasChanged(85)||e.hasChanged(88)||e.hasChanged(89)||e.hasChanged(10)||e.hasChanged(11)||e.hasChanged(15)||e.hasChanged(13)||e.hasChanged(14)||e.hasChanged(20)||e.hasChanged(145)||e.hasChanged(141)||e.hasChanged(59)||e.hasChanged(104)||e.hasChanged(147)||e.hasChanged(93)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(165),a=s.get(59);this.readOnly=s.get(104),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(132),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(145),this.trimWhitespaceOnDelete=s.get(141),this.wordSeparators=s.get(148),this.emptySelectionClipboard=s.get(45),this.copyWithSyntaxHighlighting=s.get(31),this.multiCursorMergeOverlapping=s.get(85),this.multiCursorPaste=s.get(88),this.multiCursorLimit=s.get(89),this.autoClosingBrackets=s.get(10),this.autoClosingComments=s.get(11),this.autoClosingQuotes=s.get(15),this.autoClosingDelete=s.get(13),this.autoClosingOvertype=s.get(14),this.autoSurround=s.get(20),this.autoIndent=s.get(16),this.wordSegmenterLocales=s.get(147),this.overtypeOnPaste=s.get(93),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=c?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return bT.getInputMode()}onElectricCharacter(e,t,i){const n=gg(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return R4(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return rne;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return sne;case"never":return one}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return hi.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=hi.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(nr?r:n}}let lt=class v${static fromModelState(e){return new ane(e)}static fromViewState(e){return new lne(e)}static fromModelSelection(e){const t=le.liftSelection(e),i=new In(D.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return v$.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;is,c=n>r,d=nr||bn||_0&&n--,Uu.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=s;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new R(l,c));n=Math.max(n,d)}let a=i.toViewVisualColumn;return as&&(a=new R(s,e.getLineMaxColumn(s)));const l=D.fromPositions(i,a);t.addTrackedEditOperation(l,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return le.fromPositions(n.getEndPosition())}}class cne{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return le.fromRange(n,0)}}class k0{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return le.fromPositions(n.getStartPosition())}}class ky{constructor(e,t,i,n,s=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=s}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return le.fromPositions(n.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class dne{constructor(e){this._range=e}getEditOperations(e,t){const i=e.getValueInRange(this._range),n=this._range.getEndPosition(),s=n.lineNumber;let r=w$(e,n,i.length);r.lineNumber>s&&(r=new R(s,e.getLineMaxColumn(s)));const a=D.fromPositions(n,r);t.addTrackedEditOperation(a,"")}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return le.fromPositions(n.getEndPosition())}}class M4{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function w$(o,e,t){if(t<0)throw new Error("Unexpected negative delta");const i=o.getLineCount();let n=new R(i,o.getLineMaxColumn(i));for(let s=e.lineNumber;s<=i;s++)if(s===e.lineNumber){const r=t-o.getLineMaxColumn(e.lineNumber)+e.column;if(r<=0){n=new R(e.lineNumber,e.column+t);break}t=r}else{const r=t-o.getLineMaxColumn(s);if(r<=0){n=new R(s,t);break}t=r}return n}class mv{static whitespaceVisibleColumn(e,t,i){const n=e.length;let s=0,r=-1,a=-1;for(let l=0;le.getLineMinColumn(t.lineNumber))return t.delta(void 0,-SU(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new R(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),r=mv.atomicPosition(s,t.column-1,i,0);if(r!==-1&&r+1>=n)return new R(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?bt.leftPositionAtomicSoftTabs(t,i,e.tabSize):bt.leftPosition(t,i);return new OI(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(s-1)),c=t.normalizePosition(bt.clipPositionColumn(l,t),0),d=bt.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new R(e.lineNumber,bt.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,c),g?s=0:s=c-hi.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),l!==void 0){const f=new R(i,n),p=t.normalizePosition(f,l);s=s+(n-p.column),i=p.lineNumber,n=p.column}return new OI(i,n,s)}static down(e,t,i,n,s,r,a){return this.vertical(e,t,i,n,s,i+r,a,4)}static moveDown(e,t,i,n,s){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=bt.down(e,t,r+l,a,i.leftoverVisibleColumns,s,!0),t.normalizePosition(new R(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){const s=t.getLineCount();let r=i.position.lineNumber;for(;r0,a=t.getLineFirstNonWhitespaceColumn(s.lineNumber);if(r&&a>0)return new D(s.lineNumber,a,n.lineNumber,n.column)}return new D(s.lineNumber,s.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,s,r,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,c=r.length;l=u.length+1)return!1;const g=u.charAt(h.column-2),f=n.get(g);if(!f)return!1;if($h(g)){if(i==="never")return!1}else if(t==="never")return!1;const p=u.charAt(h.column-1);let _=!1;for(const b of f)b.open===g&&b.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let b=!1;for(let C=0,w=a.length;C1){const s=t.getLineContent(n.lineNumber),r=vs(s),a=r===-1?s.length+1:r+1;if(n.column<=a){const l=i.visibleColumnFromColumn(t,n),c=hi.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,c);return new D(n.lineNumber,d,n.lineNumber,n.column)}}return D.fromPositions(Yg.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Oee(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new R(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let s=null;i.sort((r,a)=>R.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&s?.endLineNumber!==c.lineNumber?(d=c.lineNumber-1,h=t.getLineMaxColumn(c.lineNumber-1),u=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,h=1,u=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber));const f=new D(d,h,u,g);s=f,f.isEmpty()?n[r]=null:n[r]=new jn(f,"")}else n[r]=null;else n[r]=new jn(l,"")}return new Hs(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}const Ef={DateTimeFormat(o,e){return new $n(()=>{try{return new Intl.DateTimeFormat(o,e)}catch{return new Intl.DateTimeFormat(void 0,e)}})},Collator(o,e){return new $n(()=>{try{return new Intl.Collator(o,e)}catch{return new Intl.Collator(void 0,e)}})},Segmenter(o,e){return new $n(()=>{try{return new Intl.Segmenter(o,e)}catch{return new Intl.Segmenter(void 0,e)}})},Locale(o,e){return new $n(()=>{try{return new Intl.Locale(o,e)}catch{return new Intl.Locale(ag,e)}})},NumberFormat(o,e){return new $n(()=>{try{return new Intl.NumberFormat(o,e)}catch{return new Intl.NumberFormat(void 0,e)}})}};function Iy(o){return o<0?0:o>255?255:o|0}function tp(o){return o<0?0:o>4294967295?4294967295:o|0}class P_{constructor(e){const t=Iy(e);this._defaultValue=t,this._asciiMap=P_._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Iy(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class Ey{constructor(){this._actual=new P_(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class hne extends P_{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=Ef.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return this._createIntlWord(s,l);if(l===0){if(n===2)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=1}else if(l===2){if(n===1)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=2}else if(l===1&&n!==0)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==0?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const s=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return r;if(l===1||i===1&&l===2||i===2&&l===0)return r+1}return 0}static moveWordLeft(e,t,i,n,s){let r=i.lineNumber,a=i.column;a===1&&r>1&&(r=r-1,a=t.getLineMaxColumn(r));let l=Ct._findPreviousWordOnLine(e,t,new R(r,a));if(n===0)return new R(r,l?l.start+1:1);if(n===1)return!s&&l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=Ct._findPreviousWordOnLine(e,t,new R(r,l.start+1))),new R(r,l?l.start+1:1);if(n===3){for(;l&&l.wordType===2;)l=Ct._findPreviousWordOnLine(e,t,new R(r,l.start+1));return new R(r,l?l.start+1:1)}return l&&a<=l.end+1&&(l=Ct._findPreviousWordOnLine(e,t,new R(r,l.start+1))),new R(r,l?l.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new R(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=s.charCodeAt(r-2),l=s.charCodeAt(r-1);if(a===95&&l!==95)return new R(i,r);if(a===45&&l!==45)return new R(i,r);if((hh(a)||q1(a))&&Dl(l))return new R(i,r);if(Dl(a)&&Dl(l)&&r+1=l.start+1&&(l=Ct._findNextWordOnLine(e,t,new R(s,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(s);return new R(s,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?c=1:(l--,c=n.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=Ct._findPreviousWordOnLine(i,n,new R(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=n.getLineMaxColumn(l))),new D(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new R(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,n);return s||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===0)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;r+11?new D(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new D(i.lineNumber,h,i.lineNumber,u)),l=h=>{let u=h.start+1,g=h.end+1,f=!1;for(;g-11&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,g)},c=Ct._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=Ct._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Ct._moveWordPartLeft(e,i);return new D(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=u.start+1&&(u=Ct._findNextWordOnLine(i,n,new R(l,u.end+1))),u?c=u.start+1:c!!e)}function kl(o){if(!o||typeof o!="object"||o instanceof RegExp)return o;const e=Array.isArray(o)?[]:{};return Object.entries(o).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?kl(i):i}),e}function une(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(S$.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!MJ(n)&&e.push(n)}}return o}const S$=Object.prototype.hasOwnProperty;function y$(o,e){return vT(o,e,new Set)}function vT(o,e,t){if(Sr(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(vT(s,e,t));return n}if(Xi(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)S$.call(o,s)&&(n[s]=vT(o[s],e,t));return t.delete(o),n}return o}function LD(o,e,t=!0){return Xi(o)?(Xi(e)&&Object.keys(e).forEach(i=>{i in o?t&&(Xi(o[i])&&Xi(e[i])?LD(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function xo(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;tc&&(d=c,h=e.model.getLineMaxColumn(d)),lt.fromModelState(new In(new D(r.lineNumber,1,d,h),2,0,new R(d,h),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,h=1;return d>c&&(d=c,h=e.getLineMaxColumn(d)),lt.fromViewState(t.viewState.move(!0,d,h,0))}else{const c=t.modelState.selectionStart.getEndPosition();return lt.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,n){const s=e.model.validatePosition(n);return lt.fromModelState(Ct.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new lt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return lt.fromViewState(new In(new D(i,n,i,n),0,0,new R(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,n,s)}const r=e.model.validatePosition(n),a=s?e.coordinatesConverter.validateViewPosition(new R(s.lineNumber,s.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return lt.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,s,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,s);case 1:return r===4?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,s);case 2:return r===2?this._moveUpByViewLines(e,t,n,s):this._moveUpByModelLines(e,t,n,s);case 3:return r===2?this._moveDownByViewLines(e,t,n,s):this._moveDownByModelLines(e,t,n,s);case 4:return r===2?t.map(a=>lt.fromViewState(bt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>lt.fromModelState(bt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>lt.fromViewState(bt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>lt.fromModelState(bt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:s{const a=e.getTextDirection(s.viewState.position.lineNumber)===er.RTL;return lt.fromViewState(a?bt.moveRight(e.cursorConfig,e,s.viewState,i,n):bt.moveLeft(e.cursorConfig,e,s.viewState,i,n))})}static _moveHalfLineLeft(e,t,i){const n=[];for(let s=0,r=t.length;s{const a=e.getTextDirection(s.viewState.position.lineNumber)===er.RTL;return lt.fromViewState(a?bt.moveLeft(e.cursorConfig,e,s.viewState,i,n):bt.moveRight(e.cursorConfig,e,s.viewState,i,n))})}static _moveHalfLineRight(e,t,i){const n=[];for(let s=0,r=t.length;so.length)return!1;if(t){if(!YA(o,e))return!1;if(e.length===o.length)return!0;let s=e.length;return e.charAt(e.length-1)===i&&s--,o.charAt(s)===i}return e.charAt(e.length-1)!==i&&(e+=i),o.indexOf(e)===0}function kz(o){return o>=65&&o<=90||o>=97&&o<=122}function $ee(o,e=Ln){return e?kz(o.charCodeAt(0))&&o.charCodeAt(1)===58:!1}function Qa(o){return y0(o,!0)}class jee{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:yC(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===Le.file)return aN(Qa(e),Qa(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(g7(e.authority,t.authority))return aN(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return _e.joinPath(e,...t)}basenameOrAuthority(e){return Lr(e)||e.authority}basename(e){return Ai.basename(e.path)}extname(e){return Ai.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Le.file?t=_e.file(ES(Qa(e))).path:(t=Ai.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Le.file?t=_e.file($V(Qa(e))).path:t=Ai.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!g7(e.authority,t.authority))return;if(e.scheme===Le.file){const s=JQ(Qa(e),Qa(t));return Ln?Lz(s):s}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let s=0;for(const r=Math.min(i.length,n.length);sh7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Da){return f7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Da){let i=!1;if(e.scheme===Le.file){const n=Qa(e);i=n!==void 0&&n.length===h7(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===47}return!i&&!f7(e,t)?e.with({path:e.path+"/"}):e}}const Kt=new jee(()=>!1),wh=Kt.isEqual.bind(Kt);Kt.isEqualOrParent.bind(Kt);Kt.getComparisonKey.bind(Kt);const qee=Kt.basenameOrAuthority.bind(Kt),Lr=Kt.basename.bind(Kt),Kee=Kt.extname.bind(Kt),xL=Kt.dirname.bind(Kt),Dz=Kt.joinPath.bind(Kt),Gee=Kt.normalizePath.bind(Kt),Zee=Kt.relativePath.bind(Kt),u7=Kt.resolvePath.bind(Kt);Kt.isAbsolutePath.bind(Kt);const g7=Kt.isEqualAuthority.bind(Kt),f7=Kt.hasTrailingPathSeparator.bind(Kt);Kt.removeTrailingPathSeparator.bind(Kt);Kt.addTrailingPathSeparator.bind(Kt);var Sh;(function(o){o.META_DATA_LABEL="label",o.META_DATA_DESCRIPTION="description",o.META_DATA_SIZE="size",o.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const s=t.path.substring(0,t.path.indexOf(";"));return s&&i.set(o.META_DATA_MIME,s),i}o.parseMetaData=e})(Sh||(Sh={}));const Mt=We("logService"),Iz=We("loggerService");var Ji;(function(o){o[o.Off=0]="Off",o[o.Trace=1]="Trace",o[o.Debug=2]="Debug",o[o.Info=3]="Info",o[o.Warning=4]="Warning",o[o.Error=5]="Error"})(Ji||(Ji={}));const Ez=Ji.Info;function Nz(o,e){return o!==Ji.Off&&o<=e}class Tz extends A{constructor(){super(...arguments),this.level=Ez,this._onDidChangeLogLevel=this._register(new P)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return Nz(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}}class Yee extends Tz{constructor(e=Ez,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.canLog(Ji.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.canLog(Ji.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.canLog(Ji.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.canLog(Ji.Warning)&&(this.useColors?console.warn("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.canLog(Ji.Error)&&(this.useColors?console.error("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class Xee extends Tz{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}class Qee extends A{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new ai,this._onDidChangeLoggers=this._register(new P),this._onDidChangeVisibility=this._register(new P),i)for(const n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return nn(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}createLogger(e,t){const i=this.toResource(e),n=nn(e)?e:t?.id??uw(i.toString()).toString(16);let s=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Ji.Trace:t?.logLevel;s||(s=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:s,info:{resource:i,id:n,logLevel:r,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),s}toResource(e){return nn(e)?Dz(this.logsHome,`${e}.log`):e}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}}class Jee{constructor(){this.onDidChangeLogLevel=new P().event}setLevel(e){}getLevel(){return Ji.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}dispose(){}}class ete extends Qee{constructor(){super(Ji.Off,_e.parse("log:///log"))}doCreateLogger(e,t,i){return new Jee}}function tte(o){switch(o){case Ji.Trace:return"trace";case Ji.Debug:return"debug";case Ji.Info:return"info";case Ji.Warning:return"warn";case Ji.Error:return"error";case Ji.Off:return"off"}}new oe("logLevel",tte(Ji.Info));class TC{static{this.REGISTERED_COMMANDS=new Set}static getRegisteredCommands(){return[...TC.REGISTERED_COMMANDS]}static registerCommand(e){TC.REGISTERED_COMMANDS.add(e)}}let LL=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata,this.canTriggerInlineEdits=e.canTriggerInlineEdits}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=q.and(i,this.precondition):i=this.precondition);const n={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};fn.registerKeybindingRule(n)}}Ye.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata}),this.canTriggerInlineEdits&&TC.registerCommand(this.id)}_registerMenuItem(e){un.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}};class n_ extends LL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((s,r)=>r.priority-s.priority),{dispose:()=>{for(let s=0;s{if(a.get(Ie).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return Ki.runEditorCommand(e,t,this.precondition,(i,n,s)=>this.runEditorCommand(i,n,s))}}class le extends Ki{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=M.EditorContext),n.title||(n.title=typeof e.label=="string"?e.label:e.label.value),n.when=q.and(e.precondition,n.when),n}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(le.convertOptions(e)),typeof e.label=="string"?(this.label=e.label,this.alias=e.alias??e.label):(this.label=e.label.value,this.alias=e.alias??e.label.original)}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(ts).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class kL extends le{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=s.get(Ie),a=s.get(Mt);if(!r.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(s,n,...t)})}}function Js(o,e){Ye.registerCommand(o,function(t,...i){const n=t.get(fe),[s,r]=i;Je(_e.isUri(s)),Je(R.isIPosition(r));const a=t.get(ei).getModel(s);if(a){const l=R.lift(r);return n.invokeFunction(e,a,l,...i.slice(2))}return t.get(fs).createModelReference(s).then(l=>new Promise((c,d)=>{try{const h=n.invokeFunction(e,l.object.textEditorModel,R.lift(r),i.slice(2));c(h)}catch(h){d(h)}}).finally(()=>{l.dispose()}))})}function re(o){return cr.INSTANCE.registerEditorCommand(o),o}function se(o){const e=new o;return cr.INSTANCE.registerEditorAction(e),e}function DL(o){return cr.INSTANCE.registerEditorAction(o),o}function ite(o){cr.INSTANCE.registerEditorAction(o)}function Xe(o,e,t){cr.INSTANCE.registerEditorContribution(o,e,t)}var Ep;(function(o){function e(r){return cr.INSTANCE.getEditorCommand(r)}o.getEditorCommand=e;function t(){return cr.INSTANCE.getEditorActions()}o.getEditorActions=t;function i(){return cr.INSTANCE.getEditorContributions()}o.getEditorContributions=i;function n(r){return cr.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}o.getSomeEditorContributions=n;function s(){return cr.INSTANCE.getDiffEditorContributions()}o.getDiffEditorContributions=s})(Ep||(Ep={}));const nte={EditorCommonContributions:"editor.contributions"};class cr{static{this.INSTANCE=new cr}constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}li.add(nte.EditorCommonContributions,cr.INSTANCE);function pw(o){return o.register(),o}const Mz=pw(new n_({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m(69,"&&Undo"),order:1},{menuId:M.CommandPalette,group:"",title:m(70,"Undo"),order:1},{menuId:M.SimpleEditorContext,group:"1_do",title:m(71,"Undo"),order:1}]}));pw(new Rz(Mz,{id:"default:undo",precondition:void 0}));const Pz=pw(new n_({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m(72,"&&Redo"),order:2},{menuId:M.CommandPalette,group:"",title:m(73,"Redo"),order:1},{menuId:M.SimpleEditorContext,group:"1_do",title:m(74,"Redo"),order:2}]}));pw(new Rz(Pz,{id:"default:redo",precondition:void 0}));const ste=pw(new n_({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(75,"&&Select All"),order:1},{menuId:M.CommandPalette,group:"",title:m(76,"Select All"),order:1},{menuId:M.SimpleEditorContext,group:"9_select",title:m(77,"Select All"),order:1}]}));let L=class _n{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return _n.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return _n.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return _n.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return _n.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return _n.plusRange(this,e)}static plusRange(e,t){let i,n,s,r;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,r=e.endColumn),new _n(i,n,s,r)}intersectRanges(e){return _n.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(s=c,r=d):s===c&&(r=Math.min(r,d)),i>s||i===s&&n>r?null:new _n(i,n,s,r)}equalsRange(e){return _n.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return _n.getEndPosition(this)}static getEndPosition(e){return new R(e.endLineNumber,e.endColumn)}getStartPosition(){return _n.getStartPosition(this)}static getStartPosition(e){return new R(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new _n(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new _n(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return _n.collapseToStart(this)}static collapseToStart(e){return new _n(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return _n.collapseToEnd(this)}static collapseToEnd(e){return new _n(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new _n(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new _n(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new _n(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},ae=class Ar extends L{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ar.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Ar(this.startLineNumber,this.startColumn,e,t):new Ar(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new R(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new R(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Ar(e,t,this.endLineNumber,this.endColumn):new Ar(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ar(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Ar(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ar(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ar(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i0&&o.getLanguageId(r-1)===n;)r--;return new ote(o,n,r,s+1,o.getStartOffset(r),o.getEndOffset(s))}class ote{constructor(e,t,i,n,s,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function Ja(o){return(o&3)!==0}class oi{static _nextVisibleColumn(e,t,i){return e===9?oi.nextRenderTabStop(t,i):Yc(e)||eO(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),s=e.substring(0,n),r=new C0(s);let a=0;for(;!r.eol();){const l=b0(s,n,r.offset);r.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,s=new C0(e);let r=0,a=1;for(;!s.eol();){const l=b0(e,n,s.offset);s.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=s.offset+1;if(c>=t){const h=t-r;return c-t!0,cte=()=>!1,dte=o=>o===" "||o===" ";class xf{static shouldRecreate(e){return e.hasChanged(165)||e.hasChanged(148)||e.hasChanged(45)||e.hasChanged(85)||e.hasChanged(88)||e.hasChanged(89)||e.hasChanged(10)||e.hasChanged(11)||e.hasChanged(15)||e.hasChanged(13)||e.hasChanged(14)||e.hasChanged(20)||e.hasChanged(145)||e.hasChanged(141)||e.hasChanged(59)||e.hasChanged(104)||e.hasChanged(147)||e.hasChanged(93)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(165),a=s.get(59);this.readOnly=s.get(104),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(132),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(145),this.trimWhitespaceOnDelete=s.get(141),this.wordSeparators=s.get(148),this.emptySelectionClipboard=s.get(45),this.copyWithSyntaxHighlighting=s.get(31),this.multiCursorMergeOverlapping=s.get(85),this.multiCursorPaste=s.get(88),this.multiCursorLimit=s.get(89),this.autoClosingBrackets=s.get(10),this.autoClosingComments=s.get(11),this.autoClosingQuotes=s.get(15),this.autoClosingDelete=s.get(13),this.autoClosingOvertype=s.get(14),this.autoSurround=s.get(20),this.autoIndent=s.get(16),this.wordSegmenterLocales=s.get(147),this.overtypeOnPaste=s.get(93),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=c?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return lN.getInputMode()}onElectricCharacter(e,t,i){const n=$u(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return vO(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return dte;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return lte;case"never":return cte}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return oi.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=oi.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(nr?r:n}}let tt=class Az{static fromModelState(e){return new hte(e)}static fromViewState(e){return new ute(e)}static fromModelSelection(e){const t=ae.liftSelection(e),i=new wn(L.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Az.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;is,c=n>r,d=nr||bn||_0&&n--,vu.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=s;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new R(l,c));n=Math.max(n,d)}let a=i.toViewVisualColumn;return as&&(a=new R(s,e.getLineMaxColumn(s)));const l=L.fromPositions(i,a);t.addTrackedEditOperation(l,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return ae.fromPositions(n.getEndPosition())}}class gte{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return ae.fromRange(n,0)}}class MS{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return ae.fromPositions(n.getStartPosition())}}class R0{constructor(e,t,i,n,s=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=s}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return ae.fromPositions(n.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class fte{constructor(e){this._range=e}getEditOperations(e,t){const i=e.getValueInRange(this._range),n=this._range.getEndPosition(),s=n.lineNumber;let r=Oz(e,n,i.length);r.lineNumber>s&&(r=new R(s,e.getLineMaxColumn(s)));const a=L.fromPositions(n,r);t.addTrackedEditOperation(a,"")}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return ae.fromPositions(n.getEndPosition())}}class wO{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Oz(o,e,t){if(t<0)throw new Error("Unexpected negative delta");const i=o.getLineCount();let n=new R(i,o.getLineMaxColumn(i));for(let s=e.lineNumber;s<=i;s++)if(s===e.lineNumber){const r=t-o.getLineMaxColumn(e.lineNumber)+e.column;if(r<=0){n=new R(e.lineNumber,e.column+t);break}t=r}else{const r=t-o.getLineMaxColumn(s);if(r<=0){n=new R(s,t);break}t=r}return n}class RC{static whitespaceVisibleColumn(e,t,i){const n=e.length;let s=0,r=-1,a=-1;for(let l=0;le.getLineMinColumn(t.lineNumber))return t.delta(void 0,-FV(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new R(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),r=RC.atomicPosition(s,t.column-1,i,0);if(r!==-1&&r+1>=n)return new R(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?gt.leftPositionAtomicSoftTabs(t,i,e.tabSize):gt.leftPosition(t,i);return new RD(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(s-1)),c=t.normalizePosition(gt.clipPositionColumn(l,t),0),d=gt.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new R(e.lineNumber,gt.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,c),g?s=0:s=c-oi.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),l!==void 0){const f=new R(i,n),p=t.normalizePosition(f,l);s=s+(n-p.column),i=p.lineNumber,n=p.column}return new RD(i,n,s)}static down(e,t,i,n,s,r,a){return this.vertical(e,t,i,n,s,i+r,a,4)}static moveDown(e,t,i,n,s){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=gt.down(e,t,r+l,a,i.leftoverVisibleColumns,s,!0),t.normalizePosition(new R(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){const s=t.getLineCount();let r=i.position.lineNumber;for(;r0,a=t.getLineFirstNonWhitespaceColumn(s.lineNumber);if(r&&a>0)return new L(s.lineNumber,a,n.lineNumber,n.column)}return new L(s.lineNumber,s.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,s,r,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,c=r.length;l=u.length+1)return!1;const g=u.charAt(h.column-2),f=n.get(g);if(!f)return!1;if(yh(g)){if(i==="never")return!1}else if(t==="never")return!1;const p=u.charAt(h.column-1);let _=!1;for(const b of f)b.open===g&&b.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let b=!1;for(let C=0,w=a.length;C1){const s=t.getLineContent(n.lineNumber),r=hs(s),a=r===-1?s.length+1:r+1;if(n.column<=a){const l=i.visibleColumnFromColumn(t,n),c=oi.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,c);return new L(n.lineNumber,d,n.lineNumber,n.column)}}return L.fromPositions(Dg.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=HQ(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new R(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let s=null;i.sort((r,a)=>R.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&s?.endLineNumber!==c.lineNumber?(d=c.lineNumber-1,h=t.getLineMaxColumn(c.lineNumber-1),u=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,h=1,u=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber));const f=new L(d,h,u,g);s=f,f.isEmpty()?n[r]=null:n[r]=new Fn(f,"")}else n[r]=null;else n[r]=new Fn(l,"")}return new Ns(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}const rf={DateTimeFormat(o,e){return new On(()=>{try{return new Intl.DateTimeFormat(o,e)}catch{return new Intl.DateTimeFormat(void 0,e)}})},Collator(o,e){return new On(()=>{try{return new Intl.Collator(o,e)}catch{return new Intl.Collator(void 0,e)}})},Segmenter(o,e){return new On(()=>{try{return new Intl.Segmenter(o,e)}catch{return new Intl.Segmenter(void 0,e)}})},Locale(o,e){return new On(()=>{try{return new Intl.Locale(o,e)}catch{return new Intl.Locale(Wu,e)}})},NumberFormat(o,e){return new On(()=>{try{return new Intl.NumberFormat(o,e)}catch{return new Intl.NumberFormat(void 0,e)}})}};function M0(o){return o<0?0:o>255?255:o|0}function Lf(o){return o<0?0:o>4294967295?4294967295:o|0}class s_{constructor(e){const t=M0(e);this._defaultValue=t,this._asciiMap=s_._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=M0(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class P0{constructor(){this._actual=new s_(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class pte extends s_{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=rf.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return this._createIntlWord(s,l);if(l===0){if(n===2)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=1}else if(l===2){if(n===1)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=2}else if(l===1&&n!==0)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==0?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const s=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return r;if(l===1||i===1&&l===2||i===2&&l===0)return r+1}return 0}static moveWordLeft(e,t,i,n,s){let r=i.lineNumber,a=i.column;a===1&&r>1&&(r=r-1,a=t.getLineMaxColumn(r));let l=ft._findPreviousWordOnLine(e,t,new R(r,a));if(n===0)return new R(r,l?l.start+1:1);if(n===1)return!s&&l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=ft._findPreviousWordOnLine(e,t,new R(r,l.start+1))),new R(r,l?l.start+1:1);if(n===3){for(;l&&l.wordType===2;)l=ft._findPreviousWordOnLine(e,t,new R(r,l.start+1));return new R(r,l?l.start+1:1)}return l&&a<=l.end+1&&(l=ft._findPreviousWordOnLine(e,t,new R(r,l.start+1))),new R(r,l?l.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new R(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=s.charCodeAt(r-2),l=s.charCodeAt(r-1);if(a===95&&l!==95)return new R(i,r);if(a===45&&l!==45)return new R(i,r);if(($d(a)||e1(a))&&cl(l))return new R(i,r);if(cl(a)&&cl(l)&&r+1=l.start+1&&(l=ft._findNextWordOnLine(e,t,new R(s,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(s);return new R(s,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?c=1:(l--,c=n.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=ft._findPreviousWordOnLine(i,n,new R(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=n.getLineMaxColumn(l))),new L(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new R(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,n);return s||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===0)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;r+11?new L(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new L(i.lineNumber,h,i.lineNumber,u)),l=h=>{let u=h.start+1,g=h.end+1,f=!1;for(;g-11&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,g)},c=ft._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=ft._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ft._moveWordPartLeft(e,i);return new L(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=u.start+1&&(u=ft._findNextWordOnLine(i,n,new R(l,u.end+1))),u?c=u.start+1:c!!e)}function dl(o){if(!o||typeof o!="object"||o instanceof RegExp)return o;const e=Array.isArray(o)?[]:{};return Object.entries(o).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?dl(i):i}),e}function mte(o){if(!o||typeof o!="object")return o;const e=[o];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(Fz.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!FX(n)&&e.push(n)}}return o}const Fz=Object.prototype.hasOwnProperty;function Wz(o,e){return dN(o,e,new Set)}function dN(o,e,t){if(lr(o))return o;const i=e(o);if(typeof i<"u")return i;if(Array.isArray(o)){const n=[];for(const s of o)n.push(dN(s,e,t));return n}if(Ui(o)){if(t.has(o))throw new Error("Cannot clone recursive data-structure");t.add(o);const n={};for(const s in o)Fz.call(o,s)&&(n[s]=dN(o[s],e,t));return t.delete(o),n}return o}function EL(o,e,t=!0){return Ui(o)?(Ui(e)&&Object.keys(e).forEach(i=>{i in o?t&&(Ui(o[i])&&Ui(e[i])?EL(o[i],e[i],t):o[i]=e[i]):o[i]=e[i]}),o):e}function go(o,e){if(o===e)return!0;if(o==null||e===null||e===void 0||typeof o!=typeof e||typeof o!="object"||Array.isArray(o)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(o)){if(o.length!==e.length)return!1;for(t=0;tc&&(d=c,h=e.model.getLineMaxColumn(d)),tt.fromModelState(new wn(new L(r.lineNumber,1,d,h),2,0,new R(d,h),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,h=1;return d>c&&(d=c,h=e.getLineMaxColumn(d)),tt.fromViewState(t.viewState.move(!0,d,h,0))}else{const c=t.modelState.selectionStart.getEndPosition();return tt.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,n){const s=e.model.validatePosition(n);return tt.fromModelState(ft.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new tt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return tt.fromViewState(new wn(new L(i,n,i,n),0,0,new R(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,n,s)}const r=e.model.validatePosition(n),a=s?e.coordinatesConverter.validateViewPosition(new R(s.lineNumber,s.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return tt.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,s,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,s);case 1:return r===4?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,s);case 2:return r===2?this._moveUpByViewLines(e,t,n,s):this._moveUpByModelLines(e,t,n,s);case 3:return r===2?this._moveDownByViewLines(e,t,n,s):this._moveDownByModelLines(e,t,n,s);case 4:return r===2?t.map(a=>tt.fromViewState(gt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>tt.fromModelState(gt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>tt.fromViewState(gt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>tt.fromModelState(gt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:s{const a=e.getTextDirection(s.viewState.position.lineNumber)===Ho.RTL;return tt.fromViewState(a?gt.moveRight(e.cursorConfig,e,s.viewState,i,n):gt.moveLeft(e.cursorConfig,e,s.viewState,i,n))})}static _moveHalfLineLeft(e,t,i){const n=[];for(let s=0,r=t.length;s{const a=e.getTextDirection(s.viewState.position.lineNumber)===Ho.RTL;return tt.fromViewState(a?gt.moveLeft(e.cursorConfig,e,s.viewState,i,n):gt.moveRight(e.cursorConfig,e,s.viewState,i,n))})}static _moveHalfLineRight(e,t,i){const n=[];for(let s=0,r=t.length;s/?";function _ne(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of Ty)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const P4=_ne();function A4(o){let e=P4;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const x$=new bs;x$.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function bv(o,e,t,i,n){if(e=A4(e),n||(n=Je.first(x$)),t.length>n.maxLen){let c=o-n.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,o+n.maxLen/2),bv(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-s>=n.timeBudget);c++){const d=r-n.windowSize*c;e.lastIndex=Math.max(0,d);const h=bne(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function bne(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}class Ry{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1},noHistory:{type:"boolean",default:!1}}}}]},o.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1,noHistory:!!i.noHistory}}o.parse=t})(A0||(A0={}));var Oi;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(Oi||(Oi={}));class PD{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t/?";function wte(o=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of O0)o.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const SO=wte();function yO(o){let e=SO;if(o&&o instanceof RegExp)if(o.global)e=o;else{let t="g";o.ignoreCase&&(t+="i"),o.multiline&&(t+="m"),o.unicode&&(t+="u"),e=new RegExp(o.source,t)}return e.lastIndex=0,e}const Hz=new cs;Hz.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function PC(o,e,t,i,n){if(e=yO(e),n||(n=Ke.first(Hz)),t.length>n.maxLen){let c=o-n.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,o+n.maxLen/2),PC(o,e,t,i,n)}const s=Date.now(),r=o-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-s>=n.timeBudget);c++){const d=r-n.windowSize*c;e.lastIndex=Math.max(0,d);const h=Ste(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Ste(o,e,t,i){let n;for(;n=o.exec(e);){const s=n.index||0;if(s<=t&&o.lastIndex>=t)return n;if(i>0&&s>i)return null}return null}class F0{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new WI(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new WI({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new WI({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Ry.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Ry.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}let BI;function D$(){return BI||(BI=new TextDecoder("UTF-16LE")),BI}let HI;function Cne(){return HI||(HI=new TextDecoder("UTF-16BE")),HI}let VI;function k$(){return VI||(VI=aU()?D$():Cne()),VI}function vne(o,e,t){const i=new Uint16Array(o.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?wne(o,e,t):D$().decode(i)}function wne(o,e,t){const i=[];let n=0;for(let s=0;s=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,h]=a;return l===d||l===h||c===d||c===h},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&s.push({open:a,close:l})}return s}class yne{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Sne(t);this.brackets=i.map((n,s)=>new My(e,s,n.open,n.close,Lne(n.open,n.close,i,s),xne(n.open,n.close,i,s))),this.forwardRegex=Dne(this.brackets),this.reversedRegex=kne(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const s of n.open)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(const s of n.close)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}}function I$(o,e,t,i){for(let n=0,s=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(o)>=0&&i.push(a)}}function E$(o,e){return o.length-e.length}function xD(o){if(o.length<=1)return o;const e=[],t=new Set;for(const i of o)t.has(i)||(e.push(i),t.add(i));return e}function Lne(o,e,t,i){let n=[];n=n.concat(o),n=n.concat(e);for(let s=0,r=n.length;s=0;r--)n[s++]=i.charCodeAt(r);return k$().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=o(e)),t}})();class Yr{static _findPrevBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const r=i.length-(s.index||0),a=s[0].length,l=n+r;return new D(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,s){const a=O4(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const r=s.index||0,a=s[0].length;if(a===0)return null;const l=n+r;return new D(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,s){const r=i.substring(n,s);return this.findNextBracketInText(e,t,r,n)}}class Ene{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const n=i.charAt(i.length-1);e.push(n)}return bd(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(ml(t.getStandardTokenType(n)))return null;const s=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Yr.findPrevBracketInRange(s,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function X1(o){return o.global&&(o.lastIndex=0),!0}class Nne{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&X1(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&X1(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&X1(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&X1(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class Ap{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=Ap._createOpenBracketRegExp(t[0]),n=Ap._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let s=0,r=this._regExpRules.length;sc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&n.length>0)for(let s=0,r=this._brackets.length;s=2&&i.length>0){for(let s=0,r=this._brackets.length;s"u"?t:s}function Rne(o){return o.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}const yi=Ve("languageService");class Il{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const R$=[];function Ge(o,e,t){e instanceof Il||(e=new Il(e,[],!!t)),R$.push([o,e])}function G7(){return R$}const Di=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),DD={JSONContribution:"base.contributions.json"};function Mne(o){return o.length>0&&o.charAt(o.length-1)==="#"?o.substring(0,o.length-1):o}class Pne extends F{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new P)}registerSchema(e,t,i){const n=Mne(e);this.schemasById[n]=t,this._onDidChangeSchema.fire(e),i&&i.add(ge(()=>{delete this.schemasById[n],this._onDidChangeSchema.fire(e)}))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Ane=new Pne;fi.add(DD.JSONContribution,Ane);let Vo;const zI=globalThis.vscode;if(typeof zI<"u"&&typeof zI.context<"u"){const o=zI.context.configuration();if(o)Vo=o.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Vo=globalThis._VSCODE_PRODUCT_JSON,my.VSCODE_DEV&&Object.assign(Vo,{nameShort:`${Vo.nameShort} Dev`,nameLong:`${Vo.nameLong} Dev`,dataFolderName:`${Vo.dataFolderName}-dev`,serverDataFolderName:Vo.serverDataFolderName?`${Vo.serverDataFolderName}-dev`:void 0}),!Vo.version){const o=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Vo,{version:o.version})}}else Vo={},Object.keys(Vo).length===0&&Object.assign(Vo,{version:"1.104.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var E0=Vo;const rl={Configuration:"base.contributions.configuration"},Q1="vscode://schemas/settings/resourceLanguage",Z7=fi.as(DD.JSONContribution);class One extends F{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new P),this._onDidUpdateConfiguration=this._register(new P),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m(1664,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Z7.registerSchema(Q1,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Z7.registerSchema(Q1,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:s}of e)for(const r in n){t.add(r);const a=this.configurationDefaultsOverrides.get(r)??this.configurationDefaultsOverrides.set(r,{configurationDefaultOverrides:[]}).get(r),l=n[r];if(a.configurationDefaultOverrides.push({value:l,source:s}),jh.test(r)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(r,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(r,c,s),i.push(...Py(r))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(r,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;const d=this.configurationProperties[r];d&&(this.updatePropertyDefaultValue(r,d),this.updateSchema(r,d))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const n={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:m(1665,"Configure settings to be overridden for {0}.",Rne(e)),$ref:Q1,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const s=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const l=t[a];if(Xi(l)&&(ss(s[a])||Xi(s[a]))){if(s[a]={...s[a]??{},...l},i)for(const d in l)r.set(`${a}.${d}`,i)}else s[a]=l,i?r.set(a,i):r.delete(a)}return{value:s,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const s=this.configurationProperties[e],r=n?.value??s?.defaultDefaultValue;let a=i;if(Xi(t)&&(s!==void 0&&s.type==="object"||s===void 0&&(ss(r)||Xi(r)))){if(a=n?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in t)i&&a.set(`${e}.${c}`,i);t={...Xi(r)?r:{},...t}}return{value:t,source:a}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}validateAndRegisterProperties(e,t=!0,i,n,s=4,r){s=Sr(e.scope)?s:e.scope;const a=e.properties;if(a)for(const c in a){const d=a[c];if(d.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&Bne(c,d,i?.id)){delete a[c];continue}d.source=i,d.defaultDefaultValue=a[c].default,this.updatePropertyDefaultValue(c,d),jh.test(c)?d.scope=void 0:(d.scope=Sr(d.scope)?s:d.scope,d.restricted=Sr(d.restricted)?!!n?.includes(c):d.restricted),d.experiment?d.tags?.some(g=>g.toLowerCase()==="onexp")||(d.tags=d.tags??[],d.tags.push("onExP")):d.tags?.some(g=>g.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${c}'. Please use 'experiment' property instead.`),d.experiment={mode:"startup"});const h=a[c].hasOwnProperty("included")&&!a[c].included,u=a[c].policy?.name;h?(this.excludedConfigurationProperties[c]=a[c],u&&(this.policyConfigurations.set(u,c),r.add(c)),delete a[c]):(r.add(c),u&&this.policyConfigurations.set(u,c),this.configurationProperties[c]=a[c],!a[c].deprecationMessage&&a[c].markdownDeprecationMessage&&(a[c].deprecationMessage=a[c].markdownDeprecationMessage))}const l=e.allOf;if(l)for(const c of l)this.validateAndRegisterProperties(c,t,i,n,s,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 3:break;case 7:break;case 4:break;case 5:break;case 6:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m(1666,"Configure editor settings to be overridden for a language."),errorMessage:m(1667,"This setting does not support per-language configuration."),$ref:Q1};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m(1668,"Configure editor settings to be overridden for a language."),m(1669,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,s;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,s=i.source),ss(n)&&(n=t.defaultDefaultValue,s=void 0),ss(n)&&(n=Wne(t.type)),t.default=n,t.defaultValueSource=s}}const M$="\\[([^\\]]+)\\]",Y7=new RegExp(M$,"g"),Fne=`^(${M$})+$`,jh=new RegExp(Fne);function Py(o){const e=[];if(jh.test(o)){let t=Y7.exec(o);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=Y7.exec(o)}}return bd(e)}function Wne(o){switch(Array.isArray(o)?o[0]:o){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const N0=new One;fi.add(rl.Configuration,N0);function Bne(o,e,t){return o.trim()?jh.test(o)?m(1671,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",o):N0.getConfigurationProperties()[o]!==void 0&&(!t||!Hne.has(t.toLowerCase()))?m(1672,"Cannot register '{0}'. This property is already registered.",o):e.policy?.name&&N0.getPolicyConfigurations().get(e.policy?.name)!==void 0?m(1673,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",o,e.policy?.name,N0.getPolicyConfigurations().get(e.policy?.name)):null:m(1670,"Cannot register an empty property")}const Hne=new Set(E0.defaultChatAgent?[E0.defaultChatAgent.extensionId,E0.defaultChatAgent.chatExtensionId].map(o=>o.toLowerCase()):[]),Vne={ModesRegistry:"editor.modesRegistry"};class zne extends F{constructor(){super(),this._onDidChangeLanguages=this._register(new P),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new jne(this,a,l),closing:l}}),s=new JN(a=>{const l=new Set,c=new Set;return{info:new qne(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?X7(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return e1(t,e)}}function X7(o){return o.filter(([e,t])=>e!==""&&t!=="")}class P${constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class jne extends P${constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class qne extends P${constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Kne=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Q7=function(o,e){return function(t,i){e(t,i,o)}};class UI{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const ai=Ve("languageConfigurationService");let ST=class extends F{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Xne),this.onDidChangeEmitter=this._register(new P),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(yT));this._register(this.configurationService.onDidChangeConfiguration(n=>{const s=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(s)this.configurations.clear(),this.onDidChangeEmitter.fire(new UI(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new UI(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new UI(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Gne(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};ST=Kne([Q7(0,Oe),Q7(1,yi)],ST);function Gne(o,e,t,i){let n=e.getLanguageConfiguration(o);if(!n){if(!i.isRegisteredLanguageId(o))return new rm(o,{});n=new rm(o,{})}const s=Zne(n.languageId,t),r=O$([n.underlyingConfig,s]);return new rm(n.languageId,r)}const yT={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Zne(o,e){const t=e.getValue(yT.brackets,{overrideIdentifier:o}),i=e.getValue(yT.colorizedBracketPairs,{overrideIdentifier:o});return{brackets:J7(t),colorizedBracketPairs:J7(i)}}function J7(o){if(Array.isArray(o))return o.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function A$(o,e,t){const i=o.getLineContent(e);let n=Rt(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class Yne{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new e9(e,t,++this._order);return this._entries.push(i),this._resolved=null,ge(()=>{for(let n=0;ne.configuration)))}}function O$(o){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of o)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class e9{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class t9{constructor(e){this.languageId=e}}class Xne extends F{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._register(this.register(rr,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new Yne(e),this._entries.set(e,n));const s=n.register(t,i);return this._onDidChange.fire(new t9(e)),ge(()=>{s.dispose(),this._onDidChange.fire(new t9(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class rm{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new Ap(this.underlyingConfig):null,this.comments=rm._handleComments(this.underlyingConfig),this.characterPair=new Ry(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||P4,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Nne(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new $ne(e,this.underlyingConfig)}getWordDefinition(){return A4(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new yne(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Ene(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new mne(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(typeof t.lineComment=="string"?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){const[n,s]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=s}return i}}Ge(ai,ST,1);class es{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&1&&(i+=" mtki"),n&2&&(i+=" mtkb"),n&4&&(i+=" mtku"),n&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let s=`color: ${t[i]};`;n&1&&(s+="font-style: italic;"),n&2&&(s+="font-weight: bold;");let r="";return n&4&&(r+=" underline"),n&8&&(r+=" line-through"),r&&(s+=`text-decoration:${r};`),s}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class fe{static fromTo(e,t){return new fe(e,t)}static addRange(e,t){let i=0;for(;it))return new fe(e,t)}static ofLength(e){return new fe(0,e)}static ofStartAndLength(e,t){return new fe(e,e+t)}static emptyAt(e){return new fe(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new ve(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new fe(this.start+e,this.endExclusive+e)}deltaStart(e){return new fe(this.start+e,this.endExclusive)}deltaEnd(e){return new fe(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ve(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ve(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}class Xt{static createEmpty(e,t){const i=Xt.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new Xt(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const s=new Array;for(const{text:r,metadata:a}of e)s.push(i+r.length,a),i+=r.length,n+=r;return new Xt(new Uint32Array(s),n,t)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let s=0;s>>1)-1;for(;it&&(n=s)}return i}static{this.defaultTokenMetadata=(32768|2<<24)>>>0}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&Te(new Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(e){return e instanceof Xt?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let r=n;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=es.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return es.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return es.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return es.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return es.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return es.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Xt.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new W4(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const s=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];s.push(n.length,c),r=l.offset}n+=l.text,s.push(n.length,l.tokenMetadata),i++}else break}return new Xt(new Uint32Array(s),n,this.languageIdCodec)}getTokensInRange(e){const t=new Jne,i=this.findTokenIndexAtOffset(e.start),n=this.findTokenIndexAtOffset(e.endExclusive);for(let s=i;s<=n;s++){const a=new fe(this.getStartOffset(s),this.getEndOffset(s)).intersectionLength(e);a>0&&t.add(a,this.getMetadata(s))}return t.build()}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`}),e}}class W4{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let s=this._firstTokenIndex,r=e.getCount();s=i);s++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof W4?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let s=this._source.getTokenText(t);return ithis._endOffset&&(s=s.substring(0,s.length-(n-this._endOffset))),s}forEach(e){for(let t=0;t({text:i.substring(e),metadata:n.metadata})),t)}forEach(e){let t=0;for(const i of this._tokenInfo){const n=new fe(t,t+i.length);e(n,i),t+=i.length}}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=new fe(i,i+n.length);t.push(e(s,n)),i+=n.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=i,r=s+n.length;if(r>e.start){if(s>=e.endExclusive)break;const a=Math.max(0,e.start-s),l=Math.max(0,r-e.endExclusive);t.push(new LT(n.length-a-l,n.metadata))}i+=n.length}return rd.create(t)}}class LT{constructor(e,t){this.length=e,this.metadata=t}}class Jne{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new LT(e,t))}build(){return rd.create(this._tokens)}}class B4{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new F$(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class H4{constructor(e,t){this.model=e,this.indentationLineProcessor=new F$(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=gg(t,e.startColumn-1);let n;if(V4(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+r;n=t.sliceAndInflate(a,l,0)}else{const r=e.startColumn-1;n=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=gg(i,t.column-1),s=t.column-1-n.firstCharOffset,r=n.firstCharOffset+s,a=n.firstCharOffset+n.getLineLength(),l=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=g=>{this.model.tokenization.forceTokenization(g);const f=this.model.tokenization.getLineTokens(g),p=this.model.getLineMaxColumn(g)-1;return gg(f,p)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=gg(i,e.startColumn-1),s=Xt.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return s;const c=t(r);if(!(n.languageId===c.languageId))return s;const h=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class F${constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const l=Rt(r);return a+r.substring(l.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let s=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(s=i(s,t)),s}getProcessedTokens(e){const t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(l=>{const c=e.getStandardTokenType(l);let d=e.getTokenText(l);t(c)&&(d=d.replace(s,""));const h=e.getMetadata(l);r.push({text:d,metadata:h})}),Xt.createFromTextAndMetadata(r,e.languageIdCodec)}}function V4(o,e){o.tokenization.forceTokenization(e.lineNumber);const t=o.tokenization.getLineTokens(e.lineNumber),i=gg(t,e.column-1),n=i.firstCharOffset===0,s=t.getLanguageId(0)===i.languageId;return!n&&!s}function am(o,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),s=i.getLanguageConfiguration(n);if(!s)return null;const a=new H4(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=s.onEnter(o,l,c,d);if(!h)return null;const u=h.indentAction;let g=h.appendText;const f=h.removeText||0;g?u===Ui.Indent&&(g=" "+g):u===Ui.Indent||u===Ui.IndentOutdent?g=" ":g="";let p=A$(e,t.startLineNumber,t.startColumn);return f&&(p=p.substring(0,p.length-f)),{indentAction:u,appendText:g,removeText:f,indentation:p}}var ese=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tse=function(o,e){return function(t,i){e(t,i,o)}},T0;const $I=Object.create(null);function pu(o,e){if(e<=0)return"";$I[o]||($I[o]=["",o]);const t=$I[o];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+o;return t[e]}let Vr=T0=class{static unshiftIndent(e,t,i,n,s){const r=hi.visibleColumnFromColumn(e,t,i);if(s){const a=pu(" ",n),c=hi.prevIndentTabStop(r,n)/n;return pu(a,c)}else{const c=hi.prevRenderTabStop(r,i)/i;return pu(" ",c)}}static shiftIndent(e,t,i,n,s){const r=hi.visibleColumnFromColumn(e,t,i);if(s){const a=pu(" ",n),c=hi.nextIndentTabStop(r,n)/n;return pu(a,c)}else{const c=hi.nextRenderTabStop(r,i)/i;return pu(" ",c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:s,indentSize:r,insertSpaces:a}=this._opts,l=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let h=i;h<=n;h++,c=d){d=0;const u=e.getLineContent(h);let g=vs(u);if(this._opts.isUnshift&&(u.length===0||g===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(g===-1&&(g=u.length),h>1&&hi.visibleColumnFromColumn(u,g+1,s)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const _=am(this._opts.autoIndent,e,new D(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let b=0,C=_.appendText.length;b1){let n,s=-1;for(n=e-1;n>=1;n--){if(o.tokenization.getLanguageIdAtPosition(n,0)!==i)return s;const r=o.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){s=n;continue}return n}}return-1}function Cv(o,e,t,i=!0,n){if(o<4)return null;const s=n.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;const r=new B4(e,s,n);if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const a=sse(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const l=e.getLineContent(a);return{indentation:Rt(l),action:Ui.Indent,line:a}}else if(r.shouldDecrease(a)){const l=e.getLineContent(a);return{indentation:Rt(l),action:null,line:a}}else{if(a===1)return{indentation:Rt(e.getLineContent(a)),action:null,line:a};const l=a-1,c=s.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let h=l-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:Rt(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Rt(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:Rt(e.getLineContent(d)),action:Ui.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:Rt(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Rt(e.getLineContent(d)),action:null,line:d}}return{indentation:Rt(e.getLineContent(1)),action:null,line:1}}}function dC(o,e,t,i,n,s){if(o<4)return null;const r=s.getLanguageConfiguration(t);if(!r)return null;const a=s.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=new B4(e,a,s),c=Cv(o,e,i,void 0,s);if(c){const d=c.line;if(d!==void 0){let h=!0;for(let u=d;u0){const b=e.getLineContent(_);if(c.shouldIndentNextLine(b)&&c.shouldIncrease(p)){const w=Cv(r,e,t.startLineNumber,!1,s)?.indentation;if(w!==void 0){const v=e.getLineContent(t.startLineNumber),S=Rt(v),x=n.shiftIndent(w)===S,k=/^\s*$/.test(f),I=o.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),A=I&&I.length>0&&k;if(x&&A)return w}}}return null}function W$(o,e,t){const i=t.getLanguageConfiguration(o.getLanguageId()).indentRulesSupport;return!i||e<1||e>o.getLineCount()?null:i.getIndentMetadata(o.getLineContent(e))}function ase(o,e,t){return{tokenization:{getLineTokens:n=>n===e?t:o.tokenization.getLineTokens(n),getLanguageId:()=>o.getLanguageId(),getLanguageIdAtPosition:(n,s)=>o.getLanguageIdAtPosition(n,s)},getLineContent:n=>n===e?t.getLineContent():o.getLineContent(n)}}class lse{static getEdits(e,t,i,n,s){if(!s&&this._isAutoIndentType(e,t,i)){const r=[];for(const l of i){const c=this._findActualIndentationForSelection(e,t,l,n);if(c===null)return;r.push({selection:l,indentation:c})}const a=xT.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,r,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;n$4(e,a),unshiftIndent:a=>Ay(e,a)},e.languageConfigurationService);if(s===null)return null;const r=A$(t,i.startLineNumber,i.startColumn);return s===e.normalizeIndentation(r)?null:s}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,s){const r=i.map(({selection:l,indentation:c})=>{if(s!==null){const d=this._getEditFromIndentationAndSelection(e,t,c,l,n,!1);return new Cse(d,l,n,s)}else{const d=this._getEditFromIndentationAndSelection(e,t,c,l,n,!0);return Ru(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new Hs(4,r,a)}static _getEditFromIndentationAndSelection(e,t,i,n,s,r=!0){const a=n.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a);let c=e.normalizeIndentation(i);if(l!==0){const h=t.getLineContent(a);c+=h.substring(l-1,n.startColumn-1)}return c+=r?s:"",{range:new D(a,1,n.endLineNumber,n.endColumn),text:c}}}class cse{static getEdits(e,t,i,n,s,r){if(B$(t,i,n,s,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let s=0,r=t.length;snew jn(new D(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new Hs(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class xT{static getEdits(e,t,i,n,s,r){if(!r){const a=this.getAutoClosingPairClose(e,t,i,n,s);if(a!==null)return this._runAutoClosingOpenCharType(i,n,s,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const s=[];for(let r=0,a=e.length;r{const p=f.getPosition();return s?{lineNumber:p.lineNumber,beforeColumn:p.column-n.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(f=>new R(f.lineNumber,f.beforeColumn)),n);if(!a)return null;let l,c;if($h(n)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let g=!0;for(const f of r){const{lineNumber:p,beforeColumn:_,afterColumn:b}=f,C=t.getLineContent(p),w=C.substring(0,_-1),v=C.substring(b-1);if(v.startsWith(u)||(g=!1),v.length>0){const k=v.charAt(0);if(!this._isBeforeClosingBrace(e,v)&&!c(k))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const k=Hr(e.wordSeparators,[]);if(w.length>0){const I=w.charCodeAt(w.length-1);if(k.get(I)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),L=gg(S,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const x=a.findNeutralCharacter();if(x){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,x);if(!a.isOK(k))return null}}return g?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let s=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!s||r.open.length>s.open.length)&&(s=r);return s}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let r=null;for(const a of s)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new D(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!r&&a}}class i9{static getEdits(e,t){if(!(e.inputMode==="overtype"))return null;const n=t.map(s=>new dne(s.insertedTextRange));return new Hs(4,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class hse{static getEdits(e,t,i,n,s){if(!s&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let s=0,r=t.length;snew PD(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new PD({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new PD({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:F0.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:F0.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}let AD;function Vz(){return AD||(AD=new TextDecoder("UTF-16LE")),AD}let OD;function yte(){return OD||(OD=new TextDecoder("UTF-16BE")),OD}let FD;function zz(){return FD||(FD=SV()?Vz():yte()),FD}function xte(o,e,t){const i=new Uint16Array(o.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Lte(o,e,t):Vz().decode(i)}function Lte(o,e,t){const i=[];let n=0;for(let s=0;s=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,h]=a;return l===d||l===h||c===d||c===h},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&s.push({open:a,close:l})}return s}class Dte{constructor(e,t){this._richEditBracketsBrand=void 0;const i=kte(t);this.brackets=i.map((n,s)=>new W0(e,s,n.open,n.close,Ite(n.open,n.close,i,s),Ete(n.open,n.close,i,s))),this.forwardRegex=Nte(this.brackets),this.reversedRegex=Tte(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const s of n.open)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(const s of n.close)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}}function Uz(o,e,t,i){for(let n=0,s=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(o)>=0&&i.push(a)}}function $z(o,e){return o.length-e.length}function NL(o){if(o.length<=1)return o;const e=[],t=new Set;for(const i of o)t.has(i)||(e.push(i),t.add(i));return e}function Ite(o,e,t,i){let n=[];n=n.concat(o),n=n.concat(e);for(let s=0,r=n.length;s=0;r--)n[s++]=i.charCodeAt(r);return zz().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=o(e)),t}})();class Or{static _findPrevBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const r=i.length-(s.index||0),a=s[0].length,l=n+r;return new L(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,s){const a=xO(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const r=s.index||0,a=s[0].length;if(a===0)return null;const l=n+r;return new L(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,s){const r=i.substring(n,s);return this.findNextBracketInText(e,t,r,n)}}class Mte{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const n=i.charAt(i.length-1);e.push(n)}return Xc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Ja(t.getStandardTokenType(n)))return null;const s=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Or.findPrevBracketInRange(s,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function o1(o){return o.global&&(o.lastIndex=0),!0}class Pte{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&o1(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&o1(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&o1(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&o1(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class op{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=op._createOpenBracketRegExp(t[0]),n=op._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let s=0,r=this._regExpRules.length;sc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&n.length>0)for(let s=0,r=this._brackets.length;s=2&&i.length>0){for(let s=0,r=this._brackets.length;s"u"?t:s}function Ote(o){return o.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}const _i=We("languageService");class hl{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const Kz=[];function $e(o,e,t){e instanceof hl||(e=new hl(e,[],!!t)),Kz.push([o,e])}function _7(){return Kz}const vi=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),TL={JSONContribution:"base.contributions.json"};function Fte(o){return o.length>0&&o.charAt(o.length-1)==="#"?o.substring(0,o.length-1):o}class Wte extends A{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new P)}registerSchema(e,t,i){const n=Fte(e);this.schemasById[n]=t,this._onDidChangeSchema.fire(e),i&&i.add(ue(()=>{delete this.schemasById[n],this._onDidChangeSchema.fire(e)}))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Bte=new Wte;li.add(TL.JSONContribution,Bte);let Do;const WD=globalThis.vscode;if(typeof WD<"u"&&typeof WD.context<"u"){const o=WD.context.configuration();if(o)Do=o.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Do=globalThis._VSCODE_PRODUCT_JSON,w0.VSCODE_DEV&&Object.assign(Do,{nameShort:`${Do.nameShort} Dev`,nameLong:`${Do.nameLong} Dev`,dataFolderName:`${Do.dataFolderName}-dev`,serverDataFolderName:Do.serverDataFolderName?`${Do.serverDataFolderName}-dev`:void 0}),!Do.version){const o=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Do,{version:o.version})}}else Do={},Object.keys(Do).length===0&&Object.assign(Do,{version:"1.104.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var AS=Do;const $a={Configuration:"base.contributions.configuration"},r1="vscode://schemas/settings/resourceLanguage",b7=li.as(TL.JSONContribution);class Hte extends A{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new P),this._onDidUpdateConfiguration=this._register(new P),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m(1664,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},b7.registerSchema(r1,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),b7.registerSchema(r1,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:s}of e)for(const r in n){t.add(r);const a=this.configurationDefaultsOverrides.get(r)??this.configurationDefaultsOverrides.set(r,{configurationDefaultOverrides:[]}).get(r),l=n[r];if(a.configurationDefaultOverrides.push({value:l,source:s}),xh.test(r)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(r,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(r,c,s),i.push(...B0(r))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(r,l,s,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;const d=this.configurationProperties[r];d&&(this.updatePropertyDefaultValue(r,d),this.updateSchema(r,d))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const n={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:m(1665,"Configure settings to be overridden for {0}.",Ote(e)),$ref:r1,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const s=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const l=t[a];if(Ui(l)&&(Yn(s[a])||Ui(s[a]))){if(s[a]={...s[a]??{},...l},i)for(const d in l)r.set(`${a}.${d}`,i)}else s[a]=l,i?r.set(a,i):r.delete(a)}return{value:s,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const s=this.configurationProperties[e],r=n?.value??s?.defaultDefaultValue;let a=i;if(Ui(t)&&(s!==void 0&&s.type==="object"||s===void 0&&(Yn(r)||Ui(r)))){if(a=n?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in t)i&&a.set(`${e}.${c}`,i);t={...Ui(r)?r:{},...t}}return{value:t,source:a}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}validateAndRegisterProperties(e,t=!0,i,n,s=4,r){s=lr(e.scope)?s:e.scope;const a=e.properties;if(a)for(const c in a){const d=a[c];if(d.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&Ute(c,d,i?.id)){delete a[c];continue}d.source=i,d.defaultDefaultValue=a[c].default,this.updatePropertyDefaultValue(c,d),xh.test(c)?d.scope=void 0:(d.scope=lr(d.scope)?s:d.scope,d.restricted=lr(d.restricted)?!!n?.includes(c):d.restricted),d.experiment?d.tags?.some(g=>g.toLowerCase()==="onexp")||(d.tags=d.tags??[],d.tags.push("onExP")):d.tags?.some(g=>g.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${c}'. Please use 'experiment' property instead.`),d.experiment={mode:"startup"});const h=a[c].hasOwnProperty("included")&&!a[c].included,u=a[c].policy?.name;h?(this.excludedConfigurationProperties[c]=a[c],u&&(this.policyConfigurations.set(u,c),r.add(c)),delete a[c]):(r.add(c),u&&this.policyConfigurations.set(u,c),this.configurationProperties[c]=a[c],!a[c].deprecationMessage&&a[c].markdownDeprecationMessage&&(a[c].deprecationMessage=a[c].markdownDeprecationMessage))}const l=e.allOf;if(l)for(const c of l)this.validateAndRegisterProperties(c,t,i,n,s,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 3:break;case 7:break;case 4:break;case 5:break;case 6:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m(1666,"Configure editor settings to be overridden for a language."),errorMessage:m(1667,"This setting does not support per-language configuration."),$ref:r1};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m(1668,"Configure editor settings to be overridden for a language."),m(1669,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,s;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,s=i.source),Yn(n)&&(n=t.defaultDefaultValue,s=void 0),Yn(n)&&(n=zte(t.type)),t.default=n,t.defaultValueSource=s}}const Gz="\\[([^\\]]+)\\]",C7=new RegExp(Gz,"g"),Vte=`^(${Gz})+$`,xh=new RegExp(Vte);function B0(o){const e=[];if(xh.test(o)){let t=C7.exec(o);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=C7.exec(o)}}return Xc(e)}function zte(o){switch(Array.isArray(o)?o[0]:o){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const OS=new Hte;li.add($a.Configuration,OS);function Ute(o,e,t){return o.trim()?xh.test(o)?m(1671,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",o):OS.getConfigurationProperties()[o]!==void 0&&(!t||!$te.has(t.toLowerCase()))?m(1672,"Cannot register '{0}'. This property is already registered.",o):e.policy?.name&&OS.getPolicyConfigurations().get(e.policy?.name)!==void 0?m(1673,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",o,e.policy?.name,OS.getPolicyConfigurations().get(e.policy?.name)):null:m(1670,"Cannot register an empty property")}const $te=new Set(AS.defaultChatAgent?[AS.defaultChatAgent.extensionId,AS.defaultChatAgent.chatExtensionId].map(o=>o.toLowerCase()):[]),jte={ModesRegistry:"editor.modesRegistry"};class qte extends A{constructor(){super(),this._onDidChangeLanguages=this._register(new P),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new Zte(this,a,l),closing:l}}),s=new UE(a=>{const l=new Set,c=new Set;return{info:new Yte(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?v7(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=n.get(a),d=s.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return mw(t,e)}}function v7(o){return o.filter(([e,t])=>e!==""&&t!=="")}class Zz{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Zte extends Zz{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Yte extends Zz{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Xte=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},w7=function(o,e){return function(t,i){e(t,i,o)}};class BD{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const ti=We("languageConfigurationService");let uN=class extends A{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new tie),this.onDidChangeEmitter=this._register(new P),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(gN));this._register(this.configurationService.onDidChangeConfiguration(n=>{const s=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(s)this.configurations.clear(),this.onDidChangeEmitter.fire(new BD(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new BD(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new BD(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Qte(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};uN=Xte([w7(0,Pe),w7(1,_i)],uN);function Qte(o,e,t,i){let n=e.getLanguageConfiguration(o);if(!n){if(!i.isRegisteredLanguageId(o))return new Np(o,{});n=new Np(o,{})}const s=Jte(n.languageId,t),r=Xz([n.underlyingConfig,s]);return new Np(n.languageId,r)}const gN={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Jte(o,e){const t=e.getValue(gN.brackets,{overrideIdentifier:o}),i=e.getValue(gN.colorizedBracketPairs,{overrideIdentifier:o});return{brackets:S7(t),colorizedBracketPairs:S7(i)}}function S7(o){if(Array.isArray(o))return o.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Yz(o,e,t){const i=o.getLineContent(e);let n=Dt(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class eie{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new y7(e,t,++this._order);return this._entries.push(i),this._resolved=null,ue(()=>{for(let n=0;ne.configuration)))}}function Xz(o){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of o)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class y7{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class x7{constructor(e){this.languageId=e}}class tie extends A{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._register(this.register(qo,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new eie(e),this._entries.set(e,n));const s=n.register(t,i);return this._onDidChange.fire(new x7(e)),ue(()=>{s.dispose(),this._onDidChange.fire(new x7(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class Np{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new op(this.underlyingConfig):null,this.comments=Np._handleComments(this.underlyingConfig),this.characterPair=new F0(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||SO,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Pte(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Gte(e,this.underlyingConfig)}getWordDefinition(){return yO(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Dte(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Mte(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new vte(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(typeof t.lineComment=="string"?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){const[n,s]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=s}return i}}$e(ti,uN,1);class qn{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&1&&(i+=" mtki"),n&2&&(i+=" mtkb"),n&4&&(i+=" mtku"),n&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let s=`color: ${t[i]};`;n&1&&(s+="font-style: italic;"),n&2&&(s+="font-weight: bold;");let r="";return n&4&&(r+=" underline"),n&8&&(r+=" line-through"),r&&(s+=`text-decoration:${r};`),s}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class ge{static fromTo(e,t){return new ge(e,t)}static addRange(e,t){let i=0;for(;it))return new ge(e,t)}static ofLength(e){return new ge(0,e)}static ofStartAndLength(e,t){return new ge(e,e+t)}static emptyAt(e){return new ge(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ce(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new ge(this.start+e,this.endExclusive+e)}deltaStart(e){return new ge(this.start+e,this.endExclusive)}deltaEnd(e){return new ge(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Ce(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ce(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}class $t{static createEmpty(e,t){const i=$t.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new $t(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const s=new Array;for(const{text:r,metadata:a}of e)s.push(i+r.length,a),i+=r.length,n+=r;return new $t(new Uint32Array(s),n,t)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let s=0;s>>1)-1;for(;it&&(n=s)}return i}static{this.defaultTokenMetadata=(32768|2<<24)>>>0}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&Ee(new Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(e){return e instanceof $t?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let r=n;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=qn.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return qn.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return qn.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return qn.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return qn.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return qn.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return $t.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new kO(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const s=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];s.push(n.length,c),r=l.offset}n+=l.text,s.push(n.length,l.tokenMetadata),i++}else break}return new $t(new Uint32Array(s),n,this.languageIdCodec)}getTokensInRange(e){const t=new nie,i=this.findTokenIndexAtOffset(e.start),n=this.findTokenIndexAtOffset(e.endExclusive);for(let s=i;s<=n;s++){const a=new ge(this.getStartOffset(s),this.getEndOffset(s)).intersectionLength(e);a>0&&t.add(a,this.getMetadata(s))}return t.build()}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`}),e}}class kO{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let s=this._firstTokenIndex,r=e.getCount();s=i);s++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof kO?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let s=this._source.getTokenText(t);return ithis._endOffset&&(s=s.substring(0,s.length-(n-this._endOffset))),s}forEach(e){for(let t=0;t({text:i.substring(e),metadata:n.metadata})),t)}forEach(e){let t=0;for(const i of this._tokenInfo){const n=new ge(t,t+i.length);e(n,i),t+=i.length}}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=new ge(i,i+n.length);t.push(e(s,n)),i+=n.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=i,r=s+n.length;if(r>e.start){if(s>=e.endExclusive)break;const a=Math.max(0,e.start-s),l=Math.max(0,r-e.endExclusive);t.push(new fN(n.length-a-l,n.metadata))}i+=n.length}return Bc.create(t)}}class fN{constructor(e,t){this.length=e,this.metadata=t}}class nie{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new fN(e,t))}build(){return Bc.create(this._tokens)}}class DO{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new Qz(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class IO{constructor(e,t){this.model=e,this.indentationLineProcessor=new Qz(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=$u(t,e.startColumn-1);let n;if(EO(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+r;n=t.sliceAndInflate(a,l,0)}else{const r=e.startColumn-1;n=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=$u(i,t.column-1),s=t.column-1-n.firstCharOffset,r=n.firstCharOffset+s,a=n.firstCharOffset+n.getLineLength(),l=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=g=>{this.model.tokenization.forceTokenization(g);const f=this.model.tokenization.getLineTokens(g),p=this.model.getLineMaxColumn(g)-1;return $u(f,p)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=$u(i,e.startColumn-1),s=$t.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return s;const c=t(r);if(!(n.languageId===c.languageId))return s;const h=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class Qz{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const l=Dt(r);return a+r.substring(l.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let s=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(s=i(s,t)),s}getProcessedTokens(e){const t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(l=>{const c=e.getStandardTokenType(l);let d=e.getTokenText(l);t(c)&&(d=d.replace(s,""));const h=e.getMetadata(l);r.push({text:d,metadata:h})}),$t.createFromTextAndMetadata(r,e.languageIdCodec)}}function EO(o,e){o.tokenization.forceTokenization(e.lineNumber);const t=o.tokenization.getLineTokens(e.lineNumber),i=$u(t,e.column-1),n=i.firstCharOffset===0,s=t.getLanguageId(0)===i.languageId;return!n&&!s}function Tp(o,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),s=i.getLanguageConfiguration(n);if(!s)return null;const a=new IO(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=s.onEnter(o,l,c,d);if(!h)return null;const u=h.indentAction;let g=h.appendText;const f=h.removeText||0;g?u===Oi.Indent&&(g=" "+g):u===Oi.Indent||u===Oi.IndentOutdent?g=" ":g="";let p=Yz(e,t.startLineNumber,t.startColumn);return f&&(p=p.substring(0,p.length-f)),{indentAction:u,appendText:g,removeText:f,indentation:p}}var sie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oie=function(o,e){return function(t,i){e(t,i,o)}},FS;const HD=Object.create(null);function qh(o,e){if(e<=0)return"";HD[o]||(HD[o]=["",o]);const t=HD[o];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+o;return t[e]}let Dr=FS=class{static unshiftIndent(e,t,i,n,s){const r=oi.visibleColumnFromColumn(e,t,i);if(s){const a=qh(" ",n),c=oi.prevIndentTabStop(r,n)/n;return qh(a,c)}else{const c=oi.prevRenderTabStop(r,i)/i;return qh(" ",c)}}static shiftIndent(e,t,i,n,s){const r=oi.visibleColumnFromColumn(e,t,i);if(s){const a=qh(" ",n),c=oi.nextIndentTabStop(r,n)/n;return qh(a,c)}else{const c=oi.nextRenderTabStop(r,i)/i;return qh(" ",c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:s,indentSize:r,insertSpaces:a}=this._opts,l=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let h=i;h<=n;h++,c=d){d=0;const u=e.getLineContent(h);let g=hs(u);if(this._opts.isUnshift&&(u.length===0||g===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(g===-1&&(g=u.length),h>1&&oi.visibleColumnFromColumn(u,g+1,s)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const _=Tp(this._opts.autoIndent,e,new L(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let b=0,C=_.appendText.length;b1){let n,s=-1;for(n=e-1;n>=1;n--){if(o.tokenization.getLanguageIdAtPosition(n,0)!==i)return s;const r=o.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){s=n;continue}return n}}return-1}function AC(o,e,t,i=!0,n){if(o<4)return null;const s=n.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;const r=new DO(e,s,n);if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const a=lie(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const l=e.getLineContent(a);return{indentation:Dt(l),action:Oi.Indent,line:a}}else if(r.shouldDecrease(a)){const l=e.getLineContent(a);return{indentation:Dt(l),action:null,line:a}}else{if(a===1)return{indentation:Dt(e.getLineContent(a)),action:null,line:a};const l=a-1,c=s.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let h=l-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:Dt(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:Dt(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:Dt(e.getLineContent(d)),action:Oi.Indent,line:d};if(r.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!r.shouldIndentNextLine(d)){h=u;break}return{indentation:Dt(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:Dt(e.getLineContent(d)),action:null,line:d}}return{indentation:Dt(e.getLineContent(1)),action:null,line:1}}}function kb(o,e,t,i,n,s){if(o<4)return null;const r=s.getLanguageConfiguration(t);if(!r)return null;const a=s.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=new DO(e,a,s),c=AC(o,e,i,void 0,s);if(c){const d=c.line;if(d!==void 0){let h=!0;for(let u=d;u0){const b=e.getLineContent(_);if(c.shouldIndentNextLine(b)&&c.shouldIncrease(p)){const w=AC(r,e,t.startLineNumber,!1,s)?.indentation;if(w!==void 0){const v=e.getLineContent(t.startLineNumber),S=Dt(v),k=n.shiftIndent(w)===S,D=/^\s*$/.test(f),I=o.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),F=I&&I.length>0&&D;if(k&&F)return w}}}return null}function Jz(o,e,t){const i=t.getLanguageConfiguration(o.getLanguageId()).indentRulesSupport;return!i||e<1||e>o.getLineCount()?null:i.getIndentMetadata(o.getLineContent(e))}function hie(o,e,t){return{tokenization:{getLineTokens:n=>n===e?t:o.tokenization.getLineTokens(n),getLanguageId:()=>o.getLanguageId(),getLanguageIdAtPosition:(n,s)=>o.getLanguageIdAtPosition(n,s)},getLineContent:n=>n===e?t.getLineContent():o.getLineContent(n)}}class uie{static getEdits(e,t,i,n,s){if(!s&&this._isAutoIndentType(e,t,i)){const r=[];for(const l of i){const c=this._findActualIndentationForSelection(e,t,l,n);if(c===null)return;r.push({selection:l,indentation:c})}const a=pN.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,r,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;nRO(e,a),unshiftIndent:a=>H0(e,a)},e.languageConfigurationService);if(s===null)return null;const r=Yz(t,i.startLineNumber,i.startColumn);return s===e.normalizeIndentation(r)?null:s}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,s){const r=i.map(({selection:l,indentation:c})=>{if(s!==null){const d=this._getEditFromIndentationAndSelection(e,t,c,l,n,!1);return new yie(d,l,n,s)}else{const d=this._getEditFromIndentationAndSelection(e,t,c,l,n,!0);return cu(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new Ns(4,r,a)}static _getEditFromIndentationAndSelection(e,t,i,n,s,r=!0){const a=n.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a);let c=e.normalizeIndentation(i);if(l!==0){const h=t.getLineContent(a);c+=h.substring(l-1,n.startColumn-1)}return c+=r?s:"",{range:new L(a,1,n.endLineNumber,n.endColumn),text:c}}}class gie{static getEdits(e,t,i,n,s,r){if(eU(t,i,n,s,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let s=0,r=t.length;snew Fn(new L(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new Ns(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class pN{static getEdits(e,t,i,n,s,r){if(!r){const a=this.getAutoClosingPairClose(e,t,i,n,s);if(a!==null)return this._runAutoClosingOpenCharType(i,n,s,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const s=[];for(let r=0,a=e.length;r{const p=f.getPosition();return s?{lineNumber:p.lineNumber,beforeColumn:p.column-n.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(f=>new R(f.lineNumber,f.beforeColumn)),n);if(!a)return null;let l,c;if(yh(n)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let g=!0;for(const f of r){const{lineNumber:p,beforeColumn:_,afterColumn:b}=f,C=t.getLineContent(p),w=C.substring(0,_-1),v=C.substring(b-1);if(v.startsWith(u)||(g=!1),v.length>0){const D=v.charAt(0);if(!this._isBeforeClosingBrace(e,v)&&!c(D))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const D=kr(e.wordSeparators,[]);if(w.length>0){const I=w.charCodeAt(w.length-1);if(D.get(I)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),x=$u(S,_-1);if(!a.shouldAutoClose(x,_-x.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,k);if(!a.isOK(D))return null}}return g?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let s=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!s||r.open.length>s.open.length)&&(s=r);return s}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let r=null;for(const a of s)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new L(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!r&&a}}class L7{static getEdits(e,t){if(!(e.inputMode==="overtype"))return null;const n=t.map(s=>new fte(s.insertedTextRange));return new Ns(4,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class pie{static getEdits(e,t,i,n,s){if(!s&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let s=0,r=t.length;s=4){const l=ose(e.autoIndent,t,n,{unshiftIndent:c=>Ay(e,c),shiftIndent:c=>$4(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=vs(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new k0(n,` -`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new ky(n,` -`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Ru(n,` -`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;sthis._compositionType(i,d,s,r,a,l));return new Hs(4,c,{shouldPushStackElementBefore:ID(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new D(a.lineNumber,l,a.lineNumber,c);return new ky(d,i,0,r)}}class mse{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(ua(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=am(e.autoIndent,t,new D(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===Ui.Indent&&(s=$4(e,s)),n===Ui.Outdent&&(s=Ay(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d2?c.charCodeAt(l.column-2):0)===92&&h)return!1;if(o.autoClosingOvertype==="auto"){let g=!1;for(let f=0,p=i.length;f{const n=t.get(at).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Ji();return n&&$a(n)?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(at).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var mn;(function(o){class e extends xi{constructor(C){super(C),this._inSelectionMode=C.inSelectionMode}runCoreEditorCommand(C,w){if(!w.position)return;C.model.pushStackElement(),C.setCursorStates(w.source,3,[Dn.moveTo(C,C.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&C.revealAllCursors(w.source,!0,!0)}}o.MoveTo=ae(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),o.MoveToSelect=ae(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends xi{runCoreEditorCommand(C,w){C.model.pushStackElement();const v=this._getColumnSelectResult(C,C.getPrimaryCursorState(),C.getCursorColumnSelectData(),w);v!==null&&(C.setCursorStates(w.source,3,v.viewStates.map(S=>lt.fromViewState(S))),C.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:v.fromLineNumber,fromViewVisualColumn:v.fromVisualColumn,toViewLineNumber:v.toLineNumber,toViewVisualColumn:v.toVisualColumn}),v.reversed?C.revealTopMostCursor(w.source):C.revealBottomMostCursor(w.source))}}o.ColumnSelect=ae(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,C,w,v){if(typeof v.position>"u"||typeof v.viewPosition>"u"||typeof v.mouseColumn>"u")return null;const S=b.model.validatePosition(v.position),L=b.coordinatesConverter.validateViewPosition(new R(v.viewPosition.lineNumber,v.viewPosition.column),S),x=v.doColumnSelect?w.fromViewLineNumber:L.lineNumber,k=v.doColumnSelect?w.fromViewVisualColumn:v.mouseColumn-1;return Uu.columnSelect(b.cursorConfig,b,x,k,L.lineNumber,v.mouseColumn-1)}}),o.CursorColumnSelectLeft=ae(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(b,C,w,v){return Uu.columnSelectLeft(b.cursorConfig,b,w)}}),o.CursorColumnSelectRight=ae(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(b,C,w,v){return Uu.columnSelectRight(b.cursorConfig,b,w)}});class i extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,w,v,S){return Uu.columnSelectUp(C.cursorConfig,C,v,this._isPaged)}}o.CursorColumnSelectUp=ae(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3600,linux:{primary:0}}})),o.CursorColumnSelectPageUp=ae(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,w,v,S){return Uu.columnSelectDown(C.cursorConfig,C,v,this._isPaged)}}o.CursorColumnSelectDown=ae(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3602,linux:{primary:0}}})),o.CursorColumnSelectPageDown=ae(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends xi{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Ny.metadata})}runCoreEditorCommand(C,w){const v=Ny.parse(w);v&&this._runCursorMove(C,w.source,v)}_runCursorMove(C,w,v){const S=v.noHistory?"api":w;C.model.pushStackElement(),C.setCursorStates(S,3,s._move(C,C.getCursorStates(),v)),C.revealAllCursors(S,!0)}static _move(C,w,v){const S=v.select,L=v.value;switch(v.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Dn.simpleMove(C,w,v.direction,S,L,v.unit);case 11:case 13:case 12:case 14:return Dn.viewportMove(C,w,v.direction,S,L);default:return null}}}o.CursorMoveImpl=s,o.CursorMove=ae(new s);class r extends xi{constructor(C){super(C),this._staticArgs=C.args}runCoreEditorCommand(C,w){let v=this._staticArgs;this._staticArgs.value===-1&&(v={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||C.cursorConfig.pageSize}),C.model.pushStackElement(),C.setCursorStates(w.source,3,Dn.simpleMove(C,C.getCursorStates(),v.direction,v.select,v.value,v.unit)),C.revealAllCursors(w.source,!0)}}o.CursorLeft=ae(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),o.CursorLeftSelect=ae(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1039}})),o.CursorRight=ae(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),o.CursorRightSelect=ae(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1041}})),o.CursorUp=ae(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),o.CursorUpSelect=ae(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),o.CursorPageUp=ae(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:11}})),o.CursorPageUpSelect=ae(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1035}})),o.CursorDown=ae(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),o.CursorDownSelect=ae(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),o.CursorPageDown=ae(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:12}})),o.CursorPageDownSelect=ae(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1036}})),o.CreateCursor=ae(new class extends xi{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,C){if(!C.position)return;let w;C.wholeLine?w=Dn.line(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition):w=Dn.moveTo(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition);const v=b.getCursorStates();if(v.length>1){const S=w.modelState?w.modelState.position:null,L=w.viewState?w.viewState.position:null;for(let x=0,k=v.length;xL&&(S=L);const x=new D(S,1,S,b.model.getLineMaxColumn(S));let k=0;if(w.at)switch(w.at){case Op.RawAtArgument.Top:k=3;break;case Op.RawAtArgument.Center:k=1;break;case Op.RawAtArgument.Bottom:k=4;break}const I=b.coordinatesConverter.convertModelRangeToViewRange(x);b.revealRange(C.source,!1,I,k,0)}}),o.SelectAll=new class extends DT{constructor(){super(ene)}runDOMCommand(b){so&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,C,w){const v=C._getViewModel();v&&this.runCoreEditorCommand(v,w)}runCoreEditorCommand(b,C){b.model.pushStackElement(),b.setCursorStates("keyboard",3,[Dn.selectAll(b,b.getPrimaryCursorState())])}},o.SetSelection=ae(new class extends xi{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,C){C.selection&&(b.model.pushStackElement(),b.setCursorStates(C.source,3,[lt.fromModelSelection(C.selection)]))}})})(mn||(mn={}));const wse=K.and(N.textInputFocus,N.columnSelection);function A_(o,e){Sn.registerKeybindingRule({id:o,primary:e,when:wse,weight:ft+1})}A_(mn.CursorColumnSelectLeft.id,1039);A_(mn.CursorColumnSelectRight.id,1041);A_(mn.CursorColumnSelectUp.id,1040);A_(mn.CursorColumnSelectPageUp.id,1035);A_(mn.CursorColumnSelectDown.id,1042);A_(mn.CursorColumnSelectPageDown.id,1036);function o9(o){return o.register(),o}var lm;(function(o){class e extends tn{runEditorCommand(i,n,s){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,s||{})}}o.CoreEditingCommand=e,o.LineBreakInsert=ae(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:N.writable,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,kD.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection)))}}),o.Outdent=ae(new class extends e{constructor(){super({id:"outdent",precondition:N.writable,kbOpts:{weight:ft,kbExpr:K.and(N.editorTextFocus,N.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,th.outdent(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),o.Tab=ae(new class extends e{constructor(){super({id:"tab",precondition:N.writable,kbOpts:{weight:ft,kbExpr:K.and(N.editorTextFocus,N.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,th.tab(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),o.DeleteLeft=ae(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[s,r]=Yg.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),o.DeleteRight=ae(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ft,kbExpr:N.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[s,r]=Yg.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),o.Undo=new class extends DT{constructor(){super(b$)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().undo()}},o.Redo=new class extends DT{constructor(){super(C$)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().redo()}}})(lm||(lm={}));class r9 extends vD{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(at).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Nf(o,e){o9(new r9("default:"+o,o)),o9(new r9(o,o,e))}Nf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Nf("replacePreviousChar");Nf("compositionType");Nf("compositionStart");Nf("compositionEnd");Nf("paste");Nf("cut");const j4=Ve("markerDecorationsService");var Sse=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yse=function(o,e){return function(t,i){e(t,i,o)}};let Oy=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};Oy=Sse([yse(1,j4)],Oy);nt(Oy.ID,Oy,0);class Fy{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){const t=ya(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=ya(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=ya(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=ya(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=ya(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=ya(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=ya(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=ya(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=ya(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=ya(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=ya(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function ya(o){return typeof o=="number"?`${o}px`:o}function mt(o){return new Fy(o)}function wn(o,e){o instanceof Fy?(o.setFontFamily(e.getMassagedFontFamily()),o.setFontWeight(e.fontWeight),o.setFontSize(e.fontSize),o.setFontFeatureSettings(e.fontFeatureSettings),o.setFontVariationSettings(e.fontVariationSettings),o.setLineHeight(e.lineHeight),o.setLetterSpacing(e.letterSpacing)):(o.style.fontFamily=e.getMassagedFontFamily(),o.style.fontWeight=e.fontWeight,o.style.fontSize=e.fontSize+"px",o.style.fontFeatureSettings=e.fontFeatureSettings,o.style.fontVariationSettings=e.fontVariationSettings,o.style.lineHeight=e.lineHeight+"px",o.style.letterSpacing=e.letterSpacing+"px")}class V$ extends F{constructor(e,t){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{ro(me(this._referenceDomElement),()=>{n=!1,s()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,s()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class Lse extends F{constructor(e){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class xse extends F{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new Lse(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class Dse{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=hv(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new xse(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),se.once($te)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const vv=new Dse;class kse{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class q4{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");wn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");wn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");wn(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const s=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=n),a.appendChild(document.createElement("br"));const l=document.createElement("span");q4._render(l,r),a.appendChild(l),s.push(l)}this._container=e,this._testElements=s}static _render(e,t){if(t.chr===" "){let i=" ";for(let n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e"u"?e:o==="false"?!1:!!o}class Ue extends O_{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return _e(e,this.defaultValue)}}function Fc(o,e,t,i){if(typeof o=="string"&&(o=parseInt(o,10)),typeof o!="number"||isNaN(o))return e;let n=o;return n=Math.max(t,n),n=Math.min(i,n),n|0}class Dt extends O_{static clampedInt(e,t,i,n){return Fc(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return Dt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Pse(o,e,t,i){if(typeof o>"u")return e;const n=eo.float(o,e);return eo.clamp(n,t,i)}class eo extends O_{static clamp(e,t,i){return ei?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,n,s,r,a){typeof s<"u"&&(s.type="number",s.default=i,s.minimum=r,s.maximum=a),super(e,t,i,s),this.validationFn=n,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(eo.float(e,this.defaultValue))}}class fs extends O_{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return fs.string(e,this.defaultValue)}}function Ut(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class ii extends O_{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n.slice(0),s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ut(e,this.defaultValue,this._allowedValues)}}class lb extends si{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Ase(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Ose extends si{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m(201,"Use platform APIs to detect when a Screen Reader is attached."),m(202,"Optimize for usage with a Screen Reader."),m(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:m(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class Fse extends si{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:_e(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:_e(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Wse(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var cn;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(cn||(cn={}));function a9(o){switch(o){case"line":return cn.Line;case"block":return cn.Block;case"underline":return cn.Underline;case"line-thin":return cn.LineThin;case"block-outline":return cn.BlockOutline;case"underline-thin":return cn.UnderlineThin}}class Bse extends ou{constructor(){super(162,"")}compute(e,t,i){const n=["monaco-editor"];return t.get(48)&&n.push(t.get(48)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(82)==="default"?n.push("mouse-default"):t.get(82)==="copy"&&n.push("mouse-copy"),t.get(127)&&n.push("showUnused"),t.get(157)&&n.push("showDeprecated"),n.join(" ")}}class Hse extends Ue{constructor(){super(45,"emptySelectionClipboard",!0,{description:m(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Vse extends si{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m(209,"Never seed search string from the editor selection."),m(210,"Always seed search string from the editor selection, including word at cursor position."),m(211,"Only seed search string from the editor selection.")],description:m(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m(213,"Never turn on Find in Selection automatically (default)."),m(214,"Always turn on Find in Selection automatically."),m(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:je},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[m(220,"Do not store search history from the find widget."),m(221,"Store search history across the active workspace")],description:m(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[m(223,"Do not store history from the replace widget."),m(224,"Store replace history across the active workspace")],description:m(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:m(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:_e(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:_e(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Ut(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Ut(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:_e(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:_e(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:_e(t.loop,this.defaultValue.loop),history:Ut(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Ut(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}class Dr extends si{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",Dr.OFF,{anyOf:[{type:"boolean",description:m(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?Dr.OFF:e==="true"?Dr.ON:e:e?Dr.ON:Dr.OFF}}class $u extends si{static{this.OFF=z$}static{this.TRANSLATE=U$}constructor(){super(63,"fontVariations",$u.OFF,{anyOf:[{type:"boolean",description:m(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?$u.OFF:e==="true"?$u.TRANSLATE:e:e?$u.TRANSLATE:$u.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}class zse extends ou{constructor(){super(59,new Wy({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class Use extends ou{constructor(){super(161,cn.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class $se extends ou{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class jse extends ou{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class qse extends O_{constructor(){super(61,"fontSize",io.fontSize,{type:"number",minimum:6,maximum:100,default:io.fontSize,description:m(233,"Controls the font size in pixels.")})}validate(e){const t=eo.float(e,this.defaultValue);return t===0?io.fontSize:eo.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class ju extends si{static{this.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,"fontWeight",io.fontWeight,{anyOf:[{type:"number",minimum:ju.MINIMUM_VALUE,maximum:ju.MAXIMUM_VALUE,errorMessage:m(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:ju.SUGGESTION_VALUES}],default:io.fontWeight,description:m(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(Dt.clampedInt(e,io.fontWeight,ju.MINIMUM_VALUE,ju.MAXIMUM_VALUE))}}class Kse extends si{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m(236,"Show Peek view of the results (default)"),m(237,"Go to the primary result and show a Peek view"),m(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:m(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:m(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:m(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:m(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:m(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Ut(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Ut(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Ut(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Ut(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Ut(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Ut(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Ut(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:fs.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:fs.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:fs.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:fs.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:fs.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:fs.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class Gse extends si{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:m(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_e(t.enabled,this.defaultValue.enabled),delay:Dt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:_e(t.sticky,this.defaultValue.sticky),hidingDelay:Dt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:_e(t.above,this.defaultValue.above)}}}class cm extends ou{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return cm.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,f=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,b=e.viewLineCount,C=e.remainingWidth,w=e.isViewportWrapping,v=h?2:3;let S=Math.floor(s*n);const L=S/s;let x=!1,k=!1,I=v*u,T=u/s,A=1;if(f==="fill"||f==="fit"){const{typicalViewportLineCount:ne,extraLinesBeforeFirstLine:ce,extraLinesBeyondLastLine:De,desiredRatio:We,minimapLineCount:st}=cm.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(b/st>1)x=!0,k=!0,u=1,I=1,T=u/s;else{let Ft=!1,yt=u+1;if(f==="fit"){const nn=Math.ceil((ce+b+De)*I);w&&a&&C<=t.stableFitRemainingWidth?(Ft=!0,yt=t.stableFitMaxMinimapScale):Ft=nn>S}if(f==="fill"||Ft){x=!0;const nn=u;I=Math.min(l*s,Math.max(1,Math.floor(1/We))),w&&a&&C<=t.stableFitRemainingWidth&&(yt=t.stableFitMaxMinimapScale),u=Math.min(yt,Math.max(1,Math.floor(I/v))),u>nn&&(A=Math.min(2,u/nn)),T=u/s/A,S=Math.ceil(Math.max(ne,ce+b+De)*I),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=C,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(g*T),W=Math.min(O,Math.max(0,Math.floor((C-_-2)*T/(c+T)))+_l);let U=Math.floor(s*W);const q=U/s;U=Math.floor(U*A);const ie=h?1:2,Q=p==="left"?0:i-W-_;return{renderMinimap:ie,minimapLeft:Q,minimapWidth:W,minimapHeightIsEditorHeight:x,minimapIsSampling:k,minimapScale:u,minimapLineHeight:I,minimapCanvasInnerWidth:U,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:q,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,g=u==="inherit"?e.get(149):u,f=e.get(152),p=t.isDominatedByLongLines,_=e.get(66),b=e.get(76).renderType!==0,C=e.get(77),w=e.get(119),v=e.get(96),S=e.get(81),L=e.get(117),x=L.verticalScrollbarSize,k=L.verticalHasArrows,I=L.arrowSize,T=L.horizontalScrollbarSize,A=e.get(52),O=e.get(126)!=="never";let W=e.get(74);A&&O&&(W+=16);let U=0;if(b){const xs=Math.max(r,C);U=Math.round(xs*l)}let q=0;_&&(q=s*t.glyphMarginDecorationLaneCount);let ie=0,Q=ie+q,ne=Q+U,ce=ne+W;const De=i-q-U-W;let We=!1,st=!1,Ye=-1;e.get(2)===2&&u==="inherit"&&p?(We=!0,st=!0):g==="on"||g==="bounded"?st=!0:g==="wordWrapColumn"&&(Ye=f);const Ft=cm._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:v.top,paddingBottom:v.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:De,isViewportWrapping:st},t.memory||new j$);Ft.renderMinimap!==0&&Ft.minimapLeft===0&&(ie+=Ft.minimapWidth,Q+=Ft.minimapWidth,ne+=Ft.minimapWidth,ce+=Ft.minimapWidth);const yt=De-Ft.minimapWidth,nn=Math.max(1,Math.floor((yt-x-2)/a)),Pi=k?I:0;return st&&(Ye=Math.max(1,nn),g==="bounded"&&(Ye=Math.min(Ye,f))),{width:i,height:n,glyphMarginLeft:ie,glyphMarginWidth:q,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:Q,lineNumbersWidth:U,decorationsLeft:ne,decorationsWidth:W,contentLeft:ce,contentWidth:yt,minimap:Ft,viewportColumn:nn,isWordWrapMinified:We,isViewportWrapping:st,wrappingColumn:Ye,verticalScrollbarWidth:x,horizontalScrollbarHeight:T,overviewRuler:{top:Pi,width:x,height:n-2*Pi,right:0}}}}class Zse extends si{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ut(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var ia;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(ia||(ia={}));class Yse extends si{constructor(){const e={enabled:ia.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[ia.Off,ia.OnCode,ia.On],default:e.enabled,enumDescriptions:[m(258,"Disable the code action menu."),m(259,"Show the code action menu when the cursor is on lines with code."),m(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:m(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ut(e.enabled,this.defaultValue.enabled,[ia.Off,ia.OnCode,ia.On])}}}class Xse extends si{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:m(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_e(t.enabled,this.defaultValue.enabled),maxLineCount:Dt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Ut(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:_e(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Qse extends si{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m(267,"Inlay hints are enabled"),m(268,"Inlay hints are showing by default and hide when holding {0}",je?"Ctrl+Option":"Ctrl+Alt"),m(269,"Inlay hints are hidden by default and show when holding {0}",je?"Ctrl+Option":"Ctrl+Alt"),m(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:m(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ut(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Dt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:fs.string(t.fontFamily,this.defaultValue.fontFamily),padding:_e(t.padding,this.defaultValue.padding),maximumLength:Dt.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class Jse extends si{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Dt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Dt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class eoe extends eo{constructor(){super(75,"lineHeight",io.lineHeight,e=>eo.clamp(e,0,150),{markdownDescription:m(275,`Controls the line height. +`+l;return i?new MS(n,d,!0):new R0(n,d,-1,c.length-l.length,!0)}else if(s.indentAction===Oi.Outdent){const l=H0(e,s.indentation);return cu(n,` +`+e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=Dt(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=cie(e.autoIndent,t,n,{unshiftIndent:c=>H0(e,c),shiftIndent:c=>RO(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=hs(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new MS(n,` +`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new R0(n,` +`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return cu(n,` +`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;sthis._compositionType(i,d,s,r,a,l));return new Ns(4,c,{shouldPushStackElementBefore:ML(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new L(a.lineNumber,l,a.lineNumber,c);return new R0(d,i,0,r)}}class vie{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Qr(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=Tp(e.autoIndent,t,new L(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===Oi.Indent&&(s=RO(e,s)),n===Oi.Outdent&&(s=H0(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d2?c.charCodeAt(l.column-2):0)===92&&h)return!1;if(o.autoClosingOvertype==="auto"){let g=!1;for(let f=0,p=i.length;f{const n=t.get(et).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=ji();return n&&Ia(n)?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(et).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var ln;(function(o){class e extends Ci{constructor(C){super(C),this._inSelectionMode=C.inSelectionMode}runCoreEditorCommand(C,w){if(!w.position)return;C.model.pushStackElement(),C.setCursorStates(w.source,3,[Cn.moveTo(C,C.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&C.revealAllCursors(w.source,!0,!0)}}o.MoveTo=re(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),o.MoveToSelect=re(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Ci{runCoreEditorCommand(C,w){C.model.pushStackElement();const v=this._getColumnSelectResult(C,C.getPrimaryCursorState(),C.getCursorColumnSelectData(),w);v!==null&&(C.setCursorStates(w.source,3,v.viewStates.map(S=>tt.fromViewState(S))),C.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:v.fromLineNumber,fromViewVisualColumn:v.fromVisualColumn,toViewLineNumber:v.toLineNumber,toViewVisualColumn:v.toVisualColumn}),v.reversed?C.revealTopMostCursor(w.source):C.revealBottomMostCursor(w.source))}}o.ColumnSelect=re(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(b,C,w,v){if(typeof v.position>"u"||typeof v.viewPosition>"u"||typeof v.mouseColumn>"u")return null;const S=b.model.validatePosition(v.position),x=b.coordinatesConverter.validateViewPosition(new R(v.viewPosition.lineNumber,v.viewPosition.column),S),k=v.doColumnSelect?w.fromViewLineNumber:x.lineNumber,D=v.doColumnSelect?w.fromViewVisualColumn:v.mouseColumn-1;return vu.columnSelect(b.cursorConfig,b,k,D,x.lineNumber,v.mouseColumn-1)}}),o.CursorColumnSelectLeft=re(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(b,C,w,v){return vu.columnSelectLeft(b.cursorConfig,b,w)}}),o.CursorColumnSelectRight=re(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(b,C,w,v){return vu.columnSelectRight(b.cursorConfig,b,w)}});class i extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,w,v,S){return vu.columnSelectUp(C.cursorConfig,C,v,this._isPaged)}}o.CursorColumnSelectUp=re(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3600,linux:{primary:0}}})),o.CursorColumnSelectPageUp=re(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(C){super(C),this._isPaged=C.isPaged}_getColumnSelectResult(C,w,v,S){return vu.columnSelectDown(C.cursorConfig,C,v,this._isPaged)}}o.CursorColumnSelectDown=re(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3602,linux:{primary:0}}})),o.CursorColumnSelectPageDown=re(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends Ci{constructor(){super({id:"cursorMove",precondition:void 0,metadata:A0.metadata})}runCoreEditorCommand(C,w){const v=A0.parse(w);v&&this._runCursorMove(C,w.source,v)}_runCursorMove(C,w,v){const S=v.noHistory?"api":w;C.model.pushStackElement(),C.setCursorStates(S,3,s._move(C,C.getCursorStates(),v)),C.revealAllCursors(S,!0)}static _move(C,w,v){const S=v.select,x=v.value;switch(v.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Cn.simpleMove(C,w,v.direction,S,x,v.unit);case 11:case 13:case 12:case 14:return Cn.viewportMove(C,w,v.direction,S,x);default:return null}}}o.CursorMoveImpl=s,o.CursorMove=re(new s);class r extends Ci{constructor(C){super(C),this._staticArgs=C.args}runCoreEditorCommand(C,w){let v=this._staticArgs;this._staticArgs.value===-1&&(v={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||C.cursorConfig.pageSize}),C.model.pushStackElement(),C.setCursorStates(w.source,3,Cn.simpleMove(C,C.getCursorStates(),v.direction,v.select,v.value,v.unit)),C.revealAllCursors(w.source,!0)}}o.CursorLeft=re(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),o.CursorLeftSelect=re(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1039}})),o.CursorRight=re(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),o.CursorRightSelect=re(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1041}})),o.CursorUp=re(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),o.CursorUpSelect=re(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),o.CursorPageUp=re(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:11}})),o.CursorPageUpSelect=re(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1035}})),o.CursorDown=re(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),o.CursorDownSelect=re(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),o.CursorPageDown=re(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:12}})),o.CursorPageDownSelect=re(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1036}})),o.CreateCursor=re(new class extends Ci{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(b,C){if(!C.position)return;let w;C.wholeLine?w=Cn.line(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition):w=Cn.moveTo(b,b.getPrimaryCursorState(),!1,C.position,C.viewPosition);const v=b.getCursorStates();if(v.length>1){const S=w.modelState?w.modelState.position:null,x=w.viewState?w.viewState.position:null;for(let k=0,D=v.length;kx&&(S=x);const k=new L(S,1,S,b.model.getLineMaxColumn(S));let D=0;if(w.at)switch(w.at){case rp.RawAtArgument.Top:D=3;break;case rp.RawAtArgument.Center:D=1;break;case rp.RawAtArgument.Bottom:D=4;break}const I=b.coordinatesConverter.convertModelRangeToViewRange(k);b.revealRange(C.source,!1,I,D,0)}}),o.SelectAll=new class extends mN{constructor(){super(ste)}runDOMCommand(b){Ks&&(b.focus(),b.select()),b.ownerDocument.execCommand("selectAll")}runEditorCommand(b,C,w){const v=C._getViewModel();v&&this.runCoreEditorCommand(v,w)}runCoreEditorCommand(b,C){b.model.pushStackElement(),b.setCursorStates("keyboard",3,[Cn.selectAll(b,b.getPrimaryCursorState())])}},o.SetSelection=re(new class extends Ci{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(b,C){C.selection&&(b.model.pushStackElement(),b.setCursorStates(C.source,3,[tt.fromModelSelection(C.selection)]))}})})(ln||(ln={}));const Lie=q.and(N.textInputFocus,N.columnSelection);function o_(o,e){fn.registerKeybindingRule({id:o,primary:e,when:Lie,weight:ct+1})}o_(ln.CursorColumnSelectLeft.id,1039);o_(ln.CursorColumnSelectRight.id,1041);o_(ln.CursorColumnSelectUp.id,1040);o_(ln.CursorColumnSelectPageUp.id,1035);o_(ln.CursorColumnSelectDown.id,1042);o_(ln.CursorColumnSelectPageDown.id,1036);function I7(o){return o.register(),o}var Rp;(function(o){class e extends Ki{runEditorCommand(i,n,s){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,s||{})}}o.CoreEditingCommand=e,o.LineBreakInsert=re(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:N.writable,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,RL.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection)))}}),o.Outdent=re(new class extends e{constructor(){super({id:"outdent",precondition:N.writable,kbOpts:{weight:ct,kbExpr:q.and(N.editorTextFocus,N.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Pd.outdent(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),o.Tab=re(new class extends e{constructor(){super({id:"tab",precondition:N.writable,kbOpts:{weight:ct,kbExpr:q.and(N.editorTextFocus,N.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Pd.tab(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),o.DeleteLeft=re(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[s,r]=Dg.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),o.DeleteRight=re(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ct,kbExpr:N.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[s,r]=Dg.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),o.Undo=new class extends mN{constructor(){super(Mz)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().undo()}},o.Redo=new class extends mN{constructor(){super(Pz)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(104)===!0))return i.getModel().redo()}}})(Rp||(Rp={}));class E7 extends LL{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(et).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function af(o,e){I7(new E7("default:"+o,o)),I7(new E7(o,o,e))}af("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});af("replacePreviousChar");af("compositionType");af("compositionStart");af("compositionEnd");af("paste");af("cut");const MO=We("markerDecorationsService");var kie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Die=function(o,e){return function(t,i){e(t,i,o)}};let V0=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};V0=kie([Die(1,MO)],V0);Xe(V0.ID,V0,0);class z0{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){const t=la(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=la(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=la(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=la(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=la(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=la(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=la(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=la(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=la(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=la(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=la(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function la(o){return typeof o=="number"?`${o}px`:o}function ht(o){return new z0(o)}function gn(o,e){o instanceof z0?(o.setFontFamily(e.getMassagedFontFamily()),o.setFontWeight(e.fontWeight),o.setFontSize(e.fontSize),o.setFontFeatureSettings(e.fontFeatureSettings),o.setFontVariationSettings(e.fontVariationSettings),o.setLineHeight(e.lineHeight),o.setLetterSpacing(e.letterSpacing)):(o.style.fontFamily=e.getMassagedFontFamily(),o.style.fontWeight=e.fontWeight,o.style.fontSize=e.fontSize+"px",o.style.fontFeatureSettings=e.fontFeatureSettings,o.style.fontVariationSettings=e.fontVariationSettings,o.style.lineHeight=e.lineHeight+"px",o.style.letterSpacing=e.letterSpacing+"px")}class iU extends A{constructor(e,t){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Zs(pe(this._referenceDomElement),()=>{n=!1,s()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,s()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class Iie extends A{constructor(e){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class Eie extends A{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new Iie(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class Nie{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=DC(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new Eie(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),te.once(GJ)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const OC=new Nie;class Tie{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class PO{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");gn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");gn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");gn(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const s=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=n),a.appendChild(document.createElement("br"));const l=document.createElement("span");PO._render(l,r),a.appendChild(l),s.push(l)}this._container=e,this._testElements=s}static _render(e,t){if(t.chr===" "){let i=" ";for(let n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e"u"?e:o==="false"?!1:!!o}class He extends r_{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return me(e,this.defaultValue)}}function mc(o,e,t,i){if(typeof o=="string"&&(o=parseInt(o,10)),typeof o!="number"||isNaN(o))return e;let n=o;return n=Math.max(t,n),n=Math.min(i,n),n|0}class vt extends r_{static clampedInt(e,t,i,n){return mc(e,t,i,n)}constructor(e,t,i,n,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=s),super(e,t,i,r),this.minimum=n,this.maximum=s}validate(e){return vt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Wie(o,e,t,i){if(typeof o>"u")return e;const n=Us.float(o,e);return Us.clamp(n,t,i)}class Us extends r_{static clamp(e,t,i){return ei?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,n,s,r,a){typeof s<"u"&&(s.type="number",s.default=i,s.minimum=r,s.maximum=a),super(e,t,i,s),this.validationFn=n,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(Us.float(e,this.defaultValue))}}class os extends r_{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return os.string(e,this.defaultValue)}}function Ot(o,e,t,i){return typeof o!="string"?e:i&&o in i?i[o]:t.indexOf(o)===-1?e:o}class Yt extends r_{constructor(e,t,i,n,s=void 0){typeof s<"u"&&(s.type="string",s.enum=n.slice(0),s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return Ot(e,this.defaultValue,this._allowedValues)}}class E_ extends Qt{constructor(e,t,i,n,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=n),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Bie(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Hie extends Qt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m(201,"Use platform APIs to detect when a Screen Reader is attached."),m(202,"Optimize for usage with a Screen Reader."),m(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:m(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class Vie extends Qt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:me(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:me(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function zie(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var en;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(en||(en={}));function N7(o){switch(o){case"line":return en.Line;case"block":return en.Block;case"underline":return en.Underline;case"line-thin":return en.LineThin;case"block-outline":return en.BlockOutline;case"underline-thin":return en.UnderlineThin}}class Uie extends Wh{constructor(){super(162,"")}compute(e,t,i){const n=["monaco-editor"];return t.get(48)&&n.push(t.get(48)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(82)==="default"?n.push("mouse-default"):t.get(82)==="copy"&&n.push("mouse-copy"),t.get(127)&&n.push("showUnused"),t.get(157)&&n.push("showDeprecated"),n.join(" ")}}class $ie extends He{constructor(){super(45,"emptySelectionClipboard",!0,{description:m(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class jie extends Qt{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m(209,"Never seed search string from the editor selection."),m(210,"Always seed search string from the editor selection, including word at cursor position."),m(211,"Only seed search string from the editor selection.")],description:m(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m(213,"Never turn on Find in Selection automatically (default)."),m(214,"Always turn on Find in Selection automatically."),m(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ze},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[m(220,"Do not store search history from the find widget."),m(221,"Store search history across the active workspace")],description:m(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[m(223,"Do not store history from the replace widget."),m(224,"Store replace history across the active workspace")],description:m(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:m(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:me(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:me(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Ot(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Ot(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:me(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:me(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:me(t.loop,this.defaultValue.loop),history:Ot(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Ot(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}class ur extends Qt{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",ur.OFF,{anyOf:[{type:"boolean",description:m(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?ur.OFF:e==="true"?ur.ON:e:e?ur.ON:ur.OFF}}class wu extends Qt{static{this.OFF=nU}static{this.TRANSLATE=sU}constructor(){super(63,"fontVariations",wu.OFF,{anyOf:[{type:"boolean",description:m(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?wu.OFF:e==="true"?wu.TRANSLATE:e:e?wu.TRANSLATE:wu.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}class qie extends Wh{constructor(){super(59,new U0({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class Kie extends Wh{constructor(){super(161,en.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class Gie extends Wh{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class Zie extends Wh{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class Yie extends r_{constructor(){super(61,"fontSize",js.fontSize,{type:"number",minimum:6,maximum:100,default:js.fontSize,description:m(233,"Controls the font size in pixels.")})}validate(e){const t=Us.float(e,this.defaultValue);return t===0?js.fontSize:Us.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Su extends Qt{static{this.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,"fontWeight",js.fontWeight,{anyOf:[{type:"number",minimum:Su.MINIMUM_VALUE,maximum:Su.MAXIMUM_VALUE,errorMessage:m(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Su.SUGGESTION_VALUES}],default:js.fontWeight,description:m(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(vt.clampedInt(e,js.fontWeight,Su.MINIMUM_VALUE,Su.MAXIMUM_VALUE))}}class Xie extends Qt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m(236,"Show Peek view of the results (default)"),m(237,"Go to the primary result and show a Peek view"),m(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:m(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:m(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:m(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:m(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:m(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Ot(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Ot(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Ot(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Ot(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Ot(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Ot(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Ot(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:os.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:os.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:os.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:os.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:os.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:os.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class Qie extends Qt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:m(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),delay:vt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:me(t.sticky,this.defaultValue.sticky),hidingDelay:vt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:me(t.above,this.defaultValue.above)}}}class Mp extends Wh{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return Mp.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,f=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,b=e.viewLineCount,C=e.remainingWidth,w=e.isViewportWrapping,v=h?2:3;let S=Math.floor(s*n);const x=S/s;let k=!1,D=!1,I=v*u,T=u/s,F=1;if(f==="fill"||f==="fit"){const{typicalViewportLineCount:ne,extraLinesBeforeFirstLine:ce,extraLinesBeyondLastLine:ke,desiredRatio:it,minimapLineCount:ot}=Mp.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:s});if(b/ot>1)k=!0,D=!0,u=1,I=1,T=u/s;else{let Zt=!1,mn=u+1;if(f==="fit"){const ms=Math.ceil((ce+b+ke)*I);w&&a&&C<=t.stableFitRemainingWidth?(Zt=!0,mn=t.stableFitMaxMinimapScale):Zt=ms>S}if(f==="fill"||Zt){k=!0;const ms=u;I=Math.min(l*s,Math.max(1,Math.floor(1/it))),w&&a&&C<=t.stableFitRemainingWidth&&(mn=t.stableFitMaxMinimapScale),u=Math.min(mn,Math.max(1,Math.floor(I/v))),u>ms&&(F=Math.min(2,u/ms)),T=u/s/F,S=Math.ceil(Math.max(ne,ce+b+ke)*I),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=C,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(g*T),B=Math.min(O,Math.max(0,Math.floor((C-_-2)*T/(c+T)))+el);let U=Math.floor(s*B);const K=U/s;U=Math.floor(U*F);const ie=h?1:2,X=p==="left"?0:i-B-_;return{renderMinimap:ie,minimapLeft:X,minimapWidth:B,minimapHeightIsEditorHeight:k,minimapIsSampling:D,minimapScale:u,minimapLineHeight:I,minimapCanvasInnerWidth:U,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:K,minimapCanvasOuterHeight:x}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,g=u==="inherit"?e.get(149):u,f=e.get(152),p=t.isDominatedByLongLines,_=e.get(66),b=e.get(76).renderType!==0,C=e.get(77),w=e.get(119),v=e.get(96),S=e.get(81),x=e.get(117),k=x.verticalScrollbarSize,D=x.verticalHasArrows,I=x.arrowSize,T=x.horizontalScrollbarSize,F=e.get(52),O=e.get(126)!=="never";let B=e.get(74);F&&O&&(B+=16);let U=0;if(b){const yo=Math.max(r,C);U=Math.round(yo*l)}let K=0;_&&(K=s*t.glyphMarginDecorationLaneCount);let ie=0,X=ie+K,ne=X+U,ce=ne+B;const ke=i-K-U-B;let it=!1,ot=!1,Lt=-1;e.get(2)===2&&u==="inherit"&&p?(it=!0,ot=!0):g==="on"||g==="bounded"?ot=!0:g==="wordWrapColumn"&&(Lt=f);const Zt=Mp._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:v.top,paddingBottom:v.bottom,minimap:S,verticalScrollbarWidth:k,viewLineCount:d,remainingWidth:ke,isViewportWrapping:ot},t.memory||new rU);Zt.renderMinimap!==0&&Zt.minimapLeft===0&&(ie+=Zt.minimapWidth,X+=Zt.minimapWidth,ne+=Zt.minimapWidth,ce+=Zt.minimapWidth);const mn=ke-Zt.minimapWidth,ms=Math.max(1,Math.floor((mn-k-2)/a)),Gi=D?I:0;return ot&&(Lt=Math.max(1,ms),g==="bounded"&&(Lt=Math.min(Lt,f))),{width:i,height:n,glyphMarginLeft:ie,glyphMarginWidth:K,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:X,lineNumbersWidth:U,decorationsLeft:ne,decorationsWidth:B,contentLeft:ce,contentWidth:mn,minimap:Zt,viewportColumn:ms,isWordWrapMinified:it,isViewportWrapping:ot,wrappingColumn:Lt,verticalScrollbarWidth:k,horizontalScrollbarHeight:T,overviewRuler:{top:Gi,width:k,height:n-2*Gi,right:0}}}}class Jie extends Qt{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ot(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var zr;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(zr||(zr={}));class ene extends Qt{constructor(){const e={enabled:zr.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[zr.Off,zr.OnCode,zr.On],default:e.enabled,enumDescriptions:[m(258,"Disable the code action menu."),m(259,"Show the code action menu when the cursor is on lines with code."),m(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:m(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ot(e.enabled,this.defaultValue.enabled,[zr.Off,zr.OnCode,zr.On])}}}class tne extends Qt{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:m(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:me(t.enabled,this.defaultValue.enabled),maxLineCount:vt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Ot(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:me(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class ine extends Qt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m(267,"Inlay hints are enabled"),m(268,"Inlay hints are showing by default and hide when holding {0}",ze?"Ctrl+Option":"Ctrl+Alt"),m(269,"Inlay hints are hidden by default and show when holding {0}",ze?"Ctrl+Option":"Ctrl+Alt"),m(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:m(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ot(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:vt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:os.string(t.fontFamily,this.defaultValue.fontFamily),padding:me(t.padding,this.defaultValue.padding),maximumLength:vt.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class nne extends Qt{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):vt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?vt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class sne extends Us{constructor(){super(75,"lineHeight",js.lineHeight,e=>Us.clamp(e,0,150),{markdownDescription:m(275,`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}class toe extends si{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?-?)\\s*(?
(?:\+|-)?\d+(\.\d+)?)\)/);if(!_)throw new Error("Invalid color format "+p);const b=parseInt(_.groups?.r??"0"),C=parseInt(_.groups?.g??"0"),w=parseInt(_.groups?.b??"0"),v=parseFloat(_.groups?.a??"0");return new o(new j(b,C,w,v))}if(p.startsWith("rgb(")){const _=p.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/);if(!_)throw new Error("Invalid color format "+p);const b=parseInt(_.groups?.r??"0"),C=parseInt(_.groups?.g??"0"),w=parseInt(_.groups?.b??"0");return new o(new j(b,C,w))}return u(p)}t.parse=h;function u(p){switch(p){case"aliceblue":return new o(new j(240,248,255,1));case"antiquewhite":return new o(new j(250,235,215,1));case"aqua":return new o(new j(0,255,255,1));case"aquamarine":return new o(new j(127,255,212,1));case"azure":return new o(new j(240,255,255,1));case"beige":return new o(new j(245,245,220,1));case"bisque":return new o(new j(255,228,196,1));case"black":return new o(new j(0,0,0,1));case"blanchedalmond":return new o(new j(255,235,205,1));case"blue":return new o(new j(0,0,255,1));case"blueviolet":return new o(new j(138,43,226,1));case"brown":return new o(new j(165,42,42,1));case"burlywood":return new o(new j(222,184,135,1));case"cadetblue":return new o(new j(95,158,160,1));case"chartreuse":return new o(new j(127,255,0,1));case"chocolate":return new o(new j(210,105,30,1));case"coral":return new o(new j(255,127,80,1));case"cornflowerblue":return new o(new j(100,149,237,1));case"cornsilk":return new o(new j(255,248,220,1));case"crimson":return new o(new j(220,20,60,1));case"cyan":return new o(new j(0,255,255,1));case"darkblue":return new o(new j(0,0,139,1));case"darkcyan":return new o(new j(0,139,139,1));case"darkgoldenrod":return new o(new j(184,134,11,1));case"darkgray":return new o(new j(169,169,169,1));case"darkgreen":return new o(new j(0,100,0,1));case"darkgrey":return new o(new j(169,169,169,1));case"darkkhaki":return new o(new j(189,183,107,1));case"darkmagenta":return new o(new j(139,0,139,1));case"darkolivegreen":return new o(new j(85,107,47,1));case"darkorange":return new o(new j(255,140,0,1));case"darkorchid":return new o(new j(153,50,204,1));case"darkred":return new o(new j(139,0,0,1));case"darksalmon":return new o(new j(233,150,122,1));case"darkseagreen":return new o(new j(143,188,143,1));case"darkslateblue":return new o(new j(72,61,139,1));case"darkslategray":return new o(new j(47,79,79,1));case"darkslategrey":return new o(new j(47,79,79,1));case"darkturquoise":return new o(new j(0,206,209,1));case"darkviolet":return new o(new j(148,0,211,1));case"deeppink":return new o(new j(255,20,147,1));case"deepskyblue":return new o(new j(0,191,255,1));case"dimgray":return new o(new j(105,105,105,1));case"dimgrey":return new o(new j(105,105,105,1));case"dodgerblue":return new o(new j(30,144,255,1));case"firebrick":return new o(new j(178,34,34,1));case"floralwhite":return new o(new j(255,250,240,1));case"forestgreen":return new o(new j(34,139,34,1));case"fuchsia":return new o(new j(255,0,255,1));case"gainsboro":return new o(new j(220,220,220,1));case"ghostwhite":return new o(new j(248,248,255,1));case"gold":return new o(new j(255,215,0,1));case"goldenrod":return new o(new j(218,165,32,1));case"gray":return new o(new j(128,128,128,1));case"green":return new o(new j(0,128,0,1));case"greenyellow":return new o(new j(173,255,47,1));case"grey":return new o(new j(128,128,128,1));case"honeydew":return new o(new j(240,255,240,1));case"hotpink":return new o(new j(255,105,180,1));case"indianred":return new o(new j(205,92,92,1));case"indigo":return new o(new j(75,0,130,1));case"ivory":return new o(new j(255,255,240,1));case"khaki":return new o(new j(240,230,140,1));case"lavender":return new o(new j(230,230,250,1));case"lavenderblush":return new o(new j(255,240,245,1));case"lawngreen":return new o(new j(124,252,0,1));case"lemonchiffon":return new o(new j(255,250,205,1));case"lightblue":return new o(new j(173,216,230,1));case"lightcoral":return new o(new j(240,128,128,1));case"lightcyan":return new o(new j(224,255,255,1));case"lightgoldenrodyellow":return new o(new j(250,250,210,1));case"lightgray":return new o(new j(211,211,211,1));case"lightgreen":return new o(new j(144,238,144,1));case"lightgrey":return new o(new j(211,211,211,1));case"lightpink":return new o(new j(255,182,193,1));case"lightsalmon":return new o(new j(255,160,122,1));case"lightseagreen":return new o(new j(32,178,170,1));case"lightskyblue":return new o(new j(135,206,250,1));case"lightslategray":return new o(new j(119,136,153,1));case"lightslategrey":return new o(new j(119,136,153,1));case"lightsteelblue":return new o(new j(176,196,222,1));case"lightyellow":return new o(new j(255,255,224,1));case"lime":return new o(new j(0,255,0,1));case"limegreen":return new o(new j(50,205,50,1));case"linen":return new o(new j(250,240,230,1));case"magenta":return new o(new j(255,0,255,1));case"maroon":return new o(new j(128,0,0,1));case"mediumaquamarine":return new o(new j(102,205,170,1));case"mediumblue":return new o(new j(0,0,205,1));case"mediumorchid":return new o(new j(186,85,211,1));case"mediumpurple":return new o(new j(147,112,219,1));case"mediumseagreen":return new o(new j(60,179,113,1));case"mediumslateblue":return new o(new j(123,104,238,1));case"mediumspringgreen":return new o(new j(0,250,154,1));case"mediumturquoise":return new o(new j(72,209,204,1));case"mediumvioletred":return new o(new j(199,21,133,1));case"midnightblue":return new o(new j(25,25,112,1));case"mintcream":return new o(new j(245,255,250,1));case"mistyrose":return new o(new j(255,228,225,1));case"moccasin":return new o(new j(255,228,181,1));case"navajowhite":return new o(new j(255,222,173,1));case"navy":return new o(new j(0,0,128,1));case"oldlace":return new o(new j(253,245,230,1));case"olive":return new o(new j(128,128,0,1));case"olivedrab":return new o(new j(107,142,35,1));case"orange":return new o(new j(255,165,0,1));case"orangered":return new o(new j(255,69,0,1));case"orchid":return new o(new j(218,112,214,1));case"palegoldenrod":return new o(new j(238,232,170,1));case"palegreen":return new o(new j(152,251,152,1));case"paleturquoise":return new o(new j(175,238,238,1));case"palevioletred":return new o(new j(219,112,147,1));case"papayawhip":return new o(new j(255,239,213,1));case"peachpuff":return new o(new j(255,218,185,1));case"peru":return new o(new j(205,133,63,1));case"pink":return new o(new j(255,192,203,1));case"plum":return new o(new j(221,160,221,1));case"powderblue":return new o(new j(176,224,230,1));case"purple":return new o(new j(128,0,128,1));case"rebeccapurple":return new o(new j(102,51,153,1));case"red":return new o(new j(255,0,0,1));case"rosybrown":return new o(new j(188,143,143,1));case"royalblue":return new o(new j(65,105,225,1));case"saddlebrown":return new o(new j(139,69,19,1));case"salmon":return new o(new j(250,128,114,1));case"sandybrown":return new o(new j(244,164,96,1));case"seagreen":return new o(new j(46,139,87,1));case"seashell":return new o(new j(255,245,238,1));case"sienna":return new o(new j(160,82,45,1));case"silver":return new o(new j(192,192,192,1));case"skyblue":return new o(new j(135,206,235,1));case"slateblue":return new o(new j(106,90,205,1));case"slategray":return new o(new j(112,128,144,1));case"slategrey":return new o(new j(112,128,144,1));case"snow":return new o(new j(255,250,250,1));case"springgreen":return new o(new j(0,255,127,1));case"steelblue":return new o(new j(70,130,180,1));case"tan":return new o(new j(210,180,140,1));case"teal":return new o(new j(0,128,128,1));case"thistle":return new o(new j(216,191,216,1));case"tomato":return new o(new j(255,99,71,1));case"turquoise":return new o(new j(64,224,208,1));case"violet":return new o(new j(238,130,238,1));case"wheat":return new o(new j(245,222,179,1));case"white":return new o(new j(255,255,255,1));case"whitesmoke":return new o(new j(245,245,245,1));case"yellow":return new o(new j(255,255,0,1));case"yellowgreen":return new o(new j(154,205,50,1));default:return null}}function g(p){const _=p.length;if(_===0||p.charCodeAt(0)!==35)return null;if(_===7){const b=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),C=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),w=16*f(p.charCodeAt(5))+f(p.charCodeAt(6));return new o(new j(b,C,w,1))}if(_===9){const b=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),C=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),w=16*f(p.charCodeAt(5))+f(p.charCodeAt(6)),v=16*f(p.charCodeAt(7))+f(p.charCodeAt(8));return new o(new j(b,C,w,v/255))}if(_===4){const b=f(p.charCodeAt(1)),C=f(p.charCodeAt(2)),w=f(p.charCodeAt(3));return new o(new j(16*b+b,16*C+C,16*w+w))}if(_===5){const b=f(p.charCodeAt(1)),C=f(p.charCodeAt(2)),w=f(p.charCodeAt(3)),v=f(p.charCodeAt(4));return new o(new j(16*b+b,16*C+C,16*w+w,(16*v+v)/255))}return null}t.parseHex=g;function f(p){switch(p){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(o.Format||(o.Format={}))})(V||(V={}));function K4(o){return`--vscode-${o.replace(/\./g,"-")}`}function J(o){return`var(${K4(o)})`}function G$(o,e){return`var(${K4(o)}, ${e})`}function Voe(o){return o!==null&&typeof o=="object"&&"light"in o&&"dark"in o}const Z$={ColorContribution:"base.contributions.colors"},zoe="default";class Uoe extends F{constructor(){super(),this._onDidChangeSchema=this._register(new P),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};this.colorsById[e]=r;const a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(a.deprecationMessage=s),n&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=m(2022,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:zoe,description:m(2023,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i?.defaults){const n=Voe(i.defaults)?i.defaults[t.type]:i.defaults;return pr(n,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,s=i.indexOf(".")===-1?0:1;return n!==s?n-s:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const ND=new Uoe;fi.add(Z$.ColorContribution,ND);function E(o,e,t,i,n){return ND.registerColor(o,e,t,i,n)}function $oe(o,e){switch(o.op){case 0:return pr(o.value,e)?.darken(o.factor);case 1:return pr(o.value,e)?.lighten(o.factor);case 2:return pr(o.value,e)?.transparent(o.factor);case 7:{const t=pr(o.color,e)||V.transparent,i=pr(o.with,e)||V.transparent;return t.mix(i,o.ratio)}case 3:{const t=pr(o.background,e);return t?pr(o.value,e)?.makeOpaque(t):pr(o.value,e)}case 4:for(const t of o.values){const i=pr(t,e);if(i)return i}return;case 6:return pr(e.defines(o.if)?o.then:o.else,e);case 5:{const t=pr(o.value,e);if(!t)return;const i=pr(o.background,e);return i?t.isDarkerThan(i)?V.getLighterColor(t,i,o.factor).transparent(o.transparency):V.getDarkerColor(t,i,o.factor).transparent(o.transparency):t.transparent(o.factor*o.transparency)}default:throw Uw()}}function to(o,e){return{op:0,value:o,factor:e}}function ja(o,e){return{op:1,value:o,factor:e}}function Pe(o,e){return{op:2,value:o,factor:e}}function wv(...o){return{op:4,values:o}}function joe(o,e,t){return{op:6,if:o,then:e,else:t}}function d9(o,e,t,i){return{op:5,value:o,background:e,factor:t,transparency:i}}function pr(o,e){if(o!==null){if(typeof o=="string")return o[0]==="#"?V.fromHex(o):e.getColor(o);if(o instanceof V)return o;if(typeof o=="object")return $oe(o,e)}}const Y$="vscode://schemas/workbench-colors",X$=fi.as(DD.JSONContribution);X$.registerSchema(Y$,ND.getColorSchema());const h9=new It(()=>X$.notifySchemaChanged(Y$),200);ND.onDidChangeSchema(()=>{h9.isScheduled()||h9.schedule()});const Ke=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m(1773,"Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m(1774,"Overall foreground for disabled elements. This color is only used if not overridden by a component."));E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m(1775,"Overall foreground color for error messages. This color is only used if not overridden by a component."));const Q$=E("descriptionForeground",{light:"#717171",dark:Pe(Ke,.7),hcDark:Pe(Ke,.7),hcLight:Pe(Ke,.7)},m(1776,"Foreground color for description text providing additional information, for example for a label.")),Uy=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m(1777,"The default color for icons in the workbench.")),Kl=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m(1778,"Overall border color for focused elements. This color is only used if not overridden by a component.")),et=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m(1779,"An extra border around elements to separate them from others for greater contrast.")),ti=E("contrastActiveBorder",{light:null,dark:null,hcDark:Kl,hcLight:Kl},m(1780,"An extra border around active elements to separate them from others for greater contrast."));E("selection.background",null,m(1781,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const qoe=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m(1782,"Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m(1783,"Foreground color for links in text when clicked on and on mouse hover."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:V.black,hcLight:"#292929"},m(1784,"Color for text separators."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},m(1785,"Foreground color for preformatted text segments."));E("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},m(1786,"Background color for preformatted text segments."));E("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},m(1787,"Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:V.white,hcLight:"#292929"},m(1788,"Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:V.black,hcLight:"#F2F2F2"},m(1789,"Background color for code blocks in text."));E("sash.hoverBorder",Kl,m(1994,"Border color of active sashes."));const R0=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:V.black,hcLight:"#0F4A85"},m(1995,"Badge background color. Badges are small information labels, e.g. for search results count.")),Koe=E("badge.foreground",{dark:V.white,light:"#333",hcDark:V.white,hcLight:V.white},m(1996,"Badge foreground color. Badges are small information labels, e.g. for search results count."));E("activityWarningBadge.foreground",{dark:V.black.lighten(.2),light:V.white,hcDark:null,hcLight:V.black.lighten(.2)},m(1997,"Foreground color of the warning activity badge"));E("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},m(1998,"Background color of the warning activity badge"));E("activityErrorBadge.foreground",{dark:V.black.lighten(.2),light:V.white,hcDark:null,hcLight:V.black.lighten(.2)},m(1999,"Foreground color of the error activity badge"));E("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},m(2e3,"Background color of the error activity badge"));const TD=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m(2001,"Scrollbar shadow to indicate that the view is scrolled.")),J$=E("scrollbarSlider.background",{dark:V.fromHex("#797979").transparent(.4),light:V.fromHex("#646464").transparent(.4),hcDark:Pe(et,.6),hcLight:Pe(et,.4)},m(2002,"Scrollbar slider background color.")),ej=E("scrollbarSlider.hoverBackground",{dark:V.fromHex("#646464").transparent(.7),light:V.fromHex("#646464").transparent(.7),hcDark:Pe(et,.8),hcLight:Pe(et,.8)},m(2003,"Scrollbar slider background color when hovering.")),tj=E("scrollbarSlider.activeBackground",{dark:V.fromHex("#BFBFBF").transparent(.4),light:V.fromHex("#000000").transparent(.6),hcDark:et,hcLight:et},m(2004,"Scrollbar slider background color when clicked on."));E("scrollbar.background",null,m(2005,"Scrollbar track background color."));const Goe=E("progressBar.background",{dark:V.fromHex("#0E70C0"),light:V.fromHex("#0E70C0"),hcDark:et,hcLight:et},m(2006,"Background color of the progress bar that can show for long running operations."));E("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},m(2007,"Line color for the chart."));E("chart.axis",{dark:V.fromHex("#BFBFBF").transparent(.4),light:V.fromHex("#000000").transparent(.6),hcDark:et,hcLight:et},m(2008,"Axis color for the chart."));E("chart.guide",{dark:V.fromHex("#BFBFBF").transparent(.2),light:V.fromHex("#000000").transparent(.2),hcDark:et,hcLight:et},m(2009,"Guide line for the chart."));const Ri=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:V.black,hcLight:V.white},m(1798,"Editor background color.")),nc=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:V.white,hcLight:Ke},m(1799,"Editor default foreground color."));E("editorStickyScroll.background",Ri,m(1800,"Background color of sticky scroll in the editor"));E("editorStickyScrollGutter.background",Ri,m(1801,"Background color of the gutter part of sticky scroll in the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1802,"Background color of sticky scroll on hover in the editor"));E("editorStickyScroll.border",{dark:null,light:null,hcDark:et,hcLight:et},m(1803,"Border color of sticky scroll in the editor"));E("editorStickyScroll.shadow",TD,m(1804," Shadow color of sticky scroll in the editor"));const tr=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:V.white},m(1805,"Background color of editor widgets, such as find/replace.")),RD=E("editorWidget.foreground",Ke,m(1806,"Foreground color of editor widgets, such as find/replace.")),G4=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:et,hcLight:et},m(1807,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));E("editorWidget.resizeBorder",null,m(1808,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));E("editorError.background",null,m(1809,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const MD=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m(1810,"Foreground color of error squigglies in the editor.")),Zoe=E("editorError.border",{dark:null,light:null,hcDark:V.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m(1811,"If set, color of double underlines for errors in the editor.")),Yoe=E("editorWarning.background",null,m(1812,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),vd=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m(1813,"Foreground color of warning squigglies in the editor.")),Sv=E("editorWarning.border",{dark:null,light:null,hcDark:V.fromHex("#FFCC00").transparent(.8),hcLight:V.fromHex("#FFCC00").transparent(.8)},m(1814,"If set, color of double underlines for warnings in the editor."));E("editorInfo.background",null,m(1815,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Gl=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m(1816,"Foreground color of info squigglies in the editor.")),yv=E("editorInfo.border",{dark:null,light:null,hcDark:V.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m(1817,"If set, color of double underlines for infos in the editor.")),Xoe=E("editorHint.foreground",{dark:V.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m(1818,"Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:V.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m(1819,"If set, color of double underlines for hints in the editor."));const Qoe=E("editorLink.activeForeground",{dark:"#4E94CE",light:V.blue,hcDark:V.cyan,hcLight:"#292929"},m(1820,"Color of active links.")),fh=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m(1821,"Color of the editor selection.")),Joe=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:V.white},m(1822,"Color of the selected text for high contrast.")),ij=E("editor.inactiveSelectionBackground",{light:Pe(fh,.5),dark:Pe(fh,.5),hcDark:Pe(fh,.7),hcLight:Pe(fh,.5)},m(1823,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Z4=E("editor.selectionHighlightBackground",{light:d9(fh,Ri,.3,.6),dark:d9(fh,Ri,.3,.6),hcDark:null,hcLight:null},m(1824,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:ti,hcLight:ti},m(1825,"Border color for regions with the same content as the selection."));E("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},m(1826,"The border color for an IME composition."));E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m(1827,"Color of the current search match."));const ere=E("editor.findMatchForeground",null,m(1828,"Text color of the current search match.")),Yc=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m(1829,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),tre=E("editor.findMatchHighlightForeground",null,m(1830,"Foreground color of the other search matches."),!0);E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m(1831,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.findMatchBorder",{light:null,dark:null,hcDark:ti,hcLight:ti},m(1832,"Border color of the current search match."));const ph=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:ti,hcLight:ti},m(1833,"Border color of the other search matches.")),ire=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Pe(ti,.4),hcLight:Pe(ti,.4)},m(1834,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m(1835,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const $y=E("editorHoverWidget.background",tr,m(1836,"Background color of the editor hover.")),u9=E("editorHoverWidget.foreground",RD,m(1837,"Foreground color of the editor hover.")),Y4=E("editorHoverWidget.border",G4,m(1838,"Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:ja($y,.2),light:to($y,.05),hcDark:tr,hcLight:tr},m(1839,"Background color of the editor hover status bar."));const X4=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:V.white,hcLight:V.black},m(1840,"Foreground color of inline hints")),Q4=E("editorInlayHint.background",{dark:Pe(R0,.1),light:Pe(R0,.1),hcDark:Pe(V.white,.1),hcLight:Pe(R0,.1)},m(1841,"Background color of inline hints")),nre=E("editorInlayHint.typeForeground",X4,m(1842,"Foreground color of inline hints for types")),sre=E("editorInlayHint.typeBackground",Q4,m(1843,"Background color of inline hints for types")),ore=E("editorInlayHint.parameterForeground",X4,m(1844,"Foreground color of inline hints for parameters")),rre=E("editorInlayHint.parameterBackground",Q4,m(1845,"Background color of inline hints for parameters")),are=E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m(1846,"The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1847,"The color used for the lightbulb auto fix actions icon."));E("editorLightBulbAi.foreground",are,m(1848,"The color used for the lightbulb AI icon."));E("editor.snippetTabstopHighlightBackground",{dark:new V(new j(124,124,124,.3)),light:new V(new j(10,50,100,.2)),hcDark:new V(new j(124,124,124,.3)),hcLight:new V(new j(10,50,100,.2))},m(1849,"Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",null,m(1850,"Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",null,m(1851,"Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new V(new j(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m(1852,"Highlight border color of the final tabstop of a snippet."));const NT=new V(new j(155,185,85,.2)),TT=new V(new j(255,0,0,.2)),fg=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m(1853,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),mh=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m(1854,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),J1=E("diffEditor.insertedLineBackground",{dark:NT,light:NT,hcDark:null,hcLight:null},m(1855,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:TT,light:TT,hcDark:null,hcLight:null},m(1856,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",null,m(1857,"Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",null,m(1858,"Background color for the margin where lines got removed."));const lre=E("diffEditorOverview.insertedForeground",null,m(1859,"Diff overview ruler foreground for inserted content.")),cre=E("diffEditorOverview.removedForeground",null,m(1860,"Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m(1861,"Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m(1862,"Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:et,hcLight:et},m(1863,"Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m(1864,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground","sideBar.background",m(1865,"The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground","foreground",m(1866,"The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m(1867,"The background color of unchanged code in the diff editor."));const B_=E("widget.shadow",{dark:Pe(V.black,.36),light:Pe(V.black,.16),hcDark:null,hcLight:null},m(1868,"Shadow color of widgets such as find/replace inside the editor.")),J4=E("widget.border",{dark:null,light:null,hcDark:et,hcLight:et},m(1869,"Border color of widgets such as find/replace inside the editor.")),g9=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m(1870,"Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:ti,hcLight:ti},m(1871,"Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:ja(g9,.1),light:to(g9,.1),hcDark:null,hcLight:null},m(1872,"Toolbar background when holding the mouse over actions"));const dre=E("breadcrumb.foreground",Pe(Ke,.8),m(1873,"Color of focused breadcrumb items.")),hre=E("breadcrumb.background",Ri,m(1874,"Background color of breadcrumb items.")),f9=E("breadcrumb.focusForeground",{light:to(Ke,.2),dark:ja(Ke,.1),hcDark:ja(Ke,.1),hcLight:ja(Ke,.1)},m(1875,"Color of focused breadcrumb items.")),ure=E("breadcrumb.activeSelectionForeground",{light:to(Ke,.2),dark:ja(Ke,.1),hcDark:ja(Ke,.1),hcLight:ja(Ke,.1)},m(1876,"Color of selected breadcrumb items."));E("breadcrumbPicker.background",tr,m(1877,"Background color of breadcrumb item picker."));const nj=.5,p9=V.fromHex("#40C8AE").transparent(nj),m9=V.fromHex("#40A6FF").transparent(nj),_9=V.fromHex("#606060").transparent(.4),eF=.4,Gm=1,RT=E("merge.currentHeaderBackground",{dark:p9,light:p9,hcDark:null,hcLight:null},m(1878,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",Pe(RT,eF),m(1879,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const MT=E("merge.incomingHeaderBackground",{dark:m9,light:m9,hcDark:null,hcLight:null},m(1880,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",Pe(MT,eF),m(1881,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const PT=E("merge.commonHeaderBackground",{dark:_9,light:_9,hcDark:null,hcLight:null},m(1882,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",Pe(PT,eF),m(1883,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Zm=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m(1884,"Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:Pe(RT,Gm),light:Pe(RT,Gm),hcDark:Zm,hcLight:Zm},m(1885,"Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:Pe(MT,Gm),light:Pe(MT,Gm),hcDark:Zm,hcLight:Zm},m(1886,"Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:Pe(PT,Gm),light:Pe(PT,Gm),hcDark:Zm,hcLight:Zm},m(1887,"Common ancestor overview ruler foreground for inline merge-conflicts."));const KI=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},m(1888,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),sj=E("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",m(1889,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gre=E("problemsErrorIcon.foreground",MD,m(1890,"The color used for the problems error icon.")),fre=E("problemsWarningIcon.foreground",vd,m(1891,"The color used for the problems warning icon.")),pre=E("problemsInfoIcon.foreground",Gl,m(1892,"The color used for the problems info icon.")),AT=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m(1983,"Minimap marker color for find matches."),!0),PD=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m(1984,"Minimap marker color for repeating editor selections."),!0),b9=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m(1985,"Minimap marker color for the editor selection."),!0),mre=E("minimap.infoHighlight",{dark:Gl,light:Gl,hcDark:yv,hcLight:yv},m(1986,"Minimap marker color for infos.")),_re=E("minimap.warningHighlight",{dark:vd,light:vd,hcDark:Sv,hcLight:Sv},m(1987,"Minimap marker color for warnings.")),bre=E("minimap.errorHighlight",{dark:new V(new j(255,18,18,.7)),light:new V(new j(255,18,18,.7)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(1988,"Minimap marker color for errors.")),Cre=E("minimap.background",null,m(1989,"Minimap background color.")),vre=E("minimap.foregroundOpacity",V.fromHex("#000f"),m(1990,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",Pe(J$,.5),m(1991,"Minimap slider background color."));E("minimapSlider.hoverBackground",Pe(ej,.5),m(1992,"Minimap slider background color when hovering."));E("minimapSlider.activeBackground",Pe(tj,.5),m(1993,"Minimap slider background color when clicked on."));E("charts.foreground",Ke,m(1790,"The foreground color used in charts."));E("charts.lines",Pe(Ke,.5),m(1791,"The color used for horizontal lines in charts."));E("charts.red",MD,m(1792,"The red color used in chart visualizations."));E("charts.blue",Gl,m(1793,"The blue color used in chart visualizations."));E("charts.yellow",vd,m(1794,"The yellow color used in chart visualizations."));E("charts.orange",AT,m(1795,"The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m(1796,"The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1797,"The purple color used in chart visualizations."));const OT=E("input.background",{dark:"#3C3C3C",light:V.white,hcDark:V.black,hcLight:V.white},m(1893,"Input box background.")),oj=E("input.foreground",Ke,m(1894,"Input box foreground.")),rj=E("input.border",{dark:null,light:null,hcDark:et,hcLight:et},m(1895,"Input box border.")),t1=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:et,hcLight:et},m(1896,"Border color of activated options in input fields.")),wre=E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m(1897,"Background color of activated options in input fields.")),H_=E("inputOption.activeBackground",{dark:Pe(Kl,.4),light:Pe(Kl,.2),hcDark:V.transparent,hcLight:V.transparent},m(1898,"Background hover color of options in input fields.")),i1=E("inputOption.activeForeground",{dark:V.white,light:V.black,hcDark:Ke,hcLight:Ke},m(1899,"Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:Pe(Ke,.5),dark:Pe(Ke,.5),hcDark:Pe(Ke,.7),hcLight:Pe(Ke,.7)},m(1900,"Input box foreground color for placeholder text."));const Sre=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:V.black,hcLight:V.white},m(1901,"Input validation background color for information severity.")),yre=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},m(1902,"Input validation foreground color for information severity.")),Lre=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:et,hcLight:et},m(1903,"Input validation border color for information severity.")),xre=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:V.black,hcLight:V.white},m(1904,"Input validation background color for warning severity.")),Dre=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},m(1905,"Input validation foreground color for warning severity.")),kre=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:et,hcLight:et},m(1906,"Input validation border color for warning severity.")),Ire=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:V.black,hcLight:V.white},m(1907,"Input validation background color for error severity.")),Ere=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},m(1908,"Input validation foreground color for error severity.")),Nre=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:et,hcLight:et},m(1909,"Input validation border color for error severity.")),AD=E("dropdown.background",{dark:"#3C3C3C",light:V.white,hcDark:V.black,hcLight:V.white},m(1910,"Dropdown background.")),Tre=E("dropdown.listBackground",{dark:null,light:null,hcDark:V.black,hcLight:V.white},m(1911,"Dropdown list background.")),tF=E("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:V.white,hcLight:Ke},m(1912,"Dropdown foreground.")),iF=E("dropdown.border",{dark:AD,light:"#CECECE",hcDark:et,hcLight:et},m(1913,"Dropdown border.")),OD=E("button.foreground",V.white,m(1914,"Button foreground color.")),Rre=E("button.separator",Pe(OD,.4),m(1915,"Button separator color.")),pg=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:V.black,hcLight:"#0F4A85"},m(1916,"Button background color.")),Mre=E("button.hoverBackground",{dark:ja(pg,.2),light:to(pg,.2),hcDark:pg,hcLight:pg},m(1917,"Button background color when hovering.")),Pre=E("button.border",et,m(1918,"Button border color.")),aj=E("button.secondaryForeground",{dark:V.white,light:V.white,hcDark:V.white,hcLight:Ke},m(1919,"Secondary button foreground color.")),jy=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:V.white},m(1920,"Secondary button background color.")),Are=E("button.secondaryHoverBackground",{dark:ja(jy,.2),light:to(jy,.2),hcDark:null,hcLight:null},m(1921,"Secondary button background color when hovering.")),zb=E("radio.activeForeground",i1,m(1922,"Foreground color of active radio option.")),Ore=E("radio.activeBackground",H_,m(1923,"Background color of active radio option.")),Fre=E("radio.activeBorder",t1,m(1924,"Border color of the active radio option.")),Wre=E("radio.inactiveForeground",null,m(1925,"Foreground color of inactive radio option.")),Bre=E("radio.inactiveBackground",null,m(1926,"Background color of inactive radio option.")),Hre=E("radio.inactiveBorder",{light:Pe(zb,.2),dark:Pe(zb,.2),hcDark:Pe(zb,.4),hcLight:Pe(zb,.2)},m(1927,"Border color of the inactive radio option.")),Vre=E("radio.inactiveHoverBackground",wre,m(1928,"Background color of inactive active radio option when hovering.")),nF=E("checkbox.background",AD,m(1929,"Background color of checkbox widget."));E("checkbox.selectBackground",tr,m(1930,"Background color of checkbox widget when the element it's in is selected."));const sF=E("checkbox.foreground",tF,m(1931,"Foreground color of checkbox widget.")),zre=E("checkbox.border",iF,m(1932,"Border color of checkbox widget."));E("checkbox.selectBorder",Uy,m(1933,"Border color of checkbox widget when the element it's in is selected."));const Ure=E("checkbox.disabled.background",{op:7,color:nF,with:sF,ratio:.33},m(1934,"Background of a disabled checkbox.")),$re=E("checkbox.disabled.foreground",{op:7,color:sF,with:nF,ratio:.33},m(1935,"Foreground of a disabled checkbox.")),jre=E("keybindingLabel.background",{dark:new V(new j(128,128,128,.17)),light:new V(new j(221,221,221,.4)),hcDark:V.transparent,hcLight:V.transparent},m(1936,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),qre=E("keybindingLabel.foreground",{dark:V.fromHex("#CCCCCC"),light:V.fromHex("#555555"),hcDark:V.white,hcLight:Ke},m(1937,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Kre=E("keybindingLabel.border",{dark:new V(new j(51,51,51,.6)),light:new V(new j(204,204,204,.4)),hcDark:new V(new j(111,195,223)),hcLight:et},m(1938,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Gre=E("keybindingLabel.bottomBorder",{dark:new V(new j(68,68,68,.6)),light:new V(new j(187,187,187,.4)),hcDark:new V(new j(111,195,223)),hcLight:Ke},m(1939,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Zre=E("list.focusBackground",null,m(1940,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Yre=E("list.focusForeground",null,m(1941,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Xre=E("list.focusOutline",{dark:Kl,light:Kl,hcDark:ti,hcLight:ti},m(1942,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Qre=E("list.focusAndSelectionOutline",null,m(1943,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Qg=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1944,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Lv=E("list.activeSelectionForeground",{dark:V.white,light:V.white,hcDark:null,hcLight:null},m(1945,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),lj=E("list.activeSelectionIconForeground",null,m(1946,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Jre=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1947,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),eae=E("list.inactiveSelectionForeground",null,m(1948,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),tae=E("list.inactiveSelectionIconForeground",null,m(1949,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),iae=E("list.inactiveFocusBackground",null,m(1950,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),nae=E("list.inactiveFocusOutline",null,m(1951,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),cj=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:V.white.transparent(.1),hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1952,"List/Tree background when hovering over items using the mouse.")),dj=E("list.hoverForeground",null,m(1953,"List/Tree foreground when hovering over items using the mouse.")),sae=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m(1954,"List/Tree drag and drop background when moving items over other items when using the mouse.")),oae=E("list.dropBetweenBackground",{dark:Uy,light:Uy,hcDark:null,hcLight:null},m(1955,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Wp=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Kl,hcLight:Kl},m(1956,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),rae=E("list.focusHighlightForeground",{dark:Wp,light:joe(Qg,Wp,"#BBE7FF"),hcDark:Wp,hcLight:Wp},m(1957,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m(1958,"List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m(1959,"Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m(1960,"Foreground color of list items containing warnings."));const aae=E("listFilterWidget.background",{light:to(tr,0),dark:ja(tr,0),hcDark:tr,hcLight:tr},m(1961,"Background color of the type filter widget in lists and trees.")),lae=E("listFilterWidget.outline",{dark:V.transparent,light:V.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m(1962,"Outline color of the type filter widget in lists and trees.")),cae=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:et,hcLight:et},m(1963,"Outline color of the type filter widget in lists and trees, when there are no matches.")),dae=E("listFilterWidget.shadow",B_,m(1964,"Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:Yc,light:Yc,hcDark:null,hcLight:null},m(1965,"Background color of the filtered match."));E("list.filterMatchBorder",{dark:ph,light:ph,hcDark:et,hcLight:ti},m(1966,"Border color of the filtered match."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m(1967,"List/Tree foreground color for items that are deemphasized."));const hj=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m(1968,"Tree stroke color for the indentation guides.")),hae=E("tree.inactiveIndentGuidesStroke",Pe(hj,.4),m(1969,"Tree stroke color for the indentation guides that are not active.")),uae=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m(1970,"Table border color between columns.")),gae=E("tree.tableOddRowsBackground",{dark:Pe(Ke,.04),light:Pe(Ke,.04),hcDark:null,hcLight:null},m(1971,"Background color for odd table rows."));E("editorActionList.background",tr,m(1972,"Action List background color."));const fae=E("editorActionList.foreground",RD,m(1973,"Action List foreground color."));E("editorActionList.focusForeground",Lv,m(1974,"Action List foreground color for the focused item."));E("editorActionList.focusBackground",Qg,m(1975,"Action List background color for the focused item."));const pae=E("menu.border",{dark:null,light:null,hcDark:et,hcLight:et},m(1976,"Border color of menus.")),mae=E("menu.foreground",tF,m(1977,"Foreground color of menu items.")),_ae=E("menu.background",AD,m(1978,"Background color of menu items.")),bae=E("menu.selectionForeground",Lv,m(1979,"Foreground color of the selected menu item in menus.")),Cae=E("menu.selectionBackground",Qg,m(1980,"Background color of the selected menu item in menus.")),vae=E("menu.selectionBorder",{dark:null,light:null,hcDark:ti,hcLight:ti},m(1981,"Border color of the selected menu item in menus.")),wae=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:et,hcLight:et},m(1982,"Color of a separator menu item in menus.")),GI=E("quickInput.background",tr,m(2010,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Sae=E("quickInput.foreground",RD,m(2011,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),yae=E("quickInputTitle.background",{dark:new V(new j(255,255,255,.105)),light:new V(new j(0,0,0,.06)),hcDark:"#000000",hcLight:V.white},m(2012,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),uj=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:V.white,hcLight:"#0F4A85"},m(2013,"Quick picker color for grouping labels.")),Lae=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:V.white,hcLight:"#0F4A85"},m(2014,"Quick picker color for grouping borders.")),C9=E("quickInput.list.focusBackground",null,"",void 0,m(2015,"Please use quickInputList.focusBackground instead")),xv=E("quickInputList.focusForeground",Lv,m(2016,"Quick picker foreground color for the focused item.")),oF=E("quickInputList.focusIconForeground",lj,m(2017,"Quick picker icon foreground color for the focused item.")),Dv=E("quickInputList.focusBackground",{dark:wv(C9,Qg),light:wv(C9,Qg),hcDark:null,hcLight:null},m(2018,"Quick picker background color for the focused item."));E("search.resultsInfoForeground",{light:Ke,dark:Pe(Ke,.65),hcDark:Ke,hcLight:Ke},m(2019,"Color of the text in the search viewlet's completion message."));E("searchEditor.findMatchBackground",{light:Pe(Yc,.66),dark:Pe(Yc,.66),hcDark:Yc,hcLight:Yc},m(2020,"Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:Pe(ph,.66),dark:Pe(ph,.66),hcDark:ph,hcLight:ph},m(2021,"Border color of the Search Editor query matches."));class n1{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new gj(this.x-e.scrollX,this.y-e.scrollY)}}class gj{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new n1(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class xae{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Dae{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function FD(o){const e=wi(o);return new xae(e.left,e.top,e.width,e.height)}function WD(o,e,t){const i=e.width/o.offsetWidth,n=e.height/o.offsetHeight,s=(t.x-e.x)/i,r=(t.y-e.y)/n;return new Dae(s,r)}class wd extends qn{constructor(e,t,i){super(me(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new n1(this.posx,this.posy),this.editorPos=FD(i),this.relativePos=WD(i,this.editorPos,this.pos)}}class kae{constructor(e){this._editorViewDomNode=e}_create(e){return new wd(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return B(e,te.CONTEXT_MENU,i=>{t(this._create(i))})}onMouseUp(e,t){return B(e,te.MOUSE_UP,i=>{t(this._create(i))})}onMouseDown(e,t){return B(e,te.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return B(e,te.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return B(e,te.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return B(e,te.MOUSE_MOVE,i=>t(this._create(i)))}}class Iae{constructor(e){this._editorViewDomNode=e}_create(e){return new wd(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return B(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return B(e,te.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return B(e,te.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return B(e,"pointermove",i=>t(this._create(i)))}}class Eae extends F{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new W_),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=Ti(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new wd(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),s(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class BD{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++BD._idPool,this._counter=0,this._rules=new iD,this._garbageCollectionScheduler=new It(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new Nae(t,`dyn-rule-${this._instanceId}-${n}`,xy(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}}class Nae{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new z,this._styleElement=zr(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const s=t[n];let r;typeof s=="object"?r=J(s.id):r=s;const a=Tae(n);i+=` + - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}class one extends Qt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?-?)\\s*(?(?:\+|-)?\d+(\.\d+)?)\)/);if(!_)throw new Error("Invalid color format "+p);const b=parseInt(_.groups?.r??"0"),C=parseInt(_.groups?.g??"0"),w=parseInt(_.groups?.b??"0"),v=parseFloat(_.groups?.a??"0");return new o(new j(b,C,w,v))}if(p.startsWith("rgb(")){const _=p.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/);if(!_)throw new Error("Invalid color format "+p);const b=parseInt(_.groups?.r??"0"),C=parseInt(_.groups?.g??"0"),w=parseInt(_.groups?.b??"0");return new o(new j(b,C,w))}return u(p)}t.parse=h;function u(p){switch(p){case"aliceblue":return new o(new j(240,248,255,1));case"antiquewhite":return new o(new j(250,235,215,1));case"aqua":return new o(new j(0,255,255,1));case"aquamarine":return new o(new j(127,255,212,1));case"azure":return new o(new j(240,255,255,1));case"beige":return new o(new j(245,245,220,1));case"bisque":return new o(new j(255,228,196,1));case"black":return new o(new j(0,0,0,1));case"blanchedalmond":return new o(new j(255,235,205,1));case"blue":return new o(new j(0,0,255,1));case"blueviolet":return new o(new j(138,43,226,1));case"brown":return new o(new j(165,42,42,1));case"burlywood":return new o(new j(222,184,135,1));case"cadetblue":return new o(new j(95,158,160,1));case"chartreuse":return new o(new j(127,255,0,1));case"chocolate":return new o(new j(210,105,30,1));case"coral":return new o(new j(255,127,80,1));case"cornflowerblue":return new o(new j(100,149,237,1));case"cornsilk":return new o(new j(255,248,220,1));case"crimson":return new o(new j(220,20,60,1));case"cyan":return new o(new j(0,255,255,1));case"darkblue":return new o(new j(0,0,139,1));case"darkcyan":return new o(new j(0,139,139,1));case"darkgoldenrod":return new o(new j(184,134,11,1));case"darkgray":return new o(new j(169,169,169,1));case"darkgreen":return new o(new j(0,100,0,1));case"darkgrey":return new o(new j(169,169,169,1));case"darkkhaki":return new o(new j(189,183,107,1));case"darkmagenta":return new o(new j(139,0,139,1));case"darkolivegreen":return new o(new j(85,107,47,1));case"darkorange":return new o(new j(255,140,0,1));case"darkorchid":return new o(new j(153,50,204,1));case"darkred":return new o(new j(139,0,0,1));case"darksalmon":return new o(new j(233,150,122,1));case"darkseagreen":return new o(new j(143,188,143,1));case"darkslateblue":return new o(new j(72,61,139,1));case"darkslategray":return new o(new j(47,79,79,1));case"darkslategrey":return new o(new j(47,79,79,1));case"darkturquoise":return new o(new j(0,206,209,1));case"darkviolet":return new o(new j(148,0,211,1));case"deeppink":return new o(new j(255,20,147,1));case"deepskyblue":return new o(new j(0,191,255,1));case"dimgray":return new o(new j(105,105,105,1));case"dimgrey":return new o(new j(105,105,105,1));case"dodgerblue":return new o(new j(30,144,255,1));case"firebrick":return new o(new j(178,34,34,1));case"floralwhite":return new o(new j(255,250,240,1));case"forestgreen":return new o(new j(34,139,34,1));case"fuchsia":return new o(new j(255,0,255,1));case"gainsboro":return new o(new j(220,220,220,1));case"ghostwhite":return new o(new j(248,248,255,1));case"gold":return new o(new j(255,215,0,1));case"goldenrod":return new o(new j(218,165,32,1));case"gray":return new o(new j(128,128,128,1));case"green":return new o(new j(0,128,0,1));case"greenyellow":return new o(new j(173,255,47,1));case"grey":return new o(new j(128,128,128,1));case"honeydew":return new o(new j(240,255,240,1));case"hotpink":return new o(new j(255,105,180,1));case"indianred":return new o(new j(205,92,92,1));case"indigo":return new o(new j(75,0,130,1));case"ivory":return new o(new j(255,255,240,1));case"khaki":return new o(new j(240,230,140,1));case"lavender":return new o(new j(230,230,250,1));case"lavenderblush":return new o(new j(255,240,245,1));case"lawngreen":return new o(new j(124,252,0,1));case"lemonchiffon":return new o(new j(255,250,205,1));case"lightblue":return new o(new j(173,216,230,1));case"lightcoral":return new o(new j(240,128,128,1));case"lightcyan":return new o(new j(224,255,255,1));case"lightgoldenrodyellow":return new o(new j(250,250,210,1));case"lightgray":return new o(new j(211,211,211,1));case"lightgreen":return new o(new j(144,238,144,1));case"lightgrey":return new o(new j(211,211,211,1));case"lightpink":return new o(new j(255,182,193,1));case"lightsalmon":return new o(new j(255,160,122,1));case"lightseagreen":return new o(new j(32,178,170,1));case"lightskyblue":return new o(new j(135,206,250,1));case"lightslategray":return new o(new j(119,136,153,1));case"lightslategrey":return new o(new j(119,136,153,1));case"lightsteelblue":return new o(new j(176,196,222,1));case"lightyellow":return new o(new j(255,255,224,1));case"lime":return new o(new j(0,255,0,1));case"limegreen":return new o(new j(50,205,50,1));case"linen":return new o(new j(250,240,230,1));case"magenta":return new o(new j(255,0,255,1));case"maroon":return new o(new j(128,0,0,1));case"mediumaquamarine":return new o(new j(102,205,170,1));case"mediumblue":return new o(new j(0,0,205,1));case"mediumorchid":return new o(new j(186,85,211,1));case"mediumpurple":return new o(new j(147,112,219,1));case"mediumseagreen":return new o(new j(60,179,113,1));case"mediumslateblue":return new o(new j(123,104,238,1));case"mediumspringgreen":return new o(new j(0,250,154,1));case"mediumturquoise":return new o(new j(72,209,204,1));case"mediumvioletred":return new o(new j(199,21,133,1));case"midnightblue":return new o(new j(25,25,112,1));case"mintcream":return new o(new j(245,255,250,1));case"mistyrose":return new o(new j(255,228,225,1));case"moccasin":return new o(new j(255,228,181,1));case"navajowhite":return new o(new j(255,222,173,1));case"navy":return new o(new j(0,0,128,1));case"oldlace":return new o(new j(253,245,230,1));case"olive":return new o(new j(128,128,0,1));case"olivedrab":return new o(new j(107,142,35,1));case"orange":return new o(new j(255,165,0,1));case"orangered":return new o(new j(255,69,0,1));case"orchid":return new o(new j(218,112,214,1));case"palegoldenrod":return new o(new j(238,232,170,1));case"palegreen":return new o(new j(152,251,152,1));case"paleturquoise":return new o(new j(175,238,238,1));case"palevioletred":return new o(new j(219,112,147,1));case"papayawhip":return new o(new j(255,239,213,1));case"peachpuff":return new o(new j(255,218,185,1));case"peru":return new o(new j(205,133,63,1));case"pink":return new o(new j(255,192,203,1));case"plum":return new o(new j(221,160,221,1));case"powderblue":return new o(new j(176,224,230,1));case"purple":return new o(new j(128,0,128,1));case"rebeccapurple":return new o(new j(102,51,153,1));case"red":return new o(new j(255,0,0,1));case"rosybrown":return new o(new j(188,143,143,1));case"royalblue":return new o(new j(65,105,225,1));case"saddlebrown":return new o(new j(139,69,19,1));case"salmon":return new o(new j(250,128,114,1));case"sandybrown":return new o(new j(244,164,96,1));case"seagreen":return new o(new j(46,139,87,1));case"seashell":return new o(new j(255,245,238,1));case"sienna":return new o(new j(160,82,45,1));case"silver":return new o(new j(192,192,192,1));case"skyblue":return new o(new j(135,206,235,1));case"slateblue":return new o(new j(106,90,205,1));case"slategray":return new o(new j(112,128,144,1));case"slategrey":return new o(new j(112,128,144,1));case"snow":return new o(new j(255,250,250,1));case"springgreen":return new o(new j(0,255,127,1));case"steelblue":return new o(new j(70,130,180,1));case"tan":return new o(new j(210,180,140,1));case"teal":return new o(new j(0,128,128,1));case"thistle":return new o(new j(216,191,216,1));case"tomato":return new o(new j(255,99,71,1));case"turquoise":return new o(new j(64,224,208,1));case"violet":return new o(new j(238,130,238,1));case"wheat":return new o(new j(245,222,179,1));case"white":return new o(new j(255,255,255,1));case"whitesmoke":return new o(new j(245,245,245,1));case"yellow":return new o(new j(255,255,0,1));case"yellowgreen":return new o(new j(154,205,50,1));default:return null}}function g(p){const _=p.length;if(_===0||p.charCodeAt(0)!==35)return null;if(_===7){const b=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),C=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),w=16*f(p.charCodeAt(5))+f(p.charCodeAt(6));return new o(new j(b,C,w,1))}if(_===9){const b=16*f(p.charCodeAt(1))+f(p.charCodeAt(2)),C=16*f(p.charCodeAt(3))+f(p.charCodeAt(4)),w=16*f(p.charCodeAt(5))+f(p.charCodeAt(6)),v=16*f(p.charCodeAt(7))+f(p.charCodeAt(8));return new o(new j(b,C,w,v/255))}if(_===4){const b=f(p.charCodeAt(1)),C=f(p.charCodeAt(2)),w=f(p.charCodeAt(3));return new o(new j(16*b+b,16*C+C,16*w+w))}if(_===5){const b=f(p.charCodeAt(1)),C=f(p.charCodeAt(2)),w=f(p.charCodeAt(3)),v=f(p.charCodeAt(4));return new o(new j(16*b+b,16*C+C,16*w+w,(16*v+v)/255))}return null}t.parseHex=g;function f(p){switch(p){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(o.Format||(o.Format={}))})(V||(V={}));function AO(o){return`--vscode-${o.replace(/\./g,"-")}`}function Q(o){return`var(${AO(o)})`}function cU(o,e){return`var(${AO(o)}, ${e})`}function jne(o){return o!==null&&typeof o=="object"&&"light"in o&&"dark"in o}const dU={ColorContribution:"base.contributions.colors"},qne="default";class Kne extends A{constructor(){super(),this._onDidChangeSchema=this._register(new P),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};this.colorsById[e]=r;const a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(a.deprecationMessage=s),n&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=m(2022,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:qne,description:m(2023,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i?.defaults){const n=jne(i.defaults)?i.defaults[t.type]:i.defaults;return tr(n,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,s=i.indexOf(".")===-1?0:1;return n!==s?n-s:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const AL=new Kne;li.add(dU.ColorContribution,AL);function E(o,e,t,i,n){return AL.registerColor(o,e,t,i,n)}function Gne(o,e){switch(o.op){case 0:return tr(o.value,e)?.darken(o.factor);case 1:return tr(o.value,e)?.lighten(o.factor);case 2:return tr(o.value,e)?.transparent(o.factor);case 7:{const t=tr(o.color,e)||V.transparent,i=tr(o.with,e)||V.transparent;return t.mix(i,o.ratio)}case 3:{const t=tr(o.background,e);return t?tr(o.value,e)?.makeOpaque(t):tr(o.value,e)}case 4:for(const t of o.values){const i=tr(t,e);if(i)return i}return;case 6:return tr(e.defines(o.if)?o.then:o.else,e);case 5:{const t=tr(o.value,e);if(!t)return;const i=tr(o.background,e);return i?t.isDarkerThan(i)?V.getLighterColor(t,i,o.factor).transparent(o.transparency):V.getDarkerColor(t,i,o.factor).transparent(o.transparency):t.transparent(o.factor*o.transparency)}default:throw ow()}}function $s(o,e){return{op:0,value:o,factor:e}}function Ea(o,e){return{op:1,value:o,factor:e}}function Re(o,e){return{op:2,value:o,factor:e}}function FC(...o){return{op:4,values:o}}function Zne(o,e,t){return{op:6,if:o,then:e,else:t}}function M7(o,e,t,i){return{op:5,value:o,background:e,factor:t,transparency:i}}function tr(o,e){if(o!==null){if(typeof o=="string")return o[0]==="#"?V.fromHex(o):e.getColor(o);if(o instanceof V)return o;if(typeof o=="object")return Gne(o,e)}}const hU="vscode://schemas/workbench-colors",uU=li.as(TL.JSONContribution);uU.registerSchema(hU,AL.getColorSchema());const P7=new St(()=>uU.notifySchemaChanged(hU),200);AL.onDidChangeSchema(()=>{P7.isScheduled()||P7.schedule()});const Ue=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m(1773,"Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m(1774,"Overall foreground for disabled elements. This color is only used if not overridden by a component."));E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m(1775,"Overall foreground color for error messages. This color is only used if not overridden by a component."));const gU=E("descriptionForeground",{light:"#717171",dark:Re(Ue,.7),hcDark:Re(Ue,.7),hcLight:Re(Ue,.7)},m(1776,"Foreground color for description text providing additional information, for example for a label.")),G0=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m(1777,"The default color for icons in the workbench.")),Nl=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m(1778,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Ge=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m(1779,"An extra border around elements to separate them from others for greater contrast.")),Gt=E("contrastActiveBorder",{light:null,dark:null,hcDark:Nl,hcLight:Nl},m(1780,"An extra border around active elements to separate them from others for greater contrast."));E("selection.background",null,m(1781,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const Yne=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m(1782,"Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m(1783,"Foreground color for links in text when clicked on and on mouse hover."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:V.black,hcLight:"#292929"},m(1784,"Color for text separators."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},m(1785,"Foreground color for preformatted text segments."));E("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},m(1786,"Background color for preformatted text segments."));E("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},m(1787,"Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:V.white,hcLight:"#292929"},m(1788,"Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:V.black,hcLight:"#F2F2F2"},m(1789,"Background color for code blocks in text."));E("sash.hoverBorder",Nl,m(1994,"Border color of active sashes."));const WS=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:V.black,hcLight:"#0F4A85"},m(1995,"Badge background color. Badges are small information labels, e.g. for search results count.")),Xne=E("badge.foreground",{dark:V.white,light:"#333",hcDark:V.white,hcLight:V.white},m(1996,"Badge foreground color. Badges are small information labels, e.g. for search results count."));E("activityWarningBadge.foreground",{dark:V.black.lighten(.2),light:V.white,hcDark:null,hcLight:V.black.lighten(.2)},m(1997,"Foreground color of the warning activity badge"));E("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},m(1998,"Background color of the warning activity badge"));E("activityErrorBadge.foreground",{dark:V.black.lighten(.2),light:V.white,hcDark:null,hcLight:V.black.lighten(.2)},m(1999,"Foreground color of the error activity badge"));E("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},m(2e3,"Background color of the error activity badge"));const OL=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m(2001,"Scrollbar shadow to indicate that the view is scrolled.")),fU=E("scrollbarSlider.background",{dark:V.fromHex("#797979").transparent(.4),light:V.fromHex("#646464").transparent(.4),hcDark:Re(Ge,.6),hcLight:Re(Ge,.4)},m(2002,"Scrollbar slider background color.")),pU=E("scrollbarSlider.hoverBackground",{dark:V.fromHex("#646464").transparent(.7),light:V.fromHex("#646464").transparent(.7),hcDark:Re(Ge,.8),hcLight:Re(Ge,.8)},m(2003,"Scrollbar slider background color when hovering.")),mU=E("scrollbarSlider.activeBackground",{dark:V.fromHex("#BFBFBF").transparent(.4),light:V.fromHex("#000000").transparent(.6),hcDark:Ge,hcLight:Ge},m(2004,"Scrollbar slider background color when clicked on."));E("scrollbar.background",null,m(2005,"Scrollbar track background color."));const Qne=E("progressBar.background",{dark:V.fromHex("#0E70C0"),light:V.fromHex("#0E70C0"),hcDark:Ge,hcLight:Ge},m(2006,"Background color of the progress bar that can show for long running operations."));E("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},m(2007,"Line color for the chart."));E("chart.axis",{dark:V.fromHex("#BFBFBF").transparent(.4),light:V.fromHex("#000000").transparent(.6),hcDark:Ge,hcLight:Ge},m(2008,"Axis color for the chart."));E("chart.guide",{dark:V.fromHex("#BFBFBF").transparent(.2),light:V.fromHex("#000000").transparent(.2),hcDark:Ge,hcLight:Ge},m(2009,"Guide line for the chart."));const ki=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:V.black,hcLight:V.white},m(1798,"Editor background color.")),Hl=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:V.white,hcLight:Ue},m(1799,"Editor default foreground color."));E("editorStickyScroll.background",ki,m(1800,"Background color of sticky scroll in the editor"));E("editorStickyScrollGutter.background",ki,m(1801,"Background color of the gutter part of sticky scroll in the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1802,"Background color of sticky scroll on hover in the editor"));E("editorStickyScroll.border",{dark:null,light:null,hcDark:Ge,hcLight:Ge},m(1803,"Border color of sticky scroll in the editor"));E("editorStickyScroll.shadow",OL,m(1804," Shadow color of sticky scroll in the editor"));const Vo=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:V.white},m(1805,"Background color of editor widgets, such as find/replace.")),FL=E("editorWidget.foreground",Ue,m(1806,"Foreground color of editor widgets, such as find/replace.")),OO=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ge,hcLight:Ge},m(1807,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));E("editorWidget.resizeBorder",null,m(1808,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));E("editorError.background",null,m(1809,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const WL=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m(1810,"Foreground color of error squigglies in the editor.")),Jne=E("editorError.border",{dark:null,light:null,hcDark:V.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m(1811,"If set, color of double underlines for errors in the editor.")),ese=E("editorWarning.background",null,m(1812,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Jc=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m(1813,"Foreground color of warning squigglies in the editor.")),WC=E("editorWarning.border",{dark:null,light:null,hcDark:V.fromHex("#FFCC00").transparent(.8),hcLight:V.fromHex("#FFCC00").transparent(.8)},m(1814,"If set, color of double underlines for warnings in the editor."));E("editorInfo.background",null,m(1815,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Tl=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m(1816,"Foreground color of info squigglies in the editor.")),BC=E("editorInfo.border",{dark:null,light:null,hcDark:V.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m(1817,"If set, color of double underlines for infos in the editor.")),tse=E("editorHint.foreground",{dark:V.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m(1818,"Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:V.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m(1819,"If set, color of double underlines for hints in the editor."));const ise=E("editorLink.activeForeground",{dark:"#4E94CE",light:V.blue,hcDark:V.cyan,hcLight:"#292929"},m(1820,"Color of active links.")),Kd=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m(1821,"Color of the editor selection.")),nse=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:V.white},m(1822,"Color of the selected text for high contrast.")),_U=E("editor.inactiveSelectionBackground",{light:Re(Kd,.5),dark:Re(Kd,.5),hcDark:Re(Kd,.7),hcLight:Re(Kd,.5)},m(1823,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),FO=E("editor.selectionHighlightBackground",{light:M7(Kd,ki,.3,.6),dark:M7(Kd,ki,.3,.6),hcDark:null,hcLight:null},m(1824,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m(1825,"Border color for regions with the same content as the selection."));E("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},m(1826,"The border color for an IME composition."));E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m(1827,"Color of the current search match."));const sse=E("editor.findMatchForeground",null,m(1828,"Text color of the current search match.")),Ec=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m(1829,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),ose=E("editor.findMatchHighlightForeground",null,m(1830,"Foreground color of the other search matches."),!0);E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m(1831,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.findMatchBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m(1832,"Border color of the current search match."));const Gd=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m(1833,"Border color of the other search matches.")),rse=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Re(Gt,.4),hcLight:Re(Gt,.4)},m(1834,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m(1835,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const Z0=E("editorHoverWidget.background",Vo,m(1836,"Background color of the editor hover.")),A7=E("editorHoverWidget.foreground",FL,m(1837,"Foreground color of the editor hover.")),WO=E("editorHoverWidget.border",OO,m(1838,"Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:Ea(Z0,.2),light:$s(Z0,.05),hcDark:Vo,hcLight:Vo},m(1839,"Background color of the editor hover status bar."));const BO=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:V.white,hcLight:V.black},m(1840,"Foreground color of inline hints")),HO=E("editorInlayHint.background",{dark:Re(WS,.1),light:Re(WS,.1),hcDark:Re(V.white,.1),hcLight:Re(WS,.1)},m(1841,"Background color of inline hints")),ase=E("editorInlayHint.typeForeground",BO,m(1842,"Foreground color of inline hints for types")),lse=E("editorInlayHint.typeBackground",HO,m(1843,"Background color of inline hints for types")),cse=E("editorInlayHint.parameterForeground",BO,m(1844,"Foreground color of inline hints for parameters")),dse=E("editorInlayHint.parameterBackground",HO,m(1845,"Background color of inline hints for parameters")),hse=E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m(1846,"The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1847,"The color used for the lightbulb auto fix actions icon."));E("editorLightBulbAi.foreground",hse,m(1848,"The color used for the lightbulb AI icon."));E("editor.snippetTabstopHighlightBackground",{dark:new V(new j(124,124,124,.3)),light:new V(new j(10,50,100,.2)),hcDark:new V(new j(124,124,124,.3)),hcLight:new V(new j(10,50,100,.2))},m(1849,"Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",null,m(1850,"Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",null,m(1851,"Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new V(new j(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m(1852,"Highlight border color of the final tabstop of a snippet."));const vN=new V(new j(155,185,85,.2)),wN=new V(new j(255,0,0,.2)),ju=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m(1853,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Zd=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m(1854,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),a1=E("diffEditor.insertedLineBackground",{dark:vN,light:vN,hcDark:null,hcLight:null},m(1855,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:wN,light:wN,hcDark:null,hcLight:null},m(1856,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",null,m(1857,"Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",null,m(1858,"Background color for the margin where lines got removed."));const use=E("diffEditorOverview.insertedForeground",null,m(1859,"Diff overview ruler foreground for inserted content.")),gse=E("diffEditorOverview.removedForeground",null,m(1860,"Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m(1861,"Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m(1862,"Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:Ge,hcLight:Ge},m(1863,"Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m(1864,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground","sideBar.background",m(1865,"The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground","foreground",m(1866,"The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m(1867,"The background color of unchanged code in the diff editor."));const c_=E("widget.shadow",{dark:Re(V.black,.36),light:Re(V.black,.16),hcDark:null,hcLight:null},m(1868,"Shadow color of widgets such as find/replace inside the editor.")),VO=E("widget.border",{dark:null,light:null,hcDark:Ge,hcLight:Ge},m(1869,"Border color of widgets such as find/replace inside the editor.")),O7=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m(1870,"Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m(1871,"Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:Ea(O7,.1),light:$s(O7,.1),hcDark:null,hcLight:null},m(1872,"Toolbar background when holding the mouse over actions"));const fse=E("breadcrumb.foreground",Re(Ue,.8),m(1873,"Color of focused breadcrumb items.")),pse=E("breadcrumb.background",ki,m(1874,"Background color of breadcrumb items.")),F7=E("breadcrumb.focusForeground",{light:$s(Ue,.2),dark:Ea(Ue,.1),hcDark:Ea(Ue,.1),hcLight:Ea(Ue,.1)},m(1875,"Color of focused breadcrumb items.")),mse=E("breadcrumb.activeSelectionForeground",{light:$s(Ue,.2),dark:Ea(Ue,.1),hcDark:Ea(Ue,.1),hcLight:Ea(Ue,.1)},m(1876,"Color of selected breadcrumb items."));E("breadcrumbPicker.background",Vo,m(1877,"Background color of breadcrumb item picker."));const bU=.5,W7=V.fromHex("#40C8AE").transparent(bU),B7=V.fromHex("#40A6FF").transparent(bU),H7=V.fromHex("#606060").transparent(.4),zO=.4,bm=1,SN=E("merge.currentHeaderBackground",{dark:W7,light:W7,hcDark:null,hcLight:null},m(1878,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",Re(SN,zO),m(1879,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const yN=E("merge.incomingHeaderBackground",{dark:B7,light:B7,hcDark:null,hcLight:null},m(1880,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",Re(yN,zO),m(1881,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const xN=E("merge.commonHeaderBackground",{dark:H7,light:H7,hcDark:null,hcLight:null},m(1882,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",Re(xN,zO),m(1883,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Cm=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m(1884,"Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:Re(SN,bm),light:Re(SN,bm),hcDark:Cm,hcLight:Cm},m(1885,"Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:Re(yN,bm),light:Re(yN,bm),hcDark:Cm,hcLight:Cm},m(1886,"Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:Re(xN,bm),light:Re(xN,bm),hcDark:Cm,hcLight:Cm},m(1887,"Common ancestor overview ruler foreground for inline merge-conflicts."));const UD=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},m(1888,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),CU=E("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",m(1889,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),_se=E("problemsErrorIcon.foreground",WL,m(1890,"The color used for the problems error icon.")),bse=E("problemsWarningIcon.foreground",Jc,m(1891,"The color used for the problems warning icon.")),Cse=E("problemsInfoIcon.foreground",Tl,m(1892,"The color used for the problems info icon.")),LN=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m(1983,"Minimap marker color for find matches."),!0),BL=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m(1984,"Minimap marker color for repeating editor selections."),!0),V7=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m(1985,"Minimap marker color for the editor selection."),!0),vse=E("minimap.infoHighlight",{dark:Tl,light:Tl,hcDark:BC,hcLight:BC},m(1986,"Minimap marker color for infos.")),wse=E("minimap.warningHighlight",{dark:Jc,light:Jc,hcDark:WC,hcLight:WC},m(1987,"Minimap marker color for warnings.")),Sse=E("minimap.errorHighlight",{dark:new V(new j(255,18,18,.7)),light:new V(new j(255,18,18,.7)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(1988,"Minimap marker color for errors.")),yse=E("minimap.background",null,m(1989,"Minimap background color.")),xse=E("minimap.foregroundOpacity",V.fromHex("#000f"),m(1990,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",Re(fU,.5),m(1991,"Minimap slider background color."));E("minimapSlider.hoverBackground",Re(pU,.5),m(1992,"Minimap slider background color when hovering."));E("minimapSlider.activeBackground",Re(mU,.5),m(1993,"Minimap slider background color when clicked on."));E("charts.foreground",Ue,m(1790,"The foreground color used in charts."));E("charts.lines",Re(Ue,.5),m(1791,"The color used for horizontal lines in charts."));E("charts.red",WL,m(1792,"The red color used in chart visualizations."));E("charts.blue",Tl,m(1793,"The blue color used in chart visualizations."));E("charts.yellow",Jc,m(1794,"The yellow color used in chart visualizations."));E("charts.orange",LN,m(1795,"The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m(1796,"The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1797,"The purple color used in chart visualizations."));const kN=E("input.background",{dark:"#3C3C3C",light:V.white,hcDark:V.black,hcLight:V.white},m(1893,"Input box background.")),vU=E("input.foreground",Ue,m(1894,"Input box foreground.")),wU=E("input.border",{dark:null,light:null,hcDark:Ge,hcLight:Ge},m(1895,"Input box border.")),_w=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ge,hcLight:Ge},m(1896,"Border color of activated options in input fields.")),Lse=E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m(1897,"Background color of activated options in input fields.")),d_=E("inputOption.activeBackground",{dark:Re(Nl,.4),light:Re(Nl,.2),hcDark:V.transparent,hcLight:V.transparent},m(1898,"Background hover color of options in input fields.")),bw=E("inputOption.activeForeground",{dark:V.white,light:V.black,hcDark:Ue,hcLight:Ue},m(1899,"Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:Re(Ue,.5),dark:Re(Ue,.5),hcDark:Re(Ue,.7),hcLight:Re(Ue,.7)},m(1900,"Input box foreground color for placeholder text."));const kse=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:V.black,hcLight:V.white},m(1901,"Input validation background color for information severity.")),Dse=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ue},m(1902,"Input validation foreground color for information severity.")),Ise=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ge,hcLight:Ge},m(1903,"Input validation border color for information severity.")),Ese=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:V.black,hcLight:V.white},m(1904,"Input validation background color for warning severity.")),Nse=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ue},m(1905,"Input validation foreground color for warning severity.")),Tse=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ge,hcLight:Ge},m(1906,"Input validation border color for warning severity.")),Rse=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:V.black,hcLight:V.white},m(1907,"Input validation background color for error severity.")),Mse=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ue},m(1908,"Input validation foreground color for error severity.")),Pse=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ge,hcLight:Ge},m(1909,"Input validation border color for error severity.")),HL=E("dropdown.background",{dark:"#3C3C3C",light:V.white,hcDark:V.black,hcLight:V.white},m(1910,"Dropdown background.")),Ase=E("dropdown.listBackground",{dark:null,light:null,hcDark:V.black,hcLight:V.white},m(1911,"Dropdown list background.")),UO=E("dropdown.foreground",{dark:"#F0F0F0",light:Ue,hcDark:V.white,hcLight:Ue},m(1912,"Dropdown foreground.")),$O=E("dropdown.border",{dark:HL,light:"#CECECE",hcDark:Ge,hcLight:Ge},m(1913,"Dropdown border.")),VL=E("button.foreground",V.white,m(1914,"Button foreground color.")),Ose=E("button.separator",Re(VL,.4),m(1915,"Button separator color.")),qu=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:V.black,hcLight:"#0F4A85"},m(1916,"Button background color.")),Fse=E("button.hoverBackground",{dark:Ea(qu,.2),light:$s(qu,.2),hcDark:qu,hcLight:qu},m(1917,"Button background color when hovering.")),Wse=E("button.border",Ge,m(1918,"Button border color.")),SU=E("button.secondaryForeground",{dark:V.white,light:V.white,hcDark:V.white,hcLight:Ue},m(1919,"Secondary button foreground color.")),Y0=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:V.white},m(1920,"Secondary button background color.")),Bse=E("button.secondaryHoverBackground",{dark:Ea(Y0,.2),light:$s(Y0,.2),hcDark:null,hcLight:null},m(1921,"Secondary button background color when hovering.")),sb=E("radio.activeForeground",bw,m(1922,"Foreground color of active radio option.")),Hse=E("radio.activeBackground",d_,m(1923,"Background color of active radio option.")),Vse=E("radio.activeBorder",_w,m(1924,"Border color of the active radio option.")),zse=E("radio.inactiveForeground",null,m(1925,"Foreground color of inactive radio option.")),Use=E("radio.inactiveBackground",null,m(1926,"Background color of inactive radio option.")),$se=E("radio.inactiveBorder",{light:Re(sb,.2),dark:Re(sb,.2),hcDark:Re(sb,.4),hcLight:Re(sb,.2)},m(1927,"Border color of the inactive radio option.")),jse=E("radio.inactiveHoverBackground",Lse,m(1928,"Background color of inactive active radio option when hovering.")),jO=E("checkbox.background",HL,m(1929,"Background color of checkbox widget."));E("checkbox.selectBackground",Vo,m(1930,"Background color of checkbox widget when the element it's in is selected."));const qO=E("checkbox.foreground",UO,m(1931,"Foreground color of checkbox widget.")),qse=E("checkbox.border",$O,m(1932,"Border color of checkbox widget."));E("checkbox.selectBorder",G0,m(1933,"Border color of checkbox widget when the element it's in is selected."));const Kse=E("checkbox.disabled.background",{op:7,color:jO,with:qO,ratio:.33},m(1934,"Background of a disabled checkbox.")),Gse=E("checkbox.disabled.foreground",{op:7,color:qO,with:jO,ratio:.33},m(1935,"Foreground of a disabled checkbox.")),Zse=E("keybindingLabel.background",{dark:new V(new j(128,128,128,.17)),light:new V(new j(221,221,221,.4)),hcDark:V.transparent,hcLight:V.transparent},m(1936,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Yse=E("keybindingLabel.foreground",{dark:V.fromHex("#CCCCCC"),light:V.fromHex("#555555"),hcDark:V.white,hcLight:Ue},m(1937,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Xse=E("keybindingLabel.border",{dark:new V(new j(51,51,51,.6)),light:new V(new j(204,204,204,.4)),hcDark:new V(new j(111,195,223)),hcLight:Ge},m(1938,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Qse=E("keybindingLabel.bottomBorder",{dark:new V(new j(68,68,68,.6)),light:new V(new j(187,187,187,.4)),hcDark:new V(new j(111,195,223)),hcLight:Ue},m(1939,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Jse=E("list.focusBackground",null,m(1940,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),eoe=E("list.focusForeground",null,m(1941,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),toe=E("list.focusOutline",{dark:Nl,light:Nl,hcDark:Gt,hcLight:Gt},m(1942,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ioe=E("list.focusAndSelectionOutline",null,m(1943,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Eg=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1944,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),HC=E("list.activeSelectionForeground",{dark:V.white,light:V.white,hcDark:null,hcLight:null},m(1945,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yU=E("list.activeSelectionIconForeground",null,m(1946,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),noe=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1947,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),soe=E("list.inactiveSelectionForeground",null,m(1948,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),ooe=E("list.inactiveSelectionIconForeground",null,m(1949,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),roe=E("list.inactiveFocusBackground",null,m(1950,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),aoe=E("list.inactiveFocusOutline",null,m(1951,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),xU=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:V.white.transparent(.1),hcLight:V.fromHex("#0F4A85").transparent(.1)},m(1952,"List/Tree background when hovering over items using the mouse.")),LU=E("list.hoverForeground",null,m(1953,"List/Tree foreground when hovering over items using the mouse.")),loe=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m(1954,"List/Tree drag and drop background when moving items over other items when using the mouse.")),coe=E("list.dropBetweenBackground",{dark:G0,light:G0,hcDark:null,hcLight:null},m(1955,"List/Tree drag and drop border color when moving items between items when using the mouse.")),lp=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Nl,hcLight:Nl},m(1956,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),doe=E("list.focusHighlightForeground",{dark:lp,light:Zne(Eg,lp,"#BBE7FF"),hcDark:lp,hcLight:lp},m(1957,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m(1958,"List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m(1959,"Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m(1960,"Foreground color of list items containing warnings."));const hoe=E("listFilterWidget.background",{light:$s(Vo,0),dark:Ea(Vo,0),hcDark:Vo,hcLight:Vo},m(1961,"Background color of the type filter widget in lists and trees.")),uoe=E("listFilterWidget.outline",{dark:V.transparent,light:V.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m(1962,"Outline color of the type filter widget in lists and trees.")),goe=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ge,hcLight:Ge},m(1963,"Outline color of the type filter widget in lists and trees, when there are no matches.")),foe=E("listFilterWidget.shadow",c_,m(1964,"Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:Ec,light:Ec,hcDark:null,hcLight:null},m(1965,"Background color of the filtered match."));E("list.filterMatchBorder",{dark:Gd,light:Gd,hcDark:Ge,hcLight:Gt},m(1966,"Border color of the filtered match."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m(1967,"List/Tree foreground color for items that are deemphasized."));const kU=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m(1968,"Tree stroke color for the indentation guides.")),poe=E("tree.inactiveIndentGuidesStroke",Re(kU,.4),m(1969,"Tree stroke color for the indentation guides that are not active.")),moe=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m(1970,"Table border color between columns.")),_oe=E("tree.tableOddRowsBackground",{dark:Re(Ue,.04),light:Re(Ue,.04),hcDark:null,hcLight:null},m(1971,"Background color for odd table rows."));E("editorActionList.background",Vo,m(1972,"Action List background color."));const boe=E("editorActionList.foreground",FL,m(1973,"Action List foreground color."));E("editorActionList.focusForeground",HC,m(1974,"Action List foreground color for the focused item."));E("editorActionList.focusBackground",Eg,m(1975,"Action List background color for the focused item."));const Coe=E("menu.border",{dark:null,light:null,hcDark:Ge,hcLight:Ge},m(1976,"Border color of menus.")),voe=E("menu.foreground",UO,m(1977,"Foreground color of menu items.")),woe=E("menu.background",HL,m(1978,"Background color of menu items.")),Soe=E("menu.selectionForeground",HC,m(1979,"Foreground color of the selected menu item in menus.")),yoe=E("menu.selectionBackground",Eg,m(1980,"Background color of the selected menu item in menus.")),xoe=E("menu.selectionBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m(1981,"Border color of the selected menu item in menus.")),Loe=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ge,hcLight:Ge},m(1982,"Color of a separator menu item in menus.")),$D=E("quickInput.background",Vo,m(2010,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),koe=E("quickInput.foreground",FL,m(2011,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Doe=E("quickInputTitle.background",{dark:new V(new j(255,255,255,.105)),light:new V(new j(0,0,0,.06)),hcDark:"#000000",hcLight:V.white},m(2012,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),DU=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:V.white,hcLight:"#0F4A85"},m(2013,"Quick picker color for grouping labels.")),Ioe=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:V.white,hcLight:"#0F4A85"},m(2014,"Quick picker color for grouping borders.")),z7=E("quickInput.list.focusBackground",null,"",void 0,m(2015,"Please use quickInputList.focusBackground instead")),VC=E("quickInputList.focusForeground",HC,m(2016,"Quick picker foreground color for the focused item.")),KO=E("quickInputList.focusIconForeground",yU,m(2017,"Quick picker icon foreground color for the focused item.")),zC=E("quickInputList.focusBackground",{dark:FC(z7,Eg),light:FC(z7,Eg),hcDark:null,hcLight:null},m(2018,"Quick picker background color for the focused item."));E("search.resultsInfoForeground",{light:Ue,dark:Re(Ue,.65),hcDark:Ue,hcLight:Ue},m(2019,"Color of the text in the search viewlet's completion message."));E("searchEditor.findMatchBackground",{light:Re(Ec,.66),dark:Re(Ec,.66),hcDark:Ec,hcLight:Ec},m(2020,"Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:Re(Gd,.66),dark:Re(Gd,.66),hcDark:Gd,hcLight:Gd},m(2021,"Border color of the Search Editor query matches."));class Cw{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new IU(this.x-e.scrollX,this.y-e.scrollY)}}class IU{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new Cw(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class Eoe{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Noe{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function zL(o){const e=pi(o);return new Eoe(e.left,e.top,e.width,e.height)}function UL(o,e,t){const i=e.width/o.offsetWidth,n=e.height/o.offsetHeight,s=(t.x-e.x)/i,r=(t.y-e.y)/n;return new Noe(s,r)}class ed extends Wn{constructor(e,t,i){super(pe(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new Cw(this.posx,this.posy),this.editorPos=zL(i),this.relativePos=UL(i,this.editorPos,this.pos)}}class Toe{constructor(e){this._editorViewDomNode=e}_create(e){return new ed(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return W(e,ee.CONTEXT_MENU,i=>{t(this._create(i))})}onMouseUp(e,t){return W(e,ee.MOUSE_UP,i=>{t(this._create(i))})}onMouseDown(e,t){return W(e,ee.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return W(e,ee.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return W(e,ee.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return W(e,ee.MOUSE_MOVE,i=>t(this._create(i)))}}class Roe{constructor(e){this._editorViewDomNode=e}_create(e){return new ed(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return W(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return W(e,ee.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return W(e,ee.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return W(e,"pointermove",i=>t(this._create(i)))}}class Moe extends A{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new l_),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=Li(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new ed(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),s(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class $L{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++$L._idPool,this._counter=0,this._rules=new aL,this._garbageCollectionScheduler=new St(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new Poe(t,`dyn-rule-${this._instanceId}-${n}`,N0(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}}class Poe{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new z,this._styleElement=Ir(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const s=t[n];let r;typeof s=="object"?r=Q(s.id):r=s;const a=Aoe(n);i+=` ${a}: ${r};`}return i+=` -}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Tae(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class Tf extends F{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;is.lineNumber-r.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}}class fj{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class s1{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let s=0,r=e.length;sl)return null;if(t=Math.min(l,Math.max(0,t)),n=Math.min(l,Math.max(0,n)),t===n&&i===s&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&s===0&&(n--,s=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&s===0&&n>0&&(d=e.children[n-1].firstChild,s=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),s=Math.min(d.textContent.length,Math.max(0,s));const h=this._readClientRects(c,i,d,s,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}class Cs{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,n=t.length;if(i!==n)return!1;for(let s=0;s=s||(a[l++]=new Cs(Math.max(1,c.startColumn-n+1),Math.min(r+1,c.endColumn-n+1),c.className,c.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const s=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;s[r++]=new Cs(h,u,c.inlineClassName,c.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=Cs._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class Pae{static normalize(e,t){if(t.length===0)return[];const i=[],n=new qy;let s=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);Zi(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);Zi(p)&&d--}const g=c-1,f=d-2;s=n.consumeLowerThan(g,s,i),n.count===0&&(s=g),n.insert(f,h,u)}return n.consumeLowerThan(1073741824,s,i),i}}class Yi{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Nd{get isLTR(){return!this.containsRTL&&this.textDirection!==er.RTL}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b,C,w,v,S,L=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(Cs.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=b,this.fontLigatures=C,this.selectionsOnLine=w&&w.sort((I,T)=>I.start>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const s=(t<<16|i<<0)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=El.getPartIndex(t),n=El.getCharIndex(t);return new mj(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<<16|i<<0)>>>0;let s=0,r=this.length-1;for(;s+1>>1,_=this._data[p];if(_===n)return p;_>n?r=p:s=p}if(s===r)return s;const a=this._data[s],l=this._data[r];if(a===n)return s;if(l===n)return r;const c=El.getPartIndex(a),d=El.getCharIndex(a),h=El.getPartIndex(l);let u;c!==h?u=t:u=El.getCharIndex(l);const g=i-d,f=u-i;return g<=f?s:r}}class Ky{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}}function V_(o,e){if(o.lineContent.length===0){if(o.lineDecorations.length>0){e.appendString("");let t=0,i=0,n=0;for(const r of o.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(n|=1,t++),r.type===2&&(n|=2,i++));e.appendString("");const s=new El(1,t+i);return s.setColumnInfo(1,t,0,0),new Ky(s,n)}return o.renderNewLineWhenEmpty?e.appendString(` -`):e.appendString(""),new Ky(new El(0,0),0)}return $ae(Fae(o),e)}class Aae{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}function HD(o){const e=new su(1e4),t=V_(o,e);return new Aae(t.characterMapping,e.build(),t.containsForeignElements)}class Oae{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=s,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=f,this.renderControlCharacters=p}}function Fae(o){const e=o.lineContent;let t,i,n;o.stopRenderingLineAfter!==-1&&o.stopRenderingLineAfter0){for(let a=0,l=o.lineDecorations.length;a0&&(s[r++]=new Yi(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=n){const g=e?zm(o.substring(a,n)):!1;s[r++]=new Yi(n,h,0,g);break}const u=e?zm(o.substring(a,d)):!1;s[r++]=new Yi(d,h,0,u),a=d}return s}function Bae(o,e,t){let i=0;const n=[];let s=0;if(t)for(let r=0,a=e.length;r=50&&(n[s++]=new Yi(g+1,d,h,u),f=g+1,g=-1);f!==c&&(n[s++]=new Yi(c,d,h,u))}else n[s++]=l;i=c}else for(let r=0,a=e.length;r50){const h=l.type,u=l.metadata,g=l.containsRTL,f=Math.ceil(d/50);for(let p=1;p=8234&&o<=8238||o>=8294&&o<=8297||o>=8206&&o<=8207||o===1564}function Vae(o,e){const t=[];let i=new Yi(0,"",0,!1),n=0;for(const s of e){const r=s.endIndex;for(;ni.endIndex&&(i=new Yi(n,s.type,s.metadata,s.containsRTL),t.push(i)),i=new Yi(n+1,"mtkcontrol",s.metadata,!1),t.push(i))}n>i.endIndex&&(i=new Yi(r,s.type,s.metadata,s.containsRTL),t.push(i))}return t}function zae(o,e,t,i){const n=o.continuesWithWrappedLine,s=o.fauxIndentLength,r=o.tabSize,a=o.startVisibleColumn,l=o.useMonospaceOptimizations,c=o.selectionsOnLine,d=o.renderWhitespace===1,h=o.renderWhitespace===3,u=o.renderSpaceWidth!==o.spaceWidth,g=[];let f=0,p=0,_=i[p].type,b=i[p].containsRTL,C=i[p].endIndex;const w=i.length;let v=!1,S=vs(e),L;S===-1?(v=!0,S=t,L=t):L=ua(e);let x=!1,k=0,I=c&&c[k],T=a%r;for(let O=s;OL)U=!0;else if(W===9)U=!0;else if(W===32)if(d)if(x)U=!0;else{const q=O+1L),U&&b&&O>=S&&O<=L&&(U=!1),x){if(!U||!l&&T>=r){if(u){const q=f>0?g[f-1].endIndex:s;for(let ie=q+1;ie<=O;ie++)g[f++]=new Yi(ie,"mtkw",1,!1)}else g[f++]=new Yi(O,"mtkw",1,!1);T=T%r}}else(O===C||U&&O>s)&&(g[f++]=new Yi(O,_,0,b),T=T%r);for(W===9?T=r:_d(W)?T+=2:T++,x=U;O===C&&(p++,p0?e.charCodeAt(t-1):0,W=t>1?e.charCodeAt(t-2):0;O===32&&W!==32&&W!==9||(A=!0)}else A=!0;if(A)if(u){const O=f>0?g[f-1].endIndex:s;for(let W=O+1;W<=t;W++)g[f++]=new Yi(W,"mtkw",1,!1)}else g[f++]=new Yi(t,"mtkw",1,!1);else g[f++]=new Yi(t,_,0,b);return g}function Uae(o,e,t,i){i.sort(Cs.compare);const n=Pae.normalize(o,i),s=n.length;let r=0;const a=[];let l=0,c=0;for(let h=0,u=t.length;hc&&(c=C.startOffset,a[l++]=new Yi(c,p,_,b)),C.endOffset+1<=f)c=C.endOffset+1,a[l++]=new Yi(c,p+" "+C.className,_|C.metadata,b),r++;else{c=f,a[l++]=new Yi(c,p+" "+C.className,_|C.metadata,b);break}}f>c&&(c=f,a[l++]=new Yi(c,p,_,b))}const d=t[t.length-1].endIndex;if(r");for(let k=0,I=c.length;k=d&&(ce+=We)}}for(q&&(e.appendString(' style="width:'),e.appendString(String(g*Q)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let We=2;We<=De;We++)e.appendCharCode(160)}else ce=2,De=1,e.appendCharCode(f),e.appendCharCode(8204);S+=ce,L+=De,w>=d&&(v+=De)}}else for(e.appendASCIICharCode(62);w=d&&(v+=ce)}ie?x++:x=0,w>=r&&!C&&T.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,k,S,L)),e.appendString("")}return C||b.setColumnInfo(r+1,c.length-1,S,L),a&&(e.appendString(''),e.appendString(m(796,"Show more ({0})",qae(l))),e.appendString("")),e.appendString(""),new Ky(b,n)}function jae(o){return o.toString(16).toUpperCase().padStart(4,"0")}function qae(o){return o<1024?m(797,"{0} chars",o):o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/1024/1024).toFixed(1)} MB`}var Tr;(function(o){o.DARK="dark",o.LIGHT="light",o.HIGH_CONTRAST_DARK="hcDark",o.HIGH_CONTRAST_LIGHT="hcLight"})(Tr||(Tr={}));var Bp;(function(o){o.VS="vs",o.VS_DARK="vs-dark",o.HC_BLACK="hc-black",o.HC_LIGHT="hc-light"})(Bp||(Bp={}));function qa(o){return o===Tr.HIGH_CONTRAST_DARK||o===Tr.HIGH_CONTRAST_LIGHT}function Sd(o){return o===Tr.DARK||o===Tr.HIGH_CONTRAST_DARK}const Kae=(function(){return Za?!0:!(oo||so||Ug)})();let hm=!0;class Uc{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=mt(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return qa(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===2?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,s){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,n,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,l=Cs.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn),c=r.hasVariableFonts||a.experimentalWhitespaceRendering==="off"?a.renderWhitespace:"none",d=!r.hasVariableFonts;let h=null;if(qa(a.themeType)||c==="selection"){const p=n.selections;for(const _ of p){if(_.endLineNumbere)continue;const b=_.startLineNumber===e?_.startColumn:r.minColumn,C=_.endLineNumber===e?_.endColumn:r.maxColumn;b');const g=V_(u,s);s.appendString("

");let f=null;return d&&hm&&Kae&&r.isBasicASCII&&u.isLTR&&a.useMonospaceOptimizations&&g.containsForeignElements===0&&(f=new eS(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping)),f||(f=Cj(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping,g.containsForeignElements)),this._renderedViewLine=f,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return this._renderedViewLine?this._renderedViewLine.input.textDirection===er.RTL:!1}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof eS:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof eS?this._renderedViewLine.monospaceAssumptionsAreValid():hm}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof eS&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const s=this._renderedViewLine.input.stopRenderingLineAfter;if(s!==-1&&t>s+1&&i>s+1)return new FT(!0,[new Rh(this.getWidth(n),0)]);s!==-1&&t>s+1&&(t=s+1),s!==-1&&i>s+1&&(i=s+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new FT(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}class eS{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let s=0;s=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),hm=!1)}return hm}toSlowRenderedLine(){return Cj(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,n){const s=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new Rh(s,r-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const n=Math.floor((t-1)/300)-1,s=(n+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(s),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),s=M0.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!s||s.length===0?-1:s[0].left}getColumnOfNodeOffset(e,t){return Ym(this._characterMapping,e,t)}}class bj{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,r=this._characterMapping.length;s<=r;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const s=this._readPixelOffset(this.domNode,e,t,n);if(s===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new Rh(s,r-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i===n){const r=this._readPixelOffset(e,t,i,s);return r===-1?null:[new Rh(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,s)}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(n);const s=this._getReadingTarget(e);return s.firstChild?(n.markDidDomLayout(),s.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const s=this._pixelOffsetCache[i];if(s!==-1)return s;const r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const l=M0.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!l||l.length===0?-1:l[0].left}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(n);const s=this._characterMapping.getDomPosition(i),r=M0.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&t===1&&i===this._characterMapping.length)return[new Rh(0,this.getWidth(n))];const s=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return M0.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return Ym(this._characterMapping,e,t)}}class Gae extends bj{_readVisibleRangesForRange(e,t,i,n,s){const r=super._readVisibleRangesForRange(e,t,i,n,s);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(this.input.isLTR){const a=this._readPixelOffset(e,t,n,s);if(a!==-1){const l=r[r.length-1];l.left=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class Xm{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(75),this.stickyTabStops=n.get(132),this.typicalHalfwidthCharacterWidth=n.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Xm.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==s&&(l=new R(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new R(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,gs._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class Jae extends Qae{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Qa.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,s){super(e,t,i,n),this.hitTestResult=new $n(()=>gs.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=s;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return ks.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let s=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if(s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=l[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,n,i.range,r)}return s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,r):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!ks.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new R(1,1),w9);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new R(n,s),w9)}if(ks.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineLength(n),r=e.getLineWidth(n);if(s===0){const l=mu(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new R(n,1),l)}if(e.isRtl(n)){if(t.mouseContentHorizontalOffset+r<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const l=mu(t.mouseContentHorizontalOffset-r),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=r){const l=mu(t.mouseContentHorizontalOffset-r),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(e.viewLinesGpu){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const l=e.getLineWidth(n),c=mu(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(new R(n,1),c)}const s=e.getLineWidth(n);if(e.isRtl(n)){if(t.mouseContentHorizontalOffset+s<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const l=mu(t.mouseContentHorizontalOffset-s),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=s){const l=mu(t.mouseContentHorizontalOffset-s),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}const a=e.viewLinesGpu.getPositionAtCoordinate(n,t.mouseContentHorizontalOffset);if(a){const l={injectedText:null,mightBeForeignElement:!1};return t.fulfillContentText(a,D.fromPositions(a,a),l)}}const i=t.hitTestResult.value;return i.type===1?gs.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(ks.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new R(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(ks.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new R(n,s))}}return null}static _hitTestScrollbar(e,t){if(ks.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new R(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(165),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return gs._getMouseColumn(n,t.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){const r=n.lineNumber,a=n.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const b=mu(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(n,b)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(n);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});const h=[];if(h.push({offset:c.left,column:a}),a>1){const b=e.visibleRangeForPosition(r,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(ab.offset-C.offset);const g=t.pos.toClientCoordinates(me(e.viewDomNode)),f=i.getBoundingClientRect(),p=f.left<=g.clientX&&g.clientX<=f.right;let _=null;for(let b=1;bs)){const a=Math.floor((n+s)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new n1(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(me(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(me(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Vh(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=ele(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Ud;const s=n.startContainer;if(s.nodeType===s.TEXT_NODE){const r=s.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Uc.CLASS_NAME?qu.createFromDOMInfo(e,r,n.startOffset):new Ud(s.parentNode)}else if(s.nodeType===s.ELEMENT_NODE){const r=s.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Uc.CLASS_NAME?qu.createFromDOMInfo(e,s,s.textContent.length):new Ud(s)}return new Ud}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,s=n?n.parentNode:null,r=s?s.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Uc.CLASS_NAME?qu.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Ud(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,s=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(s===Uc.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return qu.createFromDOMInfo(e,l,0)}else if(a===Uc.CLASS_NAME)return qu.createFromDOMInfo(e,i.offsetNode,0)}return new Ud(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),s=mv.atomicPosition(i,e.column-1,n,2);return s!==-1?new R(e.lineNumber,s+1):e}static doHitTest(e,t){let i=new Ud;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(me(e.viewDomNode)))),i.type===1){const n=e.viewModel.getInjectedTextAt(i.position),s=e.viewModel.normalizePosition(i.position,2);(n||!s.equals(i.position))&&(i=new vj(s,i.spanNode,n))}return i}}function ele(o,e,t){const i=document.createRange();let n=o.elementFromPoint(e,t);if(n?.hasChildNodes()){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const s=n.getBoundingClientRect(),r=me(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),l=r.getComputedStyle(n,null).getPropertyValue("font-variant"),c=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),h=r.getComputedStyle(n,null).getPropertyValue("line-height"),u=r.getComputedStyle(n,null).getPropertyValue("font-family"),g=`${a} ${l} ${c} ${d}/${h} ${u}`,f=n.innerText;let p=s.left,_=0,b;if(e>s.left+s.width)_=f.length;else{const C=Hp.getInstance();for(let w=0;w=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Bt;(function(o){o.Tap="-monaco-gesturetap",o.Change="-monaco-gesturechange",o.Start="-monaco-gesturestart",o.End="-monaco-gesturesend",o.Contextmenu="-monaco-gesturecontextmenu"})(Bt||(Bt={}));class ni extends F{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new bs,this.ignoreTargets=new bs,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(se.runAndSubscribe(Xw,({window:e,disposables:t})=>{t.add(B(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(B(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(B(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:kt,disposables:this._store}))}static addTarget(e){if(!ni.isTouchDevice())return F.None;ni.INSTANCE||(ni.INSTANCE=new ni);const t=ni.INSTANCE.targets.push(e);return ge(t)}static ignoreTarget(e){if(!ni.isTouchDevice())return F.None;ni.INSTANCE||(ni.INSTANCE=new ni);const t=ni.INSTANCE.ignoreTargets.push(e);return ge(t)}static isTouchDevice(){return"ontouchstart"in kt||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=ni.HOLD_DELAY&&Math.abs(l.initialPageX-l.rollingPageX.at(-1))<30&&Math.abs(l.initialPageY-l.rollingPageY.at(-1))<30){const d=this.newGestureEvent(Bt.Contextmenu,l.initialTarget);d.pageX=l.rollingPageX.at(-1),d.pageY=l.rollingPageY.at(-1),this.dispatchEvent(d)}else if(n===1){const d=l.rollingPageX.at(-1),h=l.rollingPageY.at(-1),u=l.rollingTimestamps.at(-1)-l.rollingTimestamps[0],g=d-l.rollingPageX[0],f=h-l.rollingPageY[0],p=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,p,i,Math.abs(g)/u,g>0?1:-1,d,Math.abs(f)/u,f>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(Bt.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Bt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>ni.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Bt.Change||e.type===Bt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,s=e.initialTarget;for(;s&&s!==i;)n++,s=s.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,s,r,a,l,c){this.handle=ro(e,()=>{const d=Date.now(),h=d-i;let u=0,g=0,f=!0;n+=ni.SCROLL_FRICTION*h,a+=ni.SCROLL_FRICTION*h,n>0&&(f=!1,u=s*n*h),a>0&&(f=!1,g=l*a*h);const p=this.newGestureEvent(Bt.Change);p.translationX=u,p.translationY=g,t.forEach(_=>_.dispatchEvent(p)),f||this.inertia(e,t,d,n,s,r+u,a,l,c+g)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(s.pageX),r.rollingPageY.push(s.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}tle([Ii],ni,"isTouchDevice",null);let Oo=class extends F{onclick(e,t){this._register(B(e,te.CLICK,i=>t(new qn(me(e),i))))}onmousedown(e,t){this._register(B(e,te.MOUSE_DOWN,i=>t(new qn(me(e),i))))}onmouseover(e,t){this._register(B(e,te.MOUSE_OVER,i=>t(new qn(me(e),i))))}onmouseleave(e,t){this._register(B(e,te.MOUSE_LEAVE,i=>t(new qn(me(e),i))))}onkeydown(e,t){this._register(B(e,te.KEY_DOWN,i=>t(new Et(i))))}onkeyup(e,t){this._register(B(e,te.KEY_UP,i=>t(new Et(i))))}oninput(e,t){this._register(B(e,te.INPUT,t))}onblur(e,t){this._register(B(e,te.BLUR,t))}onfocus(e,t){this._register(B(e,te.FOCUS,t))}ignoreGesture(e){return ni.ignoreTarget(e)}};const Qm=11;class ile extends Oo{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...ye.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Qm+"px",this.domNode.style.height=Qm+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new W_),this._register(Ti(this.bgDomNode,te.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ti(this.domNode,te.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new D4),this._pointerdownScheduleRepeatTimer=this._register(new Io)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,me(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class nle extends F{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Io)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const sle=140;class wj extends Oo{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new nle(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new W_),this._shouldRender=!0,this.domNode=mt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(B(this.domNode.domNode,te.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new ile(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=mt(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(B(this.slider.domNode,te.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const r=wi(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}const n=e.pointerType==="mouse",s=e.button===0;if(s||!n){const r=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r))}s&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{const r=this._sliderOrthogonalPointerPosition(s),a=Math.abs(r-i);if(Rn&&a>sle){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const c=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const ole=20;class Jm{constructor(e,t,i,n,s,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Jm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(ole,Math.floor(i*a/n))),d=(a-c)/(n-i),h=s*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=Jm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new jg(null,1,0))}),this._createArrow({className:"scra",icon:Z.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new jg(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class ale extends wj{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Jm(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-Qm)/2,a=(t.verticalScrollbarSize-Qm)/2;this._createArrow({className:"scra",icon:Z.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new jg(null,0,1))}),this._createArrow({className:"scra",icon:Z.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new jg(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class Gy{constructor(e,t,i,n,s,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,s=s|0,r=r|0,a=a|0),this.rawScrollLeft=n,this.rawScrollTop=a,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),a+s>r&&(a=r-s),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new Gy(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Gy(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class z_ extends F{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Gy(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new kv(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=kv.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class S9{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function ZI(o,e){const t=e-o;return function(i){return o+t*dle(i)}}function lle(o,e,t){return function(i){return i2.5*i){let s,r;return e0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),s=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,r),1),c=Math.max(Math.min(s,a),1),d=Math.max(n,r),h=Math.max(s,a);d%l===0&&h%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){const t=Number.EPSILON*100;return Math.abs(Math.round(e)-e)<.01+t}}class rF extends Oo{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new P),this._onWillScroll=this._register(new P),e.style.overflow="hidden",this._options=gle(t),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));const n={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new ale(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new rle(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=mt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=mt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=mt(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new Io),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=vt(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,je&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new jg(e))}async _periodicSync(){let e=!1;(this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0)&&(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-this._inertialSpeed.Y*100,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-this._inertialSpeed.X*100}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0),e?(this._inertialTimeout||(this._inertialTimeout=new Io),this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=vt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new jg(n))};this._mouseWheelToDispose.push(B(this._listenOnDomNode,te.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=VD.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+s===0?r=s=0:Math.abs(s)>=Math.abs(r)?r=0:s=0),this._options.flipAxes&&([s,r]=[r,s]);const a=!je&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const l=this._scrollable.getFutureScrollPosition();let c={};if(s){const d=y9*s,h=l.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(c,h)}if(r){const d=y9*r,h=l.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(c,h)}if(c=this._scrollable.validateScrollPosition(c),this._options.inertialScroll&&(r||s)&&!t.isPhysicalMouseWheel()){let d=!1;this._inertialSpeed.X===0&&this._inertialSpeed.Y===0&&(d=!0),this._inertialSpeed.Y=(s<0?-1:1)*Math.abs(s)**1.02,this._inertialSpeed.X=(r<0?-1:1)*Math.abs(r)**1.02,d&&this._periodicSync()}(l.scrollLeft!==c.scrollLeft||l.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),hle)}}class Sj extends rF{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new z_({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>ro(me(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class zD extends rF{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class o1 extends rF{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new z_({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>ro(me(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function gle(o){const e={lazyRender:typeof o.lazyRender<"u"?o.lazyRender:!1,className:typeof o.className<"u"?o.className:"",useShadows:typeof o.useShadows<"u"?o.useShadows:!0,handleMouseWheel:typeof o.handleMouseWheel<"u"?o.handleMouseWheel:!0,flipAxes:typeof o.flipAxes<"u"?o.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof o.consumeMouseWheelIfScrollbarIsNeeded<"u"?o.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof o.alwaysConsumeMouseWheel<"u"?o.alwaysConsumeMouseWheel:!1,scrollYToX:typeof o.scrollYToX<"u"?o.scrollYToX:!1,mouseWheelScrollSensitivity:typeof o.mouseWheelScrollSensitivity<"u"?o.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof o.fastScrollSensitivity<"u"?o.fastScrollSensitivity:5,scrollPredominantAxis:typeof o.scrollPredominantAxis<"u"?o.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof o.mouseWheelSmoothScroll<"u"?o.mouseWheelSmoothScroll:!0,inertialScroll:typeof o.inertialScroll<"u"?o.inertialScroll:!1,arrowSize:typeof o.arrowSize<"u"?o.arrowSize:11,listenOnDomNode:typeof o.listenOnDomNode<"u"?o.listenOnDomNode:null,horizontal:typeof o.horizontal<"u"?o.horizontal:1,horizontalScrollbarSize:typeof o.horizontalScrollbarSize<"u"?o.horizontalScrollbarSize:10,horizontalSliderSize:typeof o.horizontalSliderSize<"u"?o.horizontalSliderSize:0,horizontalHasArrows:typeof o.horizontalHasArrows<"u"?o.horizontalHasArrows:!1,vertical:typeof o.vertical<"u"?o.vertical:1,verticalScrollbarSize:typeof o.verticalScrollbarSize<"u"?o.verticalScrollbarSize:10,verticalHasArrows:typeof o.verticalHasArrows<"u"?o.verticalHasArrows:!1,verticalSliderSize:typeof o.verticalSliderSize<"u"?o.verticalSliderSize:0,scrollByPage:typeof o.scrollByPage<"u"?o.scrollByPage:!1};return e.horizontalSliderSize=typeof o.horizontalSliderSize<"u"?o.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof o.verticalSliderSize<"u"?o.verticalSliderSize:e.verticalScrollbarSize,je&&(e.className+=" mac"),e}class yj extends F{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Lj extends F{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=ro(me(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}}class fle extends yj{_createDragScrollingOperation(e,t){return new ple(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class ple extends Lj{_getScrollSpeed(){const e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(75),t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e,s=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,s),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=FD(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(165).horizontalScrollbarHeight,h=new n1(this._mouseEvent.pos.x,c.y+c.height-d-.1),u=WD(this._viewHelper.viewDomNode,c,h);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,h,u,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Hn.createOutsideEditor(this._position.mouseColumn,new R(a,1),"above",this._position.outsideDistance):l=Hn.createOutsideEditor(this._position.mouseColumn,new R(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=ro(me(l.element),()=>this._execute())}}class mle extends yj{_createDragScrollingOperation(e,t){return new _le(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class _le extends Lj{_getScrollSpeed(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e*.5,s=this._position.outsidePosition==="left"?-n:n;if(this._context.viewModel.viewLayout.deltaScrollNow(s,0),this._viewHelper.renderNow(),!this._position.position)return;const r=this._position.position.lineNumber;let a;{const l=FD(this._viewHelper.viewDomNode),c=this._context.configuration.options.get(165).horizontalScrollbarHeight,d=new n1(this._mouseEvent.pos.x,l.y+l.height-c-.1),h=WD(this._viewHelper.viewDomNode,l,d);a=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,d,h,null)}this._position.outsidePosition==="left"?a=Hn.createOutsideEditor(a.mouseColumn,new R(r,a.mouseColumn),"left",this._position.outsideDistance):a=Hn.createOutsideEditor(a.mouseColumn,new R(r,a.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(a,!0,2),this._animationFrameDisposable=ro(me(a.element),()=>this._execute())}}class aF extends Tf{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new gs(this._context,i),this._mouseDownOperation=this._register(new ble(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;const n=new kae(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=B(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new wd(a,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{s=a})),this._register(B(this.viewHelper.viewDomNode,te.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=VD.INSTANCE;let t=0,i=xr.getZoomLevel(),n=!1,s=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(84))return;const c=new jg(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=xr.getZoomLevel(),h=c.deltaY>0?1:-1;xr.setZoomLevel(d+h),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=xr.getZoomLevel(),n=a(l),s=0),t=Date.now(),s+=c.deltaY,n&&(xr.setZoomLevel(i+s/5),c.preventDefault(),c.stopPropagation())};this._register(B(this.viewHelper.viewDomNode,te.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return je?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){const t=this._context.configuration.options.get(165).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const n=new gj(e,t).toPageCoordinates(me(this.viewHelper.viewDomNode)),s=FD(this.viewHelper.viewDomNode);if(n.ys.y+s.height||n.xs.x+s.width)return null;const r=WD(this.viewHelper.viewDomNode,s,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),s,n,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=Vh(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(l){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class ble extends F{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Eae(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new fle(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._leftRightDragScrolling=this._register(new mle(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new lF,this._currentSelection=new le(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13?t.outsidePosition==="above"||t.outsidePosition==="below"?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const s=this._context.configuration.options;if(!s.get(104)&&s.get(42)&&!s.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===6&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);Oc(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,s=this._getMouseColumn(e);if(e.posyt.y+t.height){const h=e.posy-t.y-t.height,u=n.getCurrentScrollTop()+e.relativePos.y,g=Xm.getZoneAtCoord(this._context,u);if(g){const p=this._helpPositionJumpOverViewZone(g);if(p)return Hn.createOutsideEditor(s,p,"below",h)}const f=n.getLineNumberAtVerticalOffset(u);return Hn.createOutsideEditor(s,new R(f,i.getLineMaxColumn(f)),"below",h)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),a=this._context.configuration.options.get(165),l=a.contentLeft;if(e.relativePos.x<=l){const h=l-e.relativePos.x;return Hn.createOutsideEditor(s,new R(r,1),"left",h)}const d=a.minimap.minimapLeft===0?a.width-a.verticalScrollbarWidth:a.minimap.minimapLeft;if(e.relativePos.x>=d){const h=e.relativePos.x-d;return Hn.createOutsideEditor(s,new R(r,i.getLineMaxColumn(r)),"right",h)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===8||n.type===5){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return Hn.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new R(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class lF{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>lF.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}class wt{get event(){return this.emitter.event}constructor(e,t,i){const n=s=>this.emitter.fire(s);this.emitter=new P({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}function xj(o,e,t,i){const n=o.getPlainTextToCopy(e,t,Rn),s=o.model.getEOL(),r=t&&e.length===1&&e[0].isEmpty(),a=Array.isArray(n)?n:null,l=Array.isArray(n)?n.join(s):n;let c,d=null;if(WT.forceCopyWithSyntaxHighlighting||i&&l.length<65536){const u=o.getRichTextToCopy(e,t);u&&(c=u.html,d=u.mode)}return{isFromEmptySelection:r,multicursorText:a,text:l,html:c,mode:d}}class Bl{static{this.INSTANCE=new Bl}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}const WT={forceCopyWithSyntaxHighlighting:!1},Ng={getTextData(o){const e=o.getData(Di.text);let t=null;const i=o.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&o.files.length>0?[Array.prototype.slice.call(o.files,0).map(s=>s.name).join(` -`),null]:[e,t]},setTextData(o,e,t,i){o.setData(Di.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}};class kn{static{this.EMPTY=new kn("",0,0,null,void 0)}constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new kn(i,n,s,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new kn(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){const i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;(s=t.indexOf(` -`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(pa(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(md(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(pa(e.value,t.value),e.selectionEnd),n=Math.min(md(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}static fromScreenReaderContentState(e){return new kn(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}}const Rf=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const o=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(o),o[6]=o[6]&15|64,o[8]=o[8]&63|128;let i=0,n="";return n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n}})();function Dj(o){return`${o}-${Rf()}`}var Cle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},L9=function(o,e){return function(t,i){e(t,i,o)}},Zy;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(Zy||(Zy={}));class vle{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let BT=class extends F{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new P),this.onFocus=this._onFocus.event,this._onBlur=this._register(new P),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new P),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new P),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new P),this.onCut=this._onCut.event,this._onPaste=this._register(new P),this.onPaste=this._onPaste.event,this._onType=this._register(new P),this.onType=this._onType.event,this._onCompositionStart=this._register(new P),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new P),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new P),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new P),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new _t),this._asyncTriggerCut=this._register(new It(()=>this._onCut.fire(),0)),this._textAreaState=kn.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(se.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new It(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new Et(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new Et(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new vle;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const h=kn.readFromTextArea(this._textArea,this._textAreaState),u=kn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(l);return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=kn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const h=kn.readFromTextArea(this._textArea,this._textAreaState),u=kn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=kn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=kn.readFromTextArea(this._textArea,this._textAreaState),d=kn.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(Zi(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&(l.inputType==="insertFromPaste"?this._onPaste.fire({text:d.text,metadata:Bl.INSTANCE.get(d.text)}):this._onType.fire(d)))})),this._register(this._textArea.onCut(l=>{this._logService.trace("TextAreaInput#onCut",l),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._logService.trace("TextAreaInput#onCopy",l),this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._logService.trace("TextAreaInput#onPaste",l),this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=Ng.getTextData(l.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",d?.id," with text.length: ",c.length),c&&(d=d||Bl.INSTANCE.get(c),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new It(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return B(this._textArea.ownerDocument,"selectionchange",t=>{if(gh.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),h=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(h[0],h[1],h[2]),g=new le(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(g)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy();let i;this._logService.getLevel()===ln.Trace&&(i=Rf());const n={version:1,id:i,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Bl.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,n),e.preventDefault(),e.clipboardData&&Ng.setTextData(e.clipboardData,t.text,t.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}};BT=Cle([L9(4,Mn),L9(5,Ht)],BT);class wle extends F{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new P),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new wt(this._actual,"keydown")).event,this.onKeyPress=this._register(new wt(this._actual,"keypress")).event,this.onKeyUp=this._register(new wt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new wt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new wt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new wt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new wt(this._actual,"beforeinput")).event,this.onInput=this._register(new wt(this._actual,"input")).event,this.onCut=this._register(new wt(this._actual,"cut")).event,this.onCopy=this._register(new wt(this._actual,"copy")).event,this.onPaste=this._register(new wt(this._actual,"paste")).event,this.onFocus=this._register(new wt(this._actual,"focus")).event,this.onBlur=this._register(new wt(this._actual,"blur")).event,this._register(this.onKeyDown(()=>gh.onKeyDown())),this._register(this.onBeforeInput(()=>gh.onBeforeInput())),this._register(this.onInput(()=>gh.onInput())),this._register(this.onKeyUp(()=>gh.onKeyUp())),this._register(B(this._actual,Zy.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Vh(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Ji()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const r=Vh(n);r?s=r.activeElement:s=Ji();const a=me(s),l=s===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){so&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),so&&a.parent!==a&&n.focus();return}try{const h=eie(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),tie(n,h)}catch{}}}class Sle extends aF{constructor(e,t,i){super(e,t,i),this._register(ni.addTarget(this.viewHelper.linesContentDomNode)),this._register(B(this.viewHelper.linesContentDomNode,Bt.Tap,s=>this.onTap(s))),this._register(B(this.viewHelper.linesContentDomNode,Bt.Change,s=>this.onChange(s))),this._register(B(this.viewHelper.linesContentDomNode,Bt.Contextmenu,s=>this._onContextMenu(new wd(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(B(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new Iae(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new wd(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class yle extends aF{constructor(e,t,i){super(e,t,i),this._register(ni.addTarget(this.viewHelper.linesContentDomNode)),this._register(B(this.viewHelper.linesContentDomNode,Bt.Tap,n=>this.onTap(n))),this._register(B(this.viewHelper.linesContentDomNode,Bt.Change,n=>this.onChange(n))),this._register(B(this.viewHelper.linesContentDomNode,Bt.Contextmenu,n=>this._onContextMenu(new wd(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new wd(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(Zy.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Lle extends F{constructor(e,t,i){super(),(Or||jJ&&rU)&&qw.pointerEvents?this.handler=this._register(new Sle(e,t,i)):kt.TouchEvent?this.handler=this._register(new yle(e,t,i)):this.handler=this._register(new aF(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class xle{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){mn.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){mn.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){mn.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),mn.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),mn.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){mn.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){mn.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){mn.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){mn.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){mn.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){mn.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){mn.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){mn.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){mn.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}function sc(o,e){const t=ZO();if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(o,e)}catch(i){Te(i);return}try{return globalThis.trustedTypes?.createPolicy(o,e)}catch(i){Te(i);return}}class kj{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new ve("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let s=0,r=0;for(let l=i;l<=n;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(s=c,r=1):r++)}if(e=n&&a<=s&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s)return this._lines.splice(e-this._rendLineNumberStart,s-e+1);const r=[];for(let h=0;hi)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),n=!0}}return n}}class Ij{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new kj(this._lineFactory)}_createDomNode(){const e=mt(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){const i=this._linesCollection.getStartLineNumber(),n=this._linesCollection.getEndLineNumber();for(let s=i;s<=n;s++)this._linesCollection.getLine(s).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;ie})}constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){const s={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(s.rendLineNumberStart+s.linesLength-1t){const r=t,a=Math.min(i,s.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(s,r,a,n,t),s.linesLength+=a-r+1)}else if(s.rendLineNumberStart0&&(this._removeLinesBefore(s,r),s.linesLength-=r)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1i){const r=Math.max(0,i-s.rendLineNumberStart+1),l=s.linesLength-1-r+1;l>0&&(this._removeLinesAfter(s,l),s.linesLength-=l)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,n[c-s],this._lineHeightForLineNumber(c))}}_insertLinesBefore(e,t,i,n,s){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this._lineFactory.createLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];n[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");Ku._ttPolicy&&(t=Ku._ttPolicy.createHTML(t)),n.innerHTML=t;for(let s=0;snew Dle(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(59);wn(this.domNode,i),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,n=t.length;i'),s.appendString(r),s.appendString("
"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}}class kle extends Ej{constructor(e){super(e);const i=this._context.configuration.options.get(165);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Ile extends Ej{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),wn(this.domNode,t.get(59))}onConfigurationChanged(e){const t=this._context.configuration.options;wn(this.domNode,t.get(59));const i=t.get(165);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class UD{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return UD.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new R(e.afterLineNumber,1)).lineNumber}}}class Ele extends zs{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=mt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(165),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);const s=i.contentLeft;return this.contentLeft!==s&&(this.contentLeft=s,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let s=this.blocks[t];s||(s=this.blocks[t]=mt(document.createElement("div")),this.domNode.appendChild(s));let r,a;n.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),a=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[l,c,d,h]=n.options.blockPadding??[0,0,0,0];s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+c),s.setTop(r-e.scrollTop-l),s.setHeight(a-r+l+d),t++}for(let n=t;n0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const s=e.top,r=s,a=e.top+e.height,l=n.viewportHeight-a,c=s-i,d=r>=i,h=a,u=l>=i;let g=e.left;return g+t>n.scrollLeft+n.viewportWidth&&(g=n.scrollLeft+n.viewportWidth-t),gl){const u=h-(l-n);h-=u,i-=u}if(h=p,C=h+i<=u.height-_;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,p),fitsBelow:C,belowTop:h,left:f}:{fitsAbove:b,aboveTop:s,fitsBelow:C,belowTop:r,left:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new db(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=s(this._primaryAnchor.viewPosition,this._affinity),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,n=s(i,this._affinity);return{primary:t,secondary:n};function s(r,a){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const c=r.column===1&&a===3?0:l.left,d=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop,h=e.getLineHeightForLineNumber(r.lineNumber);return new x9(d,c,h)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(59);let s=t.left;return se.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&YI(this._actual.afterRender,this._actual,null,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&YI(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}}class cb{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class db{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class x9{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function YI(o,e,...t){try{return o.call(e,...t)}catch{return null}}class ru extends Tf{}const pi=Ve("themeService");function _i(o){return{id:o}}function HT(o){switch(o){case Tr.DARK:return Bp.VS_DARK;case Tr.HIGH_CONTRAST_DARK:return Bp.HC_BLACK;case Tr.HIGH_CONTRAST_LIGHT:return Bp.HC_LIGHT;default:return Bp.VS}}const Nj={ThemingContribution:"base.contributions.theming"};class Rle extends F{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new P)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),ge(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Tj=new Rle;fi.add(Nj.ThemingContribution,Tj);function jr(o){return Tj.onColorThemeChange(o)}class Mle extends F{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const Rj=E("editor.lineHighlightBackground",null,m(610,"Background color for the highlight of line at the cursor position.")),D9=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:et},m(611,"Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m(612,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ti,hcLight:ti},m(613,"Background color of the border around highlighted ranges."));E("editor.symbolHighlightBackground",{dark:Yc,light:Yc,hcDark:null,hcLight:null},m(614,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ti,hcLight:ti},m(615,"Background color of the border around highlighted symbols."));const $D=E("editorCursor.foreground",{dark:"#AEAFAD",light:V.black,hcDark:V.white,hcLight:"#0F4A85"},m(616,"Color of the editor cursor.")),cF=E("editorCursor.background",null,m(617,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Mj=E("editorMultiCursor.primary.foreground",$D,m(618,"Color of the primary editor cursor when multiple cursors are present.")),Ple=E("editorMultiCursor.primary.background",cF,m(619,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),Pj=E("editorMultiCursor.secondary.foreground",$D,m(620,"Color of secondary editor cursors when multiple cursors are present.")),Ale=E("editorMultiCursor.secondary.background",cF,m(621,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),dF=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m(622,"Color of whitespace characters in the editor.")),Ole=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:V.white,hcLight:"#292929"},m(623,"Color of editor line numbers.")),Fle=E("editorIndentGuide.background",dF,m(624,"Color of the editor indentation guides."),!1,m(625,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Wle=E("editorIndentGuide.activeBackground",dF,m(626,"Color of the active editor indentation guides."),!1,m(627,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),r1=E("editorIndentGuide.background1",Fle,m(628,"Color of the editor indentation guides (1).")),Ble=E("editorIndentGuide.background2","#00000000",m(629,"Color of the editor indentation guides (2).")),Hle=E("editorIndentGuide.background3","#00000000",m(630,"Color of the editor indentation guides (3).")),Vle=E("editorIndentGuide.background4","#00000000",m(631,"Color of the editor indentation guides (4).")),zle=E("editorIndentGuide.background5","#00000000",m(632,"Color of the editor indentation guides (5).")),Ule=E("editorIndentGuide.background6","#00000000",m(633,"Color of the editor indentation guides (6).")),a1=E("editorIndentGuide.activeBackground1",Wle,m(634,"Color of the active editor indentation guides (1).")),$le=E("editorIndentGuide.activeBackground2","#00000000",m(635,"Color of the active editor indentation guides (2).")),jle=E("editorIndentGuide.activeBackground3","#00000000",m(636,"Color of the active editor indentation guides (3).")),qle=E("editorIndentGuide.activeBackground4","#00000000",m(637,"Color of the active editor indentation guides (4).")),Kle=E("editorIndentGuide.activeBackground5","#00000000",m(638,"Color of the active editor indentation guides (5).")),Gle=E("editorIndentGuide.activeBackground6","#00000000",m(639,"Color of the active editor indentation guides (6).")),Zle=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ti,hcLight:ti},m(640,"Color of editor active line number"),!1,m(641,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",Zle,m(642,"Color of editor active line number"));const Yle=E("editorLineNumber.dimmedForeground",null,m(643,"Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),Xle=E("editorRuler.foreground",{dark:"#5A5A5A",light:V.lightgrey,hcDark:V.white,hcLight:"#292929"},m(644,"Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m(645,"Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m(646,"Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:et,hcLight:et},m(647,"Color for matching brackets boxes"));const Qle=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m(648,"Color of the overview ruler border.")),Jle=E("editorOverviewRuler.background",null,m(649,"Background color of the editor overview ruler."));E("editorGutter.background",Ri,m(650,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:V.fromHex("#fff").transparent(.8),hcLight:et},m(651,"Border color of unnecessary (unused) source code in the editor."));const ece=E("editorUnnecessaryCode.opacity",{dark:V.fromHex("#000a"),light:V.fromHex("#0007"),hcDark:null,hcLight:null},m(652,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:V.fromHex("#fff").transparent(.8),hcLight:V.fromHex("#292929").transparent(.8)},m(653,"Border color of ghost text in the editor."));const tce=E("editorGhostText.foreground",{dark:V.fromHex("#ffffff56"),light:V.fromHex("#0007"),hcDark:null,hcLight:null},m(654,"Foreground color of the ghost text in the editor."));E("editorGhostText.background",null,m(655,"Background color of the ghost text in the editor."));const ice=new V(new j(0,122,204,.6)),Aj=E("editorOverviewRuler.rangeHighlightForeground",ice,m(656,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),nce=E("editorOverviewRuler.errorForeground",{dark:new V(new j(255,18,18,.7)),light:new V(new j(255,18,18,.7)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(657,"Overview ruler marker color for errors.")),sce=E("editorOverviewRuler.warningForeground",{dark:vd,light:vd,hcDark:Sv,hcLight:Sv},m(658,"Overview ruler marker color for warnings.")),oce=E("editorOverviewRuler.infoForeground",{dark:Gl,light:Gl,hcDark:yv,hcLight:yv},m(659,"Overview ruler marker color for infos.")),Oj=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m(660,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Fj=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m(661,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Wj=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m(662,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Bj=E("editorBracketHighlight.foreground4","#00000000",m(663,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Hj=E("editorBracketHighlight.foreground5","#00000000",m(664,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Vj=E("editorBracketHighlight.foreground6","#00000000",m(665,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),rce=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new V(new j(255,18,18,.8)),light:new V(new j(255,18,18,.8)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(666,"Foreground color of unexpected brackets.")),ace=E("editorBracketPairGuide.background1","#00000000",m(667,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),lce=E("editorBracketPairGuide.background2","#00000000",m(668,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),cce=E("editorBracketPairGuide.background3","#00000000",m(669,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),dce=E("editorBracketPairGuide.background4","#00000000",m(670,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),hce=E("editorBracketPairGuide.background5","#00000000",m(671,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),uce=E("editorBracketPairGuide.background6","#00000000",m(672,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),gce=E("editorBracketPairGuide.activeBackground1","#00000000",m(673,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),fce=E("editorBracketPairGuide.activeBackground2","#00000000",m(674,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),pce=E("editorBracketPairGuide.activeBackground3","#00000000",m(675,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),mce=E("editorBracketPairGuide.activeBackground4","#00000000",m(676,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),_ce=E("editorBracketPairGuide.activeBackground5","#00000000",m(677,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),bce=E("editorBracketPairGuide.activeBackground6","#00000000",m(678,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",vd,m(679,"Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",Yoe,m(680,"Background color used to highlight unicode characters."));jr((o,e)=>{const t=o.getColor(Ri),i=o.getColor(Rj),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});class zj extends ru{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new le(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const s of this._selections)t.add(s.positionLineNumber);const i=Array.from(t);i.sort((s,r)=>s-r),Qt(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let r=t;r<=i;r++){const a=r-t;n[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new R(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new R(c,1)).lineNumber,h=l.convertModelPositionToViewPosition(new R(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,u=Math.max(d,t),g=Math.min(h,i);for(let f=u;f<=g;f++){const p=f-t;n[p]=r}}}const s=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=s}this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Cce extends zj{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class vce extends zj{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}jr((o,e)=>{const t=o.getColor(Rj);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||o.defines(D9)){const i=o.getColor(D9);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),qa(o.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class wce extends ru{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,h=c.options.className;return dh?1:D.compareRangesUsingStarts(l.range,c.range)});const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=s;l<=r;l++){const c=l-s;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(l.range.startLineNumber,n),h=Math.min(l.range.endLineNumber,s);for(let u=d;u<=h;u++){const g=u-n;i[g]+=c}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let s=null,r=!1,a=null,l=!1;for(let c=0,d=t.length;c';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Sce extends zs{constructor(e,t,i,n){super(e);const s=this._context.configuration.options,r=s.get(117),a=s.get(83),l=s.get(49),c=s.get(120),d=s.get(158),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+HT(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage,inertialScroll:d};this.scrollbar=this._register(new zD(t.domNode,h,this._context.viewLayout.getScrollable())),Qa.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=mt(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(g,f,p)=>{const _={};{const b=g.scrollTop;b&&(_.scrollTop=this._context.viewLayout.getCurrentScrollTop()+b,g.scrollTop=0)}if(p){const b=g.scrollLeft;b&&(_.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+b,g.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(_,1)};this._register(B(i.domNode,"scroll",g=>u(i.domNode,!0,!0))),this._register(B(t.domNode,"scroll",g=>u(t.domNode,!0,!1))),this._register(B(n.domNode,"scroll",g=>u(n.domNode,!0,!1))),this._register(B(this.scrollbarDomNode.domNode,"scroll",g=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(81).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(117)||e.hasChanged(83)||e.hasChanged(49)){const t=this._context.configuration.options,i=t.get(117),n=t.get(83),s=t.get(49),r=t.get(120),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:s,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+HT(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class VT{constructor(e,t,i,n,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=s??0}}class yce{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class Lce{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Uj extends ru{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=new Lce}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamen)continue;const c=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(c,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(s.preference.lane);t.push(new kce(c,h,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===0&&n.type===0?i.className0;){const n=t.peek();if(!n)break;const s=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!s||s.length===0)break;const r=s[0];if(r.type===0){const a=[];for(const l of s){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}class Dce{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new Ice(this.lineNumber,this.laneIndex,e)}}class kce{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class Ice{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}function Iv(o,e,t=o.length-1){const i=Ece(o,e,t);if(i!==-1)return o[i]}function Ece(o,e,t=o.length-1){for(let i=t;i>=0;i--){const n=o[i];if(e(n,i))return i}return-1}function e_(o,e){const t=t_(o,e);return t===-1?void 0:o[t]}function t_(o,e,t=0,i=o.length){let n=t,s=i;for(;n0&&(t=n)}return t}function $j(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i=0&&(t=n)}return t}function jj(o,e){return hF(o,(t,i)=>-e(t,i))}function Tce(o,e){if(o.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function Rce(o,e){for(const t of o){const i=e(t);if(i!==void 0)return i}}class qj extends F{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function qD(o,e){let t=0,i=0;const n=o.length;for(;in)throw new ve("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide);let a=-2,l=-1,c=-2,d=-1;const h=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let k=x-2;k>=0;k--){const I=this._computeIndentLevel(k);if(I>=0){a=k,l=I;break}}}if(c===-2){c=-1,d=-1;for(let k=x;k=0){c=k,d=I;break}}}};let u=-2,g=-1,f=-2,p=-1;const _=x=>{if(u===-2){u=-1,g=-1;for(let k=x-2;k>=0;k--){const I=this._computeIndentLevel(k);if(I>=0){u=k,g=I;break}}}if(f!==-1&&(f===-2||f=0){f=k,p=I;break}}}};let b=0,C=!0,w=0,v=!0,S=0,L=0;for(let x=0;C||v;x++){const k=e-x,I=e+x;x>1&&(k<1||k1&&(I>n||I>i)&&(v=!1),x>5e4&&(C=!1,v=!1);let T=-1;if(C&&k>=1){const O=this._computeIndentLevel(k-1);O>=0?(c=k-1,d=O,T=Math.ceil(O/this.textModel.getOptions().indentSize)):(h(k),T=this._getIndentLevelForWhitespaceLine(r,l,d))}let A=-1;if(v&&I<=n){const O=this._computeIndentLevel(I-1);O>=0?(u=I-1,g=O,A=Math.ceil(O/this.textModel.getOptions().indentSize)):(_(I),A=this._getIndentLevelForWhitespaceLine(r,g,p))}if(x===0){L=T;continue}if(x===1){if(I<=n&&A>=0&&L+1===A){C=!1,b=I,w=I,S=A;continue}if(k>=1&&T>=0&&T-1===L){v=!1,b=k,w=k,S=T;continue}if(b=e,w=e,S=L,S===0)return{startLineNumber:b,endLineNumber:w,indent:S}}C&&(T>=S?b=k:C=!1),v&&(A>=S?w=I:v=!1)}return{startLineNumber:b,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,n){const s=[];for(let h=e;h<=t;h++)s.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new D(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(D.fromPositions(i)).toArray()).filter(u=>D.strictContainsPosition(u.range,i));l=Iv(h,u=>r)?.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Kj;for(const h of a){if(!h.closingBracketRange)continue;const u=l&&h.range.equalsRange(l);if(!u&&!n.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,c)+(n.highlightActive&&u?" "+d.activeClassName:""),f=h.openingBracketRange.getStartPosition(),p=h.closingBracketRange.getStartPosition(),_=n.horizontalGuides===Tg.Enabled||n.horizontalGuides===Tg.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){_&&s[h.range.startLineNumber-e].push(new mg(-1,h.openingBracketRange.getEndPosition().column,g,new uC(!1,p.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(p),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let v=!1;vs(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&s[f.lineNumber-e].push(new mg(w,-1,g,new uC(!1,f.column),-1,-1)),p.lineNumber<=t&&b>w&&s[p.lineNumber-e].push(new mg(w,-1,g,new uC(!v,p.column),-1,-1)))}for(const h of s)h.sort((u,g)=>u.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return hi.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const g=u-e,f=this._computeIndentLevel(u-1);if(f>=0){l=u-1,c=f,a[g]=Math.ceil(f/n.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=u-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,h=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(r,c,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:tn||this._maxIndentLeft>0&&f>this._maxIndentLeft)break;const p=g.horizontalLine?g.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",_=g.horizontalLine?(e.visibleRangeForPosition(new R(l,g.horizontalLine.endColumn))?.left??f+this._spaceWidth)-f:this._spaceWidth;h+=`
`}a[c]=h}this._renderResult=a}getGuidesByLine(e,t,i){const n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Tg.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Tg.EnabledForActive:Tg.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,l=h.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const g=n?n[h-e]:[],f=new Cd(g),p=s?s[h-e]:0;for(let _=1;_<=p;_++){const b=(_-1)*c+1,C=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||g.length===0)&&r<=h&&h<=a&&_===l;u.push(...f.takeWhile(v=>v.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function ip(o){if(!(o&&o.isTransparent()))return o}jr((o,e)=>{const t=[{bracketColor:Oj,guideColor:ace,guideColorActive:gce},{bracketColor:Fj,guideColor:lce,guideColorActive:fce},{bracketColor:Wj,guideColor:cce,guideColorActive:pce},{bracketColor:Bj,guideColor:dce,guideColorActive:mce},{bracketColor:Hj,guideColor:hce,guideColorActive:_ce},{bracketColor:Vj,guideColor:uce,guideColorActive:bce}],i=new Kj,n=[{indentColor:r1,indentColorActive:a1},{indentColor:Ble,indentColorActive:$le},{indentColor:Hle,indentColorActive:jle},{indentColor:Vle,indentColorActive:qle},{indentColor:zle,indentColorActive:Kle},{indentColor:Ule,indentColorActive:Gle}],s=t.map(a=>{const l=o.getColor(a.bracketColor),c=o.getColor(a.guideColor),d=o.getColor(a.guideColorActive),h=ip(ip(c)??l?.transparent(.3)),u=ip(ip(d)??l);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Cn),r=n.map(a=>{const l=o.getColor(a.indentColor),c=o.getColor(a.indentColorActive),d=ip(l),h=ip(c);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Cn);if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class KD extends ru{static{this.CLASS_NAME="line-numbers"}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new R(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(75);const t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);const i=e.get(165);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=oo?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);s.sort((c,d)=>D.compareRangesUsingEnds(c.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=n;c++){const d=c-i,h=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(c,1)).lineNumber;let u=this._getLineRenderLineNumber(c),g="";for(;r${u}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}jr((o,e)=>{const t=o.getColor(Ole),i=o.getColor(Yle);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});const um="monaco-mouse-cursor-text";class XI{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class Yy{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(59);this.renderWhitespace=i.get(113),this.experimentalWhitespaceRendering=i.get(47),this.renderControlCharacters=i.get(108),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(40),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(75),this.stopRenderingLineAfter=i.get(133),this.fontLigatures=i.get(60),this.verticalScrollbarSize=i.get(117).verticalScrollbarSize,this.useGpu=i.get(46)==="on"}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}}class Ace{constructor(){this._currentVisibleRange=new D(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Oce{constructor(e,t,i,n,s,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Fce{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;lnew Uc(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,Qa.write(this.domNode,8),this.domNode.setClassName(`view-lines ${um}`),wn(this.domNode,r),this._maxLineWidth=0,this._asyncUpdateLineWidths=new It(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new It(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Ace,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(131).enabled,this._maxNumberStickyLines=s.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(59),n=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,wn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Yy(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++)this._visibleLines.getVisibleLine(s).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let s=t;s<=i;s++)n=this._visibleLines.getVisibleLine(s).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Oce(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Fce(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const s=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,s),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new R(n,1);const s=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new XI(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=D.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const s=[];let r=0;const a=new XI(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(n.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const u=h===n.startLineNumber?n.startColumn:1,g=h!==i,f=g?this._context.viewModel.getLineMaxColumn(h):n.endColumn,_=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,f,a);if(_){if(t&&hthis._visibleLines.getEndLineNumber())return null;const n=new XI(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}_lineIsRenderedRTL(e){return ethis._visibleLines.getEndLineNumber()?!1:this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new pj(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,s=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){s=!1;continue}n=Math.max(n,a.getWidth(null))}return s&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){const r=this._visibleLines.getVisibleLine(s);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=s)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=n;s++)this._visibleLines.getVisibleLine(s).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const n=this._computeScrollLeftToReveal(i);n&&(!this._isViewportWrapping&&!n.hasRTL&&this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),oo&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++)if(this._visibleLines.getVisibleLine(s).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let b=s[0].startLineNumber,C=s[0].endLineNumber;for(let w=1,v=s.length;wl){if(!d)return-1;_=h}else if(r===5||r===6)if(r===6&&a<=h&&u<=c)_=a;else{const b=Math.max(5*this._lineHeight,l*.2),C=h-b,w=u-l;_=Math.max(w,C)}else if(r===1||r===2)if(r===2&&a<=h&&u<=c)_=a;else{const b=(h+u)/2;_=Math.max(0,b-l/2)}else _=this._computeMinimumScrolling(a,c,h,u,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(165),n=t.left,s=n+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0,l=!1;if(e.type==="range"){l=this._lineIsRenderedRTL(e.lineNumber);const d=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}else for(const d of e.selections){if(d.startLineNumber!==d.endLineNumber)return null;const h=this._visibleRangesForLineRange(d.startLineNumber,d.startColumn,d.endColumn);if(l||=this._lineIsRenderedRTL(d.startLineNumber),!h)return null;for(const u of h.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-uF.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,s,r,a),maxHorizontalOffset:a,hasRTL:l}}_computeMinimumScrolling(e,t,i,n,s,r){e=e|0,t=t|0,i=i|0,n=n|0,s=!!s,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}}class Wce extends Uj{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(165);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let s=0,r=t.length;s',l=[];for(let c=t;c<=i;c++){const d=c-t,h=n[d].getDecorations();let u="";for(const g of h){let f='
';s[a]=c}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class kr{static{this.Empty=new kr(0,0,0,0)}constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=kr._clamp(e),this.g=kr._clamp(t),this.b=kr._clamp(i),this.a=kr._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}let Hce=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),ge(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new Vce(this,e,t);return this._factories.set(e,i),ge(()=>{const n=this._factories.get(e);!n||n!==i||(this._factories.delete(e),n.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class Vce extends F{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let Tv=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class gF{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class GD{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var bo;(function(o){o[o.Increase=0]="Increase",o[o.Decrease=1]="Decrease"})(bo||(bo={}));var i_;(function(o){const e=new Map;e.set(0,Z.symbolMethod),e.set(1,Z.symbolFunction),e.set(2,Z.symbolConstructor),e.set(3,Z.symbolField),e.set(4,Z.symbolVariable),e.set(5,Z.symbolClass),e.set(6,Z.symbolStruct),e.set(7,Z.symbolInterface),e.set(8,Z.symbolModule),e.set(9,Z.symbolProperty),e.set(10,Z.symbolEvent),e.set(11,Z.symbolOperator),e.set(12,Z.symbolUnit),e.set(13,Z.symbolValue),e.set(15,Z.symbolEnum),e.set(14,Z.symbolConstant),e.set(15,Z.symbolEnum),e.set(16,Z.symbolEnumMember),e.set(17,Z.symbolKeyword),e.set(28,Z.symbolSnippet),e.set(18,Z.symbolText),e.set(19,Z.symbolColor),e.set(20,Z.symbolFile),e.set(21,Z.symbolReference),e.set(22,Z.symbolCustomColor),e.set(23,Z.symbolFolder),e.set(24,Z.symbolTypeParameter),e.set(25,Z.account),e.set(26,Z.issues),e.set(27,Z.tools);function t(r){let a=e.get(r);return a||(console.info("No codicon found for CompletionItemKind "+r),a=Z.symbolProperty),a}o.toIcon=t;function i(r){switch(r){case 0:return m(728,"Method");case 1:return m(729,"Function");case 2:return m(730,"Constructor");case 3:return m(731,"Field");case 4:return m(732,"Variable");case 5:return m(733,"Class");case 6:return m(734,"Struct");case 7:return m(735,"Interface");case 8:return m(736,"Module");case 9:return m(737,"Property");case 10:return m(738,"Event");case 11:return m(739,"Operator");case 12:return m(740,"Unit");case 13:return m(741,"Value");case 14:return m(742,"Constant");case 15:return m(743,"Enum");case 16:return m(744,"Enum Member");case 17:return m(745,"Keyword");case 18:return m(746,"Text");case 19:return m(747,"Color");case 20:return m(748,"File");case 21:return m(749,"Reference");case 22:return m(750,"Custom Color");case 23:return m(751,"Folder");case 24:return m(752,"Type Parameter");case 25:return m(753,"User");case 26:return m(754,"Issue");case 27:return m(755,"Tool");case 28:return m(756,"Snippet");default:return""}}o.toLabel=i;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",28),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),n.set("tool",27);function s(r,a){let l=n.get(r);return typeof l>"u"&&!a&&(l=9),l}o.fromString=s})(i_||(i_={}));var Zs;(function(o){o[o.Automatic=0]="Automatic",o[o.Explicit=1]="Explicit"})(Zs||(Zs={}));class Gj{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return D.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var zT;(function(o){o[o.Code=1]="Code",o[o.Label=2]="Label"})(zT||(zT={}));class ZD{static fromExtensionId(e){return new ZD(e,void 0,void 0)}constructor(e,t,i){this.extensionId=e,this.extensionVersion=t,this.providerId=i}toString(){let e="";return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),e.length===0&&(e="unknown"),e}toStringWithoutVersion(){let e="";return this.extensionId&&(e+=this.extensionId),this.providerId&&(e+=`:${this.providerId}`),e}}var Jg;(function(o){o[o.Accepted=0]="Accepted",o[o.Rejected=1]="Rejected",o[o.Ignored=2]="Ignored"})(Jg||(Jg={}));var Rv;(function(o){o[o.Automatic=0]="Automatic",o[o.PasteAs=1]="PasteAs"})(Rv||(Rv={}));var Hl;(function(o){o[o.Invoke=1]="Invoke",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange"})(Hl||(Hl={}));var n_;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(n_||(n_={}));function zce(o){return!!o&&be.isUri(o.uri)&&D.isIRange(o.range)&&(D.isIRange(o.originSelectionRange)||D.isIRange(o.targetSelectionRange))}const Uce={17:m(757,"array"),16:m(758,"boolean"),4:m(759,"class"),13:m(760,"constant"),8:m(761,"constructor"),9:m(762,"enumeration"),21:m(763,"enumeration member"),23:m(764,"event"),7:m(765,"field"),0:m(766,"file"),11:m(767,"function"),10:m(768,"interface"),19:m(769,"key"),5:m(770,"method"),1:m(771,"module"),2:m(772,"namespace"),20:m(773,"null"),15:m(774,"number"),18:m(775,"object"),24:m(776,"operator"),3:m(777,"package"),6:m(778,"property"),14:m(779,"string"),22:m(780,"struct"),25:m(781,"type parameter"),12:m(782,"variable")};function $ce(o,e){return m(783,"{0} ({1})",o,Uce[e])}var Xy;(function(o){const e=new Map;e.set(0,Z.symbolFile),e.set(1,Z.symbolModule),e.set(2,Z.symbolNamespace),e.set(3,Z.symbolPackage),e.set(4,Z.symbolClass),e.set(5,Z.symbolMethod),e.set(6,Z.symbolProperty),e.set(7,Z.symbolField),e.set(8,Z.symbolConstructor),e.set(9,Z.symbolEnum),e.set(10,Z.symbolInterface),e.set(11,Z.symbolFunction),e.set(12,Z.symbolVariable),e.set(13,Z.symbolConstant),e.set(14,Z.symbolString),e.set(15,Z.symbolNumber),e.set(16,Z.symbolBoolean),e.set(17,Z.symbolArray),e.set(18,Z.symbolObject),e.set(19,Z.symbolKey),e.set(20,Z.symbolNull),e.set(21,Z.symbolEnumMember),e.set(22,Z.symbolStruct),e.set(23,Z.symbolEvent),e.set(24,Z.symbolOperator),e.set(25,Z.symbolTypeParameter);function t(s){let r=e.get(s);return r||(console.info("No codicon found for SymbolKind "+s),r=Z.symbolProperty),r}o.toIcon=t;const i=new Map;i.set(0,20),i.set(1,8),i.set(2,8),i.set(3,8),i.set(4,5),i.set(5,0),i.set(6,9),i.set(7,3),i.set(8,2),i.set(9,15),i.set(10,7),i.set(11,1),i.set(12,4),i.set(13,14),i.set(14,18),i.set(15,13),i.set(16,13),i.set(17,13),i.set(18,13),i.set(19,17),i.set(20,13),i.set(21,16),i.set(22,6),i.set(23,10),i.set(24,11),i.set(25,24);function n(s){let r=i.get(s);return r===void 0&&(console.info("No completion kind found for SymbolKind "+s),r=20),r}o.toCompletionKind=n})(Xy||(Xy={}));let Mf=class $d{static{this.Comment=new $d("comment")}static{this.Imports=new $d("imports")}static{this.Region=new $d("region")}static fromValue(e){switch(e){case"comment":return $d.Comment;case"imports":return $d.Imports;case"region":return $d.Region}return new $d(e)}constructor(e){this.value=e}};var UT;(function(o){o[o.AIGenerated=1]="AIGenerated"})(UT||(UT={}));var Mv;(function(o){o[o.Invoke=0]="Invoke",o[o.Automatic=1]="Automatic"})(Mv||(Mv={}));var $T;(function(o){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}o.is=e})($T||($T={}));var Qy;(function(o){o[o.Type=1]="Type",o[o.Parameter=2]="Parameter"})(Qy||(Qy={}));class jce{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const bi=new Hce;class YD extends F{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||(this._INSTANCE=new YD),this._INSTANCE}constructor(){super(),this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(bi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=bi.getColorMap();if(!e){this._colors=[kr.Empty],this._backgroundIsLight=!0;return}this._colors=[kr.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}const qce=(()=>{const o=[];for(let e=32;e<=126;e++)o.push(e);return o.push(65533),o})(),Kce=(o,e)=>(o-=32,o<0||o>96?e<=2?(o+96)%96:95:o);class Pv{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Pv.soften(e,12/15),this.charDataLight=Pv.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;ne.width||i+f>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=Kce(n,c),b=e.width*4,C=a.r,w=a.g,v=a.b,S=s.r-C,L=s.g-w,x=s.b-v,k=Math.max(r,l),I=e.data;let T=_*u*g,A=i*b+t*4;for(let O=0;Oe.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*4,g=.5*(s/255),f=r.r,p=r.g,_=r.b,b=n.r-f,C=n.g-p,w=n.b-_,v=f+b*g,S=p+C*g,L=_+w*g,x=Math.max(s,a),k=e.data;let I=i*u+t*4;for(let T=0;T{const e=new Uint8ClampedArray(o.length/2);for(let t=0;t>1]=k9[o[t]]<<4|k9[o[t+1]]&15;return e},E9={1:qg(()=>I9("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:qg(()=>I9("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class gC{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return E9[e]?i=new Pv(E9[e](),e):i=gC.createFromSampleData(gC.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const s of qce)i.fillText(String.fromCharCode(s),n,16/2),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const n=gC._downsample(e,t);return new Pv(n,t)}static _downsampleChar(e,t,i,n,s){const r=1*s,a=2*s;let l=n,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dt===1)}function mF(o,e){return Yj(o,e.range,t=>t===2)}function Yj(o,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=o.tokenization.getLineTokens(i),s=i===e.startLineNumber,r=i===e.endLineNumber;let a=s?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}const Zce=140,Yce=2;class gm{constructor(e,t,i){const n=e.options,s=n.get(163),r=n.get(165),a=r.minimap,l=n.get(59),c=n.get(81);this.renderMinimap=a.renderMinimap,this.size=c.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(119),this.paddingTop=n.get(96).top,this.paddingBottom=n.get(96).bottom,this.showSlider=c.showSlider,this.autohide=c.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(75),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=r.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Gce,this.sectionHeaderFontSize=c.sectionHeaderFontSize*s,this.sectionHeaderLetterSpacing=c.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=gm._getSectionHeaderColor(t,i.getColor(1)),this.charRenderer=qg(()=>gC.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=gm._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=gm._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Cre);return i?new kr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(vre);return t?kr._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(nc);return i?new kr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class fC{constructor(e,t,i,n,s,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,s,r,a,l,c,d,h){const u=e.pixelRatio,g=e.minimapLineHeight,f=Math.floor(e.canvasInnerHeight/g),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,s-e.lineHeight-e.paddingBottom));const x=Math.max(1,Math.floor(s*s/L)),k=Math.max(0,e.minimapHeight-x),I=k/(d-s),T=c*I,A=k>0,O=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),W=Math.floor(e.paddingTop/e.lineHeight);return new fC(c,d,A,I,T,x,W,1,Math.min(a,O))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*g/u)}else{const L=s/p;_=Math.floor(L*g/u)}const b=Math.floor(e.paddingTop/p);let C=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const L=s/p;C=Math.max(C,L-1)}let w;if(C>0){const L=s/p;w=(b+a+C-L-1)*g/u}else w=Math.max(0,(b+a)*g/u-_);w=Math.min(e.minimapHeight-_,w);const v=w/(d-s),S=c*v;if(f>=b+a+C){const L=w>0;return new fC(c,d,L,v,S,_,b,1,a)}else{let L;t>1?L=t+b:L=Math.max(1,c/p);let x,k=Math.max(1,Math.floor(L-S*u/g));kc&&(k=Math.min(k,h.startLineNumber),x=Math.max(x,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?A=(t-k+x+T)*g/u:A=c/e.paddingTop*(x+T)*g/u,new fC(c,d,!0,v,A,_,x,k,I)}}}class XD{static{this.INVALID=new XD(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}class N9{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new kj({createLine:()=>XD.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,s=i.length;n1){for(let b=0,C=n-1;b0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Av.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let s=0,r=t-e+1;s!i.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter(n=>!!n.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new D(s,1,r,this._context.viewModel.getLineMaxColumn(r))}else i=new D(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const s=[];for(const r of n){if(!r.options.minimap)continue;const a=r.range,l=this._samplingState.modelLineToMinimapLine(a.startLineNumber),c=this._samplingState.modelLineToMinimapLine(a.endLineNumber);s.push(new Zj(new D(l,a.startColumn,c,a.endColumn),r.options))}return s}return n}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const n=this._sectionHeaderCache.get(i);if(n)return n;const s=t(i);return this._sectionHeaderCache.set(i,s),s}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new D(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class Vp extends F{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(b9),this._domNode=mt(document.createElement("div")),Qa.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=mt(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=mt(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=mt(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=mt(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=mt(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new It(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register(Ti(this._domNode.domNode,te.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register(Ti(this._domNode.domNode,te.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=Ti(this._domNode.domNode,te.POINTER_DOWN,i=>{i.preventDefault();const n=i.pointerType==="mouse",s=i.button===0;if(this._model.options.renderMinimap!==0&&this._lastRenderData){if(this._model.options.size!=="proportional"){if(s&&this._lastRenderData){const a=wi(this._slider.domNode),l=a.top+a.height/2;this._startSliderDragging(i,l,this._lastRenderData.renderedLayout)}return}if(s||!n){const a=this._model.options.minimapLineHeight,l=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let d=Math.floor(l/a)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;d=Math.min(d,this._model.getLineCount()),this._model.revealLineNumber(d)}}}),this._sliderPointerMoveMonitor=new W_,this._sliderPointerDownListener=Ti(this._slider.domNode,te.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=ni.addTarget(this._domNode.domNode),this._sliderTouchStartListener=B(this._domNode.domNode,Bt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=B(this._domNode.domNode,Bt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ti(this._domNode.domNode,Bt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){if(this._isMouseOverMinimap){this._hideSoon();return}this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const s=(r,a)=>{const l=wi(this._domNode.domNode),c=Math.min(Math.abs(a-n),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Rn&&c>Zce){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>s(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide==="mouseover"?e.push("minimap-autohide-mouseover"):this._model.options.autohide==="scroll"&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new _F(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return this._model.options.autohide==="scroll"&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(b9),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=fC.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(D.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,g)=>(u.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,n,s);const d=new T9(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const h=new T9(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,h,e,r,l,a,n),this._renderDecorationsHighlights(c,i,h,e,r,l,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=n.intersectWithViewport(l);if(!c)continue;const[d,h]=c;for(let f=d;f<=h;f++)i.set(f,!0);const u=n.getYForLineNumber(d,s),g=n.getYForLineNumber(h,s);a>=u||(a>r&&e.fillRect(_l,r,e.canvas.width,a-r),r=u),a=g}a>r&&e.fillRect(_l,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,s){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[h,u]=d,g=c.getColor(this._theme.value);if(!g||g.isTransparent())continue;let f=r.get(g.toString());f||(f=g.transparent(.5).toString(),r.set(g.toString(),f)),e.fillStyle=f;for(let p=h;p<=u;p++){if(i.has(p))continue;i.set(p,!0);const _=n.getYForLineNumber(h,s);e.fillRect(_l,_,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=n.intersectWithViewport(c);if(!d)continue;const[h,u]=d;for(let g=h;g<=u;g++)this.renderDecorationOnLine(e,i,c,this._selectionColor,n,g,s,s,r,a,l)}}_renderDecorationsHighlights(e,t,i,n,s,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const h=n.intersectWithViewport(c.range);if(!h)continue;const[u,g]=h,f=d.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let p=u;p<=g;p++)switch(d.position){case 1:this.renderDecorationOnLine(e,i,c.range,f,n,p,s,s,r,a,l);continue;case 2:{const _=n.getYForLineNumber(p,s);this.renderDecoration(e,f,2,_,Yce,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,r,a,l,c,d,h){const u=s.getYForLineNumber(r,l);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:f}=i,p=g===r?i.startColumn:1,_=f===r?i.endColumn:this._model.getLineMaxColumn(r),b=this.getXOffsetForPosition(t,r,p,c,d,h),C=this.getXOffsetForPosition(t,r,_,c,d,h);this.renderDecoration(e,n,b,u,C-b,a)}getXOffsetForPosition(e,t,i,n,s,r){if(i===1)return _l;if((i-1)*s>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[_l];let d=_l;for(let h=1;h=r){l[h]=r;break}l[h]=f,d=f}e.set(t,l)}return i-1p.range.startLineNumber-_.range.startLineNumber);const f=Vp._fitSectionHeader.bind(null,u,r-_l);for(const p of g){const _=e.getYForLineNumber(p.range.startLineNumber,t)+i,b=_-i,C=b+2,w=this._model.getSectionHeaderText(p,f);Vp._renderSectionLabel(u,w,p.options.minimap?.sectionHeaderStyle===2,l,d,r,b,s,_,C)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",s=e.measureText(i).width,r=e.measureText(n).width;if(s<=t||s<=r)return i;const a=i.length,l=s/i.length,c=Math.floor((t-r)/l)-1;let d=Math.ceil(c/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+n+i.substring(a-(c-d))}static _renderSectionLabel(e,t,i,n,s,r,a,l,c,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,l),e.fillStyle=s,e.fillText(t,_l,c)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const q=this._lastRenderData._get();return new N9(e,q.imageData,q.lines)}const s=this._getBuffer();if(!s)return null;const[r,a,l]=Vp._renderUntouchedLines(s,e.topPaddingLineCount,t,i,n,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,f=this._model.tokensColorTracker,p=f.backgroundIsLight(),_=this._model.options.renderMinimap,b=this._model.options.charRenderer(),C=this._model.options.fontScale,w=this._model.options.minimapCharWidth,S=(_===1?2:3)*C,L=n>S?Math.floor((n-S)/2):0,x=u.a/255,k=new kr(Math.round((u.r-h.r)*x+h.r),Math.round((u.g-h.g)*x+h.g),Math.round((u.b-h.b)*x+h.b),255);let I=e.topPaddingLineCount*n;const T=[];for(let q=0,ie=i-t+1;q=0&&AC)return;const O=_.charCodeAt(S);if(O===9){const W=u-(S+L)%u;L+=W-1,v+=W*r}else if(O===32)v+=r;else{const W=_d(O)?2:1;for(let U=0;UC)return}}}}}class T9{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,s=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Qce extends zs{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=mt(document.createElement("div")),Qa.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=mt(document.createElement("div")),Qa.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}_widgetCanOverflow(e){const i=this._context.configuration.options.get(4);return(e.allowEditorOverflow||!1)&&i}addWidget(e){const t=mt(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,s=t?.stackOridinal;return i.preference===n&&i.stack===s?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=s,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i0);t.sort((n,s)=>(this._widgets[n].stack||0)-(this._widgets[s].stack||0));for(let n=0,s=t.length;nt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Qt(e.data,t.data)}static equalsArr(e,t){return Qt(e,t,Ov.equals)}}class ede{constructor(e,t){const i=e.options;this.lineHeight=i.get(75),this.pixelRatio=i.get(163),this.overviewRulerLanes=i.get(95),this.renderBorder=i.get(94);const n=t.getColor(Qle);this.borderColor=n?n.toString():null,this.hideCursor=i.get(68);const s=t.getColor($D);this.cursorColorSingle=s?s.transparent(.7).toString():null;const r=t.getColor(Mj);this.cursorColorPrimary=r?r.transparent(.7).toString():null;const a=t.getColor(Pj);this.cursorColorSecondary=a?a.transparent(.7).toString():null,this.themeType=t.type;const l=i.get(81),c=l.enabled,d=l.side,h=t.getColor(Jle),u=bi.getDefaultBackground();h?this.backgroundColor=h:c&&d==="right"?this.backgroundColor=u:this.backgroundColor=null;const f=i.get(165).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[p,_]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=_}_initLanes(e,t,i){const n=t-e;if(i>=3){const s=Math.floor(n/3),r=Math.floor(n/3),a=n-s-r,l=e,c=l+s,d=l+s+a;return[[0,l,c,l,d,l,c,l],[0,s,a,s+a,r,s+a+r,a+r,s+a+r]]}else if(i===2){const s=Math.floor(n/2),r=n-s,a=e,l=a+s;return[[0,a,a,a,l,a,a,a],[0,s,s,s,r,s+r,s+r,s+r]]}else{const s=e,r=n;return[[0,s,s,s,s,s,s,s],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&V.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class tde extends zs{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=mt(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=bi.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new R(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new ede(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((t,i)=>R.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?V.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Ov.compareByRenderingProps),this._actualShouldRender===1&&!Ov.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Qt(this._renderedCursorPositions,this._cursorPositions,(f,p)=>f.position.lineNumber===p.position.lineNumber&&f.color===p.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,s=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=n/a,c=6*this._settings.pixelRatio|0,d=c/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=V.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=V.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const u=this._settings.x,g=this._settings.w;for(const f of t){const p=f.color,_=f.data;h.fillStyle=p;let b=0,C=0,w=0;for(let v=0,S=_.length/3;vn&&(O=n-d),I=O-d,T=O+d}I>w+1||L!==b?(v!==0&&h.fillRect(u[b],C,g[b],w-C),b=L,C=I,w=T):T>w&&(w=T)}h.fillRect(u[b],C,g[b],w-C)}if(!this._settings.hideCursor){const f=2*this._settings.pixelRatio|0,p=f/2|0,_=this._settings.x[7],b=this._settings.w[7];let C=-100,w=-100,v=null;for(let S=0,L=this._cursorPositions.length;Sn&&(I=n-p);const T=I-p,A=T+f;T>w+1||x!==v?(S!==0&&v&&h.fillRect(_,C,b,w-C),C=T,w=A):A>w&&(w=A),v=x,h.fillStyle=x}v&&h.fillRect(_,C,b,w-C)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}class M9{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Xj{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const b=d.color;let C=this._color2Id[b];C||(C=++this._lastAssignedId,this._color2Id[b]=C,this._id2Color[C]=b);const w=new M9(p-_,p+_,C);d.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(M9.compare),a}}class nde extends Tf{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=mt(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new ide(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(75)),this._zoneManager.setPixelRatio(i.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,h=l.to;c!==s?(e.fillRect(0,r,n,a-r),s=c,e.fillStyle=i[s],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=d,a=h)}e.fillRect(0,r,n,a-r)}}class sde extends zs{constructor(e){super(e),this.domNode=mt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=mt(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(s),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const n=this._renderedRulers.pop();this.domNode.removeChild(n),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(165);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(117);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class rde{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ade{constructor(e,t){this.lineNumber=e,this.ranges=t}}function lde(o){return new rde(o)}function cde(o){return new ade(o.lineNumber,o.ranges.map(lde))}class xn extends ru{static{this.SELECTION_CLASS_NAME="selected-text"}static{this.SELECTION_TOP_LEFT="top-left-radius"}static{this.SELECTION_BOTTOM_LEFT="bottom-left-radius"}static{this.SELECTION_TOP_RIGHT="top-right-radius"}static{this.SELECTION_BOTTOM_RIGHT="bottom-right-radius"}static{this.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background"}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let s=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!s&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);s&&!s.startStyle&&(s=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const f=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;tS(d-f)f&&(u.top=1),tS(h-p)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const s=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let l=0,c=n.length;l1,c)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}jr((o,e)=>{const t=o.getColor(Joe);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function tS(o){return o<0?-o:o}class P9{constructor(e,t,i,n,s,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=r,this.textContentClassName=a}}var Xc;(function(o){o[o.Single=0]="Single",o[o.MultiPrimary=1]="MultiPrimary",o[o.MultiSecondary=2]="MultiSecondary"})(Xc||(Xc={}));class A9{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(59);this._cursorStyle=i.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(38),this._isVisible=!0,this._domNode=mt(document.createElement("div")),this._domNode.setClassName(`cursor ${um}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),wn(this._domNode,n),this._domNode.setDisplay("none"),this._position=new R(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case Xc.Single:this._pluralityClass="";break;case Xc.MultiPrimary:this._pluralityClass="cursor-primary";break;case Xc.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),wn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=Nee(i,t-1);return[new R(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="";const[n,s]=this._getGraphemeAwarePosition(),r=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),a=this._lineCursorHeight===0?r:Math.min(r,this._lineCursorHeight),l=(r-a)/2;if(this._cursorStyle===cn.Line||this._cursorStyle===cn.LineThin){const p=e.visibleRangeForPosition(n);if(!p||p.outsideRenderedLine)return null;const _=me(this._domNode.domNode);let b;this._cursorStyle===cn.Line?(b=E7(_,this._lineCursorWidth>0?this._lineCursorWidth:2),b>2&&(t=s,i=this._getTokenClassName(n))):b=E7(_,1);let C=p.left,w=0;b>=2&&C>=1&&(w=1,C-=w);const v=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+l;return new P9(v,C,w,b,a,t,i)}const c=e.linesVisibleRangesForRange(new D(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!c||c.length===0)return null;const d=c[0];if(d.outsideRenderedLine||d.ranges.length===0)return null;const h=d.ranges[0],u=s===" "?this._typicalHalfwidthCharacterWidth:h.width<1?this._typicalHalfwidthCharacterWidth:h.width;this._cursorStyle===cn.Block&&(t=s,i=this._getTokenClassName(n));let g=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,f=r;return(this._cursorStyle===cn.Underline||this._cursorStyle===cn.UnderlineThin)&&(g+=r-2,f=2),new P9(g,h.left,0,u,f,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${um} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class Jy extends zs{static{this.BLINK_INTERVAL=500}constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new A9(this._context,Xc.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=mt(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Io,this._cursorFlatBlinkInterval=new D4,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const s=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,s=e.ranges.length;n{this._isVisible?this._hide():this._show()},Jy.BLINK_INTERVAL,me(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Jy.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case cn.Line:e+=" cursor-line-style";break;case cn.Block:e+=" cursor-block-style";break;case cn.Underline:e+=" cursor-underline-style";break;case cn.LineThin:e+=" cursor-line-thin-style";break;case cn.BlockOutline:e+=" cursor-block-outline-style";break;case cn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:$D,background:cF},{class:".cursor-primary",foreground:Mj,background:Ple},{class:".cursor-secondary",foreground:Pj,background:Ale}];for(const i of t){const n=o.getColor(i.foreground);if(n){let s=o.getColor(i.background);s||(s=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${s}; }`),qa(o.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`)}}});const QI=()=>{throw new Error("Invalid change accessor")};class dde extends zs{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=mt(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=mt(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const s=Object.keys(this._zones);for(let r=0,a=s.length;r{const n={addZone:s=>(t=!0,this._addZone(i,s)),removeZone:s=>{s&&(t=this._removeZone(i,s)||t)},layoutZone:s=>{s&&(t=this._layoutZone(i,s)||t)}};hde(e,n),n.addZone=QI,n.removeZone=QI,n.layoutZone=QI}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),s={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:mt(t.domNode),marginDomNode:t.marginDomNode?mt(t.marginDomNode):null};return this._safeCallOnComputedHeight(s.delegate,i.heightInPx),s.domNode.setPosition("absolute"),s.domNode.domNode.style.width="100%",s.domNode.setDisplay("none"),s.domNode.setAttribute("monaco-view-zone",s.whitespaceId),this.domNode.appendChild(s.domNode),s.marginDomNode&&(s.marginDomNode.setPosition("absolute"),s.marginDomNode.domNode.style.width="100%",s.marginDomNode.setDisplay("none"),s.marginDomNode.setAttribute("monaco-view-zone",s.whitespaceId),this.marginDomNode.appendChild(s.marginDomNode)),this._zones[s.whitespaceId]=s,this.setShouldRender(),s.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){Te(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Te(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!0);const s=Object.keys(this._zones);for(let r=0,a=s.length;rr)continue;const u=h.startLineNumber===r?h.startColumn:l.minColumn,g=h.endLineNumber===r?h.endColumn:l.maxColumn;u=x&&O<=k&&W===32){const q=O-1>=0?a.charCodeAt(O-1):0,ie=O+1=0?a.charCodeAt(O-1):0;if(W===32&&q!==32&&q!==9)continue}if(i&&!(T&&T.start<=O&&O`):W===9?S+=`
${v?"→":"→"}
`:S+=`
${String.fromCharCode(w)}
`)}return r?(A=Math.round(A+_),``+S+""):S}_renderArrow(e,t,i){const n=t/7,s=t,r=e/2,a=i,l={x:0,y:n/2},c={x:100/125*s,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},h={x:d.x+.1*c.x,y:d.y+.1*c.x},u={x:h.x+.35*c.x,y:h.y-.35*c.x},g={x:u.x,y:-u.y},f={x:h.x,y:-h.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},b={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class O9{constructor(e){const t=e.options,i=t.get(59),n=t.get(47);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="svg"?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class gde{constructor(e,t,i,n){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new D(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class fde{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class pde{constructor(e,t,i){this.configuration=e,this.theme=new fde(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}const Rg=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function ef(o){if(!o)throw new Error(`Value "${o}" cannot be null`);return o}function Qj(o,e,t){let i=new e.ResizeObserver(n=>{const s=n.find(l=>l.target===o);if(!s)return;if(!("devicePixelContentBoxSize"in s)){i?.disconnect(),i=void 0;return}const r=s.devicePixelContentBoxSize[0].inlineSize,a=s.devicePixelContentBoxSize[0].blockSize;r>0&&a>0&&t(r,a)});try{i.observe(o,{box:["device-pixel-content-box"]})}catch{throw i.disconnect(),i=void 0,new ve("Could not observe device pixel dimensions")}return ge(()=>i?.disconnect())}var mde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};let _de=0;class Fv extends F{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=_de++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=je?"greyscale":"subpixel";const s=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(s*3,s*3),this._ctx=ef(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:this._antiAliasing==="greyscale"})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${s}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return e===""?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){const s=Math.ceil(this.fontSize*this.devicePixelRatio),r=s*3;this._canvas.width!==r&&(this._canvas.width=r,this._canvas.height=r),this._ctx.save();const a=(t&15)/10,l=es.getBackground(t),c=n[l],d=this._decorationStyleCache.getStyleSet(i);this._antiAliasing==="subpixel"?(this._ctx.fillStyle=c,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);const h=new su(200),u=es.getFontStyle(t);u&1&&h.appendString("italic "),d?.bold!==void 0?d.bold&&h.appendString("bold "):u&2&&h.appendString("bold "),h.appendString(`${s}px ${this.fontFamily}`),this._ctx.font=h.build();const g=s,f=s;d?.color!==void 0?this._ctx.fillStyle=`#${d.color.toString(16).padStart(8,"0")}`:this._ctx.fillStyle=n[es.getForeground(t)],this._ctx.textBaseline="top",d?.opacity!==void 0&&(this._ctx.globalAlpha=d.opacity),this._ctx.fillText(e,g+a,f),this._ctx.restore();const p=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if(this._antiAliasing==="subpixel"){const _=parseInt(c.substring(1,3),16),b=parseInt(c.substring(3,5),16),C=parseInt(c.substring(5,7),16);this._clearColor(p,_,b,C),this._ctx.putImageData(p,0,0)}return this._findGlyphBoundingBox(p,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-g,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-f,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let s=0;s=t.left;r--){for(let a=0;a=0;r--){for(let a=0;a=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Cde=function(o,e){return function(t,i){e(t,i,o)}};let eL=class extends F{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(ge(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),s=0;for(;this._is){n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=s}this.clear()}};eL=bde([Cde(0,Ht)],eL);class vde extends eL{_requestCallback(e){return St().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){St().clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}class wde extends eL{_requestCallback(e){return St().requestIdleCallback(e)}_cancelCallback(e){St().cancelIdleCallback(e)}}const Sde="requestIdleCallback"in St()?wde:vde;class yde{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=ef(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new ve("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);const n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=ef(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);const s=new Map,r=new Map;for(const a of this._allocatedGlyphs)s.set(a.y,Math.max(s.get(a.y)??0,a.h)),r.set(a.y,Math.max(r.get(a.y)??0,a.x+a.w));for(const a of this._allocatedGlyphs)n.fillStyle="#4040FF",n.fillRect(a.x,a.y,a.w,a.h),n.fillStyle="#FF0000",n.fillRect(a.x,a.y+a.h,a.w,s.get(a.y)-a.h);for(const[a,l]of r.entries())a!==this._currentRow.y&&(n.fillStyle="#FF0000",n.fillRect(l,a,e-l,s.get(a)));return i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0;const s=e*t,r=new Map,a=new Map;for(const l of this._allocatedGlyphs)r.set(l.y,Math.max(r.get(l.y)??0,l.h)),a.set(l.y,Math.max(a.get(l.y)??0,l.x+l.w));for(const l of this._allocatedGlyphs)i+=l.w*l.h,n+=l.w*(r.get(l.y)-l.h);for(const[l,c]of a.entries())l!==this._currentRow.y&&(n+=(e-c)*r.get(l));return[`page${this._textureIndex}:`,` Total: ${s} (${e}x${t})`,` Used: ${i} (${(i/s*100).toPrecision(2)}%)`,` Wasted: ${n} (${(n/s*100).toPrecision(2)}%)`,`Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`].join(` -`)}}class Lde{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new bD,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=ef(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<this._canvas.width||i>this._canvas.height)throw new ve("Glyph is too large for the atlas page");if(t>this._slabW||i>this._slabH){if(this._allocatedGlyphs.size>0)return;let c=this._canvas.width;for(;t=c&&(s=void 0)}let r,a;if(!s)if(t=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,t=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,i=this._slabsPerRow*this._slabsPerColumn)return;s={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n.w,entryH:n.h,count:0};const d=this._slabW%s.entryW,h=this._slabH%s.entryH;d&&F9(this._openRegionsByWidth,d,{x:s.x+this._slabW-d,w:d,y:s.y,h:this._slabH-(h??0)}),h&&F9(this._openRegionsByHeight,h,{x:s.x,w:this._slabW,y:s.y+this._slabH-h,h}),this._slabs.push(s),this._activeSlabsByDims.set(s,n.w,n.h)}const c=Math.floor(this._slabW/s.entryW);r=s.x+Math.floor(s.count%c)*s.entryW,a=s.y+Math.floor(s.count/c)*s.entryH,s.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,r,a,t,i);const l={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:r,y:a,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(l),l}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=ef(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let s=0,r=0,a=0;const l=64<l&&(u=0,g+=h.entryH),n.fillStyle="#FF0000",n.fillRect(h.x+u,h.y+g,h.entryW,h.entryH),s+=h.entryW*h.entryH,u+=h.entryW;const f=Math.floor(l/h.entryW),p=Math.floor(c/h.entryH);h.entryW*f*h.entryH*p}for(const h of this._allocatedGlyphs)r+=h.w*h.h,n.fillStyle="#4040FF",n.fillRect(h.x,h.y,h.w,h.h);const d=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const h of d)n.fillStyle="#FF000088",n.fillRect(h.x,h.y,h.w,h.h),a+=h.w*h.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0,s=0,r=0,a=0;const l=e*t,c=64<c&&(p=0,_+=f.entryH),i+=f.entryW*f.entryH,p+=f.entryW;const b=Math.floor(c/f.entryW),C=Math.floor(d/f.entryH),w=f.entryW*b*f.entryH*C;s+=c*d-w}for(const f of this._allocatedGlyphs)n+=f.w*f.h;const h=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const f of h)a+=f.w*f.h;const u=s-a;r=i-(n-u);const g=n/(n+r+a);return[`page[${this._textureIndex}]:`,` Total: ${l}px (${e}x${t})`,` Used: ${n}px (${(n/l*100).toFixed(2)}%)`,` Wasted: ${r}px (${(r/l*100).toFixed(2)}%)`,`Restricted: ${a}px (${(a/l*100).toFixed(2)}%) (hard to allocate)`,`Efficiency: ${g===1?"100":(g*100).toFixed(2)}%`,` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/c)*Math.floor(this._canvas.height/d)}`].join(` -`)}}function F9(o,e,t){let i=o.get(e);i||(i=[],o.set(e,i)),i.push(t)}var xde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},W9=function(o,e){return function(t,i){e(t,i,o)}},jT;let Fa=class extends F{static{jT=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,s){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new bD,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=s.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new yde(this._canvas,e);break;case"slab":this._allocator=new Lde(this._canvas,e);break;default:this._allocator=i(this._canvas,e);break}this._register(ge(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=jT.maximumGlyphCount)return;const s=e.rasterizeGlyph(t,i,n,this._colorMap),r=this._allocator.allocate(s);if(r!==void 0)return this._glyphMap.set(r,t,i,n,e.cacheKey),this._glyphInOrderSet.add(r),this._version++,this._usedArea.right=Math.max(this._usedArea.right,r.x+r.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,r.y+r.h-1),this._logService.getLevel()===ln.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:s,glyph:r}),r}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};Fa=jT=xde([W9(3,Ht),W9(4,pi)],Fa);var Dde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},B9=function(o,e){return function(t,i){e(t,i,o)}},P0;let _h=class extends F{static{P0=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,i,n,s){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=s,this._warmUpTask=this._register(new _t),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new bD,this._onDidDeleteGlyphs=this._register(new P),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(se.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));const r=Math.max(1,Math.floor(St().devicePixelRatio));this.pageSize=Math.min(1024*r,this._maxTextureSize),this._initFirstPage(),this._register(ge(()=>vt(this._pages)))}_initFirstPage(){const e=this._instantiationService.createInstance(Fa,0,this.pageSize,this._allocatorType);this._pages.push(e);const t=new Fv(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(const e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,s){return i&=-2048,i|=Math.floor(s%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,s){return this._glyphPageIndex.set(e,i,n,s,t.cacheKey),this._pages[e].getGlyph(t,i,n,s)??(e+1=P0.maximumPageCount)throw new Error(`Attempt to create a texture atlas page past the limit ${P0.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(Fa,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){const t=this._colorMap;if(!t)throw new ve("Cannot warm atlas without color map");this._warmUpTask.value?.clear();const i=this._warmUpTask.value=this._instantiationService.createInstance(Sde);for(let n=65;n<=90;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)});for(let n=97;n<=122;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)});for(let n=33;n<=126;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)})}};_h=P0=Dde([B9(3,pi),B9(4,pe)],_h);var Wv;(function(o){o[o.Ignore=0]="Ignore",o[o.Info=1]="Info",o[o.Warning=2]="Warning",o[o.Error=3]="Error"})(Wv||(Wv={}));(function(o){const e="error",t="warning",i="warn",n="info",s="ignore";function r(l){return l?lg(e,l)?o.Error:lg(t,l)||lg(i,l)?o.Warning:lg(n,l)?o.Info:o.Ignore:o.Ignore}o.fromValue=r;function a(l){switch(l){case o.Error:return e;case o.Warning:return t;case o.Info:return n;default:return s}}o.toString=a})(Wv||(Wv={}));var ci=Wv,U_=ci;const Li=Ve("notificationService");class kde{}var Js;(function(o){async function e(n){try{if(!navigator.gpu)throw new Error("This browser does not support WebGPU");const s=await navigator.gpu.requestAdapter();if(!s)throw new Error("This browser supports WebGPU but it appears to be disabled");return JI(await s.requestDevice())}catch(s){throw n&&n(s.message),s}}o.requestDevice=e;function t(n,s,r){const a=n.createBuffer(s);return r&&n.queue.writeBuffer(a,0,$g(r)?r():r),JI(a)}o.createBuffer=t;function i(n,s){return JI(n.createTexture(s))}o.createTexture=i})(Js||(Js={}));function JI(o){return{object:o,dispose:()=>o.destroy()}}class Ide{get dataOffset(){return this._startIndex}get dirtySize(){if(!(this._startIndex===void 0||this._endIndex===void 0))return this._endIndex-this._startIndex+1}get isDirty(){return this._startIndex!==void 0}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(this._startIndex===void 0||ethis._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}}function Ede(o,e){return new Nde(o,e)}class Nde extends F{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new Ide,this._propertySpecsMap=new Map,this._entries=new bs,this._onDidChange=this._register(new P),this._onDidChangeBuffer=this._register(new P),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let i=0;ivt(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());const t=new Tde(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(se.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose(()=>{const s=t.i;i(),this.view.set(this.view.subarray(s*this._entrySize+2,this._entries.size*this._entrySize+2),s*this._entrySize);for(const r of this._entries)r.i>s&&r.i--;this._dirtyTracker.flag(s,(this._entries.size-s)*this._entrySize),vt(n)})),t}_expandBuffer(){this.capacity*=2;const e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}}class Tde extends F{constructor(e,t,i,n,s){super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new P),this.onWillDispose=this._onWillDispose.event;for(const r of this._propertySpecsMap.values())this._view[this.i*this._propertySpecsMap.size+r.offset]=s[r.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw new Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}}const Rde=` +}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Aoe(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class lf extends A{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;is.lineNumber-r.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}}class EU{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class vw{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let s=0,r=e.length;sl)return null;if(t=Math.min(l,Math.max(0,t)),n=Math.min(l,Math.max(0,n)),t===n&&i===s&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&s===0&&(n--,s=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&s===0&&n>0&&(d=e.children[n-1].firstChild,s=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),s=Math.min(d.textContent.length,Math.max(0,s));const h=this._readClientRects(c,i,d,s,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}class ds{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,n=t.length;if(i!==n)return!1;for(let s=0;s=s||(a[l++]=new ds(Math.max(1,c.startColumn-n+1),Math.min(r+1,c.endColumn-n+1),c.className,c.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const s=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;s[r++]=new ds(h,u,c.inlineClassName,c.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ds._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class Woe{static normalize(e,t){if(t.length===0)return[];const i=[],n=new X0;let s=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);Vi(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);Vi(p)&&d--}const g=c-1,f=d-2;s=n.consumeLowerThan(g,s,i),n.count===0&&(s=g),n.insert(f,h,u)}return n.consumeLowerThan(1073741824,s,i),i}}class zi{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class cd{get isLTR(){return!this.containsRTL&&this.textDirection!==Ho.RTL}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b,C,w,v,S,x=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ds.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=b,this.fontLigatures=C,this.selectionsOnLine=w&&w.sort((I,T)=>I.start>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const s=(t<<16|i<<0)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=ul.getPartIndex(t),n=ul.getCharIndex(t);return new TU(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<<16|i<<0)>>>0;let s=0,r=this.length-1;for(;s+1>>1,_=this._data[p];if(_===n)return p;_>n?r=p:s=p}if(s===r)return s;const a=this._data[s],l=this._data[r];if(a===n)return s;if(l===n)return r;const c=ul.getPartIndex(a),d=ul.getCharIndex(a),h=ul.getPartIndex(l);let u;c!==h?u=t:u=ul.getCharIndex(l);const g=i-d,f=u-i;return g<=f?s:r}}class Q0{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}}function h_(o,e){if(o.lineContent.length===0){if(o.lineDecorations.length>0){e.appendString("");let t=0,i=0,n=0;for(const r of o.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(n|=1,t++),r.type===2&&(n|=2,i++));e.appendString("");const s=new ul(1,t+i);return s.setColumnInfo(1,t,0,0),new Q0(s,n)}return o.renderNewLineWhenEmpty?e.appendString(` +`):e.appendString(""),new Q0(new ul(0,0),0)}return Goe(Voe(o),e)}class Boe{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}function jL(o){const e=new Fh(1e4),t=h_(o,e);return new Boe(t.characterMapping,e.build(),t.containsForeignElements)}class Hoe{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=s,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.renderSpaceCharCode=g,this.renderWhitespace=f,this.renderControlCharacters=p}}function Voe(o){const e=o.lineContent;let t,i,n;o.stopRenderingLineAfter!==-1&&o.stopRenderingLineAfter0){for(let a=0,l=o.lineDecorations.length;a0&&(s[r++]=new zi(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=n){const g=e?um(o.substring(a,n)):!1;s[r++]=new zi(n,h,0,g);break}const u=e?um(o.substring(a,d)):!1;s[r++]=new zi(d,h,0,u),a=d}return s}function Uoe(o,e,t){let i=0;const n=[];let s=0;if(t)for(let r=0,a=e.length;r=50&&(n[s++]=new zi(g+1,d,h,u),f=g+1,g=-1);f!==c&&(n[s++]=new zi(c,d,h,u))}else n[s++]=l;i=c}else for(let r=0,a=e.length;r50){const h=l.type,u=l.metadata,g=l.containsRTL,f=Math.ceil(d/50);for(let p=1;p=8234&&o<=8238||o>=8294&&o<=8297||o>=8206&&o<=8207||o===1564}function joe(o,e){const t=[];let i=new zi(0,"",0,!1),n=0;for(const s of e){const r=s.endIndex;for(;ni.endIndex&&(i=new zi(n,s.type,s.metadata,s.containsRTL),t.push(i)),i=new zi(n+1,"mtkcontrol",s.metadata,!1),t.push(i))}n>i.endIndex&&(i=new zi(r,s.type,s.metadata,s.containsRTL),t.push(i))}return t}function qoe(o,e,t,i){const n=o.continuesWithWrappedLine,s=o.fauxIndentLength,r=o.tabSize,a=o.startVisibleColumn,l=o.useMonospaceOptimizations,c=o.selectionsOnLine,d=o.renderWhitespace===1,h=o.renderWhitespace===3,u=o.renderSpaceWidth!==o.spaceWidth,g=[];let f=0,p=0,_=i[p].type,b=i[p].containsRTL,C=i[p].endIndex;const w=i.length;let v=!1,S=hs(e),x;S===-1?(v=!0,S=t,x=t):x=Qr(e);let k=!1,D=0,I=c&&c[D],T=a%r;for(let O=s;Ox)U=!0;else if(B===9)U=!0;else if(B===32)if(d)if(k)U=!0;else{const K=O+1x),U&&b&&O>=S&&O<=x&&(U=!1),k){if(!U||!l&&T>=r){if(u){const K=f>0?g[f-1].endIndex:s;for(let ie=K+1;ie<=O;ie++)g[f++]=new zi(ie,"mtkw",1,!1)}else g[f++]=new zi(O,"mtkw",1,!1);T=T%r}}else(O===C||U&&O>s)&&(g[f++]=new zi(O,_,0,b),T=T%r);for(B===9?T=r:Yc(B)?T+=2:T++,k=U;O===C&&(p++,p0?e.charCodeAt(t-1):0,B=t>1?e.charCodeAt(t-2):0;O===32&&B!==32&&B!==9||(F=!0)}else F=!0;if(F)if(u){const O=f>0?g[f-1].endIndex:s;for(let B=O+1;B<=t;B++)g[f++]=new zi(B,"mtkw",1,!1)}else g[f++]=new zi(t,"mtkw",1,!1);else g[f++]=new zi(t,_,0,b);return g}function Koe(o,e,t,i){i.sort(ds.compare);const n=Woe.normalize(o,i),s=n.length;let r=0;const a=[];let l=0,c=0;for(let h=0,u=t.length;hc&&(c=C.startOffset,a[l++]=new zi(c,p,_,b)),C.endOffset+1<=f)c=C.endOffset+1,a[l++]=new zi(c,p+" "+C.className,_|C.metadata,b),r++;else{c=f,a[l++]=new zi(c,p+" "+C.className,_|C.metadata,b);break}}f>c&&(c=f,a[l++]=new zi(c,p,_,b))}const d=t[t.length-1].endIndex;if(r");for(let D=0,I=c.length;D=d&&(ce+=it)}}for(K&&(e.appendString(' style="width:'),e.appendString(String(g*X)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let it=2;it<=ke;it++)e.appendCharCode(160)}else ce=2,ke=1,e.appendCharCode(f),e.appendCharCode(8204);S+=ce,x+=ke,w>=d&&(v+=ke)}}else for(e.appendASCIICharCode(62);w=d&&(v+=ce)}ie?k++:k=0,w>=r&&!C&&T.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,D,S,x)),e.appendString("")}return C||b.setColumnInfo(r+1,c.length-1,S,x),a&&(e.appendString(''),e.appendString(m(796,"Show more ({0})",Yoe(l))),e.appendString("")),e.appendString(""),new Q0(b,n)}function Zoe(o){return o.toString(16).toUpperCase().padStart(4,"0")}function Yoe(o){return o<1024?m(797,"{0} chars",o):o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/1024/1024).toFixed(1)} MB`}var _r;(function(o){o.DARK="dark",o.LIGHT="light",o.HIGH_CONTRAST_DARK="hcDark",o.HIGH_CONTRAST_LIGHT="hcLight"})(_r||(_r={}));var cp;(function(o){o.VS="vs",o.VS_DARK="vs-dark",o.HC_BLACK="hc-black",o.HC_LIGHT="hc-light"})(cp||(cp={}));function Na(o){return o===_r.HIGH_CONTRAST_DARK||o===_r.HIGH_CONTRAST_LIGHT}function td(o){return o===_r.DARK||o===_r.HIGH_CONTRAST_DARK}const Xoe=(function(){return Ma?!0:!(Gs||Ks||vg)})();let Ap=!0;class Sc{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=ht(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Na(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===2?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,s){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,n,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,l=ds.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn),c=r.hasVariableFonts||a.experimentalWhitespaceRendering==="off"?a.renderWhitespace:"none",d=!r.hasVariableFonts;let h=null;if(Na(a.themeType)||c==="selection"){const p=n.selections;for(const _ of p){if(_.endLineNumbere)continue;const b=_.startLineNumber===e?_.startColumn:r.minColumn,C=_.endLineNumber===e?_.endColumn:r.maxColumn;b');const g=h_(u,s);s.appendString("");let f=null;return d&&Ap&&Xoe&&r.isBasicASCII&&u.isLTR&&a.useMonospaceOptimizations&&g.containsForeignElements===0&&(f=new l1(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping)),f||(f=PU(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping,g.containsForeignElements)),this._renderedViewLine=f,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return this._renderedViewLine?this._renderedViewLine.input.textDirection===Ho.RTL:!1}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof l1:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof l1?this._renderedViewLine.monospaceAssumptionsAreValid():Ap}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof l1&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const s=this._renderedViewLine.input.stopRenderingLineAfter;if(s!==-1&&t>s+1&&i>s+1)return new DN(!0,[new hh(this.getWidth(n),0)]);s!==-1&&t>s+1&&(t=s+1),s!==-1&&i>s+1&&(i=s+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new DN(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}class l1{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let s=0;s=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Ap=!1)}return Ap}toSlowRenderedLine(){return PU(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,n){const s=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new hh(s,r-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const n=Math.floor((t-1)/300)-1,s=(n+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(s),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),s=BS.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!s||s.length===0?-1:s[0].left}getColumnOfNodeOffset(e,t){return vm(this._characterMapping,e,t)}}class MU{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,r=this._characterMapping.length;s<=r;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const s=this._readPixelOffset(this.domNode,e,t,n);if(s===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new hh(s,r-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i===n){const r=this._readPixelOffset(e,t,i,s);return r===-1?null:[new hh(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,s)}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(n);const s=this._getReadingTarget(e);return s.firstChild?(n.markDidDomLayout(),s.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const s=this._pixelOffsetCache[i];if(s!==-1)return s;const r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const l=BS.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!l||l.length===0?-1:l[0].left}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(n);const s=this._characterMapping.getDomPosition(i),r=BS.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&t===1&&i===this._characterMapping.length)return[new hh(0,this.getWidth(n))];const s=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return BS.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return vm(this._characterMapping,e,t)}}class Qoe extends MU{_readVisibleRangesForRange(e,t,i,n,s){const r=super._readVisibleRangesForRange(e,t,i,n,s);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(this.input.isLTR){const a=this._readPixelOffset(e,t,n,s);if(a!==-1){const l=r[r.length-1];l.left=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class wm{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(75),this.stickyTabStops=n.get(132),this.typicalHalfwidthCharacterWidth=n.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return wm.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==s&&(l=new R(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new R(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,ss._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class nre extends ire{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Oa.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,s){super(e,t,i,n),this.hitTestResult=new On(()=>ss.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=s;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return _s.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let s=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if(s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=l[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,n,i.range,r)}return s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,r):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!_s.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new R(1,1),$7);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new R(n,s),$7)}if(_s.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineLength(n),r=e.getLineWidth(n);if(s===0){const l=Kh(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new R(n,1),l)}if(e.isRtl(n)){if(t.mouseContentHorizontalOffset+r<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const l=Kh(t.mouseContentHorizontalOffset-r),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=r){const l=Kh(t.mouseContentHorizontalOffset-r),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(e.viewLinesGpu){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const l=e.getLineWidth(n),c=Kh(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(new R(n,1),c)}const s=e.getLineWidth(n);if(e.isRtl(n)){if(t.mouseContentHorizontalOffset+s<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){const l=Kh(t.mouseContentHorizontalOffset-s),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}}else if(t.mouseContentHorizontalOffset>=s){const l=Kh(t.mouseContentHorizontalOffset-s),c=new R(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(c,l)}const a=e.viewLinesGpu.getPositionAtCoordinate(n,t.mouseContentHorizontalOffset);if(a){const l={injectedText:null,mightBeForeignElement:!1};return t.fulfillContentText(a,L.fromPositions(a,a),l)}}const i=t.hitTestResult.value;return i.type===1?ss.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(_s.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new R(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(_s.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new R(n,s))}}return null}static _hitTestScrollbar(e,t){if(_s.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new R(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(165),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return ss._getMouseColumn(n,t.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){const r=n.lineNumber,a=n.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const b=Kh(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(n,b)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(n);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});const h=[];if(h.push({offset:c.left,column:a}),a>1){const b=e.visibleRangeForPosition(r,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(ab.offset-C.offset);const g=t.pos.toClientCoordinates(pe(e.viewDomNode)),f=i.getBoundingClientRect(),p=f.left<=g.clientX&&g.clientX<=f.right;let _=null;for(let b=1;bs)){const a=Math.floor((n+s)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new Cw(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(pe(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(pe(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=vh(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=sre(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Sd;const s=n.startContainer;if(s.nodeType===s.TEXT_NODE){const r=s.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Sc.CLASS_NAME?yu.createFromDOMInfo(e,r,n.startOffset):new Sd(s.parentNode)}else if(s.nodeType===s.ELEMENT_NODE){const r=s.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Sc.CLASS_NAME?yu.createFromDOMInfo(e,s,s.textContent.length):new Sd(s)}return new Sd}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,s=n?n.parentNode:null,r=s?s.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Sc.CLASS_NAME?yu.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Sd(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,s=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(s===Sc.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return yu.createFromDOMInfo(e,l,0)}else if(a===Sc.CLASS_NAME)return yu.createFromDOMInfo(e,i.offsetNode,0)}return new Sd(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),s=RC.atomicPosition(i,e.column-1,n,2);return s!==-1?new R(e.lineNumber,s+1):e}static doHitTest(e,t){let i=new Sd;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(pe(e.viewDomNode)))),i.type===1){const n=e.viewModel.getInjectedTextAt(i.position),s=e.viewModel.normalizePosition(i.position,2);(n||!s.equals(i.position))&&(i=new AU(s,i.spanNode,n))}return i}}function sre(o,e,t){const i=document.createRange();let n=o.elementFromPoint(e,t);if(n?.hasChildNodes()){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const s=n.getBoundingClientRect(),r=pe(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),l=r.getComputedStyle(n,null).getPropertyValue("font-variant"),c=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),h=r.getComputedStyle(n,null).getPropertyValue("line-height"),u=r.getComputedStyle(n,null).getPropertyValue("font-family"),g=`${a} ${l} ${c} ${d}/${h} ${u}`,f=n.innerText;let p=s.left,_=0,b;if(e>s.left+s.width)_=f.length;else{const C=dp.getInstance();for(let w=0;w=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rt;(function(o){o.Tap="-monaco-gesturetap",o.Change="-monaco-gesturechange",o.Start="-monaco-gesturestart",o.End="-monaco-gesturesend",o.Contextmenu="-monaco-gesturecontextmenu"})(Rt||(Rt={}));class Xt extends A{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new cs,this.ignoreTargets=new cs,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(te.runAndSubscribe(gw,({window:e,disposables:t})=>{t.add(W(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(W(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(W(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:wt,disposables:this._store}))}static addTarget(e){if(!Xt.isTouchDevice())return A.None;Xt.INSTANCE||(Xt.INSTANCE=new Xt);const t=Xt.INSTANCE.targets.push(e);return ue(t)}static ignoreTarget(e){if(!Xt.isTouchDevice())return A.None;Xt.INSTANCE||(Xt.INSTANCE=new Xt);const t=Xt.INSTANCE.ignoreTargets.push(e);return ue(t)}static isTouchDevice(){return"ontouchstart"in wt||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=Xt.HOLD_DELAY&&Math.abs(l.initialPageX-l.rollingPageX.at(-1))<30&&Math.abs(l.initialPageY-l.rollingPageY.at(-1))<30){const d=this.newGestureEvent(Rt.Contextmenu,l.initialTarget);d.pageX=l.rollingPageX.at(-1),d.pageY=l.rollingPageY.at(-1),this.dispatchEvent(d)}else if(n===1){const d=l.rollingPageX.at(-1),h=l.rollingPageY.at(-1),u=l.rollingTimestamps.at(-1)-l.rollingTimestamps[0],g=d-l.rollingPageX[0],f=h-l.rollingPageY[0],p=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,p,i,Math.abs(g)/u,g>0?1:-1,d,Math.abs(f)/u,f>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(Rt.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Rt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Xt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Rt.Change||e.type===Rt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,s=e.initialTarget;for(;s&&s!==i;)n++,s=s.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,s,r,a,l,c){this.handle=Zs(e,()=>{const d=Date.now(),h=d-i;let u=0,g=0,f=!0;n+=Xt.SCROLL_FRICTION*h,a+=Xt.SCROLL_FRICTION*h,n>0&&(f=!1,u=s*n*h),a>0&&(f=!1,g=l*a*h);const p=this.newGestureEvent(Rt.Change);p.translationX=u,p.translationY=g,t.forEach(_=>_.dispatchEvent(p)),f||this.inertia(e,t,d,n,s,r+u,a,l,c+g)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(s.pageX),r.rollingPageY.push(s.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}ore([Si],Xt,"isTouchDevice",null);let So=class extends A{onclick(e,t){this._register(W(e,ee.CLICK,i=>t(new Wn(pe(e),i))))}onmousedown(e,t){this._register(W(e,ee.MOUSE_DOWN,i=>t(new Wn(pe(e),i))))}onmouseover(e,t){this._register(W(e,ee.MOUSE_OVER,i=>t(new Wn(pe(e),i))))}onmouseleave(e,t){this._register(W(e,ee.MOUSE_LEAVE,i=>t(new Wn(pe(e),i))))}onkeydown(e,t){this._register(W(e,ee.KEY_DOWN,i=>t(new yt(i))))}onkeyup(e,t){this._register(W(e,ee.KEY_UP,i=>t(new yt(i))))}oninput(e,t){this._register(W(e,ee.INPUT,t))}onblur(e,t){this._register(W(e,ee.BLUR,t))}onfocus(e,t){this._register(W(e,ee.FOCUS,t))}ignoreGesture(e){return Xt.ignoreTarget(e)}};const Sm=11;class rre extends So{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Se.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Sm+"px",this.domNode.style.height=Sm+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new l_),this._register(Li(this.bgDomNode,ee.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Li(this.domNode,ee.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new fO),this._pointerdownScheduleRepeatTimer=this._register(new mo)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,pe(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class are extends A{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new mo)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}const lre=140;class OU extends So{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new are(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new l_),this._shouldRender=!0,this.domNode=ht(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(W(this.domNode.domNode,ee.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new rre(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ht(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(W(this.slider.domNode,ee.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const r=pi(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}const n=e.pointerType==="mouse",s=e.button===0;if(s||!n){const r=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r))}s&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{const r=this._sliderOrthogonalPointerPosition(s),a=Math.abs(r-i);if(Ln&&a>lre){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const c=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const cre=20;class ym{constructor(e,t,i,n,s,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ym(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(cre,Math.floor(i*a/n))),d=(a-c)/(n-i),h=s*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=ym._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new Sg(null,1,0))}),this._createArrow({className:"scra",icon:G.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Sg(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class hre extends OU{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new ym(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-Sm)/2,a=(t.verticalScrollbarSize-Sm)/2;this._createArrow({className:"scra",icon:G.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Sg(null,0,1))}),this._createArrow({className:"scra",icon:G.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Sg(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class J0{constructor(e,t,i,n,s,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,s=s|0,r=r|0,a=a|0),this.rawScrollLeft=n,this.rawScrollTop=a,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),a+s>r&&(a=r-s),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new J0(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new J0(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class u_ extends A{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new J0(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new UC(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=UC.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class j7{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function jD(o,e){const t=e-o;return function(i){return o+t*fre(i)}}function ure(o,e,t){return function(i){return i2.5*i){let s,r;return e0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),s=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,r),1),c=Math.max(Math.min(s,a),1),d=Math.max(n,r),h=Math.max(s,a);d%l===0&&h%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){const t=Number.EPSILON*100;return Math.abs(Math.round(e)-e)<.01+t}}class GO extends So{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new P),this._onWillScroll=this._register(new P),e.style.overflow="hidden",this._options=_re(t),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));const n={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new hre(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new dre(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ht(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ht(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ht(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new mo),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=pt(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ze&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Sg(e))}async _periodicSync(){let e=!1;(this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0)&&(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-this._inertialSpeed.Y*100,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-this._inertialSpeed.X*100}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=this._inertialSpeed.X!==0||this._inertialSpeed.Y!==0),e?(this._inertialTimeout||(this._inertialTimeout=new mo),this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=pt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new Sg(n))};this._mouseWheelToDispose.push(W(this._listenOnDomNode,ee.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=qL.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+s===0?r=s=0:Math.abs(s)>=Math.abs(r)?r=0:s=0),this._options.flipAxes&&([s,r]=[r,s]);const a=!ze&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const l=this._scrollable.getFutureScrollPosition();let c={};if(s){const d=q7*s,h=l.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(c,h)}if(r){const d=q7*r,h=l.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(c,h)}if(c=this._scrollable.validateScrollPosition(c),this._options.inertialScroll&&(r||s)&&!t.isPhysicalMouseWheel()){let d=!1;this._inertialSpeed.X===0&&this._inertialSpeed.Y===0&&(d=!0),this._inertialSpeed.Y=(s<0?-1:1)*Math.abs(s)**1.02,this._inertialSpeed.X=(r<0?-1:1)*Math.abs(r)**1.02,d&&this._periodicSync()}(l.scrollLeft!==c.scrollLeft||l.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),pre)}}class FU extends GO{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new u_({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Zs(pe(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class KL extends GO{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class ww extends GO{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new u_({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Zs(pe(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function _re(o){const e={lazyRender:typeof o.lazyRender<"u"?o.lazyRender:!1,className:typeof o.className<"u"?o.className:"",useShadows:typeof o.useShadows<"u"?o.useShadows:!0,handleMouseWheel:typeof o.handleMouseWheel<"u"?o.handleMouseWheel:!0,flipAxes:typeof o.flipAxes<"u"?o.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof o.consumeMouseWheelIfScrollbarIsNeeded<"u"?o.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof o.alwaysConsumeMouseWheel<"u"?o.alwaysConsumeMouseWheel:!1,scrollYToX:typeof o.scrollYToX<"u"?o.scrollYToX:!1,mouseWheelScrollSensitivity:typeof o.mouseWheelScrollSensitivity<"u"?o.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof o.fastScrollSensitivity<"u"?o.fastScrollSensitivity:5,scrollPredominantAxis:typeof o.scrollPredominantAxis<"u"?o.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof o.mouseWheelSmoothScroll<"u"?o.mouseWheelSmoothScroll:!0,inertialScroll:typeof o.inertialScroll<"u"?o.inertialScroll:!1,arrowSize:typeof o.arrowSize<"u"?o.arrowSize:11,listenOnDomNode:typeof o.listenOnDomNode<"u"?o.listenOnDomNode:null,horizontal:typeof o.horizontal<"u"?o.horizontal:1,horizontalScrollbarSize:typeof o.horizontalScrollbarSize<"u"?o.horizontalScrollbarSize:10,horizontalSliderSize:typeof o.horizontalSliderSize<"u"?o.horizontalSliderSize:0,horizontalHasArrows:typeof o.horizontalHasArrows<"u"?o.horizontalHasArrows:!1,vertical:typeof o.vertical<"u"?o.vertical:1,verticalScrollbarSize:typeof o.verticalScrollbarSize<"u"?o.verticalScrollbarSize:10,verticalHasArrows:typeof o.verticalHasArrows<"u"?o.verticalHasArrows:!1,verticalSliderSize:typeof o.verticalSliderSize<"u"?o.verticalSliderSize:0,scrollByPage:typeof o.scrollByPage<"u"?o.scrollByPage:!1};return e.horizontalSliderSize=typeof o.horizontalSliderSize<"u"?o.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof o.verticalSliderSize<"u"?o.verticalSliderSize:e.verticalScrollbarSize,ze&&(e.className+=" mac"),e}class WU extends A{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class BU extends A{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=Zs(pe(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}}class bre extends WU{_createDragScrollingOperation(e,t){return new Cre(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class Cre extends BU{_getScrollSpeed(){const e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(75),t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e,s=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,s),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=zL(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(165).horizontalScrollbarHeight,h=new Cw(this._mouseEvent.pos.x,c.y+c.height-d-.1),u=UL(this._viewHelper.viewDomNode,c,h);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,h,u,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Rn.createOutsideEditor(this._position.mouseColumn,new R(a,1),"above",this._position.outsideDistance):l=Rn.createOutsideEditor(this._position.mouseColumn,new R(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Zs(pe(l.element),()=>this._execute())}}class vre extends WU{_createDragScrollingOperation(e,t){return new wre(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class wre extends BU{_getScrollSpeed(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e*.5,s=this._position.outsidePosition==="left"?-n:n;if(this._context.viewModel.viewLayout.deltaScrollNow(s,0),this._viewHelper.renderNow(),!this._position.position)return;const r=this._position.position.lineNumber;let a;{const l=zL(this._viewHelper.viewDomNode),c=this._context.configuration.options.get(165).horizontalScrollbarHeight,d=new Cw(this._mouseEvent.pos.x,l.y+l.height-c-.1),h=UL(this._viewHelper.viewDomNode,l,d);a=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),l,d,h,null)}this._position.outsidePosition==="left"?a=Rn.createOutsideEditor(a.mouseColumn,new R(r,a.mouseColumn),"left",this._position.outsideDistance):a=Rn.createOutsideEditor(a.mouseColumn,new R(r,a.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(a,!0,2),this._animationFrameDisposable=Zs(pe(a.element),()=>this._execute())}}class ZO extends lf{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new ss(this._context,i),this._mouseDownOperation=this._register(new Sre(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;const n=new Toe(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=W(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new ed(a,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{s=a})),this._register(W(this.viewHelper.viewDomNode,ee.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=qL.INSTANCE;let t=0,i=hr.getZoomLevel(),n=!1,s=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(84))return;const c=new Sg(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=hr.getZoomLevel(),h=c.deltaY>0?1:-1;hr.setZoomLevel(d+h),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=hr.getZoomLevel(),n=a(l),s=0),t=Date.now(),s+=c.deltaY,n&&(hr.setZoomLevel(i+s/5),c.preventDefault(),c.stopPropagation())};this._register(W(this.viewHelper.viewDomNode,ee.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return ze?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){const t=this._context.configuration.options.get(165).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const n=new IU(e,t).toPageCoordinates(pe(this.viewHelper.viewDomNode)),s=zL(this.viewHelper.viewDomNode);if(n.ys.y+s.height||n.xs.x+s.width)return null;const r=UL(this.viewHelper.viewDomNode,s,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),s,n,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=vh(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(l){const u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class Sre extends A{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Moe(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new bre(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._leftRightDragScrolling=this._register(new vre(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new YO,this._currentSelection=new ae(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13?t.outsidePosition==="above"||t.outsidePosition==="below"?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const s=this._context.configuration.options;if(!s.get(104)&&s.get(42)&&!s.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===6&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);pc(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,s=this._getMouseColumn(e);if(e.posyt.y+t.height){const h=e.posy-t.y-t.height,u=n.getCurrentScrollTop()+e.relativePos.y,g=wm.getZoneAtCoord(this._context,u);if(g){const p=this._helpPositionJumpOverViewZone(g);if(p)return Rn.createOutsideEditor(s,p,"below",h)}const f=n.getLineNumberAtVerticalOffset(u);return Rn.createOutsideEditor(s,new R(f,i.getLineMaxColumn(f)),"below",h)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),a=this._context.configuration.options.get(165),l=a.contentLeft;if(e.relativePos.x<=l){const h=l-e.relativePos.x;return Rn.createOutsideEditor(s,new R(r,1),"left",h)}const d=a.minimap.minimapLeft===0?a.width-a.verticalScrollbarWidth:a.minimap.minimapLeft;if(e.relativePos.x>=d){const h=e.relativePos.x-d;return Rn.createOutsideEditor(s,new R(r,i.getLineMaxColumn(r)),"right",h)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===8||n.type===5){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return Rn.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new R(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class YO{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>YO.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}class mt{get event(){return this.emitter.event}constructor(e,t,i){const n=s=>this.emitter.fire(s);this.emitter=new P({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}function HU(o,e,t,i){const n=o.getPlainTextToCopy(e,t,Ln),s=o.model.getEOL(),r=t&&e.length===1&&e[0].isEmpty(),a=Array.isArray(n)?n:null,l=Array.isArray(n)?n.join(s):n;let c,d=null;if(IN.forceCopyWithSyntaxHighlighting||i&&l.length<65536){const u=o.getRichTextToCopy(e,t);u&&(c=u.html,d=u.mode)}return{isFromEmptySelection:r,multicursorText:a,text:l,html:c,mode:d}}class Sl{static{this.INSTANCE=new Sl}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}const IN={forceCopyWithSyntaxHighlighting:!1},ag={getTextData(o){const e=o.getData(vi.text);let t=null;const i=o.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&o.files.length>0?[Array.prototype.slice.call(o.files,0).map(s=>s.name).join(` +`),null]:[e,t]},setTextData(o,e,t,i){o.setData(vi.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}};class vn{static{this.EMPTY=new vn("",0,0,null,void 0)}constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new vn(i,n,s,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new vn(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){const i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;(s=t.indexOf(` +`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(ta(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(Zc(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(ta(e.value,t.value),e.selectionEnd),n=Math.min(Zc(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}static fromScreenReaderContentState(e){return new vn(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}}const cf=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const o=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(o),o[6]=o[6]&15|64,o[8]=o[8]&63|128;let i=0,n="";return n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+="-",n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n+=e[o[i++]],n}})();function VU(o){return`${o}-${cf()}`}var yre=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},K7=function(o,e){return function(t,i){e(t,i,o)}},ey;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(ey||(ey={}));class xre{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let EN=class extends A{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new P),this.onFocus=this._onFocus.event,this._onBlur=this._register(new P),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new P),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new P),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new P),this.onCut=this._onCut.event,this._onPaste=this._register(new P),this.onPaste=this._onPaste.event,this._onType=this._register(new P),this.onType=this._onType.event,this._onCompositionStart=this._register(new P),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new P),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new P),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new P),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new ut),this._asyncTriggerCut=this._register(new St(()=>this._onCut.fire(),0)),this._textAreaState=vn.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(te.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new St(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new yt(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new yt(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new xre;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const h=vn.readFromTextArea(this._textArea,this._textAreaState),u=vn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(l);return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=vn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const h=vn.readFromTextArea(this._textArea,this._textAreaState),u=vn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=vn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=vn.readFromTextArea(this._textArea,this._textAreaState),d=vn.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(Vi(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&(l.inputType==="insertFromPaste"?this._onPaste.fire({text:d.text,metadata:Sl.INSTANCE.get(d.text)}):this._onType.fire(d)))})),this._register(this._textArea.onCut(l=>{this._logService.trace("TextAreaInput#onCut",l),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._logService.trace("TextAreaInput#onCopy",l),this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._logService.trace("TextAreaInput#onPaste",l),this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=ag.getTextData(l.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",d?.id," with text.length: ",c.length),c&&(d=d||Sl.INSTANCE.get(c),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new St(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return W(this._textArea.ownerDocument,"selectionchange",t=>{if(qd.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),h=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(h[0],h[1],h[2]),g=new ae(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(g)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy();let i;this._logService.getLevel()===Ji.Trace&&(i=cf());const n={version:1,id:i,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Sl.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,n),e.preventDefault(),e.clipboardData&&ag.setTextData(e.clipboardData,t.text,t.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}};EN=yre([K7(4,kn),K7(5,Mt)],EN);class Lre extends A{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new P),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new mt(this._actual,"keydown")).event,this.onKeyPress=this._register(new mt(this._actual,"keypress")).event,this.onKeyUp=this._register(new mt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new mt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new mt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new mt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new mt(this._actual,"beforeinput")).event,this.onInput=this._register(new mt(this._actual,"input")).event,this.onCut=this._register(new mt(this._actual,"cut")).event,this.onCopy=this._register(new mt(this._actual,"copy")).event,this.onPaste=this._register(new mt(this._actual,"paste")).event,this.onFocus=this._register(new mt(this._actual,"focus")).event,this.onBlur=this._register(new mt(this._actual,"blur")).event,this._register(this.onKeyDown(()=>qd.onKeyDown())),this._register(this.onBeforeInput(()=>qd.onBeforeInput())),this._register(this.onInput(()=>qd.onInput())),this._register(this.onKeyUp(()=>qd.onKeyUp())),this._register(W(this._actual,ey.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=vh(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?ji()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const r=vh(n);r?s=r.activeElement:s=ji();const a=pe(s),l=s===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){Ks&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Ks&&a.parent!==a&&n.focus();return}try{const h=see(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),oee(n,h)}catch{}}}class kre extends ZO{constructor(e,t,i){super(e,t,i),this._register(Xt.addTarget(this.viewHelper.linesContentDomNode)),this._register(W(this.viewHelper.linesContentDomNode,Rt.Tap,s=>this.onTap(s))),this._register(W(this.viewHelper.linesContentDomNode,Rt.Change,s=>this.onChange(s))),this._register(W(this.viewHelper.linesContentDomNode,Rt.Contextmenu,s=>this._onContextMenu(new ed(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(W(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new Roe(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new ed(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class Dre extends ZO{constructor(e,t,i){super(e,t,i),this._register(Xt.addTarget(this.viewHelper.linesContentDomNode)),this._register(W(this.viewHelper.linesContentDomNode,Rt.Tap,n=>this.onTap(n))),this._register(W(this.viewHelper.linesContentDomNode,Rt.Change,n=>this.onChange(n))),this._register(W(this.viewHelper.linesContentDomNode,Rt.Contextmenu,n=>this._onContextMenu(new ed(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ed(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(ey.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Ire extends A{constructor(e,t,i){super(),(Sr||ZX&&wV)&&lw.pointerEvents?this.handler=this._register(new kre(e,t,i)):wt.TouchEvent?this.handler=this._register(new Dre(e,t,i)):this.handler=this._register(new ZO(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Ere{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ln.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){ln.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){ln.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ln.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ln.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){ln.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){ln.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){ln.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){ln.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){ln.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){ln.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){ln.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){ln.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){ln.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}function Vl(o,e){const t=FA();if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(o,e)}catch(i){Ee(i);return}try{return globalThis.trustedTypes?.createPolicy(o,e)}catch(i){Ee(i);return}}class zU{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Ce("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let s=0,r=0;for(let l=i;l<=n;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(s=c,r=1):r++)}if(e=n&&a<=s&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s)return this._lines.splice(e-this._rendLineNumberStart,s-e+1);const r=[];for(let h=0;hi)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),n=!0}}return n}}class UU{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new zU(this._lineFactory)}_createDomNode(){const e=ht(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){const i=this._linesCollection.getStartLineNumber(),n=this._linesCollection.getEndLineNumber();for(let s=i;s<=n;s++)this._linesCollection.getLine(s).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;ie})}constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){const s={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(s.rendLineNumberStart+s.linesLength-1t){const r=t,a=Math.min(i,s.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(s,r,a,n,t),s.linesLength+=a-r+1)}else if(s.rendLineNumberStart0&&(this._removeLinesBefore(s,r),s.linesLength-=r)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1i){const r=Math.max(0,i-s.rendLineNumberStart+1),l=s.linesLength-1-r+1;l>0&&(this._removeLinesAfter(s,l),s.linesLength-=l)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,n[c-s],this._lineHeightForLineNumber(c))}}_insertLinesBefore(e,t,i,n,s){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this._lineFactory.createLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];n[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");xu._ttPolicy&&(t=xu._ttPolicy.createHTML(t)),n.innerHTML=t;for(let s=0;snew Nre(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(59);gn(this.domNode,i),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,n=t.length;i'),s.appendString(r),s.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}}class Tre extends $U{constructor(e){super(e);const i=this._context.configuration.options.get(165);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class Rre extends $U{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),gn(this.domNode,t.get(59))}onConfigurationChanged(e){const t=this._context.configuration.options;gn(this.domNode,t.get(59));const i=t.get(165);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class GL{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return GL.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new R(e.afterLineNumber,1)).lineNumber}}}class Mre extends Rs{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ht(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(165),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);const s=i.contentLeft;return this.contentLeft!==s&&(this.contentLeft=s,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let s=this.blocks[t];s||(s=this.blocks[t]=ht(document.createElement("div")),this.domNode.appendChild(s));let r,a;n.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),a=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[l,c,d,h]=n.options.blockPadding??[0,0,0,0];s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+c),s.setTop(r-e.scrollTop-l),s.setHeight(a-r+l+d),t++}for(let n=t;n0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const s=e.top,r=s,a=e.top+e.height,l=n.viewportHeight-a,c=s-i,d=r>=i,h=a,u=l>=i;let g=e.left;return g+t>n.scrollLeft+n.viewportWidth&&(g=n.scrollLeft+n.viewportWidth-t),gl){const u=h-(l-n);h-=u,i-=u}if(h=p,C=h+i<=u.height-_;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,p),fitsBelow:C,belowTop:h,left:f}:{fitsAbove:b,aboveTop:s,fitsBelow:C,belowTop:r,left:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new T_(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=s(this._primaryAnchor.viewPosition,this._affinity),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,n=s(i,this._affinity);return{primary:t,secondary:n};function s(r,a){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const c=r.column===1&&a===3?0:l.left,d=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop,h=e.getLineHeightForLineNumber(r.lineNumber);return new G7(d,c,h)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(59);let s=t.left;return se.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&qD(this._actual.afterRender,this._actual,null,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&qD(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}}class N_{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class T_{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class G7{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function qD(o,e,...t){try{return o.call(e,...t)}catch{return null}}class Bh extends lf{}const ci=We("themeService");function hi(o){return{id:o}}function NN(o){switch(o){case _r.DARK:return cp.VS_DARK;case _r.HIGH_CONTRAST_DARK:return cp.HC_BLACK;case _r.HIGH_CONTRAST_LIGHT:return cp.HC_LIGHT;default:return cp.VS}}const jU={ThemingContribution:"base.contributions.theming"};class Ore extends A{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new P)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),ue(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const qU=new Ore;li.add(jU.ThemingContribution,qU);function Tr(o){return qU.onColorThemeChange(o)}class Fre extends A{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const KU=E("editor.lineHighlightBackground",null,m(610,"Background color for the highlight of line at the cursor position.")),Z7=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ge},m(611,"Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m(612,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m(613,"Background color of the border around highlighted ranges."));E("editor.symbolHighlightBackground",{dark:Ec,light:Ec,hcDark:null,hcLight:null},m(614,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m(615,"Background color of the border around highlighted symbols."));const ZL=E("editorCursor.foreground",{dark:"#AEAFAD",light:V.black,hcDark:V.white,hcLight:"#0F4A85"},m(616,"Color of the editor cursor.")),XO=E("editorCursor.background",null,m(617,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),GU=E("editorMultiCursor.primary.foreground",ZL,m(618,"Color of the primary editor cursor when multiple cursors are present.")),Wre=E("editorMultiCursor.primary.background",XO,m(619,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),ZU=E("editorMultiCursor.secondary.foreground",ZL,m(620,"Color of secondary editor cursors when multiple cursors are present.")),Bre=E("editorMultiCursor.secondary.background",XO,m(621,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),QO=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m(622,"Color of whitespace characters in the editor.")),Hre=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:V.white,hcLight:"#292929"},m(623,"Color of editor line numbers.")),Vre=E("editorIndentGuide.background",QO,m(624,"Color of the editor indentation guides."),!1,m(625,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),zre=E("editorIndentGuide.activeBackground",QO,m(626,"Color of the active editor indentation guides."),!1,m(627,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Sw=E("editorIndentGuide.background1",Vre,m(628,"Color of the editor indentation guides (1).")),Ure=E("editorIndentGuide.background2","#00000000",m(629,"Color of the editor indentation guides (2).")),$re=E("editorIndentGuide.background3","#00000000",m(630,"Color of the editor indentation guides (3).")),jre=E("editorIndentGuide.background4","#00000000",m(631,"Color of the editor indentation guides (4).")),qre=E("editorIndentGuide.background5","#00000000",m(632,"Color of the editor indentation guides (5).")),Kre=E("editorIndentGuide.background6","#00000000",m(633,"Color of the editor indentation guides (6).")),yw=E("editorIndentGuide.activeBackground1",zre,m(634,"Color of the active editor indentation guides (1).")),Gre=E("editorIndentGuide.activeBackground2","#00000000",m(635,"Color of the active editor indentation guides (2).")),Zre=E("editorIndentGuide.activeBackground3","#00000000",m(636,"Color of the active editor indentation guides (3).")),Yre=E("editorIndentGuide.activeBackground4","#00000000",m(637,"Color of the active editor indentation guides (4).")),Xre=E("editorIndentGuide.activeBackground5","#00000000",m(638,"Color of the active editor indentation guides (5).")),Qre=E("editorIndentGuide.activeBackground6","#00000000",m(639,"Color of the active editor indentation guides (6).")),Jre=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Gt,hcLight:Gt},m(640,"Color of editor active line number"),!1,m(641,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",Jre,m(642,"Color of editor active line number"));const eae=E("editorLineNumber.dimmedForeground",null,m(643,"Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),tae=E("editorRuler.foreground",{dark:"#5A5A5A",light:V.lightgrey,hcDark:V.white,hcLight:"#292929"},m(644,"Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m(645,"Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m(646,"Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ge,hcLight:Ge},m(647,"Color for matching brackets boxes"));const iae=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m(648,"Color of the overview ruler border.")),nae=E("editorOverviewRuler.background",null,m(649,"Background color of the editor overview ruler."));E("editorGutter.background",ki,m(650,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:V.fromHex("#fff").transparent(.8),hcLight:Ge},m(651,"Border color of unnecessary (unused) source code in the editor."));const sae=E("editorUnnecessaryCode.opacity",{dark:V.fromHex("#000a"),light:V.fromHex("#0007"),hcDark:null,hcLight:null},m(652,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:V.fromHex("#fff").transparent(.8),hcLight:V.fromHex("#292929").transparent(.8)},m(653,"Border color of ghost text in the editor."));const oae=E("editorGhostText.foreground",{dark:V.fromHex("#ffffff56"),light:V.fromHex("#0007"),hcDark:null,hcLight:null},m(654,"Foreground color of the ghost text in the editor."));E("editorGhostText.background",null,m(655,"Background color of the ghost text in the editor."));const rae=new V(new j(0,122,204,.6)),YU=E("editorOverviewRuler.rangeHighlightForeground",rae,m(656,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aae=E("editorOverviewRuler.errorForeground",{dark:new V(new j(255,18,18,.7)),light:new V(new j(255,18,18,.7)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(657,"Overview ruler marker color for errors.")),lae=E("editorOverviewRuler.warningForeground",{dark:Jc,light:Jc,hcDark:WC,hcLight:WC},m(658,"Overview ruler marker color for warnings.")),cae=E("editorOverviewRuler.infoForeground",{dark:Tl,light:Tl,hcDark:BC,hcLight:BC},m(659,"Overview ruler marker color for infos.")),XU=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m(660,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),QU=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m(661,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),JU=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m(662,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),e$=E("editorBracketHighlight.foreground4","#00000000",m(663,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),t$=E("editorBracketHighlight.foreground5","#00000000",m(664,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),i$=E("editorBracketHighlight.foreground6","#00000000",m(665,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),dae=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new V(new j(255,18,18,.8)),light:new V(new j(255,18,18,.8)),hcDark:new V(new j(255,50,50,1)),hcLight:"#B5200D"},m(666,"Foreground color of unexpected brackets.")),hae=E("editorBracketPairGuide.background1","#00000000",m(667,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),uae=E("editorBracketPairGuide.background2","#00000000",m(668,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),gae=E("editorBracketPairGuide.background3","#00000000",m(669,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),fae=E("editorBracketPairGuide.background4","#00000000",m(670,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),pae=E("editorBracketPairGuide.background5","#00000000",m(671,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),mae=E("editorBracketPairGuide.background6","#00000000",m(672,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),_ae=E("editorBracketPairGuide.activeBackground1","#00000000",m(673,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),bae=E("editorBracketPairGuide.activeBackground2","#00000000",m(674,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Cae=E("editorBracketPairGuide.activeBackground3","#00000000",m(675,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),vae=E("editorBracketPairGuide.activeBackground4","#00000000",m(676,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),wae=E("editorBracketPairGuide.activeBackground5","#00000000",m(677,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Sae=E("editorBracketPairGuide.activeBackground6","#00000000",m(678,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",Jc,m(679,"Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",ese,m(680,"Background color used to highlight unicode characters."));Tr((o,e)=>{const t=o.getColor(ki),i=o.getColor(KU),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});class n$ extends Bh{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ae(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const s of this._selections)t.add(s.positionLineNumber);const i=Array.from(t);i.sort((s,r)=>s-r),jt(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let r=t;r<=i;r++){const a=r-t;n[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new R(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new R(c,1)).lineNumber,h=l.convertModelPositionToViewPosition(new R(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,u=Math.max(d,t),g=Math.min(h,i);for(let f=u;f<=g;f++){const p=f-t;n[p]=r}}}const s=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=s}this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class yae extends n${_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class xae extends n${_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Tr((o,e)=>{const t=o.getColor(KU);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||o.defines(Z7)){const i=o.getColor(Z7);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Na(o.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class Lae extends Bh{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,h=c.options.className;return dh?1:L.compareRangesUsingStarts(l.range,c.range)});const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=s;l<=r;l++){const c=l-s;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(l.range.startLineNumber,n),h=Math.min(l.range.endLineNumber,s);for(let u=d;u<=h;u++){const g=u-n;i[g]+=c}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let s=null,r=!1,a=null,l=!1;for(let c=0,d=t.length;c';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class kae extends Rs{constructor(e,t,i,n){super(e);const s=this._context.configuration.options,r=s.get(117),a=s.get(83),l=s.get(49),c=s.get(120),d=s.get(158),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+NN(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage,inertialScroll:d};this.scrollbar=this._register(new KL(t.domNode,h,this._context.viewLayout.getScrollable())),Oa.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=ht(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(g,f,p)=>{const _={};{const b=g.scrollTop;b&&(_.scrollTop=this._context.viewLayout.getCurrentScrollTop()+b,g.scrollTop=0)}if(p){const b=g.scrollLeft;b&&(_.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+b,g.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(_,1)};this._register(W(i.domNode,"scroll",g=>u(i.domNode,!0,!0))),this._register(W(t.domNode,"scroll",g=>u(t.domNode,!0,!1))),this._register(W(n.domNode,"scroll",g=>u(n.domNode,!0,!1))),this._register(W(this.scrollbarDomNode.domNode,"scroll",g=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(81).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(117)||e.hasChanged(83)||e.hasChanged(49)){const t=this._context.configuration.options,i=t.get(117),n=t.get(83),s=t.get(49),r=t.get(120),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:s,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+NN(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class TN{constructor(e,t,i,n,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=s??0}}class Dae{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class Iae{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class s$ extends Bh{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=new Iae}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamen)continue;const c=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(c,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(s.preference.lane);t.push(new Tae(c,h,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===0&&n.type===0?i.className0;){const n=t.peek();if(!n)break;const s=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!s||s.length===0)break;const r=s[0];if(r.type===0){const a=[];for(const l of s){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}class Nae{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new Rae(this.lineNumber,this.laneIndex,e)}}class Tae{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class Rae{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}function $C(o,e,t=o.length-1){const i=Mae(o,e,t);if(i!==-1)return o[i]}function Mae(o,e,t=o.length-1){for(let i=t;i>=0;i--){const n=o[i];if(e(n,i))return i}return-1}function xm(o,e){const t=Lm(o,e);return t===-1?void 0:o[t]}function Lm(o,e,t=0,i=o.length){let n=t,s=i;for(;n0&&(t=n)}return t}function o$(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i=0&&(t=n)}return t}function r$(o,e){return JO(o,(t,i)=>-e(t,i))}function Aae(o,e){if(o.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function Oae(o,e){for(const t of o){const i=e(t);if(i!==void 0)return i}}class a$ extends A{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function XL(o,e){let t=0,i=0;const n=o.length;for(;in)throw new Ce("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide);let a=-2,l=-1,c=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let D=k-2;D>=0;D--){const I=this._computeIndentLevel(D);if(I>=0){a=D,l=I;break}}}if(c===-2){c=-1,d=-1;for(let D=k;D=0){c=D,d=I;break}}}};let u=-2,g=-1,f=-2,p=-1;const _=k=>{if(u===-2){u=-1,g=-1;for(let D=k-2;D>=0;D--){const I=this._computeIndentLevel(D);if(I>=0){u=D,g=I;break}}}if(f!==-1&&(f===-2||f=0){f=D,p=I;break}}}};let b=0,C=!0,w=0,v=!0,S=0,x=0;for(let k=0;C||v;k++){const D=e-k,I=e+k;k>1&&(D<1||D1&&(I>n||I>i)&&(v=!1),k>5e4&&(C=!1,v=!1);let T=-1;if(C&&D>=1){const O=this._computeIndentLevel(D-1);O>=0?(c=D-1,d=O,T=Math.ceil(O/this.textModel.getOptions().indentSize)):(h(D),T=this._getIndentLevelForWhitespaceLine(r,l,d))}let F=-1;if(v&&I<=n){const O=this._computeIndentLevel(I-1);O>=0?(u=I-1,g=O,F=Math.ceil(O/this.textModel.getOptions().indentSize)):(_(I),F=this._getIndentLevelForWhitespaceLine(r,g,p))}if(k===0){x=T;continue}if(k===1){if(I<=n&&F>=0&&x+1===F){C=!1,b=I,w=I,S=F;continue}if(D>=1&&T>=0&&T-1===x){v=!1,b=D,w=D,S=T;continue}if(b=e,w=e,S=x,S===0)return{startLineNumber:b,endLineNumber:w,indent:S}}C&&(T>=S?b=D:C=!1),v&&(F>=S?w=I:v=!1)}return{startLineNumber:b,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,n){const s=[];for(let h=e;h<=t;h++)s.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new L(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(L.fromPositions(i)).toArray()).filter(u=>L.strictContainsPosition(u.range,i));l=$C(h,u=>r)?.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new l$;for(const h of a){if(!h.closingBracketRange)continue;const u=l&&h.range.equalsRange(l);if(!u&&!n.includeInactive)continue;const g=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,c)+(n.highlightActive&&u?" "+d.activeClassName:""),f=h.openingBracketRange.getStartPosition(),p=h.closingBracketRange.getStartPosition(),_=n.horizontalGuides===lg.Enabled||n.horizontalGuides===lg.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){_&&s[h.range.startLineNumber-e].push(new Ku(-1,h.openingBracketRange.getEndPosition().column,g,new Ib(!1,p.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(p),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let v=!1;hs(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&s[f.lineNumber-e].push(new Ku(w,-1,g,new Ib(!1,f.column),-1,-1)),p.lineNumber<=t&&b>w&&s[p.lineNumber-e].push(new Ku(w,-1,g,new Ib(!v,p.column),-1,-1)))}for(const h of s)h.sort((u,g)=>u.visibleColumn-g.visibleColumn);return s}getVisibleColumnFromPosition(e){return oi.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const g=u-e,f=this._computeIndentLevel(u-1);if(f>=0){l=u-1,c=f,a[g]=Math.ceil(f/n.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=u-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,h=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(r,c,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:tn||this._maxIndentLeft>0&&f>this._maxIndentLeft)break;const p=g.horizontalLine?g.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",_=g.horizontalLine?(e.visibleRangeForPosition(new R(l,g.horizontalLine.endColumn))?.left??f+this._spaceWidth)-f:this._spaceWidth;h+=`
`}a[c]=h}this._renderResult=a}getGuidesByLine(e,t,i){const n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?lg.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?lg.EnabledForActive:lg.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,l=h.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const u=new Array;d.push(u);const g=n?n[h-e]:[],f=new Qc(g),p=s?s[h-e]:0;for(let _=1;_<=p;_++){const b=(_-1)*c+1,C=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||g.length===0)&&r<=h&&h<=a&&_===l;u.push(...f.takeWhile(v=>v.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function kf(o){if(!(o&&o.isTransparent()))return o}Tr((o,e)=>{const t=[{bracketColor:XU,guideColor:hae,guideColorActive:_ae},{bracketColor:QU,guideColor:uae,guideColorActive:bae},{bracketColor:JU,guideColor:gae,guideColorActive:Cae},{bracketColor:e$,guideColor:fae,guideColorActive:vae},{bracketColor:t$,guideColor:pae,guideColorActive:wae},{bracketColor:i$,guideColor:mae,guideColorActive:Sae}],i=new l$,n=[{indentColor:Sw,indentColorActive:yw},{indentColor:Ure,indentColorActive:Gre},{indentColor:$re,indentColorActive:Zre},{indentColor:jre,indentColorActive:Yre},{indentColor:qre,indentColorActive:Xre},{indentColor:Kre,indentColorActive:Qre}],s=t.map(a=>{const l=o.getColor(a.bracketColor),c=o.getColor(a.guideColor),d=o.getColor(a.guideColorActive),h=kf(kf(c)??l?.transparent(.3)),u=kf(kf(d)??l);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(hn),r=n.map(a=>{const l=o.getColor(a.indentColor),c=o.getColor(a.indentColorActive),d=kf(l),h=kf(c);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(hn);if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class QL extends Bh{static{this.CLASS_NAME="line-numbers"}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new R(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(75);const t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);const i=e.get(165);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Gs?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);s.sort((c,d)=>L.compareRangesUsingEnds(c.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=n;c++){const d=c-i,h=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(c,1)).lineNumber;let u=this._getLineRenderLineNumber(c),g="";for(;r${u}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Tr((o,e)=>{const t=o.getColor(Hre),i=o.getColor(eae);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});const Op="monaco-mouse-cursor-text";class KD{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class ty{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(59);this.renderWhitespace=i.get(113),this.experimentalWhitespaceRendering=i.get(47),this.renderControlCharacters=i.get(108),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(40),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(75),this.stopRenderingLineAfter=i.get(133),this.fontLigatures=i.get(60),this.verticalScrollbarSize=i.get(117).verticalScrollbarSize,this.useGpu=i.get(46)==="on"}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}}class Bae{constructor(){this._currentVisibleRange=new L(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Hae{constructor(e,t,i,n,s,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Vae{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;lnew Sc(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,Oa.write(this.domNode,8),this.domNode.setClassName(`view-lines ${Op}`),gn(this.domNode,r),this._maxLineWidth=0,this._asyncUpdateLineWidths=new St(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new St(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Bae,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(131).enabled,this._maxNumberStickyLines=s.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(59),n=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,gn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ty(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++)this._visibleLines.getVisibleLine(s).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let s=t;s<=i;s++)n=this._visibleLines.getVisibleLine(s).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Hae(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Vae(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const s=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,s),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new R(n,1);const s=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new KD(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=L.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const s=[];let r=0;const a=new KD(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(n.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const u=h===n.startLineNumber?n.startColumn:1,g=h!==i,f=g?this._context.viewModel.getLineMaxColumn(h):n.endColumn,_=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,f,a);if(_){if(t&&hthis._visibleLines.getEndLineNumber())return null;const n=new KD(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}_lineIsRenderedRTL(e){return ethis._visibleLines.getEndLineNumber()?!1:this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new NU(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,s=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){s=!1;continue}n=Math.max(n,a.getWidth(null))}return s&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){const r=this._visibleLines.getVisibleLine(s);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=s)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=n;s++)this._visibleLines.getVisibleLine(s).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const n=this._computeScrollLeftToReveal(i);n&&(!this._isViewportWrapping&&!n.hasRTL&&this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Gs&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++)if(this._visibleLines.getVisibleLine(s).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let b=s[0].startLineNumber,C=s[0].endLineNumber;for(let w=1,v=s.length;wl){if(!d)return-1;_=h}else if(r===5||r===6)if(r===6&&a<=h&&u<=c)_=a;else{const b=Math.max(5*this._lineHeight,l*.2),C=h-b,w=u-l;_=Math.max(w,C)}else if(r===1||r===2)if(r===2&&a<=h&&u<=c)_=a;else{const b=(h+u)/2;_=Math.max(0,b-l/2)}else _=this._computeMinimumScrolling(a,c,h,u,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(165),n=t.left,s=n+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0,l=!1;if(e.type==="range"){l=this._lineIsRenderedRTL(e.lineNumber);const d=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!d)return null;for(const h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}else for(const d of e.selections){if(d.startLineNumber!==d.endLineNumber)return null;const h=this._visibleRangesForLineRange(d.startLineNumber,d.startColumn,d.endColumn);if(l||=this._lineIsRenderedRTL(d.startLineNumber),!h)return null;for(const u of h.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-e4.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,s,r,a),maxHorizontalOffset:a,hasRTL:l}}_computeMinimumScrolling(e,t,i,n,s,r){e=e|0,t=t|0,i=i|0,n=n|0,s=!!s,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}}class zae extends s${constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(165);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let s=0,r=t.length;s',l=[];for(let c=t;c<=i;c++){const d=c-t,h=n[d].getDecorations();let u="";for(const g of h){let f='
';s[a]=c}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class gr{static{this.Empty=new gr(0,0,0,0)}constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=gr._clamp(e),this.g=gr._clamp(t),this.b=gr._clamp(i),this.a=gr._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}let $ae=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),ue(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new jae(this,e,t);return this._factories.set(e,i),ue(()=>{const n=this._factories.get(e);!n||n!==i||(this._factories.delete(e),n.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class jae extends A{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let KC=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class t4{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class JL{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var oo;(function(o){o[o.Increase=0]="Increase",o[o.Decrease=1]="Decrease"})(oo||(oo={}));var km;(function(o){const e=new Map;e.set(0,G.symbolMethod),e.set(1,G.symbolFunction),e.set(2,G.symbolConstructor),e.set(3,G.symbolField),e.set(4,G.symbolVariable),e.set(5,G.symbolClass),e.set(6,G.symbolStruct),e.set(7,G.symbolInterface),e.set(8,G.symbolModule),e.set(9,G.symbolProperty),e.set(10,G.symbolEvent),e.set(11,G.symbolOperator),e.set(12,G.symbolUnit),e.set(13,G.symbolValue),e.set(15,G.symbolEnum),e.set(14,G.symbolConstant),e.set(15,G.symbolEnum),e.set(16,G.symbolEnumMember),e.set(17,G.symbolKeyword),e.set(28,G.symbolSnippet),e.set(18,G.symbolText),e.set(19,G.symbolColor),e.set(20,G.symbolFile),e.set(21,G.symbolReference),e.set(22,G.symbolCustomColor),e.set(23,G.symbolFolder),e.set(24,G.symbolTypeParameter),e.set(25,G.account),e.set(26,G.issues),e.set(27,G.tools);function t(r){let a=e.get(r);return a||(console.info("No codicon found for CompletionItemKind "+r),a=G.symbolProperty),a}o.toIcon=t;function i(r){switch(r){case 0:return m(728,"Method");case 1:return m(729,"Function");case 2:return m(730,"Constructor");case 3:return m(731,"Field");case 4:return m(732,"Variable");case 5:return m(733,"Class");case 6:return m(734,"Struct");case 7:return m(735,"Interface");case 8:return m(736,"Module");case 9:return m(737,"Property");case 10:return m(738,"Event");case 11:return m(739,"Operator");case 12:return m(740,"Unit");case 13:return m(741,"Value");case 14:return m(742,"Constant");case 15:return m(743,"Enum");case 16:return m(744,"Enum Member");case 17:return m(745,"Keyword");case 18:return m(746,"Text");case 19:return m(747,"Color");case 20:return m(748,"File");case 21:return m(749,"Reference");case 22:return m(750,"Custom Color");case 23:return m(751,"Folder");case 24:return m(752,"Type Parameter");case 25:return m(753,"User");case 26:return m(754,"Issue");case 27:return m(755,"Tool");case 28:return m(756,"Snippet");default:return""}}o.toLabel=i;const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",28),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),n.set("tool",27);function s(r,a){let l=n.get(r);return typeof l>"u"&&!a&&(l=9),l}o.fromString=s})(km||(km={}));var Ws;(function(o){o[o.Automatic=0]="Automatic",o[o.Explicit=1]="Explicit"})(Ws||(Ws={}));class c${constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return L.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var RN;(function(o){o[o.Code=1]="Code",o[o.Label=2]="Label"})(RN||(RN={}));class ek{static fromExtensionId(e){return new ek(e,void 0,void 0)}constructor(e,t,i){this.extensionId=e,this.extensionVersion=t,this.providerId=i}toString(){let e="";return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),e.length===0&&(e="unknown"),e}toStringWithoutVersion(){let e="";return this.extensionId&&(e+=this.extensionId),this.providerId&&(e+=`:${this.providerId}`),e}}var Ng;(function(o){o[o.Accepted=0]="Accepted",o[o.Rejected=1]="Rejected",o[o.Ignored=2]="Ignored"})(Ng||(Ng={}));var GC;(function(o){o[o.Automatic=0]="Automatic",o[o.PasteAs=1]="PasteAs"})(GC||(GC={}));var yl;(function(o){o[o.Invoke=1]="Invoke",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange"})(yl||(yl={}));var Dm;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(Dm||(Dm={}));function qae(o){return!!o&&_e.isUri(o.uri)&&L.isIRange(o.range)&&(L.isIRange(o.originSelectionRange)||L.isIRange(o.targetSelectionRange))}const Kae={17:m(757,"array"),16:m(758,"boolean"),4:m(759,"class"),13:m(760,"constant"),8:m(761,"constructor"),9:m(762,"enumeration"),21:m(763,"enumeration member"),23:m(764,"event"),7:m(765,"field"),0:m(766,"file"),11:m(767,"function"),10:m(768,"interface"),19:m(769,"key"),5:m(770,"method"),1:m(771,"module"),2:m(772,"namespace"),20:m(773,"null"),15:m(774,"number"),18:m(775,"object"),24:m(776,"operator"),3:m(777,"package"),6:m(778,"property"),14:m(779,"string"),22:m(780,"struct"),25:m(781,"type parameter"),12:m(782,"variable")};function Gae(o,e){return m(783,"{0} ({1})",o,Kae[e])}var iy;(function(o){const e=new Map;e.set(0,G.symbolFile),e.set(1,G.symbolModule),e.set(2,G.symbolNamespace),e.set(3,G.symbolPackage),e.set(4,G.symbolClass),e.set(5,G.symbolMethod),e.set(6,G.symbolProperty),e.set(7,G.symbolField),e.set(8,G.symbolConstructor),e.set(9,G.symbolEnum),e.set(10,G.symbolInterface),e.set(11,G.symbolFunction),e.set(12,G.symbolVariable),e.set(13,G.symbolConstant),e.set(14,G.symbolString),e.set(15,G.symbolNumber),e.set(16,G.symbolBoolean),e.set(17,G.symbolArray),e.set(18,G.symbolObject),e.set(19,G.symbolKey),e.set(20,G.symbolNull),e.set(21,G.symbolEnumMember),e.set(22,G.symbolStruct),e.set(23,G.symbolEvent),e.set(24,G.symbolOperator),e.set(25,G.symbolTypeParameter);function t(s){let r=e.get(s);return r||(console.info("No codicon found for SymbolKind "+s),r=G.symbolProperty),r}o.toIcon=t;const i=new Map;i.set(0,20),i.set(1,8),i.set(2,8),i.set(3,8),i.set(4,5),i.set(5,0),i.set(6,9),i.set(7,3),i.set(8,2),i.set(9,15),i.set(10,7),i.set(11,1),i.set(12,4),i.set(13,14),i.set(14,18),i.set(15,13),i.set(16,13),i.set(17,13),i.set(18,13),i.set(19,17),i.set(20,13),i.set(21,16),i.set(22,6),i.set(23,10),i.set(24,11),i.set(25,24);function n(s){let r=i.get(s);return r===void 0&&(console.info("No completion kind found for SymbolKind "+s),r=20),r}o.toCompletionKind=n})(iy||(iy={}));let df=class yd{static{this.Comment=new yd("comment")}static{this.Imports=new yd("imports")}static{this.Region=new yd("region")}static fromValue(e){switch(e){case"comment":return yd.Comment;case"imports":return yd.Imports;case"region":return yd.Region}return new yd(e)}constructor(e){this.value=e}};var MN;(function(o){o[o.AIGenerated=1]="AIGenerated"})(MN||(MN={}));var ZC;(function(o){o[o.Invoke=0]="Invoke",o[o.Automatic=1]="Automatic"})(ZC||(ZC={}));var PN;(function(o){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}o.is=e})(PN||(PN={}));var ny;(function(o){o[o.Type=1]="Type",o[o.Parameter=2]="Parameter"})(ny||(ny={}));class Zae{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const ui=new $ae;class tk extends A{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||(this._INSTANCE=new tk),this._INSTANCE}constructor(){super(),this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(ui.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=ui.getColorMap();if(!e){this._colors=[gr.Empty],this._backgroundIsLight=!0;return}this._colors=[gr.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}const Yae=(()=>{const o=[];for(let e=32;e<=126;e++)o.push(e);return o.push(65533),o})(),Xae=(o,e)=>(o-=32,o<0||o>96?e<=2?(o+96)%96:95:o);class YC{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=YC.soften(e,12/15),this.charDataLight=YC.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;ne.width||i+f>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=Xae(n,c),b=e.width*4,C=a.r,w=a.g,v=a.b,S=s.r-C,x=s.g-w,k=s.b-v,D=Math.max(r,l),I=e.data;let T=_*u*g,F=i*b+t*4;for(let O=0;Oe.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*4,g=.5*(s/255),f=r.r,p=r.g,_=r.b,b=n.r-f,C=n.g-p,w=n.b-_,v=f+b*g,S=p+C*g,x=_+w*g,k=Math.max(s,a),D=e.data;let I=i*u+t*4;for(let T=0;T{const e=new Uint8ClampedArray(o.length/2);for(let t=0;t>1]=Y7[o[t]]<<4|Y7[o[t+1]]&15;return e},Q7={1:yg(()=>X7("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:yg(()=>X7("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class Eb{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return Q7[e]?i=new YC(Q7[e](),e):i=Eb.createFromSampleData(Eb.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const s of Yae)i.fillText(String.fromCharCode(s),n,16/2),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const n=Eb._downsample(e,t);return new YC(n,t)}static _downsampleChar(e,t,i,n,s){const r=1*s,a=2*s;let l=n,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dt===1)}function s4(o,e){return h$(o,e.range,t=>t===2)}function h$(o,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=o.tokenization.getLineTokens(i),s=i===e.startLineNumber,r=i===e.endLineNumber;let a=s?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}const Jae=140,ele=2;class Fp{constructor(e,t,i){const n=e.options,s=n.get(163),r=n.get(165),a=r.minimap,l=n.get(59),c=n.get(81);this.renderMinimap=a.renderMinimap,this.size=c.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(119),this.paddingTop=n.get(96).top,this.paddingBottom=n.get(96).bottom,this.showSlider=c.showSlider,this.autohide=c.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(75),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=r.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Qae,this.sectionHeaderFontSize=c.sectionHeaderFontSize*s,this.sectionHeaderLetterSpacing=c.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=Fp._getSectionHeaderColor(t,i.getColor(1)),this.charRenderer=yg(()=>Eb.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Fp._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Fp._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(yse);return i?new gr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(xse);return t?gr._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Hl);return i?new gr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class Nb{constructor(e,t,i,n,s,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,s,r,a,l,c,d,h){const u=e.pixelRatio,g=e.minimapLineHeight,f=Math.floor(e.canvasInnerHeight/g),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let x=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(x+=Math.max(0,s-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(s*s/x)),D=Math.max(0,e.minimapHeight-k),I=D/(d-s),T=c*I,F=D>0,O=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),B=Math.floor(e.paddingTop/e.lineHeight);return new Nb(c,d,F,I,T,k,B,1,Math.min(a,O))}let _;if(r&&i!==a){const x=i-t+1;_=Math.floor(x*g/u)}else{const x=s/p;_=Math.floor(x*g/u)}const b=Math.floor(e.paddingTop/p);let C=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const x=s/p;C=Math.max(C,x-1)}let w;if(C>0){const x=s/p;w=(b+a+C-x-1)*g/u}else w=Math.max(0,(b+a)*g/u-_);w=Math.min(e.minimapHeight-_,w);const v=w/(d-s),S=c*v;if(f>=b+a+C){const x=w>0;return new Nb(c,d,x,v,S,_,b,1,a)}else{let x;t>1?x=t+b:x=Math.max(1,c/p);let k,D=Math.max(1,Math.floor(x-S*u/g));Dc&&(D=Math.min(D,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?F=(t-D+k+T)*g/u:F=c/e.paddingTop*(k+T)*g/u,new Nb(c,d,!0,v,F,_,k,D,I)}}}class ik{static{this.INVALID=new ik(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}class J7{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new zU({createLine:()=>ik.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,s=i.length;n1){for(let b=0,C=n-1;b0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=XC.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let s=0,r=t-e+1;s!i.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter(n=>!!n.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new L(s,1,r,this._context.viewModel.getLineMaxColumn(r))}else i=new L(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const s=[];for(const r of n){if(!r.options.minimap)continue;const a=r.range,l=this._samplingState.modelLineToMinimapLine(a.startLineNumber),c=this._samplingState.modelLineToMinimapLine(a.endLineNumber);s.push(new d$(new L(l,a.startColumn,c,a.endColumn),r.options))}return s}return n}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const n=this._sectionHeaderCache.get(i);if(n)return n;const s=t(i);return this._sectionHeaderCache.set(i,s),s}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new L(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class hp extends A{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(V7),this._domNode=ht(document.createElement("div")),Oa.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ht(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ht(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ht(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ht(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=ht(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new St(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register(Li(this._domNode.domNode,ee.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register(Li(this._domNode.domNode,ee.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=Li(this._domNode.domNode,ee.POINTER_DOWN,i=>{i.preventDefault();const n=i.pointerType==="mouse",s=i.button===0;if(this._model.options.renderMinimap!==0&&this._lastRenderData){if(this._model.options.size!=="proportional"){if(s&&this._lastRenderData){const a=pi(this._slider.domNode),l=a.top+a.height/2;this._startSliderDragging(i,l,this._lastRenderData.renderedLayout)}return}if(s||!n){const a=this._model.options.minimapLineHeight,l=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let d=Math.floor(l/a)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;d=Math.min(d,this._model.getLineCount()),this._model.revealLineNumber(d)}}}),this._sliderPointerMoveMonitor=new l_,this._sliderPointerDownListener=Li(this._slider.domNode,ee.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Xt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=W(this._domNode.domNode,Rt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=W(this._domNode.domNode,Rt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Li(this._domNode.domNode,Rt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){if(this._isMouseOverMinimap){this._hideSoon();return}this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const s=(r,a)=>{const l=pi(this._domNode.domNode),c=Math.min(Math.abs(a-n),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Ln&&c>Jae){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>s(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide==="mouseover"?e.push("minimap-autohide-mouseover"):this._model.options.autohide==="scroll"&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new o4(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return this._model.options.autohide==="scroll"&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(V7),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=Nb.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(L.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,g)=>(u.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,n,s);const d=new eW(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const h=new eW(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,h,e,r,l,a,n),this._renderDecorationsHighlights(c,i,h,e,r,l,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=n.intersectWithViewport(l);if(!c)continue;const[d,h]=c;for(let f=d;f<=h;f++)i.set(f,!0);const u=n.getYForLineNumber(d,s),g=n.getYForLineNumber(h,s);a>=u||(a>r&&e.fillRect(el,r,e.canvas.width,a-r),r=u),a=g}a>r&&e.fillRect(el,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,s){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[h,u]=d,g=c.getColor(this._theme.value);if(!g||g.isTransparent())continue;let f=r.get(g.toString());f||(f=g.transparent(.5).toString(),r.set(g.toString(),f)),e.fillStyle=f;for(let p=h;p<=u;p++){if(i.has(p))continue;i.set(p,!0);const _=n.getYForLineNumber(h,s);e.fillRect(el,_,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=n.intersectWithViewport(c);if(!d)continue;const[h,u]=d;for(let g=h;g<=u;g++)this.renderDecorationOnLine(e,i,c,this._selectionColor,n,g,s,s,r,a,l)}}_renderDecorationsHighlights(e,t,i,n,s,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const h=n.intersectWithViewport(c.range);if(!h)continue;const[u,g]=h,f=d.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let p=u;p<=g;p++)switch(d.position){case 1:this.renderDecorationOnLine(e,i,c.range,f,n,p,s,s,r,a,l);continue;case 2:{const _=n.getYForLineNumber(p,s);this.renderDecoration(e,f,2,_,ele,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,r,a,l,c,d,h){const u=s.getYForLineNumber(r,l);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:f}=i,p=g===r?i.startColumn:1,_=f===r?i.endColumn:this._model.getLineMaxColumn(r),b=this.getXOffsetForPosition(t,r,p,c,d,h),C=this.getXOffsetForPosition(t,r,_,c,d,h);this.renderDecoration(e,n,b,u,C-b,a)}getXOffsetForPosition(e,t,i,n,s,r){if(i===1)return el;if((i-1)*s>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[el];let d=el;for(let h=1;h=r){l[h]=r;break}l[h]=f,d=f}e.set(t,l)}return i-1p.range.startLineNumber-_.range.startLineNumber);const f=hp._fitSectionHeader.bind(null,u,r-el);for(const p of g){const _=e.getYForLineNumber(p.range.startLineNumber,t)+i,b=_-i,C=b+2,w=this._model.getSectionHeaderText(p,f);hp._renderSectionLabel(u,w,p.options.minimap?.sectionHeaderStyle===2,l,d,r,b,s,_,C)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",s=e.measureText(i).width,r=e.measureText(n).width;if(s<=t||s<=r)return i;const a=i.length,l=s/i.length,c=Math.floor((t-r)/l)-1;let d=Math.ceil(c/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+n+i.substring(a-(c-d))}static _renderSectionLabel(e,t,i,n,s,r,a,l,c,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,l),e.fillStyle=s,e.fillText(t,el,c)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const K=this._lastRenderData._get();return new J7(e,K.imageData,K.lines)}const s=this._getBuffer();if(!s)return null;const[r,a,l]=hp._renderUntouchedLines(s,e.topPaddingLineCount,t,i,n,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,f=this._model.tokensColorTracker,p=f.backgroundIsLight(),_=this._model.options.renderMinimap,b=this._model.options.charRenderer(),C=this._model.options.fontScale,w=this._model.options.minimapCharWidth,S=(_===1?2:3)*C,x=n>S?Math.floor((n-S)/2):0,k=u.a/255,D=new gr(Math.round((u.r-h.r)*k+h.r),Math.round((u.g-h.g)*k+h.g),Math.round((u.b-h.b)*k+h.b),255);let I=e.topPaddingLineCount*n;const T=[];for(let K=0,ie=i-t+1;K=0&&FC)return;const O=_.charCodeAt(S);if(O===9){const B=u-(S+x)%u;x+=B-1,v+=B*r}else if(O===32)v+=r;else{const B=Yc(O)?2:1;for(let U=0;UC)return}}}}}class eW{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,s=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class ile extends Rs{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ht(document.createElement("div")),Oa.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ht(document.createElement("div")),Oa.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}_widgetCanOverflow(e){const i=this._context.configuration.options.get(4);return(e.allowEditorOverflow||!1)&&i}addWidget(e){const t=ht(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,s=t?.stackOridinal;return i.preference===n&&i.stack===s?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=s,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i0);t.sort((n,s)=>(this._widgets[n].stack||0)-(this._widgets[s].stack||0));for(let n=0,s=t.length;nt.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&jt(e.data,t.data)}static equalsArr(e,t){return jt(e,t,QC.equals)}}class sle{constructor(e,t){const i=e.options;this.lineHeight=i.get(75),this.pixelRatio=i.get(163),this.overviewRulerLanes=i.get(95),this.renderBorder=i.get(94);const n=t.getColor(iae);this.borderColor=n?n.toString():null,this.hideCursor=i.get(68);const s=t.getColor(ZL);this.cursorColorSingle=s?s.transparent(.7).toString():null;const r=t.getColor(GU);this.cursorColorPrimary=r?r.transparent(.7).toString():null;const a=t.getColor(ZU);this.cursorColorSecondary=a?a.transparent(.7).toString():null,this.themeType=t.type;const l=i.get(81),c=l.enabled,d=l.side,h=t.getColor(nae),u=ui.getDefaultBackground();h?this.backgroundColor=h:c&&d==="right"?this.backgroundColor=u:this.backgroundColor=null;const f=i.get(165).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[p,_]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=_}_initLanes(e,t,i){const n=t-e;if(i>=3){const s=Math.floor(n/3),r=Math.floor(n/3),a=n-s-r,l=e,c=l+s,d=l+s+a;return[[0,l,c,l,d,l,c,l],[0,s,a,s+a,r,s+a+r,a+r,s+a+r]]}else if(i===2){const s=Math.floor(n/2),r=n-s,a=e,l=a+s;return[[0,a,a,a,l,a,a,a],[0,s,s,s,r,s+r,s+r,s+r]]}else{const s=e,r=n;return[[0,s,s,s,s,s,s,s],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&V.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class ole extends Rs{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ht(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=ui.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new R(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new sle(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((t,i)=>R.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?V.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(QC.compareByRenderingProps),this._actualShouldRender===1&&!QC.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!jt(this._renderedCursorPositions,this._cursorPositions,(f,p)=>f.position.lineNumber===p.position.lineNumber&&f.color===p.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,s=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=n/a,c=6*this._settings.pixelRatio|0,d=c/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=V.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=V.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const u=this._settings.x,g=this._settings.w;for(const f of t){const p=f.color,_=f.data;h.fillStyle=p;let b=0,C=0,w=0;for(let v=0,S=_.length/3;vn&&(O=n-d),I=O-d,T=O+d}I>w+1||x!==b?(v!==0&&h.fillRect(u[b],C,g[b],w-C),b=x,C=I,w=T):T>w&&(w=T)}h.fillRect(u[b],C,g[b],w-C)}if(!this._settings.hideCursor){const f=2*this._settings.pixelRatio|0,p=f/2|0,_=this._settings.x[7],b=this._settings.w[7];let C=-100,w=-100,v=null;for(let S=0,x=this._cursorPositions.length;Sn&&(I=n-p);const T=I-p,F=T+f;T>w+1||k!==v?(S!==0&&v&&h.fillRect(_,C,b,w-C),C=T,w=F):F>w&&(w=F),v=k,h.fillStyle=k}v&&h.fillRect(_,C,b,w-C)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}class iW{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class u${constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const b=d.color;let C=this._color2Id[b];C||(C=++this._lastAssignedId,this._color2Id[b]=C,this._id2Color[C]=b);const w=new iW(p-_,p+_,C);d.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(iW.compare),a}}class ale extends lf{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ht(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new rle(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(75)),this._zoneManager.setPixelRatio(i.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,h=l.to;c!==s?(e.fillRect(0,r,n,a-r),s=c,e.fillStyle=i[s],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=d,a=h)}e.fillRect(0,r,n,a-r)}}class lle extends Rs{constructor(e){super(e),this.domNode=ht(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=ht(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(s),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const n=this._renderedRulers.pop();this.domNode.removeChild(n),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(165);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(117);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class dle{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class hle{constructor(e,t){this.lineNumber=e,this.ranges=t}}function ule(o){return new dle(o)}function gle(o){return new hle(o.lineNumber,o.ranges.map(ule))}class bn extends Bh{static{this.SELECTION_CLASS_NAME="selected-text"}static{this.SELECTION_TOP_LEFT="top-left-radius"}static{this.SELECTION_BOTTOM_LEFT="bottom-left-radius"}static{this.SELECTION_TOP_RIGHT="top-right-radius"}static{this.SELECTION_BOTTOM_RIGHT="bottom-right-radius"}static{this.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background"}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let s=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!s&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);s&&!s.startStyle&&(s=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const f=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;c1(d-f)f&&(u.top=1),c1(h-p)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const s=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let l=0,c=n.length;l1,c)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Tr((o,e)=>{const t=o.getColor(nse);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function c1(o){return o<0?-o:o}class nW{constructor(e,t,i,n,s,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=r,this.textContentClassName=a}}var Nc;(function(o){o[o.Single=0]="Single",o[o.MultiPrimary=1]="MultiPrimary",o[o.MultiSecondary=2]="MultiSecondary"})(Nc||(Nc={}));class sW{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(59);this._cursorStyle=i.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(38),this._isVisible=!0,this._domNode=ht(document.createElement("div")),this._domNode.setClassName(`cursor ${Op}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),gn(this._domNode,n),this._domNode.setDisplay("none"),this._position=new R(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case Nc.Single:this._pluralityClass="";break;case Nc.MultiPrimary:this._pluralityClass="cursor-primary";break;case Nc.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),gn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=PQ(i,t-1);return[new R(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="";const[n,s]=this._getGraphemeAwarePosition(),r=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),a=this._lineCursorHeight===0?r:Math.min(r,this._lineCursorHeight),l=(r-a)/2;if(this._cursorStyle===en.Line||this._cursorStyle===en.LineThin){const p=e.visibleRangeForPosition(n);if(!p||p.outsideRenderedLine)return null;const _=pe(this._domNode.domNode);let b;this._cursorStyle===en.Line?(b=Q3(_,this._lineCursorWidth>0?this._lineCursorWidth:2),b>2&&(t=s,i=this._getTokenClassName(n))):b=Q3(_,1);let C=p.left,w=0;b>=2&&C>=1&&(w=1,C-=w);const v=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+l;return new nW(v,C,w,b,a,t,i)}const c=e.linesVisibleRangesForRange(new L(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!c||c.length===0)return null;const d=c[0];if(d.outsideRenderedLine||d.ranges.length===0)return null;const h=d.ranges[0],u=s===" "?this._typicalHalfwidthCharacterWidth:h.width<1?this._typicalHalfwidthCharacterWidth:h.width;this._cursorStyle===en.Block&&(t=s,i=this._getTokenClassName(n));let g=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,f=r;return(this._cursorStyle===en.Underline||this._cursorStyle===en.UnderlineThin)&&(g+=r-2,f=2),new nW(g,h.left,0,u,f,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${Op} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class sy extends Rs{static{this.BLINK_INTERVAL=500}constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new sW(this._context,Nc.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ht(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new mo,this._cursorFlatBlinkInterval=new fO,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const s=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,s=e.ranges.length;n{this._isVisible?this._hide():this._show()},sy.BLINK_INTERVAL,pe(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},sy.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case en.Line:e+=" cursor-line-style";break;case en.Block:e+=" cursor-block-style";break;case en.Underline:e+=" cursor-underline-style";break;case en.LineThin:e+=" cursor-line-thin-style";break;case en.BlockOutline:e+=" cursor-block-outline-style";break;case en.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:ZL,background:XO},{class:".cursor-primary",foreground:GU,background:Wre},{class:".cursor-secondary",foreground:ZU,background:Bre}];for(const i of t){const n=o.getColor(i.foreground);if(n){let s=o.getColor(i.background);s||(s=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${s}; }`),Na(o.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`)}}});const GD=()=>{throw new Error("Invalid change accessor")};class fle extends Rs{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=ht(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=ht(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const s=Object.keys(this._zones);for(let r=0,a=s.length;r{const n={addZone:s=>(t=!0,this._addZone(i,s)),removeZone:s=>{s&&(t=this._removeZone(i,s)||t)},layoutZone:s=>{s&&(t=this._layoutZone(i,s)||t)}};ple(e,n),n.addZone=GD,n.removeZone=GD,n.layoutZone=GD}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),s={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ht(t.domNode),marginDomNode:t.marginDomNode?ht(t.marginDomNode):null};return this._safeCallOnComputedHeight(s.delegate,i.heightInPx),s.domNode.setPosition("absolute"),s.domNode.domNode.style.width="100%",s.domNode.setDisplay("none"),s.domNode.setAttribute("monaco-view-zone",s.whitespaceId),this.domNode.appendChild(s.domNode),s.marginDomNode&&(s.marginDomNode.setPosition("absolute"),s.marginDomNode.domNode.style.width="100%",s.marginDomNode.setDisplay("none"),s.marginDomNode.setAttribute("monaco-view-zone",s.whitespaceId),this.marginDomNode.appendChild(s.marginDomNode)),this._zones[s.whitespaceId]=s,this.setShouldRender(),s.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){Ee(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Ee(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!0);const s=Object.keys(this._zones);for(let r=0,a=s.length;rr)continue;const u=h.startLineNumber===r?h.startColumn:l.minColumn,g=h.endLineNumber===r?h.endColumn:l.maxColumn;u=k&&O<=D&&B===32){const K=O-1>=0?a.charCodeAt(O-1):0,ie=O+1=0?a.charCodeAt(O-1):0;if(B===32&&K!==32&&K!==9)continue}if(i&&!(T&&T.start<=O&&O`):B===9?S+=`
${v?"→":"→"}
`:S+=`
${String.fromCharCode(w)}
`)}return r?(F=Math.round(F+_),``+S+""):S}_renderArrow(e,t,i){const n=t/7,s=t,r=e/2,a=i,l={x:0,y:n/2},c={x:100/125*s,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},h={x:d.x+.1*c.x,y:d.y+.1*c.x},u={x:h.x+.35*c.x,y:h.y-.35*c.x},g={x:u.x,y:-u.y},f={x:h.x,y:-h.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},b={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class oW{constructor(e){const t=e.options,i=t.get(59),n=t.get(47);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="svg"?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class _le{constructor(e,t,i,n){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new L(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class ble{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class Cle{constructor(e,t,i){this.configuration=e,this.theme=new ble(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}const cg=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function Tg(o){if(!o)throw new Error(`Value "${o}" cannot be null`);return o}function g$(o,e,t){let i=new e.ResizeObserver(n=>{const s=n.find(l=>l.target===o);if(!s)return;if(!("devicePixelContentBoxSize"in s)){i?.disconnect(),i=void 0;return}const r=s.devicePixelContentBoxSize[0].inlineSize,a=s.devicePixelContentBoxSize[0].blockSize;r>0&&a>0&&t(r,a)});try{i.observe(o,{box:["device-pixel-content-box"]})}catch{throw i.disconnect(),i=void 0,new Ce("Could not observe device pixel dimensions")}return ue(()=>i?.disconnect())}var vle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};let wle=0;class JC extends A{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=wle++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=ze?"greyscale":"subpixel";const s=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(s*3,s*3),this._ctx=Tg(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:this._antiAliasing==="greyscale"})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${s}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return e===""?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){const s=Math.ceil(this.fontSize*this.devicePixelRatio),r=s*3;this._canvas.width!==r&&(this._canvas.width=r,this._canvas.height=r),this._ctx.save();const a=(t&15)/10,l=qn.getBackground(t),c=n[l],d=this._decorationStyleCache.getStyleSet(i);this._antiAliasing==="subpixel"?(this._ctx.fillStyle=c,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);const h=new Fh(200),u=qn.getFontStyle(t);u&1&&h.appendString("italic "),d?.bold!==void 0?d.bold&&h.appendString("bold "):u&2&&h.appendString("bold "),h.appendString(`${s}px ${this.fontFamily}`),this._ctx.font=h.build();const g=s,f=s;d?.color!==void 0?this._ctx.fillStyle=`#${d.color.toString(16).padStart(8,"0")}`:this._ctx.fillStyle=n[qn.getForeground(t)],this._ctx.textBaseline="top",d?.opacity!==void 0&&(this._ctx.globalAlpha=d.opacity),this._ctx.fillText(e,g+a,f),this._ctx.restore();const p=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if(this._antiAliasing==="subpixel"){const _=parseInt(c.substring(1,3),16),b=parseInt(c.substring(3,5),16),C=parseInt(c.substring(5,7),16);this._clearColor(p,_,b,C),this._ctx.putImageData(p,0,0)}return this._findGlyphBoundingBox(p,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-g,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-f,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let s=0;s=t.left;r--){for(let a=0;a=0;r--){for(let a=0;a=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yle=function(o,e){return function(t,i){e(t,i,o)}};let oy=class extends A{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(ue(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),s=0;for(;this._is){n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=s}this.clear()}};oy=Sle([yle(0,Mt)],oy);class xle extends oy{_requestCallback(e){return _t().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){_t().clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}class Lle extends oy{_requestCallback(e){return _t().requestIdleCallback(e)}_cancelCallback(e){_t().cancelIdleCallback(e)}}const kle="requestIdleCallback"in _t()?Lle:xle;class Dle{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=Tg(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new Ce("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);const n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=Tg(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);const s=new Map,r=new Map;for(const a of this._allocatedGlyphs)s.set(a.y,Math.max(s.get(a.y)??0,a.h)),r.set(a.y,Math.max(r.get(a.y)??0,a.x+a.w));for(const a of this._allocatedGlyphs)n.fillStyle="#4040FF",n.fillRect(a.x,a.y,a.w,a.h),n.fillStyle="#FF0000",n.fillRect(a.x,a.y+a.h,a.w,s.get(a.y)-a.h);for(const[a,l]of r.entries())a!==this._currentRow.y&&(n.fillStyle="#FF0000",n.fillRect(l,a,e-l,s.get(a)));return i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0;const s=e*t,r=new Map,a=new Map;for(const l of this._allocatedGlyphs)r.set(l.y,Math.max(r.get(l.y)??0,l.h)),a.set(l.y,Math.max(a.get(l.y)??0,l.x+l.w));for(const l of this._allocatedGlyphs)i+=l.w*l.h,n+=l.w*(r.get(l.y)-l.h);for(const[l,c]of a.entries())l!==this._currentRow.y&&(n+=(e-c)*r.get(l));return[`page${this._textureIndex}:`,` Total: ${s} (${e}x${t})`,` Used: ${i} (${(i/s*100).toPrecision(2)}%)`,` Wasted: ${n} (${(n/s*100).toPrecision(2)}%)`,`Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`].join(` +`)}}class Ile{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new yL,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=Tg(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<this._canvas.width||i>this._canvas.height)throw new Ce("Glyph is too large for the atlas page");if(t>this._slabW||i>this._slabH){if(this._allocatedGlyphs.size>0)return;let c=this._canvas.width;for(;t=c&&(s=void 0)}let r,a;if(!s)if(t=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,t=0;d--){const h=c[d];if(h.w>=t&&h.h>=i){r=h.x,a=h.y,i=this._slabsPerRow*this._slabsPerColumn)return;s={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n.w,entryH:n.h,count:0};const d=this._slabW%s.entryW,h=this._slabH%s.entryH;d&&rW(this._openRegionsByWidth,d,{x:s.x+this._slabW-d,w:d,y:s.y,h:this._slabH-(h??0)}),h&&rW(this._openRegionsByHeight,h,{x:s.x,w:this._slabW,y:s.y+this._slabH-h,h}),this._slabs.push(s),this._activeSlabsByDims.set(s,n.w,n.h)}const c=Math.floor(this._slabW/s.entryW);r=s.x+Math.floor(s.count%c)*s.entryW,a=s.y+Math.floor(s.count/c)*s.entryH,s.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,r,a,t,i);const l={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:r,y:a,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(l),l}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=Tg(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let s=0,r=0,a=0;const l=64<l&&(u=0,g+=h.entryH),n.fillStyle="#FF0000",n.fillRect(h.x+u,h.y+g,h.entryW,h.entryH),s+=h.entryW*h.entryH,u+=h.entryW;const f=Math.floor(l/h.entryW),p=Math.floor(c/h.entryH);h.entryW*f*h.entryH*p}for(const h of this._allocatedGlyphs)r+=h.w*h.h,n.fillStyle="#4040FF",n.fillRect(h.x,h.y,h.w,h.h);const d=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const h of d)n.fillStyle="#FF000088",n.fillRect(h.x,h.y,h.w,h.h),a+=h.w*h.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0,s=0,r=0,a=0;const l=e*t,c=64<c&&(p=0,_+=f.entryH),i+=f.entryW*f.entryH,p+=f.entryW;const b=Math.floor(c/f.entryW),C=Math.floor(d/f.entryH),w=f.entryW*b*f.entryH*C;s+=c*d-w}for(const f of this._allocatedGlyphs)n+=f.w*f.h;const h=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const f of h)a+=f.w*f.h;const u=s-a;r=i-(n-u);const g=n/(n+r+a);return[`page[${this._textureIndex}]:`,` Total: ${l}px (${e}x${t})`,` Used: ${n}px (${(n/l*100).toFixed(2)}%)`,` Wasted: ${r}px (${(r/l*100).toFixed(2)}%)`,`Restricted: ${a}px (${(a/l*100).toFixed(2)}%) (hard to allocate)`,`Efficiency: ${g===1?"100":(g*100).toFixed(2)}%`,` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/c)*Math.floor(this._canvas.height/d)}`].join(` +`)}}function rW(o,e,t){let i=o.get(e);i||(i=[],o.set(e,i)),i.push(t)}var Ele=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aW=function(o,e){return function(t,i){e(t,i,o)}},AN;let wa=class extends A{static{AN=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,s){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new yL,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=s.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new Dle(this._canvas,e);break;case"slab":this._allocator=new Ile(this._canvas,e);break;default:this._allocator=i(this._canvas,e);break}this._register(ue(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=AN.maximumGlyphCount)return;const s=e.rasterizeGlyph(t,i,n,this._colorMap),r=this._allocator.allocate(s);if(r!==void 0)return this._glyphMap.set(r,t,i,n,e.cacheKey),this._glyphInOrderSet.add(r),this._version++,this._usedArea.right=Math.max(this._usedArea.right,r.x+r.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,r.y+r.h-1),this._logService.getLevel()===Ji.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:s,glyph:r}),r}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};wa=AN=Ele([aW(3,Mt),aW(4,ci)],wa);var Nle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lW=function(o,e){return function(t,i){e(t,i,o)}},HS;let Yd=class extends A{static{HS=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,i,n,s){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=s,this._warmUpTask=this._register(new ut),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new yL,this._onDidDeleteGlyphs=this._register(new P),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(te.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));const r=Math.max(1,Math.floor(_t().devicePixelRatio));this.pageSize=Math.min(1024*r,this._maxTextureSize),this._initFirstPage(),this._register(ue(()=>pt(this._pages)))}_initFirstPage(){const e=this._instantiationService.createInstance(wa,0,this.pageSize,this._allocatorType);this._pages.push(e);const t=new JC(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(const e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,s){return i&=-2048,i|=Math.floor(s%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,s){return this._glyphPageIndex.set(e,i,n,s,t.cacheKey),this._pages[e].getGlyph(t,i,n,s)??(e+1=HS.maximumPageCount)throw new Error(`Attempt to create a texture atlas page past the limit ${HS.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(wa,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){const t=this._colorMap;if(!t)throw new Ce("Cannot warm atlas without color map");this._warmUpTask.value?.clear();const i=this._warmUpTask.value=this._instantiationService.createInstance(kle);for(let n=65;n<=90;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)});for(let n=97;n<=122;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)});for(let n=33;n<=126;n++)for(const s of t.keys())i.enqueue(()=>{for(let r=0;r<1;r+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,r)})}};Yd=HS=Nle([lW(3,ci),lW(4,fe)],Yd);var ev;(function(o){o[o.Ignore=0]="Ignore",o[o.Info=1]="Info",o[o.Warning=2]="Warning",o[o.Error=3]="Error"})(ev||(ev={}));(function(o){const e="error",t="warning",i="warn",n="info",s="ignore";function r(l){return l?Bu(e,l)?o.Error:Bu(t,l)||Bu(i,l)?o.Warning:Bu(n,l)?o.Info:o.Ignore:o.Ignore}o.fromValue=r;function a(l){switch(l){case o.Error:return e;case o.Warning:return t;case o.Info:return n;default:return s}}o.toString=a})(ev||(ev={}));var ni=ev,g_=ni;const bi=We("notificationService");class Tle{}var zs;(function(o){async function e(n){try{if(!navigator.gpu)throw new Error("This browser does not support WebGPU");const s=await navigator.gpu.requestAdapter();if(!s)throw new Error("This browser supports WebGPU but it appears to be disabled");return ZD(await s.requestDevice())}catch(s){throw n&&n(s.message),s}}o.requestDevice=e;function t(n,s,r){const a=n.createBuffer(s);return r&&n.queue.writeBuffer(a,0,wg(r)?r():r),ZD(a)}o.createBuffer=t;function i(n,s){return ZD(n.createTexture(s))}o.createTexture=i})(zs||(zs={}));function ZD(o){return{object:o,dispose:()=>o.destroy()}}class Rle{get dataOffset(){return this._startIndex}get dirtySize(){if(!(this._startIndex===void 0||this._endIndex===void 0))return this._endIndex-this._startIndex+1}get isDirty(){return this._startIndex!==void 0}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(this._startIndex===void 0||ethis._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}}function Mle(o,e){return new Ple(o,e)}class Ple extends A{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new Rle,this._propertySpecsMap=new Map,this._entries=new cs,this._onDidChange=this._register(new P),this._onDidChangeBuffer=this._register(new P),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let i=0;ipt(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());const t=new Ale(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(te.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose(()=>{const s=t.i;i(),this.view.set(this.view.subarray(s*this._entrySize+2,this._entries.size*this._entrySize+2),s*this._entrySize);for(const r of this._entries)r.i>s&&r.i--;this._dirtyTracker.flag(s,(this._entries.size-s)*this._entrySize),pt(n)})),t}_expandBuffer(){this.capacity*=2;const e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}}class Ale extends A{constructor(e,t,i,n,s){super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new P),this.onWillDispose=this._onWillDispose.event;for(const r of this._propertySpecsMap.values())this._view[this.i*this._propertySpecsMap.size+r.offset]=s[r.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw new Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}}const Ole=` struct Vertex { @location(0) position: vec2f, @@ -116,7 +116,7 @@ struct VSOutput { @fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f { return vsOut.color; } -`;class Mde extends Tf{constructor(e,t,i,n,s,r){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=s,this._shapeBindBuffer=this._register(new _t),this._initialized=!1,this._shapeCollection=this._register(Ede([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}],32)),this._context.addEventHandler(this),this._initWebgpu(r)}async _initWebgpu(e){if(this._device=await e,this._store.isDisposed)return;const t=navigator.gpu.getPreferredCanvasFormat();this._ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};let i;{const a=new Float32Array(6),l=(c=this._canvas.width,d=this._canvas.height)=>(a[0]=c,a[1]=d,a[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*St().devicePixelRatio),a[3]=0,a[4]=a[0]-a[2],a[5]=a[1]-a[3],a);i=this._register(Js.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>l())).object,this._register(Qj(this._canvas,St(),(c,d)=>{this._device.queue.writeBuffer(i,0,l(c,d))}))}const n=2;this._scrollOffsetBindBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:n*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(n);const s=()=>Js.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=s(),this._register(se.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=s(),this._pipeline&&this._updateBindGroup(this._pipeline,i)})),this._vertexBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:Rg.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},Rg)).object;const r=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:Rde});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,i),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,s,r,a,l){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:s,green:r,blue:a,alpha:l})}onScrollChanged(e){if(this._device){const t=St().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*t,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;const e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();const t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();const i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);const n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(Rg.length/2,this._shapeCollection.entryCount),i.end();const s=t.finish();this._device.queue.submit([s])}}class Pde extends F{constructor(){super(),this._ruleCache=new Map,this._container=ee("div.monaco-decoration-css-rule-extractor"),this._dummyElement=ee("span"),this._container.appendChild(this._dummyElement),this._register(ge(()=>this._container.remove()))}getStyleRules(e,t){const i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);const n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){const t=[],n=[...Qw().styleSheets];for(let s=0;s({deltas:[],didChange:!1}),handleChange:(n,s)=>{if(n.didChange(o)){const r=n.change;r!==void 0&&s.deltas.push(r),s.didChange=!0}return!0}}},(n,s)=>{const r=o.read(n),a=t;s.didChange&&(t=r,e(r,a,s.deltas)),i&&(i=!1,t=r)})}function Jj(o,e){const t=new z,i=Ka(o,(n,s,r)=>{t.clear(),e(n,s,r,t)});return{dispose(){i.dispose(),t.dispose()}}}function Ode(o,e){return Jj(o,(t,i,n,s)=>{e(t,i,n,XN(s))})}var Fde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eE=function(o,e){return function(t,i){e(t,i,o)}},Is;let ms=class extends F{static{Is=this}static{this._decorationCssRuleExtractor=new Pde}static get decorationCssRuleExtractor(){return Is._decorationCssRuleExtractor}static{this._decorationStyleCache=new Ade}static get decorationStyleCache(){return Is._decorationStyleCache}static get atlas(){if(!Is._atlas)throw new ve("Cannot call ViewGpuContext.textureAtlas before device is resolved");return Is._atlas}get atlas(){return Is.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=mt(document.createElement("canvas")),this.canvas.setClassName("editorCanvas"),this._register(se.runAndSubscribe(n.onDidChangeConfiguration,l=>{if(!l||l.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){const c=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${c}px`}})),this.ctx=ef(this.canvas.domNode.getContext("webgpu")),Is.device||(Is.device=Js.requestDevice(l=>{const c=[{label:m(78,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(U_.Warning,l,c)}).then(l=>(Is.deviceSync=l.object,Is._atlas||(Is._atlas=this._instantiationService.createInstance(_h,l.object.limits.maxTextureDimension2D,void 0,Is.decorationStyleCache)),l.object)));const s=Ee(this,St().devicePixelRatio);this._register(B(St(),"resize",()=>{s.set(St().devicePixelRatio,void 0)})),this.devicePixelRatio=s,this._register(Ka(this.devicePixelRatio,()=>Is.atlas?.clear()));const r=Ee(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(Qj(this.canvas.domNode,St(),(l,c)=>{this.canvas.domNode.width=l,this.canvas.domNode.height=c,r.set({width:l,height:c},void 0)})),this.canvasDevicePixelDimensions=r;const a=Ee(this,0);this._register(this.configurationService.onDidChangeConfiguration(l=>{a.set(e.configuration.options.get(165).contentLeft,void 0)})),this.contentLeft=a,this.rectangleRenderer=this._instantiationService.createInstance(Mde,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,Is.device)}canRender(e,t,i){const n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let s=!0;for(const r of n.inlineDecorations){if(r.type!==0){s=!1;break}const a=Is._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,r.inlineClassName);if(s&&=a.every(l=>{if(l.selectorText.includes(":"))return!1;for(const c of l.style)if(!H9(c,l.style))return!1;return!0}),!s)break}return s}return!0}canRenderDetailed(e,t,i){const n=t.getViewLineRenderingData(i),s=[];if(n.containsRTL&&s.push("containsRTL"),n.maxColumn>this.maxGpuCols&&s.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let r=!0;const a=[],l=[],c=[];for(const d of n.inlineDecorations){if(d.type!==0){a.push(d.type),r=!1;continue}const h=Is._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,d.inlineClassName);r&&=h.every(u=>{if(u.selectorText.includes(":"))return l.push(u.selectorText),!1;for(const g of u.style)if(!H9(g,u.style))return c.push(`${g}: ${u.style[g]}`),!1;return!0})}a.length>0&&s.push(`inlineDecorations with unsupported types (${a.map(d=>`\`${d}\``).join(", ")})`),c.length>0&&s.push(`inlineDecorations with unsupported CSS rules (${c.map(d=>`\`${d}\``).join(", ")})`),l.length>0&&s.push(`inlineDecorations with unsupported CSS selectors (${l.map(d=>`\`${d}\``).join(", ")})`)}return s}};ms=Is=Fde([eE(1,pe),eE(2,Li),eE(3,Oe)],ms);const Wde=["color","font-weight","opacity"];function H9(o,e){return!!Wde.includes(o)}function tL(o,e){return o.isBasicASCII&&e.useMonospaceOptimizations?new Bde(o):new Hde(o)}class Bde{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}}class Hde{constructor(e){this._segments=[];const t=e.content,i=Ef.Segmenter(void 0,{granularity:"grapheme"}).value,n=Array.from(i.segment(t));let s=0;for(let r=0;r(a[0]=c,a[1]=d,a[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*_t().devicePixelRatio),a[3]=0,a[4]=a[0]-a[2],a[5]=a[1]-a[3],a);i=this._register(zs.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>l())).object,this._register(g$(this._canvas,_t(),(c,d)=>{this._device.queue.writeBuffer(i,0,l(c,d))}))}const n=2;this._scrollOffsetBindBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:n*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(n);const s=()=>zs.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=s(),this._register(te.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=s(),this._pipeline&&this._updateBindGroup(this._pipeline,i)})),this._vertexBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:cg.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},cg)).object;const r=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:Ole});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,i),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,s,r,a,l){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:s,green:r,blue:a,alpha:l})}onScrollChanged(e){if(this._device){const t=_t().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*t,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;const e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();const t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();const i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);const n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(cg.length/2,this._shapeCollection.entryCount),i.end();const s=t.finish();this._device.queue.submit([s])}}class Wle extends A{constructor(){super(),this._ruleCache=new Map,this._container=J("div.monaco-decoration-css-rule-extractor"),this._dummyElement=J("span"),this._container.appendChild(this._dummyElement),this._register(ue(()=>this._container.remove()))}getStyleRules(e,t){const i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);const n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){const t=[],n=[...fw().styleSheets];for(let s=0;s({deltas:[],didChange:!1}),handleChange:(n,s)=>{if(n.didChange(o)){const r=n.change;r!==void 0&&s.deltas.push(r),s.didChange=!0}return!0}}},(n,s)=>{const r=o.read(n),a=t;s.didChange&&(t=r,e(r,a,s.deltas)),i&&(i=!1,t=r)})}function f$(o,e){const t=new z,i=Ta(o,(n,s,r)=>{t.clear(),e(n,s,r,t)});return{dispose(){i.dispose(),t.dispose()}}}function Hle(o,e){return f$(o,(t,i,n,s)=>{e(t,i,n,VE(s))})}var Vle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},YD=function(o,e){return function(t,i){e(t,i,o)}},bs;let as=class extends A{static{bs=this}static{this._decorationCssRuleExtractor=new Wle}static get decorationCssRuleExtractor(){return bs._decorationCssRuleExtractor}static{this._decorationStyleCache=new Ble}static get decorationStyleCache(){return bs._decorationStyleCache}static get atlas(){if(!bs._atlas)throw new Ce("Cannot call ViewGpuContext.textureAtlas before device is resolved");return bs._atlas}get atlas(){return bs.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=ht(document.createElement("canvas")),this.canvas.setClassName("editorCanvas"),this._register(te.runAndSubscribe(n.onDidChangeConfiguration,l=>{if(!l||l.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){const c=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${c}px`}})),this.ctx=Tg(this.canvas.domNode.getContext("webgpu")),bs.device||(bs.device=zs.requestDevice(l=>{const c=[{label:m(78,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(g_.Warning,l,c)}).then(l=>(bs.deviceSync=l.object,bs._atlas||(bs._atlas=this._instantiationService.createInstance(Yd,l.object.limits.maxTextureDimension2D,void 0,bs.decorationStyleCache)),l.object)));const s=De(this,_t().devicePixelRatio);this._register(W(_t(),"resize",()=>{s.set(_t().devicePixelRatio,void 0)})),this.devicePixelRatio=s,this._register(Ta(this.devicePixelRatio,()=>bs.atlas?.clear()));const r=De(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(g$(this.canvas.domNode,_t(),(l,c)=>{this.canvas.domNode.width=l,this.canvas.domNode.height=c,r.set({width:l,height:c},void 0)})),this.canvasDevicePixelDimensions=r;const a=De(this,0);this._register(this.configurationService.onDidChangeConfiguration(l=>{a.set(e.configuration.options.get(165).contentLeft,void 0)})),this.contentLeft=a,this.rectangleRenderer=this._instantiationService.createInstance(Fle,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,bs.device)}canRender(e,t,i){const n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let s=!0;for(const r of n.inlineDecorations){if(r.type!==0){s=!1;break}const a=bs._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,r.inlineClassName);if(s&&=a.every(l=>{if(l.selectorText.includes(":"))return!1;for(const c of l.style)if(!cW(c,l.style))return!1;return!0}),!s)break}return s}return!0}canRenderDetailed(e,t,i){const n=t.getViewLineRenderingData(i),s=[];if(n.containsRTL&&s.push("containsRTL"),n.maxColumn>this.maxGpuCols&&s.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let r=!0;const a=[],l=[],c=[];for(const d of n.inlineDecorations){if(d.type!==0){a.push(d.type),r=!1;continue}const h=bs._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,d.inlineClassName);r&&=h.every(u=>{if(u.selectorText.includes(":"))return l.push(u.selectorText),!1;for(const g of u.style)if(!cW(g,u.style))return c.push(`${g}: ${u.style[g]}`),!1;return!0})}a.length>0&&s.push(`inlineDecorations with unsupported types (${a.map(d=>`\`${d}\``).join(", ")})`),c.length>0&&s.push(`inlineDecorations with unsupported CSS rules (${c.map(d=>`\`${d}\``).join(", ")})`),l.length>0&&s.push(`inlineDecorations with unsupported CSS selectors (${l.map(d=>`\`${d}\``).join(", ")})`)}return s}};as=bs=Vle([YD(1,fe),YD(2,bi),YD(3,Pe)],as);const zle=["color","font-weight","opacity"];function cW(o,e){return!!zle.includes(o)}function ry(o,e){return o.isBasicASCII&&e.useMonospaceOptimizations?new Ule(o):new $le(o)}class Ule{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}}class $le{constructor(e){this._segments=[];const t=e.content,i=rf.Segmenter(void 0,{granularity:"grapheme"}).value,n=Array.from(i.segment(t));let s=0;for(let r=0;r scrollOffset: ScrollOffset; // Storage buffers -@group(0) @binding(0) var glyphInfo: array, ${_h.maximumPageCount}>; +@group(0) @binding(0) var glyphInfo: array, ${Yd.maximumPageCount}>; @group(0) @binding(1) var cells: array; @vertex fn vs( @@ -199,74 +199,74 @@ struct VSOutput { @fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f { return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex)); } -`;class Nc extends eq{static{this.maxSupportedColumns=2e3}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=tq,this._cellBindBufferLineCapacity=63,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new P),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity);const s=2;this._scrollOffsetBindBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:s*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(s)}_rebuildCellBuffer(e){this._cellBindBuffer?.destroy();const t=(Math.floor(e/32)+1)*32,i=t*Nc.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco full file cell buffer",size:i,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(i),new ArrayBuffer(i)],this._cellBindBufferLineCapacity=t,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){const t=St().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(e,t){let i="",n,s=0,r=0,a=0,l=0,c=0,d=0,h,u=0,g=0,f=0,p=0,_,b,C,w,v,S=0,L=0,x;const k=St().devicePixelRatio;let I;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacityNc.maxSupportedColumns);a++){if(n=I.getSegmentAtIndex(a),n===void 0)continue;i=n,w.isBasicASCII&&t.useMonospaceOptimizations||(s=this.glyphRasterizer.getTextMetrics(i).width),b=void 0,_=void 0,C=void 0;for(v of w.inlineDecorations){if(rv.range.endLineNumber||r===v.range.startLineNumber&&a=v.range.endColumn-1)continue;const ie=ms.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,v.inlineClassName);for(const Q of ie)for(const ne of Q.style){const ce=Q.styleMap.get(ne)?.toString()??"";switch(ne){case"color":{const De=V.Format.CSS.parse(ce);if(!De)throw new ve("Invalid color format "+ce);b=De.toNumber32Bit();break}case"font-weight":{Vde(ce)>=400?_=!0:_=!1;break}case"opacity":{C=zde(ce);break}default:throw new ve("Unexpected inline decoration style")}}}if(i===" "||i===" "){if(u=((r-1)*Nc.maxSupportedColumns+a)*6,T.fill(0,u,u+6),i===" "){const ie=a+d;d=hi.nextRenderTabStop(a+d,w.tabSize),l+=s*(d-ie),d-=a+1}else l+=s;continue}const q=ms.decorationStyleCache.getOrCreateEntry(b,_,C);h=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,i,p,q,l),c=Math.round(e.relativeVerticalOffset[r-e.startLineNumber]*k+Math.floor((e.lineHeight*k-(h.fontBoundingBoxAscent+h.fontBoundingBoxDescent))/2)+h.fontBoundingBoxAscent),u=((r-e.startLineNumber)*Nc.maxSupportedColumns+a)*6,T[u+0]=Math.floor(l),T[u+1]=c,T[u+4]=h.glyphIndex,T[u+5]=h.pageIndex,l+=s}g=f}S=((r-e.startLineNumber)*Nc.maxSupportedColumns+f)*6,L=(r-e.startLineNumber)*Nc.maxSupportedColumns*6,T.fill(0,S,L)}const O=(e.endLineNumber-e.startLineNumber+1)*A;return this._device.queue.writeBuffer(this._cellBindBuffer,0,T.buffer,0,(e.endLineNumber-e.startLineNumber)*A*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=O,O}draw(e,t){if(this._visibleObjectCount<=0)throw new ve("Attempt to draw 0 objects");e.draw(Rg.length/2,this._visibleObjectCount)}}function Vde(o){switch(o){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(o)}function zde(o){return o.endsWith("%")?parseFloat(o.substring(0,o.length-1))/100:o.match(/^\d+(?:\.\d*)/)?parseFloat(o):1}class pn extends eq{static{this.maxSupportedLines=3e3}static{this.maxSupportedColumns=200}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="fullfile",this.wgsl=tq,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];const s=pn.maxSupportedLines*pn.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco full file cell buffer",size:s,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(s),new ArrayBuffer(s)];const r=2;this._scrollOffsetBindBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:r*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(r)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(const t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){const t=St().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(const t of[0,1]){const i=this._upToDateLines[t];for(const n of i)n>=e&&i.delete(n)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){this._invalidateAllLines();for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(e,t){let i="",n,s=0,r=0,a=0,l=0,c=0,d=0,h,u=0,g=0,f=0,p=0,_,b,C,w,v,S=0,L=0,x;const k=St().devicePixelRatio;let I;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);const T=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),A=pn.maxSupportedColumns*6,O=this._upToDateLines[this._activeDoubleBufferIndex];let W=3e3,U=0;const q=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;q.length;){const Q=q.shift();switch(Q.type){case 2:case 8:case 17:{T.fill(0),W=1,U=Math.max(U,this._finalRenderedLine),this._finalRenderedLine=0;break}case 10:{const ne=(Q.fromLineNumber-1)*pn.maxSupportedColumns*6,ce=Q.toLineNumber*pn.maxSupportedColumns*6,De=(this._finalRenderedLine-(Q.toLineNumber-Q.fromLineNumber+1))*pn.maxSupportedColumns*6;T.set(T.subarray(ce),ne),T.fill(0,De),W=Math.min(W,Q.fromLineNumber),U=Math.max(U,this._finalRenderedLine),this._finalRenderedLine-=Q.toLineNumber-Q.fromLineNumber+1;break}}}for(r=e.startLineNumber;r<=e.endLineNumber;r++){if(!this._viewGpuContext.canRender(t,e,r)){S=(r-1)*pn.maxSupportedColumns*6,L=r*pn.maxSupportedColumns*6,T.fill(0,S,L),W=Math.min(W,r),U=Math.max(U,r);continue}if(!O.has(r)){W=Math.min(W,r),U=Math.max(U,r),w=e.getViewLineRenderingData(r),d=0,I=tL(w,t),s=t.spaceWidth*k,l=0,x=w.tokens,g=w.minColumn-1,f=0;for(let Q=0,ne=x.getCount();Qpn.maxSupportedColumns);a++){if(n=I.getSegmentAtIndex(a),n===void 0)continue;i=n,w.isBasicASCII&&t.useMonospaceOptimizations||(s=this.glyphRasterizer.getTextMetrics(i).width),b=void 0,_=void 0,C=void 0;for(v of w.inlineDecorations){if(rv.range.endLineNumber||r===v.range.startLineNumber&&a=v.range.endColumn-1)continue;const De=ms.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,v.inlineClassName);for(const We of De)for(const st of We.style){const Ye=We.styleMap.get(st)?.toString()??"";switch(st){case"color":{const Ft=V.Format.CSS.parse(Ye);if(!Ft)throw new ve("Invalid color format "+Ye);b=Ft.toNumber32Bit();break}case"font-weight":{Ude(Ye)>=400?_=!0:_=!1;break}case"opacity":{C=$de(Ye);break}default:throw new ve("Unexpected inline decoration style")}}}if(i===" "||i===" "){if(u=((r-1)*pn.maxSupportedColumns+a)*6,T.fill(0,u,u+6),i===" "){const De=a+d;d=hi.nextRenderTabStop(a+d,w.tabSize),l+=s*(d-De),d-=a+1}else l+=s;continue}const ce=ms.decorationStyleCache.getOrCreateEntry(b,_,C);h=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,i,p,ce,l),c=Math.round(e.relativeVerticalOffset[r-e.startLineNumber]*k+Math.floor((e.lineHeight*k-(h.fontBoundingBoxAscent+h.fontBoundingBoxDescent))/2)+h.fontBoundingBoxAscent),u=((r-1)*pn.maxSupportedColumns+a)*6,T[u+0]=Math.floor(l),T[u+1]=c,T[u+4]=h.glyphIndex,T[u+5]=h.pageIndex,l+=s}g=f}S=((r-1)*pn.maxSupportedColumns+f)*6,L=r*pn.maxSupportedColumns*6,T.fill(0,S,L),O.add(r)}}const ie=(e.endLineNumber-e.startLineNumber+1)*A;return W=Math.min(W,pn.maxSupportedLines),U=Math.min(U,pn.maxSupportedLines),W<=U&&this._device.queue.writeBuffer(this._cellBindBuffer,(W-1)*A*Float32Array.BYTES_PER_ELEMENT,T.buffer,(W-1)*A*Float32Array.BYTES_PER_ELEMENT,(U-W+1)*A*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,U),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=ie,ie}draw(e,t){if(this._visibleObjectCount<=0)throw new ve("Attempt to draw 0 objects");e.draw(Rg.length/2,this._visibleObjectCount,void 0,(t.startLineNumber-1)*pn.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}}function Ude(o){switch(o){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(o)}function $de(o){return o.endsWith("%")?parseFloat(o.substring(0,o.length-1))/100:o.match(/^\d+(?:\.\d*)/)?parseFloat(o):1}var jde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},V9=function(o,e){return function(t,i){e(t,i,o)}};let qT=class extends zs{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new _t),this._renderStrategy=this._register(new _t),this.canvas=this._viewGpuContext.canvas.domNode,this._register(ke(s=>{this._viewGpuContext.canvasDevicePixelDimensions.read(s);const r=this._lastViewportData;r&&setTimeout(()=>{r===this._lastViewportData&&this.renderText(r)})})),this.initWebgpu()}async initWebgpu(){if(this._device=ms.deviceSync||await ms.device,this._store.isDisposed)return;const e=ms.atlas;this._register(e.onDidDeleteGlyphs(()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()}));const t=navigator.gpu.getPreferredCanvasFormat();this._viewGpuContext.ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};let i;{const l=new Float32Array(6),c=(d=this.canvas.width,h=this.canvas.height)=>(l[0]=d,l[1]=h,l[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*St().devicePixelRatio),l[3]=0,l[4]=l[0]-l[2],l[5]=l[1]-l[3],l);i=this._register(Js.createBuffer(this._device,{label:"Monaco uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>c())).object,this._register(Ka(this._viewGpuContext.canvasDevicePixelDimensions,({width:d,height:h})=>{this._device.queue.writeBuffer(i,0,c(d,h))})),this._register(Ka(this._viewGpuContext.contentLeft,()=>{this._device.queue.writeBuffer(i,0,c())}))}let n;n=this._register(Js.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>{const l=new Float32Array(2);return l[0]=e.pageSize,l[1]=e.pageSize,l})).object;const s=this._context.configuration.options.get(58),r=this._context.configuration.options.get(61);this._glyphRasterizer.value=this._register(new Fv(r,s,this._viewGpuContext.devicePixelRatio.get(),ms.decorationStyleCache)),this._register(Ka(this._viewGpuContext.devicePixelRatio,()=>{this._refreshGlyphRasterizer()})),this._renderStrategy.value=this._instantiationService.createInstance(pn,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:_h.maximumPageCount*(Fa.maximumGlyphCount*24),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(Js.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:e.pageSize,height:e.pageSize,depthOrArrayLayers:_h.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(Js.createBuffer(this._device,{label:"Monaco vertex buffer",size:Rg.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},Rg)).object;const a=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:a,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:a,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._glyphStorageBuffer}},{binding:2,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:3,resource:this._atlasGpuTexture.createView()},{binding:4,resource:{buffer:i}},{binding:5,resource:{buffer:n}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(const l of this._initViewportData)this.renderText(l);this._initViewportData=void 0}}_refreshRenderStrategy(e){if(this._renderStrategy.value?.type==="viewport"||e.endLineNumberthis._rebuildBindGroup?.())),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t=0,i;for(let n=e.startLineNumber;n<=e.endLineNumber;n++)i=e.getViewLineRenderingData(n),t=Math.max(t,i.maxColumn);return t}_updateAtlasStorageBufferAndTexture(){for(const[e,t]of ms.atlas.pages.entries()){if(e>=_h.maximumPageCount){console.log(`Attempt to upload atlas page [${e}], only ${_h.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);const i=6*Fa.maximumGlyphCount,n=new Float32Array(i);let s=0;for(const r of t.glyphs)n[s+0]=r.x,n[s+0+1]=r.y,n[s+2]=r.w,n[s+2+1]=r.h,n[s+4]=r.originOffsetX,n[s+4+1]=r.originOffsetY,s+=6;if(s/6>Fa.maximumGlyphCount)throw new Error(`Attempting to write more glyphs (${s/6}) than the GPUBuffer can hold (${Fa.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,e*6*Fa.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,n,0,6*Fa.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new ve("Should not be called")}render(e){throw new ve("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){const e=this._glyphRasterizer.value;if(!e)return;const t=this._context.configuration.options.get(58),i=this._context.configuration.options.get(61),n=this._viewGpuContext.devicePixelRatio.get();(e.fontFamily!==t||e.fontSize!==i||e.devicePixelRatio!==n)&&(this._glyphRasterizer.value=new Fv(i,t,n,ms.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);const t=new Yy(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();const i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});const n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);const s=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(s,0,this.canvas.width-s,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();const r=i.finish();this._device.queue.submit([r]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;const i=e.endLineNumber,n=D.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;const s=this._lastViewportData.startLineNumber,r=this._lastViewportData.endLineNumber,a=this._lastViewportData,l=this._lastViewLineOptions;if(!a||!l)return null;const c=[];let d=0;t&&(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(n.startLineNumber,1)).lineNumber);for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hr)continue;const u=h===n.startLineNumber?n.startColumn:1,g=h!==i,f=g?this._context.viewModel.getLineMaxColumn(h):n.endColumn,p=this._visibleRangesForLineRange(h,u,f);if(p){if(t&&hn.endLineNumber)return null;const r=n.getViewLineRenderingData(e),a=r.content;let l;r.isBasicASCII&&s.useMonospaceOptimizations||(l=tL(r,s));let c="",d=0,h=0;for(let p=0;p500){const w=e.modifyPosition(d.getEndPosition(),-500);d=D.fromPositions(w,d.getEndPosition())}const h=e.getValueInRange(d,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=c.intersectRanges(new D(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const w=e.modifyPosition(f.getStartPosition(),500);f=D.fromPositions(f.getStartPosition(),w)}const p=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const w=a.intersectRanges(t),v=c.intersectRanges(t);_=e.getValueInRange(w,1)+"…"+e.getValueInRange(v,1)}n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length));let b,C;return t.getDirection()===0?(b=h.length,C=h.length+_.length):(C=h.length,b=h.length+_.length),{value:h+_+p,selection:t,selectionStart:b,selectionEnd:C,startPositionWithinEditor:d.getStartPosition(),newlineCountBeforeSelection:d.endLineNumber-d.startLineNumber}}}function KT(o,e){if(o.get(2)===1){const i=e.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=e.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),s=e.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=m(61,"The editor is not accessible at this time.");return i?m(62,"{0} To enable screen reader optimized mode, use {1}",r,i):n?m(63,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,n):s?m(64,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,s):r}return o.get(8)}function z9(o){let e=0,t=-1;do{if(t=o.indexOf(` -`,t+1),t===-1)break;e++}while(!0);return e}var Kde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U9=function(o,e){return function(t,i){e(t,i,o)}};class Gde{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new R(this.modelLineNumber,this.distanceToModelLineStart+1),i=new R(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const tE=so;let GT=class extends iq{constructor(e,t,i,n,s,r){super(e),this._keybindingService=s,this._instantiationService=r,this._primaryCursorPosition=new R(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const a=this._context.configuration.options,l=a.get(165);this._setAccessibilityOptions(a),this._contentLeft=l.contentLeft,this._contentWidth=l.contentWidth,this._contentHeight=l.height,this._fontInfo=a.get(59),this._emptySelectionClipboard=a.get(45),this._copyWithSyntaxHighlighting=a.get(31),this._visibleTextArea=null,this._selections=[new le(1,1,1,1)],this._modelSelections=[new le(1,1,1,1)],this._lastRenderPosition=null,this.textArea=mt(document.createElement("textarea")),Qa.write(this.textArea,7),this.textArea.setClassName(`inputarea ${um}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",KT(a,this._keybindingService)),this.textArea.setAttribute("aria-required",a.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(a.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m(65,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",a.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=mt(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);const d=new nq,h={getDataToCopy:()=>xj(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const f=this._selections[0];if(je&&f.isEmpty()){const _=f.getStartPosition();let b=this._getWordBeforePosition(_);if(b.length===0&&(b=this._getCharacterBeforePosition(_)),b.length>0)return new kn(b,b.length,b.length,D.fromPositions(_),0)}if(je&&!f.isEmpty()&&this._context.viewModel.getValueLengthInRange(f,0)<500){const _=this._context.viewModel.getValueInRange(f,0);return new kn(_,0,_.length,f,0)}if(Ug&&!f.isEmpty()){const _="vscode-placeholder";return new kn(_,0,_.length,null,void 0)}return kn.EMPTY}if(i7){const f=this._selections[0];if(f.isEmpty()){const p=f.getStartPosition(),[_,b]=this._getAndroidWordAtPosition(p);if(_.length>0)return new kn(_,b,b,D.fromPositions(p),0)}return kn.EMPTY}const g=d.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0);return kn.fromScreenReaderContentState(g)},deduceModelPosition:(g,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(g,f,p)},u=this._register(new wle(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(BT,h,u,wo,{isAndroid:i7,isChrome:zw,isFirefox:so,isSafari:Ug})),this._register(this._textAreaInput.onKeyDown(g=>{this._viewController.emitKeyDown(g)})),this._register(this._textAreaInput.onKeyUp(g=>{this._viewController.emitKeyUp(g)})),this._register(this._textAreaInput.onPaste(g=>{let f=!1,p=null,_=null;g.metadata&&(f=this._emptySelectionClipboard&&!!g.metadata.isFromEmptySelection,p=typeof g.metadata.multicursorText<"u"?g.metadata.multicursorText:null,_=g.metadata.mode),this._viewController.paste(g.text,f,p,_)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(g=>{g.replacePrevCharCnt||g.replaceNextCharCnt||g.positionDelta?this._viewController.compositionType(g.text,g.replacePrevCharCnt,g.replaceNextCharCnt,g.positionDelta):this._viewController.type(g.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(g=>{this._viewController.setSelection(g)})),this._register(this._textAreaInput.onCompositionStart(g=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:_,widthOfHiddenTextBefore:b}=(()=>{const w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),v=w.lastIndexOf(` -`),S=w.substring(v+1),L=S.lastIndexOf(" "),x=S.length-L-1,k=p.getStartPosition(),I=Math.min(k.column-1,x),T=k.column-1-I,A=S.substring(0,S.length-I),{tabSize:O}=this._context.viewModel.model.getOptions(),W=Zde(this.textArea.domNode.ownerDocument,A,this._fontInfo,O);return{distanceToModelLineStart:T,widthOfHiddenTextBefore:W}})(),{distanceToModelLineEnd:C}=(()=>{const w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),v=w.indexOf(` -`),S=v===-1?w:w.substring(0,v),L=S.indexOf(" "),x=L===-1?S.length:S.length-L-1,k=p.getEndPosition(),I=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,x);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-I}})();this._context.viewModel.revealRange("keyboard",!0,D.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Gde(this._context,p.startLineNumber,_,b,C),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${um} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(g=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${um}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(Vl.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Hr(t,[]);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Hr(this._context.configuration.options.get(148),[]);let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Zi(i.charCodeAt(0)))return i}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===ps.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(165).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=tE?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",KT(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(140))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!Vl.enabled||e.get(41)&&e.get(104)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new R(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,n=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(s&&r&&i&&n&&n.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,l=z9(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let c=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=n.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewLayout.getLineHeightForLineNumber(s.lineNumber),g=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),f=this._context.viewModel.getViewLineData(s.lineNumber),p=f.tokens.findTokenIndexAtOffset(s.column-1),_=f.tokens.findTokenIndexAtOffset(r.column-1),b=p===_,C=this._visibleTextArea.definePresentation(b?f.tokens.getPresentation(p):null);this.textArea.domNode.scrollTop=l*u,this.textArea.domNode.scrollLeft=c,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:u,useCover:!1,color:(bi.getColorMap()||[])[C.foreground],italic:C.italic,bold:C.bold,underline:C.underline,strikethrough:C.strikethrough,fontSize:g})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(je||this._accessibilitySupport===2){const i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=this._textAreaInput.textAreaState.newlineCountBeforeSelection??z9(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*n;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:tE?0:1,useCover:!1})}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:tE?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;wn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?V.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(66)?i.setClassName("monaco-editor-background textAreaCover "+Nv.OUTER_CLASS_NAME):n.get(76).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+KD.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};GT=Kde([U9(4,dt),U9(5,pe)],GT);function Zde(o,e,t,i){if(e.length===0)return 0;const n=o.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const s=o.createElement("span");wn(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),n.appendChild(s),o.body.appendChild(n);const r=s.offsetWidth;return n.remove(),r}var Yde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xde=function(o,e){return function(t,i){e(t,i,o)}};let ZT=class extends F{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register(B(this._domNode,"focus",()=>{e.trace("NativeEditContext.focus"),!this._isPaused&&this.refreshFocusState()})),this._register(B(this._domNode,"blur",()=>{e.trace("NativeEditContext.blur"),!this._isPaused&&this._handleFocusedChanged(!1)}))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState()}refreshFocusState(){const e=Vh(this._domNode),t=e?e.activeElement:Ji(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}};ZT=Yde([Xde(0,Ht)],ZT);function hb(o,e,t,i){return o.addEventListener(e,t,i),{dispose(){o.removeEventListener(e,t)}}}var Qde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jde=function(o,e){return function(t,i){e(t,i,o)}};const ehe=sc("richScreenReaderContent",{createHTML:o=>o}),iE="data-line-number";let YT=class extends F{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new _t),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=Bv.NULL,this._strategy=new nhe,this._renderedLines=new Map,this._renderedSelection=new le(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=St().document.activeElement;if(!t||t!==this._domNode.domNode)return;if(this._accessibilityService.isScreenReaderOptimized()){const n=this._getScreenReaderContentLineIntervals(e);this._state.equals(n)||(this._state=n,this._renderedLines=this._renderScreenReaderContent(n)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=Bv.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){const t=this._state.intervals;if(!t.length)return;const i=this._context.viewModel.viewLayout,n=t[0].startLine,s=i.getVerticalOffsetForLineNumber(n),r=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=r-s}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return B(this._domNode.domNode.ownerDocument,"selectionchange",()=>{if(!(St().document.activeElement===this._domNode.domNode)||!this._accessibilityService.isScreenReaderOptimized()||!Vl.enabled)return;const s=Date.now(),r=s-e;if(e=s,r<5)return;const a=s-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,a<100)return;const l=this._getEditorSelectionFromDomRange();l&&this._viewController.setSelection(l)})}_renderScreenReaderContent(e){const t=[],i=new Map;for(const n of e.intervals)for(let s=n.startLine;s<=n.endLine;s++){const r=this._renderLine(s);i.set(s,r),t.push(r.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){const t=this._context.viewModel,i=t.getViewLineRenderingData(e),n=this._context.configuration.options,s=n.get(59),r=n.get(133),a=n.get(108),l=n.get(60),c=n.get(40),d=Cs.filter(i.inlineDecorations,e,i.minColumn,i.maxColumn),h=s.isMonospace&&!c,u=l!==Dr.OFF;let g;n.get(47)==="off"?g=n.get(113):g="none";const p=new Nd(h,s.canUseHalfwidthRightwardsArrow,i.content,i.continuesWithWrappedLine,i.isBasicASCII,i.containsRTL,i.minColumn-1,i.tokens,d,i.tabSize,i.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,r,g,a,u,null,null,0,!0),_=new su(1e4),b=V_(p,_),C=_.build(),w=ehe?.createHTML(C)??C,v=t.viewLayout.getLineHeightForLineNumber(e)+"px",S=document.createElement("div");return S.innerHTML=w,S.style.lineHeight=v,S.style.height=v,S.setAttribute(iE,e.toString()),new the(S,b.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){const s=St().document.getSelection();if(!s)return;const r=i.startLineNumber,a=i.endLineNumber,l=t.get(r),c=t.get(a);if(!l||!c)return;const d=e.viewModel,h=d.model,u=d.coordinatesConverter,g=new D(r,1,r,i.selectionStartColumn),f=u.convertViewRangeToModelRange(g),p=h.getCharacterCountInRange(f),_=new D(a,1,a,i.positionColumn),b=u.convertViewRangeToModelRange(_),C=h.getCharacterCountInRange(b),w=l.characterMapping.getDomPosition(p),v=c.characterMapping.getDomPosition(C),S=l.domNode.firstChild,L=c.domNode.firstChild,x=S.childNodes,k=L.childNodes,I=x.item(w.partIndex),T=k.item(v.partIndex);!I.firstChild||!T.firstChild||(this._setIgnoreSelectionChangeTime("setRange"),s.setBaseAndExtent(I.firstChild,i.startColumn===1?0:w.charIndex+1,T.firstChild,i.endColumn===1?0:v.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;const e=St().document.getSelection();if(!e||e.rangeCount===0)return;const i=e.getRangeAt(0),n=i.startContainer,s=i.endContainer,r=n.parentElement,a=s.parentElement;if(!r||!Si(r)||!a||!Si(a))return;const l=r.parentElement?.parentElement,c=a.parentElement?.parentElement;if(!l||!c)return;const d=l.getAttribute(iE),h=c.getAttribute(iE);if(!d||!h)return;const u=parseInt(d),g=parseInt(h),f=this._renderedLines.get(u)?.characterMapping,p=this._renderedLines.get(g)?.characterMapping;if(!f||!p)return;const _=Ym(f,r,i.startOffset),b=Ym(p,a,i.endOffset);return e.direction==="forward"?new le(u,_,g,b):new le(g,b,u,_)}};YT=Qde([Jde(3,Mn)],YT);class the{constructor(e,t){this.domNode=e,this.characterMapping=t}}class ihe{constructor(e,t){this.startLine=e,this.endLine=t}}class Bv{constructor(e,t){this.intervals=t;let i="";for(const n of t)for(let s=n.startLine;s<=n.endLine;s++)i+=e.getLineContent(s)+` -`;this.value=i}equals(e){return this.value===e.value}static get NULL(){const e={getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(t,i)=>t};return new Bv(e,[])}}class nhe{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){const n=t*i,s=n+1,r=Math.min(n+i,e.getLineCount());return new ihe(s,r)}fromEditorSelection(e,t,i){const n=this._getPageOfLine(t.startLineNumber,i),s=this._getRangeForPage(e,n,i),r=this._getPageOfLine(t.endLineNumber,i),a=this._getRangeForPage(e,r,i),l=[{startLine:s.startLine,endLine:s.endLine}];return n+1=t))throw new ve(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){return`[${this.replacements.map(t=>t.toString()).join(", ")}]`}normalize(){const e=[];let t;for(const i of this.replacements)if(!(i.getNewLength()===0&&i.replaceRange.length===0)){if(t&&t.replaceRange.endExclusive===i.replaceRange.start){const n=t.tryJoinTouching(i);if(n){t=n;continue}}t&&e.push(t),t=i}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;const n=[...t.replacements],s=[];let r=0;for(const a of i.replacements){for(;;){const h=n[0];if(!h||h.replaceRange.start+r+h.getNewLength()>=a.replaceRange.start)break;n.shift(),s.push(h),r+=h.getNewLength()-h.replaceRange.length}const l=r;let c,d;for(;;){const h=n[0];if(!h||h.replaceRange.start+r>a.replaceRange.endExclusive)break;c||(c=h),d=h,n.shift(),r+=h.getNewLength()-h.replaceRange.length}if(!c)s.push(a.delta(-r));else{const h=Math.min(c.replaceRange.start,a.replaceRange.start-l),u=a.replaceRange.start-(c.replaceRange.start+l);if(u>0){const _=c.slice(fe.emptyAt(h),new fe(0,u));s.push(_)}if(!d)throw new ve("Invariant violation: lastIntersecting is undefined");const g=d.replaceRange.endExclusive+r-a.replaceRange.endExclusive;if(g>0){const _=d.slice(fe.ofStartAndLength(d.replaceRange.endExclusive,0),new fe(d.getNewLength()-g,d.getNewLength()));n.unshift(_),r-=_.getNewLength()-_.replaceRange.length}const f=new fe(h,a.replaceRange.endExclusive-r),p=a.slice(f,new fe(0,a.getNewLength()));s.push(p)}}for(;;){const a=n.shift();if(!a)break;s.push(a)}return this._createNew(s).normalize()}getNewRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(fe.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return this.replacements.length===0}}class ohe{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new fe(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new fe(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class rhe extends she{apply(e){const t=[];let i=0;for(const n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}}class ahe extends ohe{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=pa(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,md(t,this.newText)),s=new fe(this.replaceRange.start+i,this.replaceRange.endExclusive-n),r=this.newText.substring(i,this.newText.length-n);return new Nn(s,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){const t=this.replaceRange.substring(e),i=pa(t,this.newText);return i===0?this:this.slice(this.replaceRange.deltaStart(i),new fe(i,this.newText.length))}removeCommonSuffix(e){const t=this.replaceRange.substring(e),i=md(t,this.newText);return i===0?this:this.slice(this.replaceRange.deltaEnd(-i),new fe(0,this.newText.length-i))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}}class Ga extends rhe{static{this.empty=new Ga([])}static compose(e){if(e.length===0)return Ga.empty;let t=e[0];for(let i=1;i=n.replaceRange.start)break;o.shift(),t.push(r.delta(i))}const s=[];for(;;){const r=o[0];if(!r||!r.intersectsOrTouches(n.replaceRange))break;o.shift(),s.push(r)}for(let r=s.length-1;r>=0;r--){let a=s[r];const l=a.intersect(n.replaceRange).length;a=a.deltaEnd(-l+(r===0?n.newText.length:0));const c=a.start-n.replaceRange.start;c>0&&(a=a.delta(-c)),r!==0&&(a=a.delta(n.newText.length)),a=a.delta(-(n.newText.length-n.replaceRange.length)),o.unshift(a)}i+=n.newText.length-n.replaceRange.length}for(;;){const n=o[0];if(!n)break;o.shift(),t.push(n.delta(i))}return t}class Ce{static ofLength(e,t){return new Ce(e,e+t)}static fromRange(e){return new Ce(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new Ce(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=Kn(e=>e.startLineNumber,Lo)}static joinMany(e){if(e.length===0)return[];let t=new Ir(e[0].slice());for(let i=1;it)throw new ve(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=t_(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=e_(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=e_(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,n=0,s=null;for(;i=r.startLineNumber?s=new Ce(s.startLineNumber,Math.max(s.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(s),s=r)}return s!==null&&t.push(s),new Ir(t)}subtractFrom(e){const t=Ev(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=t_(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Ir([e]);const n=[];let s=e.startLineNumber;for(let r=t;rs&&n.push(new Ce(s,a.startLineNumber)),s=a.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}class di{static{this.zero=new di(0,0)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new di(0,t.column-e.column):new di(t.lineNumber-e.lineNumber,t.column-1)}static fromPosition(e){return new di(e.lineNumber-1,e.column-1)}static ofRange(e){return di.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` -`?(t++,i=0):i++;return new di(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new di(this.lineCount,this.columnCount+e.columnCount):new di(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new D(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new D(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new D(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Ce.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new R(e.lineNumber,e.column+this.columnCount):new R(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class oq{getOffsetRange(e){return new fe(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return D.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new pC.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new pC.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const t=e.replacements.map(i=>this.getTextReplacement(i));return new pC.deps.TextEdit(t)}}class pC{static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}}function lhe(o){pC._deps=o}class QD extends oq{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t0&&e.charAt(t-1)==="\r"?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new R(1,1);const t=this.textLength.lineCount+1;if(e.lineNumber>t){const n=this.getLineLength(t);return new R(t,n+1)}if(e.column<1)return new R(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new R(e.lineNumber,i+1):e}getPosition(e){const t=t_(this.lineStartOffsetByLineIdx,s=>s<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new R(i,n)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new pC.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class CF{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new R(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new D(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new QD(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new D(e,1,e,Number.MAX_SAFE_INTEGER))}}class che extends CF{constructor(e,t){nv(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;icc.maxSupportedColumns);a++){if(n=I.getSegmentAtIndex(a),n===void 0)continue;i=n,w.isBasicASCII&&t.useMonospaceOptimizations||(s=this.glyphRasterizer.getTextMetrics(i).width),b=void 0,_=void 0,C=void 0;for(v of w.inlineDecorations){if(rv.range.endLineNumber||r===v.range.startLineNumber&&a=v.range.endColumn-1)continue;const ie=as.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,v.inlineClassName);for(const X of ie)for(const ne of X.style){const ce=X.styleMap.get(ne)?.toString()??"";switch(ne){case"color":{const ke=V.Format.CSS.parse(ce);if(!ke)throw new Ce("Invalid color format "+ce);b=ke.toNumber32Bit();break}case"font-weight":{jle(ce)>=400?_=!0:_=!1;break}case"opacity":{C=qle(ce);break}default:throw new Ce("Unexpected inline decoration style")}}}if(i===" "||i===" "){if(u=((r-1)*cc.maxSupportedColumns+a)*6,T.fill(0,u,u+6),i===" "){const ie=a+d;d=oi.nextRenderTabStop(a+d,w.tabSize),l+=s*(d-ie),d-=a+1}else l+=s;continue}const K=as.decorationStyleCache.getOrCreateEntry(b,_,C);h=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,i,p,K,l),c=Math.round(e.relativeVerticalOffset[r-e.startLineNumber]*D+Math.floor((e.lineHeight*D-(h.fontBoundingBoxAscent+h.fontBoundingBoxDescent))/2)+h.fontBoundingBoxAscent),u=((r-e.startLineNumber)*cc.maxSupportedColumns+a)*6,T[u+0]=Math.floor(l),T[u+1]=c,T[u+4]=h.glyphIndex,T[u+5]=h.pageIndex,l+=s}g=f}S=((r-e.startLineNumber)*cc.maxSupportedColumns+f)*6,x=(r-e.startLineNumber)*cc.maxSupportedColumns*6,T.fill(0,S,x)}const O=(e.endLineNumber-e.startLineNumber+1)*F;return this._device.queue.writeBuffer(this._cellBindBuffer,0,T.buffer,0,(e.endLineNumber-e.startLineNumber)*F*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=O,O}draw(e,t){if(this._visibleObjectCount<=0)throw new Ce("Attempt to draw 0 objects");e.draw(cg.length/2,this._visibleObjectCount)}}function jle(o){switch(o){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(o)}function qle(o){return o.endsWith("%")?parseFloat(o.substring(0,o.length-1))/100:o.match(/^\d+(?:\.\d*)/)?parseFloat(o):1}class an extends p${static{this.maxSupportedLines=3e3}static{this.maxSupportedColumns=200}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="fullfile",this.wgsl=m$,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];const s=an.maxSupportedLines*an.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco full file cell buffer",size:s,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(s),new ArrayBuffer(s)];const r=2;this._scrollOffsetBindBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:r*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(r)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(const t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){const t=_t().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(const t of[0,1]){const i=this._upToDateLines[t];for(const n of i)n>=e&&i.delete(n)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){this._invalidateAllLines();for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(e,t){let i="",n,s=0,r=0,a=0,l=0,c=0,d=0,h,u=0,g=0,f=0,p=0,_,b,C,w,v,S=0,x=0,k;const D=_t().devicePixelRatio;let I;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);const T=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),F=an.maxSupportedColumns*6,O=this._upToDateLines[this._activeDoubleBufferIndex];let B=3e3,U=0;const K=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;K.length;){const X=K.shift();switch(X.type){case 2:case 8:case 17:{T.fill(0),B=1,U=Math.max(U,this._finalRenderedLine),this._finalRenderedLine=0;break}case 10:{const ne=(X.fromLineNumber-1)*an.maxSupportedColumns*6,ce=X.toLineNumber*an.maxSupportedColumns*6,ke=(this._finalRenderedLine-(X.toLineNumber-X.fromLineNumber+1))*an.maxSupportedColumns*6;T.set(T.subarray(ce),ne),T.fill(0,ke),B=Math.min(B,X.fromLineNumber),U=Math.max(U,this._finalRenderedLine),this._finalRenderedLine-=X.toLineNumber-X.fromLineNumber+1;break}}}for(r=e.startLineNumber;r<=e.endLineNumber;r++){if(!this._viewGpuContext.canRender(t,e,r)){S=(r-1)*an.maxSupportedColumns*6,x=r*an.maxSupportedColumns*6,T.fill(0,S,x),B=Math.min(B,r),U=Math.max(U,r);continue}if(!O.has(r)){B=Math.min(B,r),U=Math.max(U,r),w=e.getViewLineRenderingData(r),d=0,I=ry(w,t),s=t.spaceWidth*D,l=0,k=w.tokens,g=w.minColumn-1,f=0;for(let X=0,ne=k.getCount();Xan.maxSupportedColumns);a++){if(n=I.getSegmentAtIndex(a),n===void 0)continue;i=n,w.isBasicASCII&&t.useMonospaceOptimizations||(s=this.glyphRasterizer.getTextMetrics(i).width),b=void 0,_=void 0,C=void 0;for(v of w.inlineDecorations){if(rv.range.endLineNumber||r===v.range.startLineNumber&&a=v.range.endColumn-1)continue;const ke=as.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,v.inlineClassName);for(const it of ke)for(const ot of it.style){const Lt=it.styleMap.get(ot)?.toString()??"";switch(ot){case"color":{const Zt=V.Format.CSS.parse(Lt);if(!Zt)throw new Ce("Invalid color format "+Lt);b=Zt.toNumber32Bit();break}case"font-weight":{Kle(Lt)>=400?_=!0:_=!1;break}case"opacity":{C=Gle(Lt);break}default:throw new Ce("Unexpected inline decoration style")}}}if(i===" "||i===" "){if(u=((r-1)*an.maxSupportedColumns+a)*6,T.fill(0,u,u+6),i===" "){const ke=a+d;d=oi.nextRenderTabStop(a+d,w.tabSize),l+=s*(d-ke),d-=a+1}else l+=s;continue}const ce=as.decorationStyleCache.getOrCreateEntry(b,_,C);h=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,i,p,ce,l),c=Math.round(e.relativeVerticalOffset[r-e.startLineNumber]*D+Math.floor((e.lineHeight*D-(h.fontBoundingBoxAscent+h.fontBoundingBoxDescent))/2)+h.fontBoundingBoxAscent),u=((r-1)*an.maxSupportedColumns+a)*6,T[u+0]=Math.floor(l),T[u+1]=c,T[u+4]=h.glyphIndex,T[u+5]=h.pageIndex,l+=s}g=f}S=((r-1)*an.maxSupportedColumns+f)*6,x=r*an.maxSupportedColumns*6,T.fill(0,S,x),O.add(r)}}const ie=(e.endLineNumber-e.startLineNumber+1)*F;return B=Math.min(B,an.maxSupportedLines),U=Math.min(U,an.maxSupportedLines),B<=U&&this._device.queue.writeBuffer(this._cellBindBuffer,(B-1)*F*Float32Array.BYTES_PER_ELEMENT,T.buffer,(B-1)*F*Float32Array.BYTES_PER_ELEMENT,(U-B+1)*F*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,U),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=ie,ie}draw(e,t){if(this._visibleObjectCount<=0)throw new Ce("Attempt to draw 0 objects");e.draw(cg.length/2,this._visibleObjectCount,void 0,(t.startLineNumber-1)*an.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}}function Kle(o){switch(o){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(o)}function Gle(o){return o.endsWith("%")?parseFloat(o.substring(0,o.length-1))/100:o.match(/^\d+(?:\.\d*)/)?parseFloat(o):1}var Zle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dW=function(o,e){return function(t,i){e(t,i,o)}};let ON=class extends Rs{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new ut),this._renderStrategy=this._register(new ut),this.canvas=this._viewGpuContext.canvas.domNode,this._register(xe(s=>{this._viewGpuContext.canvasDevicePixelDimensions.read(s);const r=this._lastViewportData;r&&setTimeout(()=>{r===this._lastViewportData&&this.renderText(r)})})),this.initWebgpu()}async initWebgpu(){if(this._device=as.deviceSync||await as.device,this._store.isDisposed)return;const e=as.atlas;this._register(e.onDidDeleteGlyphs(()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()}));const t=navigator.gpu.getPreferredCanvasFormat();this._viewGpuContext.ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};let i;{const l=new Float32Array(6),c=(d=this.canvas.width,h=this.canvas.height)=>(l[0]=d,l[1]=h,l[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*_t().devicePixelRatio),l[3]=0,l[4]=l[0]-l[2],l[5]=l[1]-l[3],l);i=this._register(zs.createBuffer(this._device,{label:"Monaco uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>c())).object,this._register(Ta(this._viewGpuContext.canvasDevicePixelDimensions,({width:d,height:h})=>{this._device.queue.writeBuffer(i,0,c(d,h))})),this._register(Ta(this._viewGpuContext.contentLeft,()=>{this._device.queue.writeBuffer(i,0,c())}))}let n;n=this._register(zs.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>{const l=new Float32Array(2);return l[0]=e.pageSize,l[1]=e.pageSize,l})).object;const s=this._context.configuration.options.get(58),r=this._context.configuration.options.get(61);this._glyphRasterizer.value=this._register(new JC(r,s,this._viewGpuContext.devicePixelRatio.get(),as.decorationStyleCache)),this._register(Ta(this._viewGpuContext.devicePixelRatio,()=>{this._refreshGlyphRasterizer()})),this._renderStrategy.value=this._instantiationService.createInstance(an,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:Yd.maximumPageCount*(wa.maximumGlyphCount*24),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(zs.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:e.pageSize,height:e.pageSize,depthOrArrayLayers:Yd.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(zs.createBuffer(this._device,{label:"Monaco vertex buffer",size:cg.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},cg)).object;const a=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:a,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:a,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._glyphStorageBuffer}},{binding:2,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:3,resource:this._atlasGpuTexture.createView()},{binding:4,resource:{buffer:i}},{binding:5,resource:{buffer:n}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(const l of this._initViewportData)this.renderText(l);this._initViewportData=void 0}}_refreshRenderStrategy(e){if(this._renderStrategy.value?.type==="viewport"||e.endLineNumberthis._rebuildBindGroup?.())),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t=0,i;for(let n=e.startLineNumber;n<=e.endLineNumber;n++)i=e.getViewLineRenderingData(n),t=Math.max(t,i.maxColumn);return t}_updateAtlasStorageBufferAndTexture(){for(const[e,t]of as.atlas.pages.entries()){if(e>=Yd.maximumPageCount){console.log(`Attempt to upload atlas page [${e}], only ${Yd.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);const i=6*wa.maximumGlyphCount,n=new Float32Array(i);let s=0;for(const r of t.glyphs)n[s+0]=r.x,n[s+0+1]=r.y,n[s+2]=r.w,n[s+2+1]=r.h,n[s+4]=r.originOffsetX,n[s+4+1]=r.originOffsetY,s+=6;if(s/6>wa.maximumGlyphCount)throw new Error(`Attempting to write more glyphs (${s/6}) than the GPUBuffer can hold (${wa.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,e*6*wa.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,n,0,6*wa.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new Ce("Should not be called")}render(e){throw new Ce("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){const e=this._glyphRasterizer.value;if(!e)return;const t=this._context.configuration.options.get(58),i=this._context.configuration.options.get(61),n=this._viewGpuContext.devicePixelRatio.get();(e.fontFamily!==t||e.fontSize!==i||e.devicePixelRatio!==n)&&(this._glyphRasterizer.value=new JC(i,t,n,as.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);const t=new ty(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();const i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});const n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);const s=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(s,0,this.canvas.width-s,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();const r=i.finish();this._device.queue.submit([r]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;const i=e.endLineNumber,n=L.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;const s=this._lastViewportData.startLineNumber,r=this._lastViewportData.endLineNumber,a=this._lastViewportData,l=this._lastViewLineOptions;if(!a||!l)return null;const c=[];let d=0;t&&(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new R(n.startLineNumber,1)).lineNumber);for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hr)continue;const u=h===n.startLineNumber?n.startColumn:1,g=h!==i,f=g?this._context.viewModel.getLineMaxColumn(h):n.endColumn,p=this._visibleRangesForLineRange(h,u,f);if(p){if(t&&hn.endLineNumber)return null;const r=n.getViewLineRenderingData(e),a=r.content;let l;r.isBasicASCII&&s.useMonospaceOptimizations||(l=ry(r,s));let c="",d=0,h=0;for(let p=0;p500){const w=e.modifyPosition(d.getEndPosition(),-500);d=L.fromPositions(w,d.getEndPosition())}const h=e.getValueInRange(d,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=c.intersectRanges(new L(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const w=e.modifyPosition(f.getStartPosition(),500);f=L.fromPositions(f.getStartPosition(),w)}const p=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const w=a.intersectRanges(t),v=c.intersectRanges(t);_=e.getValueInRange(w,1)+"…"+e.getValueInRange(v,1)}n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length));let b,C;return t.getDirection()===0?(b=h.length,C=h.length+_.length):(C=h.length,b=h.length+_.length),{value:h+_+p,selection:t,selectionStart:b,selectionEnd:C,startPositionWithinEditor:d.getStartPosition(),newlineCountBeforeSelection:d.endLineNumber-d.startLineNumber}}}function FN(o,e){if(o.get(2)===1){const i=e.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=e.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),s=e.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=m(61,"The editor is not accessible at this time.");return i?m(62,"{0} To enable screen reader optimized mode, use {1}",r,i):n?m(63,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,n):s?m(64,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",r,s):r}return o.get(8)}function hW(o){let e=0,t=-1;do{if(t=o.indexOf(` +`,t+1),t===-1)break;e++}while(!0);return e}var Xle=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uW=function(o,e){return function(t,i){e(t,i,o)}};class Qle{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new R(this.modelLineNumber,this.distanceToModelLineStart+1),i=new R(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const XD=Ks;let WN=class extends _${constructor(e,t,i,n,s,r){super(e),this._keybindingService=s,this._instantiationService=r,this._primaryCursorPosition=new R(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const a=this._context.configuration.options,l=a.get(165);this._setAccessibilityOptions(a),this._contentLeft=l.contentLeft,this._contentWidth=l.contentWidth,this._contentHeight=l.height,this._fontInfo=a.get(59),this._emptySelectionClipboard=a.get(45),this._copyWithSyntaxHighlighting=a.get(31),this._visibleTextArea=null,this._selections=[new ae(1,1,1,1)],this._modelSelections=[new ae(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ht(document.createElement("textarea")),Oa.write(this.textArea,7),this.textArea.setClassName(`inputarea ${Op}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",FN(a,this._keybindingService)),this.textArea.setAttribute("aria-required",a.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(a.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m(65,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",a.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ht(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);const d=new b$,h={getDataToCopy:()=>HU(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const f=this._selections[0];if(ze&&f.isEmpty()){const _=f.getStartPosition();let b=this._getWordBeforePosition(_);if(b.length===0&&(b=this._getCharacterBeforePosition(_)),b.length>0)return new vn(b,b.length,b.length,L.fromPositions(_),0)}if(ze&&!f.isEmpty()&&this._context.viewModel.getValueLengthInRange(f,0)<500){const _=this._context.viewModel.getValueInRange(f,0);return new vn(_,0,_.length,f,0)}if(vg&&!f.isEmpty()){const _="vscode-placeholder";return new vn(_,0,_.length,null,void 0)}return vn.EMPTY}if(L3){const f=this._selections[0];if(f.isEmpty()){const p=f.getStartPosition(),[_,b]=this._getAndroidWordAtPosition(p);if(_.length>0)return new vn(_,b,b,L.fromPositions(p),0)}return vn.EMPTY}const g=d.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0);return vn.fromScreenReaderContentState(g)},deduceModelPosition:(g,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(g,f,p)},u=this._register(new Lre(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(EN,h,u,lo,{isAndroid:L3,isChrome:sw,isFirefox:Ks,isSafari:vg})),this._register(this._textAreaInput.onKeyDown(g=>{this._viewController.emitKeyDown(g)})),this._register(this._textAreaInput.onKeyUp(g=>{this._viewController.emitKeyUp(g)})),this._register(this._textAreaInput.onPaste(g=>{let f=!1,p=null,_=null;g.metadata&&(f=this._emptySelectionClipboard&&!!g.metadata.isFromEmptySelection,p=typeof g.metadata.multicursorText<"u"?g.metadata.multicursorText:null,_=g.metadata.mode),this._viewController.paste(g.text,f,p,_)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(g=>{g.replacePrevCharCnt||g.replaceNextCharCnt||g.positionDelta?this._viewController.compositionType(g.text,g.replacePrevCharCnt,g.replaceNextCharCnt,g.positionDelta):this._viewController.type(g.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(g=>{this._viewController.setSelection(g)})),this._register(this._textAreaInput.onCompositionStart(g=>{const f=this.textArea.domNode,p=this._modelSelections[0],{distanceToModelLineStart:_,widthOfHiddenTextBefore:b}=(()=>{const w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),v=w.lastIndexOf(` +`),S=w.substring(v+1),x=S.lastIndexOf(" "),k=S.length-x-1,D=p.getStartPosition(),I=Math.min(D.column-1,k),T=D.column-1-I,F=S.substring(0,S.length-I),{tabSize:O}=this._context.viewModel.model.getOptions(),B=Jle(this.textArea.domNode.ownerDocument,F,this._fontInfo,O);return{distanceToModelLineStart:T,widthOfHiddenTextBefore:B}})(),{distanceToModelLineEnd:C}=(()=>{const w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),v=w.indexOf(` +`),S=v===-1?w:w.substring(0,v),x=S.indexOf(" "),k=x===-1?S.length:S.length-x-1,D=p.getEndPosition(),I=Math.min(this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column,k);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(D.lineNumber)-D.column-I}})();this._context.viewModel.revealRange("keyboard",!0,L.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Qle(this._context,p.startLineNumber,_,b,C),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Op} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(g=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${Op}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(xl.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=kr(t,[]);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=kr(this._context.configuration.options.get(148),[]);let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Vi(i.charCodeAt(0)))return i}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===rs.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(165).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=XD?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",FN(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(140))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!xl.enabled||e.get(41)&&e.get(104)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new R(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,n=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(s&&r&&i&&n&&n.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,l=hW(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let c=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,h=n.left-i.left+1;if(dthis._contentWidth&&(h=this._contentWidth);const u=this._context.viewLayout.getLineHeightForLineNumber(s.lineNumber),g=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),f=this._context.viewModel.getViewLineData(s.lineNumber),p=f.tokens.findTokenIndexAtOffset(s.column-1),_=f.tokens.findTokenIndexAtOffset(r.column-1),b=p===_,C=this._visibleTextArea.definePresentation(b?f.tokens.getPresentation(p):null);this.textArea.domNode.scrollTop=l*u,this.textArea.domNode.scrollLeft=c,this._doRender({lastRenderPosition:null,top:a,left:d,width:h,height:u,useCover:!1,color:(ui.getColorMap()||[])[C.foreground],italic:C.italic,bold:C.bold,underline:C.underline,strikethrough:C.strikethrough,fontSize:g})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(ze||this._accessibilitySupport===2){const i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=this._textAreaInput.textAreaState.newlineCountBeforeSelection??hW(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*n;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:XD?0:1,useCover:!1})}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:XD?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;gn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?V.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(66)?i.setClassName("monaco-editor-background textAreaCover "+qC.OUTER_CLASS_NAME):n.get(76).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+QL.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};WN=Xle([uW(4,st),uW(5,fe)],WN);function Jle(o,e,t,i){if(e.length===0)return 0;const n=o.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const s=o.createElement("span");gn(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),n.appendChild(s),o.body.appendChild(n);const r=s.offsetWidth;return n.remove(),r}var ece=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tce=function(o,e){return function(t,i){e(t,i,o)}};let BN=class extends A{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register(W(this._domNode,"focus",()=>{e.trace("NativeEditContext.focus"),!this._isPaused&&this.refreshFocusState()})),this._register(W(this._domNode,"blur",()=>{e.trace("NativeEditContext.blur"),!this._isPaused&&this._handleFocusedChanged(!1)}))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState()}refreshFocusState(){const e=vh(this._domNode),t=e?e.activeElement:ji(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}};BN=ece([tce(0,Mt)],BN);function R_(o,e,t,i){return o.addEventListener(e,t,i),{dispose(){o.removeEventListener(e,t)}}}var ice=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nce=function(o,e){return function(t,i){e(t,i,o)}};const sce=Vl("richScreenReaderContent",{createHTML:o=>o}),QD="data-line-number";let HN=class extends A{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new ut),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=tv.NULL,this._strategy=new ace,this._renderedLines=new Map,this._renderedSelection=new ae(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=_t().document.activeElement;if(!t||t!==this._domNode.domNode)return;if(this._accessibilityService.isScreenReaderOptimized()){const n=this._getScreenReaderContentLineIntervals(e);this._state.equals(n)||(this._state=n,this._renderedLines=this._renderScreenReaderContent(n)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=tv.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){const t=this._state.intervals;if(!t.length)return;const i=this._context.viewModel.viewLayout,n=t[0].startLine,s=i.getVerticalOffsetForLineNumber(n),r=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=r-s}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return W(this._domNode.domNode.ownerDocument,"selectionchange",()=>{if(!(_t().document.activeElement===this._domNode.domNode)||!this._accessibilityService.isScreenReaderOptimized()||!xl.enabled)return;const s=Date.now(),r=s-e;if(e=s,r<5)return;const a=s-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,a<100)return;const l=this._getEditorSelectionFromDomRange();l&&this._viewController.setSelection(l)})}_renderScreenReaderContent(e){const t=[],i=new Map;for(const n of e.intervals)for(let s=n.startLine;s<=n.endLine;s++){const r=this._renderLine(s);i.set(s,r),t.push(r.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){const t=this._context.viewModel,i=t.getViewLineRenderingData(e),n=this._context.configuration.options,s=n.get(59),r=n.get(133),a=n.get(108),l=n.get(60),c=n.get(40),d=ds.filter(i.inlineDecorations,e,i.minColumn,i.maxColumn),h=s.isMonospace&&!c,u=l!==ur.OFF;let g;n.get(47)==="off"?g=n.get(113):g="none";const p=new cd(h,s.canUseHalfwidthRightwardsArrow,i.content,i.continuesWithWrappedLine,i.isBasicASCII,i.containsRTL,i.minColumn-1,i.tokens,d,i.tabSize,i.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,r,g,a,u,null,null,0,!0),_=new Fh(1e4),b=h_(p,_),C=_.build(),w=sce?.createHTML(C)??C,v=t.viewLayout.getLineHeightForLineNumber(e)+"px",S=document.createElement("div");return S.innerHTML=w,S.style.lineHeight=v,S.style.height=v,S.setAttribute(QD,e.toString()),new oce(S,b.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){const s=_t().document.getSelection();if(!s)return;const r=i.startLineNumber,a=i.endLineNumber,l=t.get(r),c=t.get(a);if(!l||!c)return;const d=e.viewModel,h=d.model,u=d.coordinatesConverter,g=new L(r,1,r,i.selectionStartColumn),f=u.convertViewRangeToModelRange(g),p=h.getCharacterCountInRange(f),_=new L(a,1,a,i.positionColumn),b=u.convertViewRangeToModelRange(_),C=h.getCharacterCountInRange(b),w=l.characterMapping.getDomPosition(p),v=c.characterMapping.getDomPosition(C),S=l.domNode.firstChild,x=c.domNode.firstChild,k=S.childNodes,D=x.childNodes,I=k.item(w.partIndex),T=D.item(v.partIndex);!I.firstChild||!T.firstChild||(this._setIgnoreSelectionChangeTime("setRange"),s.setBaseAndExtent(I.firstChild,i.startColumn===1?0:w.charIndex+1,T.firstChild,i.endColumn===1?0:v.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;const e=_t().document.getSelection();if(!e||e.rangeCount===0)return;const i=e.getRangeAt(0),n=i.startContainer,s=i.endContainer,r=n.parentElement,a=s.parentElement;if(!r||!mi(r)||!a||!mi(a))return;const l=r.parentElement?.parentElement,c=a.parentElement?.parentElement;if(!l||!c)return;const d=l.getAttribute(QD),h=c.getAttribute(QD);if(!d||!h)return;const u=parseInt(d),g=parseInt(h),f=this._renderedLines.get(u)?.characterMapping,p=this._renderedLines.get(g)?.characterMapping;if(!f||!p)return;const _=vm(f,r,i.startOffset),b=vm(p,a,i.endOffset);return e.direction==="forward"?new ae(u,_,g,b):new ae(g,b,u,_)}};HN=ice([nce(3,kn)],HN);class oce{constructor(e,t){this.domNode=e,this.characterMapping=t}}class rce{constructor(e,t){this.startLine=e,this.endLine=t}}class tv{constructor(e,t){this.intervals=t;let i="";for(const n of t)for(let s=n.startLine;s<=n.endLine;s++)i+=e.getLineContent(s)+` +`;this.value=i}equals(e){return this.value===e.value}static get NULL(){const e={getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(t,i)=>t};return new tv(e,[])}}class ace{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){const n=t*i,s=n+1,r=Math.min(n+i,e.getLineCount());return new rce(s,r)}fromEditorSelection(e,t,i){const n=this._getPageOfLine(t.startLineNumber,i),s=this._getRangeForPage(e,n,i),r=this._getPageOfLine(t.endLineNumber,i),a=this._getRangeForPage(e,r,i),l=[{startLine:s.startLine,endLine:s.endLine}];return n+1=t))throw new Ce(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){return`[${this.replacements.map(t=>t.toString()).join(", ")}]`}normalize(){const e=[];let t;for(const i of this.replacements)if(!(i.getNewLength()===0&&i.replaceRange.length===0)){if(t&&t.replaceRange.endExclusive===i.replaceRange.start){const n=t.tryJoinTouching(i);if(n){t=n;continue}}t&&e.push(t),t=i}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;const n=[...t.replacements],s=[];let r=0;for(const a of i.replacements){for(;;){const h=n[0];if(!h||h.replaceRange.start+r+h.getNewLength()>=a.replaceRange.start)break;n.shift(),s.push(h),r+=h.getNewLength()-h.replaceRange.length}const l=r;let c,d;for(;;){const h=n[0];if(!h||h.replaceRange.start+r>a.replaceRange.endExclusive)break;c||(c=h),d=h,n.shift(),r+=h.getNewLength()-h.replaceRange.length}if(!c)s.push(a.delta(-r));else{const h=Math.min(c.replaceRange.start,a.replaceRange.start-l),u=a.replaceRange.start-(c.replaceRange.start+l);if(u>0){const _=c.slice(ge.emptyAt(h),new ge(0,u));s.push(_)}if(!d)throw new Ce("Invariant violation: lastIntersecting is undefined");const g=d.replaceRange.endExclusive+r-a.replaceRange.endExclusive;if(g>0){const _=d.slice(ge.ofStartAndLength(d.replaceRange.endExclusive,0),new ge(d.getNewLength()-g,d.getNewLength()));n.unshift(_),r-=_.getNewLength()-_.replaceRange.length}const f=new ge(h,a.replaceRange.endExclusive-r),p=a.slice(f,new ge(0,a.getNewLength()));s.push(p)}}for(;;){const a=n.shift();if(!a)break;s.push(a)}return this._createNew(s).normalize()}getNewRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(ge.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return this.replacements.length===0}}class cce{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new ge(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new ge(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class dce extends lce{apply(e){const t=[];let i=0;for(const n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}}class hce extends cce{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=ta(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,Zc(t,this.newText)),s=new ge(this.replaceRange.start+i,this.replaceRange.endExclusive-n),r=this.newText.substring(i,this.newText.length-n);return new yn(s,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){const t=this.replaceRange.substring(e),i=ta(t,this.newText);return i===0?this:this.slice(this.replaceRange.deltaStart(i),new ge(i,this.newText.length))}removeCommonSuffix(e){const t=this.replaceRange.substring(e),i=Zc(t,this.newText);return i===0?this:this.slice(this.replaceRange.deltaEnd(-i),new ge(0,this.newText.length-i))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}}class Ra extends dce{static{this.empty=new Ra([])}static compose(e){if(e.length===0)return Ra.empty;let t=e[0];for(let i=1;i=n.replaceRange.start)break;o.shift(),t.push(r.delta(i))}const s=[];for(;;){const r=o[0];if(!r||!r.intersectsOrTouches(n.replaceRange))break;o.shift(),s.push(r)}for(let r=s.length-1;r>=0;r--){let a=s[r];const l=a.intersect(n.replaceRange).length;a=a.deltaEnd(-l+(r===0?n.newText.length:0));const c=a.start-n.replaceRange.start;c>0&&(a=a.delta(-c)),r!==0&&(a=a.delta(n.newText.length)),a=a.delta(-(n.newText.length-n.replaceRange.length)),o.unshift(a)}i+=n.newText.length-n.replaceRange.length}for(;;){const n=o[0];if(!n)break;o.shift(),t.push(n.delta(i))}return t}class be{static ofLength(e,t){return new be(e,e+t)}static fromRange(e){return new be(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new be(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=Bn(e=>e.startLineNumber,uo)}static joinMany(e){if(e.length===0)return[];let t=new fr(e[0].slice());for(let i=1;it)throw new Ce(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=Lm(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=xm(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=xm(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,n=0,s=null;for(;i=r.startLineNumber?s=new be(s.startLineNumber,Math.max(s.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(s),s=r)}return s!==null&&t.push(s),new fr(t)}subtractFrom(e){const t=jC(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Lm(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new fr([e]);const n=[];let s=e.startLineNumber;for(let r=t;rs&&n.push(new be(s,a.startLineNumber)),s=a.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}class si{static{this.zero=new si(0,0)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new si(0,t.column-e.column):new si(t.lineNumber-e.lineNumber,t.column-1)}static fromPosition(e){return new si(e.lineNumber-1,e.column-1)}static ofRange(e){return si.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` +`?(t++,i=0):i++;return new si(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new si(this.lineCount,this.columnCount+e.columnCount):new si(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new L(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new L(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new L(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return be.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new R(e.lineNumber,e.column+this.columnCount):new R(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class v${getOffsetRange(e){return new ge(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return L.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new Tb.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new Tb.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const t=e.replacements.map(i=>this.getTextReplacement(i));return new Tb.deps.TextEdit(t)}}class Tb{static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}}function uce(o){Tb._deps=o}class nk extends v${constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t0&&e.charAt(t-1)==="\r"?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new R(1,1);const t=this.textLength.lineCount+1;if(e.lineNumber>t){const n=this.getLineLength(t);return new R(t,n+1)}if(e.column<1)return new R(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new R(e.lineNumber,i+1):e}getPosition(e){const t=Lm(this.lineStartOffsetByLineIdx,s=>s<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new R(i,n)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Tb.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class a4{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new R(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new L(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new nk(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new L(e,1,e,Number.MAX_SAFE_INTEGER))}}class gce extends a4{constructor(e,t){CC(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;ie[t-1],e.length)}}class bh extends CF{constructor(e){super(),this.value=e,this._t=new QD(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}}class yo{static fromStringEdit(e,t){const i=e.replacements.map(n=>Fi.fromStringReplacement(n,t));return new yo(i)}static fromParallelReplacementsUnsorted(e){const t=e.slice().sort(Kn(i=>i.range,D.compareRangesUsingStarts));return new yo(t)}constructor(e){this.replacements=e,Wh(()=>$w(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}mapPosition(e){let t=0,i=0,n=0;for(const s of this.replacements){const r=s.range.getStartPosition();if(e.isBeforeOrEqual(r))break;const a=s.range.getEndPosition(),l=di.ofText(s.text);if(e.isBefore(a)){const c=new R(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=l.addToPosition(c);return nS(c,d)}r.lineNumber+t!==i&&(n=0),t+=l.lineCount-(s.range.endLineNumber-s.range.startLineNumber),l.lineCount===0?a.lineNumber!==r.lineNumber?n+=l.columnCount-(a.column-1):n+=l.columnCount-(a.column-r.column):n=l.columnCount,i=a.lineNumber+t}return new R(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof R?r:r.getStartPosition()}function i(r){return r instanceof R?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),s=i(this.mapPosition(e.getEndPosition()));return nS(n,s)}apply(e){let t="",i=new R(1,1);for(const s of this.replacements){const r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=nS(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const n=nS(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new bh(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const s of this.replacements){const r=di.ofText(s.text),a=R.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,n=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new ve;if(this.replacements.length===1)return this.replacements[0];const t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition();let n="";for(let s=0;st.toString()).join(` -`):typeof e=="string"?this.toString(new bh(e)):this.replacements.length===0?"":this.replacements.map(t=>{const n=e.getValueOfRange(t.range),s=D.fromPositions(new R(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition());let r=e.getValueOfRange(s);r.length>10&&(r="..."+r.substring(r.length-10));const a=D.fromPositions(t.range.getEndPosition(),new R(t.range.endLineNumber+1,1));let l=e.getValueOfRange(a);l.length>10&&(l=l.substring(0,10)+"...");let c=n;if(c.length>10){const h=Math.floor(5);c=c.substring(0,h)+"..."+c.substring(c.length-h)}let d=t.text;if(d.length>10){const h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}return c.length===0?`${r}❰${d}❱${l}`:`${r}❰${c}↦${d}❱${l}`}).join(` -`)}}class Fi{static joinReplacements(e,t){if(e.length===0)throw new ve;if(e.length===1)return e[0];const i=e[0].range.getStartPosition(),n=e[e.length-1].range.getEndPosition();let s="";for(let r=0;re[t-1],e.length)}}class Xd extends a4{constructor(e){super(),this.value=e,this._t=new nk(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}}class ho{static fromStringEdit(e,t){const i=e.replacements.map(n=>Ni.fromStringReplacement(n,t));return new ho(i)}static fromParallelReplacementsUnsorted(e){const t=e.slice().sort(Bn(i=>i.range,L.compareRangesUsingStarts));return new ho(t)}constructor(e){this.replacements=e,_h(()=>rw(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}mapPosition(e){let t=0,i=0,n=0;for(const s of this.replacements){const r=s.range.getStartPosition();if(e.isBeforeOrEqual(r))break;const a=s.range.getEndPosition(),l=si.ofText(s.text);if(e.isBefore(a)){const c=new R(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=l.addToPosition(c);return h1(c,d)}r.lineNumber+t!==i&&(n=0),t+=l.lineCount-(s.range.endLineNumber-s.range.startLineNumber),l.lineCount===0?a.lineNumber!==r.lineNumber?n+=l.columnCount-(a.column-1):n+=l.columnCount-(a.column-r.column):n=l.columnCount,i=a.lineNumber+t}return new R(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof R?r:r.getStartPosition()}function i(r){return r instanceof R?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),s=i(this.mapPosition(e.getEndPosition()));return h1(n,s)}apply(e){let t="",i=new R(1,1);for(const s of this.replacements){const r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=h1(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const n=h1(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new Xd(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const s of this.replacements){const r=si.ofText(s.text),a=R.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,n=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Ce;if(this.replacements.length===1)return this.replacements[0];const t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition();let n="";for(let s=0;st.toString()).join(` +`):typeof e=="string"?this.toString(new Xd(e)):this.replacements.length===0?"":this.replacements.map(t=>{const n=e.getValueOfRange(t.range),s=L.fromPositions(new R(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition());let r=e.getValueOfRange(s);r.length>10&&(r="..."+r.substring(r.length-10));const a=L.fromPositions(t.range.getEndPosition(),new R(t.range.endLineNumber+1,1));let l=e.getValueOfRange(a);l.length>10&&(l=l.substring(0,10)+"...");let c=n;if(c.length>10){const h=Math.floor(5);c=c.substring(0,h)+"..."+c.substring(c.length-h)}let d=t.text;if(d.length>10){const h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}return c.length===0?`${r}❰${d}❱${l}`:`${r}❰${c}↦${d}❱${l}`}).join(` +`)}}class Ni{static joinReplacements(e,t){if(e.length===0)throw new Ce;if(e.length===1)return e[0];const i=e[0].range.getStartPosition(),n=e[e.length-1].range.getEndPosition();let s="";for(let r=0;r ${t.lineNumber},${t.column}): "${this.text}"`}}function nS(o,e){if(o.lineNumber===e.lineNumber&&o.column===Number.MAX_SAFE_INTEGER)return D.fromPositions(e,e);if(!o.isBeforeOrEqual(e))throw new ve("start must be before end");return new D(o.lineNumber,o.column,e.lineNumber,e.column)}lhe({StringEdit:Ga,StringReplacement:Nn,TextReplacement:Fi,TextEdit:yo,TextLength:di});var dhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hhe=function(o,e){return function(t,i){e(t,i,o)}};let XT=class extends F{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new _t),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new nq,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,i=St().document.activeElement;if(!i||i!==t)return;if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const s=St().document.getSelection();if(!s)return;const r=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!r)return;this._setIgnoreSelectionChangeTime("setRange"),s.setBaseAndExtent(r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),s=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-n}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return B(this._domNode.domNode.ownerDocument,"selectionchange",()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!Vl.enabled||!(St().document.activeElement===this._domNode.domNode))return;const s=St().document.getSelection();if(!s||s.rangeCount===0)return;const a=s.getRangeAt(0),l=Date.now(),c=l-e;if(e=l,c<5)return;const d=l-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,!(d<100)&&this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,s.direction,a))})}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,this._accessibilityService.getAccessibilitySupport()===0),i=this._context.viewModel.model.getPositionAt(1/0);let n=t.value;return i.column===1&&e.getEndPosition().equals(i)&&(n+=` -`),t.value=n,t}_getScreenReaderRange(e,t){const i=this._domNode.domNode.firstChild;if(!i)return;const n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){const s=e.viewModel,r=s.model,l=s.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),c=r.getOffsetAt(l);let d=n.startOffset+c,h=n.endOffset+c;if(r.getEndOfLineSequence()===1){const b=t.value,C=new QD(b),w=C.getPosition(n.startOffset),v=C.getPosition(n.endOffset);d+=w.lineNumber-1,h+=v.lineNumber-1}const g=r.getPositionAt(d),f=r.getPositionAt(h),p=i==="forward"?g:f,_=i==="forward"?f:g;return le.fromPositions(p,_)}};XT=dhe([hhe(3,Mn)],XT);var uhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$9=function(o,e){return function(t,i){e(t,i,o)}};let QT=class extends F{constructor(e,t,i,n,s){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=s,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new le(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new _t),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new YT(this._domNode,this._context,this._viewController,this._accessibilityService):new XT(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",m(60,"editor")),this._domNode.domNode.setAttribute("aria-label",KT(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=`${t*i}px`;const n=e.get(154),s=n==="inherit"?e.get(153):n,r=s==="inherit"?e.get(149):s;this._domNode.domNode.style.textWrap=r==="off"?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new le(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(ithis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getCurrentScrollTop(),s=this._primarySelection.positionLineNumber,r=this._context.viewLayout.getVerticalOffsetForLineNumber(s)-n;if(r<0||r>this._contentHeight){this._renderAtTopLeft();return}const a=this._context.viewLayout.getLineHeightForLineNumber(s);this._doRender(r,this._contentLeft,this._divWidth,a),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,i,n){wn(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};QT=uhe([$9(3,dt),$9(4,Mn)],QT);var JT;(function(o){function e(t,i){return new t.EditContext(i)}o.create=e})(JT||(JT={}));class ghe{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}}const vF=new ghe;var fhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},j9=function(o,e){return function(t,i){e(t,i,o)}},mC;(function(o){o.NONE="edit-context-composition-none",o.SECONDARY="edit-context-composition-secondary",o.PRIMARY="edit-context-composition-primary"})(mC||(mC={}));let iL=class extends iq{constructor(e,t,i,n,s,r,a){super(t),this._viewController=n,this._visibleRangeProvider=s,this.logService=a,this._previousEditContextSelection=new fe(0,0),this._editContextPrimarySelection=new le(1,1,1,1),this._decorations=[],this._primarySelection=new le(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this._linesVisibleRanges=null,this.domNode=new Fy(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new Fy(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new ZT(a,this.domNode.domNode,h=>{a.trace("NativeEditContext#handleFocusChange : ",h),this._screenReaderSupport.handleFocusChange(h),this._context.viewModel.setHasFocus(h)}));const l=me(this.domNode.domNode);this._editContext=JT.create(l),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(r.createInstance(QT,this.domNode,t,this._viewController)),this._register(B(this.domNode.domNode,"copy",h=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(h)})),this._register(B(this.domNode.domNode,"cut",h=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(h),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register(B(this.domNode.domNode,"keyup",h=>this._onKeyUp(h))),this._register(B(this.domNode.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(B(this._imeTextArea.domNode,"keyup",h=>this._onKeyUp(h))),this._register(B(this._imeTextArea.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(B(this.domNode.domNode,"beforeinput",async h=>{(h.inputType==="insertParagraph"||h.inputType==="insertLineBreak")&&this._onType(this._viewController,{text:` -`,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(B(this.domNode.domNode,"paste",h=>{if(this.logService.trace("NativeEditContext#paste"),h.preventDefault(),!h.clipboardData)return;let[u,g]=Ng.getTextData(h.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",g?.id," with text.length: ",u.length),!u)return;g=g||Bl.INSTANCE.get(u);let f=!1,p=null,_=null;g&&(f=this._context.configuration.options.get(45)&&!!g.isFromEmptySelection,p=typeof g.multicursorText<"u"?g.multicursorText:null,_=g.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(u,f,p,_)})),this._register(hb(this._editContext,"textformatupdate",h=>this._handleTextFormatUpdate(h))),this._register(hb(this._editContext,"characterboundsupdate",h=>this._updateCharacterBounds(h)));let c;this._register(hb(this._editContext,"textupdate",h=>{const u=h.text;if(u.length===1){const g=u.charCodeAt(0);if(Zi(g)){c=u;return}if(Bh(g)&&c){const f={text:c+u,selectionEnd:h.selectionEnd,selectionStart:h.selectionStart,updateRangeStart:h.updateRangeStart-1,updateRangeEnd:h.updateRangeEnd-1};c=void 0,this._emitTypeEvent(this._viewController,f);return}}this._emitTypeEvent(this._viewController,h)})),this._register(hb(this._editContext,"compositionstart",h=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(hb(this._editContext,"compositionend",h=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(Vl.onDidChange(()=>{Vl.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!Vl.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(vF.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBoundsData(e)}onDidRender(){this._updateSelectionAndControlBoundsAfterRender()}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new le(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumbert||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===Ji())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=me(this.domNode.domNode),t=hv(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){this._viewController.emitKeyUp(new Et(e))}_onKeyDown(e){const t=new Et(e);t.keyCode===114&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){const e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){const e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new fe(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;const i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new fe(t.selectionStart,t.selectionEnd);let s=0,r=0;t.updateRangeEnd>i&&(s=t.updateRangeEnd-i),t.updateRangeStartt.updateRangeEnd&&(a+=this._editContext.text.substring(t.updateRangeEnd,i));let l=0;t.selectionStart===t.selectionEnd&&n===i&&(l=t.selectionStart-(t.updateRangeStart+t.text.length));const c={text:a,replacePrevCharCnt:r,replaceNextCharCnt:s,positionDelta:l};this._onType(e,c)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){const e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;const i=e.startLineNumber,n=e.endLineNumber,s=t.getLineMaxColumn(n),r=new D(i,1,n,s),a=t.getValueInRange(r,0),l=e.startColumn-1,c=a.length+e.endColumn-s;return{text:a,selectionStartOffset:l,selectionEndOffset:c,editContextPrimarySelection:e}}_editContextStartPosition(){return new R(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;const t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];t.forEach(s=>{const r=this._context.viewModel.model,a=r.getOffsetAt(i),l=r.getPositionAt(a+s.rangeStart),c=r.getPositionAt(a+s.rangeEnd),d=D.fromPositions(l,c),h=s.underlineThickness.toLowerCase();let u=mC.NONE;switch(h){case"thin":u=mC.SECONDARY;break;case"thick":u=mC.PRIMARY;break}n.push({range:d,options:{description:"textFormatDecoration",inlineClassName:u}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBoundsData(e){const t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);if(this._primarySelection.isEmpty()){const i=e.visibleRangeForPosition(t.getStartPosition());this._linesVisibleRanges=i}else this._linesVisibleRanges=null}_updateSelectionAndControlBoundsAfterRender(){const t=this._context.configuration.options.get(165).contentLeft,i=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),n=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),s=this._context.viewLayout.getVerticalOffsetAfterLineNumber(i.endLineNumber),r=this._parent.getBoundingClientRect(),a=r.top+n-this._scrollTop,l=s-n;let c=r.left+t-this._scrollLeft,d;this._primarySelection.isEmpty()?(this._linesVisibleRanges&&(c+=this._linesVisibleRanges.left),d=0):d=r.width-t;const h=new DOMRect(c,a,d,l);this._editContext.updateSelectionBounds(h),this._editContext.updateControlBounds(h)}_updateCharacterBounds(e){const t=this._context.configuration.options,i=t.get(59).typicalHalfwidthCharacterWidth,n=t.get(165).contentLeft,s=this._parent.getBoundingClientRect(),r=[],a=new QD(this._editContext.text);for(let l=e.rangeStart;l0)for(const L of p[0].ranges){w=L.left,v=L.width;break}const S=this._context.viewLayout.getLineHeightForLineNumber(_);r.push(new DOMRect(s.left+n+w-this._scrollLeft,C,v,S))}this._editContext.updateCharacterBounds(e.rangeStart,r)}_ensureClipboardGetsEditorSelection(e){const t=this._context.configuration.options,i=t.get(45),n=t.get(31),s=this._context.viewModel.getCursorStates().map(c=>c.modelState.selection),r=xj(this._context.viewModel,s,i,n);let a;this.logService.getLevel()===ln.Trace&&(a=Rf());const l={version:1,id:a,isFromEmptySelection:r.isFromEmptySelection,multicursorText:r.multicursorText,mode:r.mode};Bl.INSTANCE.set(so?r.text.replace(/\r\n/g,` -`):r.text,l),e.preventDefault(),e.clipboardData&&Ng.setTextData(e.clipboardData,r.text,r.html,l),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",a," with text.length: ",r.text.length)}};iL=fhe([j9(5,pe),j9(6,Ht)],iL);class phe extends zs{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(ke(i=>this._updateEntries(i)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,s=this._viewGpuContext.devicePixelRatio.read(e);for(let r=0,a=i.length;ri.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}class wF extends ru{static{this.CLASS_NAME="gpu-mark"}constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,s=new Yy(this._context.configuration,this._context.theme.type),r=[];for(let a=t;a<=i;a++){const l=a-t,c=this._viewGpuContext.canRenderDetailed(s,n,a);r[l]=c.length?`
`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var mhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_he=function(o,e){return function(t,i){e(t,i,o)}};let eR=class extends Tf{constructor(e,t,i,n,s,r,a,l,c){super(),this._instantiationService=c,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new bhe(e,l)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new le(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=mt(document.createElement("div")),Qa.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new xle(n,r,a,i),this._context=new pde(n,s,r),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=mt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=mt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._context.configuration.options.get(46)==="on"&&(this._viewGpuContext=this._instantiationService.createInstance(ms,this._context)),this._scrollbar=new Sce(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new uF(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(qT,this._context,this._viewGpuContext)),this._viewZones=new dde(this._context),this._viewParts.push(this._viewZones);const d=new tde(this._context);this._viewParts.push(d);const h=new ode(this._context);this._viewParts.push(h);const u=new kle(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Cce(this._context)),u.addDynamicOverlay(new xn(this._context)),u.addDynamicOverlay(new Pce(this._context)),u.addDynamicOverlay(new wce(this._context)),u.addDynamicOverlay(new ude(this._context));const g=new Ile(this._context);this._viewParts.push(g),g.addDynamicOverlay(new vce(this._context)),g.addDynamicOverlay(new Bce(this._context)),g.addDynamicOverlay(new Wce(this._context)),g.addDynamicOverlay(new KD(this._context)),this._viewGpuContext&&g.addDynamicOverlay(new wF(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new xce(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Nv(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(g.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Nle(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Jy(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Qce(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new phe(this._context,this._viewGpuContext):new sde(this._context);this._viewParts.push(p);const _=new Ele(this._context);this._viewParts.push(_);const b=new Xce(this._context);if(this._viewParts.push(b),d){const C=this._scrollbar.getOverviewRulerLayoutInfo();C.parent.insertBefore(d.getDomNode(),C.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(b.getDomNode()),this._overflowGuardContainer.appendChild(_.domNode),this.domNode.appendChild(this._overflowGuardContainer),l?(l.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),l.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Lle(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(iL,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(GT,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),n!==-1&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(s=>{const r=s.options.glyphMargin?.position??Xa.Center;return n=Math.max(n,s.range.endLineNumber),{range:s.range,lane:r,persist:s.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(s=>{const r=e.validateRange(s.preference.range);return n=Math.max(n,r.endLineNumber),{range:r,lane:s.preference.lane}})),i.sort((s,r)=>D.compareRangesUsingStarts(s.range,r.range)),t.reset(n);for(const s of i)t.push(s.lane,s.range,s.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new Xae(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const i=new R(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(t!==void 0)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const t=this._context.configuration.options.get(165);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+HT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new ve;if(this._renderAnimationFrame===null){this._editContext instanceof iL&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=SF.INSTANCE.scheduleCoordinatedRendering({window:me(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new ve;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new ve;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new ve;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new ve;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Ch(()=>e.prepareRenderText());const t=Ch(()=>e.renderText());if(t){const[i,n]=t;Ch(()=>e.prepareRender(i,n)),Ch(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}gh.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new gde(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new Mae(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const s=this._viewLines.visibleRangeForPosition(new R(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?UD.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new nde(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};eR=mhe([_he(8,pe)],eR);function Ch(o){try{return o()}catch(e){return Te(e),null}}class SF{static{this.INSTANCE=new SF}constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Ly(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Ch(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;is.renderText())}for(let i=0,n=e.length;is.prepareRender(a,l))}for(let i=0,n=e.length;is.render(a,l))}}}class bhe extends F{constructor(e,t){super(),this._onChange=this._register(new P),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Wr(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Wr(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class _C{constructor(e,t,i,n,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=s}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let s=0;sthis.injectionOffsets[s];s++)n0?this.breakOffsets[s-1]:0,t===0)if(e<=r)n=s-1;else if(e>l)i=s+1;else break;else if(e=l)i=s+1;else break}let a=e-r;return s>0&&(a+=this.wrappedTextIndentLength),new sS(s,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new sS(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const n=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&q9(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(K9(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let s=i.injectedTextIndex-1;for(;s>=0&&this.injectionOffsets[s]===this.injectionOffsets[i.injectedTextIndex]&&!(q9(this.injectionOptions[s].cursorStops)||(n-=this.injectionOptions[s].content.length,K9(this.injectionOptions[s].cursorStops)));)s--;return n}}else if(t===1||t===4){let n=i.offsetInInputWithInjections+i.length,s=i.injectedTextIndex;for(;s+1=0&&this.injectionOffsets[s-1]===this.injectionOffsets[s];)n-=this.injectionOptions[s-1].content.length,s--;return n}Uw()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let s=0;se)break;if(e<=l)return{injectedTextIndex:s,offsetInInputWithInjections:a,length:r};n+=r}}}}function q9(o){return o==null?!0:o===Lr.Right||o===Lr.Both}function K9(o){return o==null?!0:o===Lr.Left||o===Lr.Both}class sS{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new R(e+this.outputLineIndex,this.outputOffset+1)}}class Che{constructor(){this.changeType=1}}class Ja{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Ja(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Ja(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class G9{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class vhe{constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class whe{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class She{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class yhe{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Lhe{constructor(){this.changeType=5}}class fm{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;to});class yF{static create(e){return new yF(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,s,r){const a=[],l=[];return{addRequest:(c,d,h)=>{a.push(c),l.push(d)},finalize:()=>Dhe(dh(this.targetWindow.deref()),a,e,t,i,n,s,l)}}}function Dhe(o,e,t,i,n,s,r,a){function l(I){const T=a[I];if(T){const A=Ja.applyInjectedText(e[I],T),O=T.map(U=>U.options),W=T.map(U=>U.column-1);return new _C(W,O,[A.length],[],0)}else return null}if(n===-1){const I=[];for(let T=0,A=e.length;Tc?(A=0,O=0):W=c-ie}const U=T.substr(A),q=khe(U,O,i,W,f,u);p[I]=A,_[I]=O,b[I]=U,C[I]=q[0],w[I]=q[1]}const v=f.build(),S=xhe?.createHTML(v)??v;g.innerHTML=S,g.style.position="absolute",g.style.top="10000",r==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),o.document.body.appendChild(g);const L=document.createRange(),x=Array.prototype.slice.call(g.children,0),k=[];for(let I=0;Ice.options),Q=ne.map(ce=>ce.column-1)):(ie=null,Q=null),k[I]=new _C(Q,ie,A,q,W)}return g.remove(),k}function khe(o,e,t,i,n,s){if(s!==0){const u=String(s);n.appendString('
');const r=o.length;let a=e,l=0;const c=[],d=[];let h=0");for(let u=0;u"),c[u]=l,d[u]=a;const g=h;h=u+1"),c[o.length]=l,d[o.length]=a,n.appendString("
"),[c,d]}function Ihe(o,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),s=[];try{tR(o,n,i,0,null,t.length-1,null,s)}catch(r){return console.log(r),null}return s.length===0?null:(s.push(t.length),s)}function tR(o,e,t,i,n,s,r,a){if(i===s||(n=n||nE(o,e,t[i],t[i+1]),r=r||nE(o,e,t[s],t[s+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===s){a.push(s);return}const l=i+(s-i)/2|0,c=nE(o,e,t[l],t[l+1]);tR(o,e,t,i,n,l,c,a),tR(o,e,t,l,c,s,r,a)}function nE(o,e,t,i){return o.setStart(e[t/16384|0].firstChild,t%16384),o.setEnd(e[i/16384|0].firstChild,i%16384),o.getClientRects()}class Ehe extends F{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new iD),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){Te(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(0),this._register(Hb(me(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(Hb(me(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(Hb(me(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return Hb(me(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){Te(i)}}}}class cq{constructor(e,t,i,n,s,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=s,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const l1={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};function qh(o){let e=0,t=0,i=0,n=0;for(let s=0,r=o.length;s=ir&&(t=t-o%ir),t}function Phe(o,e){return o.reduce((t,i)=>vi(t,e(i)),Fs)}function dq(o,e){return o===e}function Hv(o,e){const t=o,i=e;if(i-t<=0)return Fs;const s=Math.floor(t/ir),r=Math.floor(i/ir),a=i-r*ir;if(s===r){const l=t-s*ir;return Oi(0,a-l)}else return Oi(r-s,a)}function pm(o,e){return o=e}function zp(o){return Oi(o.lineNumber-1,o.column-1)}function Pg(o,e){const t=o,i=Math.floor(t/ir),n=t-i*ir,s=e,r=Math.floor(s/ir),a=s-r*ir;return new D(i+1,n+1,r+1,a+1)}function Ahe(o){const e=No(o);return Oi(e.length-1,e[e.length-1].length)}class Qc{static fromModelContentChanges(e){return e.map(i=>{const n=D.lift(i.range);return new Qc(zp(n.getStartPosition()),zp(n.getEndPosition()),Ahe(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Mr(this.startOffset)}...${Mr(this.endOffset)}) -> ${Mr(this.newLength)}`}}class Ohe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>LF.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:Hv(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Oi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Oi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Mr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Oi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Oi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(n===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const s=this.lineTokens,r=s.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=Rhe(e,t,this.lineIdx,this.lineCharOffset);return new nh(n,0,-1,rn.getEmpty(),new Gu(n))}}class zhe{constructor(e,t){this.text=e,this._offset=Fs,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| -`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let f=0;f<60;f++)h.push(new nh(Oi(0,f),0,-1,rn.getEmpty(),new Gu(Oi(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new nh(Oi(1,f),0,-1,rn.getEmpty(),new Gu(Oi(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,p=r[0];if(p===` -`)a++,l=f+1;else{if(c!==f){let _;if(d===a){const b=f-c;if(bUhe(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Uhe(o){let e=Eo(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class gq{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=kF.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function $he(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e=2?fq(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())X9(i,n)<=X9(n,r)?(i=sE(i,n),n=r):n=sE(n,r);return sE(i,n)}function fq(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?o[2]:null,e)}function X9(o,e){return Math.abs(o.listHeight-e.listHeight)}function sE(o,e){return o.listHeight===e.listHeight?Zl.create23(o,e,null,!1):o.listHeight>e.listHeight?jhe(o,e):qhe(e,o)}function jhe(o,e){o=o.toMutable();let t=o;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Zl.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Zl.create23(o,n,null,!1):o}function qhe(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Zl.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Zl.create23(n,o,null,!1):o}class Khe{constructor(e){this.lastOffset=Fs,this.nextNodes=[e],this.offsets=[Fs],this.idxs=[]}readLongestNodeAt(e,t){if(pm(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=ub(this.nextNodes);if(!i)return;const n=ub(this.offsets);if(pm(e,n))return;if(pm(n,e))if(vi(n,i.length)<=e)this.nextNodeAfterCurrent();else{const s=oE(i);s!==-1?(this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const s=oE(i);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){const e=ub(this.offsets),t=ub(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=ub(this.nextNodes),n=oE(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(vi(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function oE(o,e=-1){for(;;){if(e++,e>=o.childrenLength)return-1;if(o.getChild(e))return e}}function ub(o){return o.length>0?o[o.length-1]:void 0}function iR(o,e,t,i){return new Ghe(o,e,t,i).parseDocument()}class Ghe{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Khe(i):void 0,this.positionMapper=new Ohe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(rn.getEmpty(),0);return e||(e=Zl.getEmpty()),e}parseList(e,t){const i=[];for(;;){let s=this.tryReadChildFromCache(e);if(!s){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;s=this.parseChild(e,t+1)}s.kind===4&&s.childrenLength===0||i.push(s)}return this.oldNodeReader?$he(i):fq(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!nL(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!pm(n.length,t)?!1:n.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Hhe(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Gu(i.length);const n=e.merge(i.bracketIds),s=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Vv.create(i.astNode,s,r.astNode)):Vv.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function rL(o,e){if(o.length===0)return e;if(e.length===0)return o;const t=new Cd(Q9(o)),i=Q9(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function s(c){if(c===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!nL(c);){const[h,u]=n.splitAt(c);d.push(h),c=Hv(h.lengthAfter,c),n=u??t.dequeue()}return nL(c)||d.push(new vh(!1,c,c)),d}const r=[];function a(c,d,h){if(r.length>0&&dq(r[r.length-1].endOffset,c)){const u=r[r.length-1];r[r.length-1]=new Qc(u.startOffset,d,vi(u.newLength,h))}else r.push({startOffset:c,endOffset:d,newLength:h})}let l=Fs;for(const c of i){const d=s(c.lengthBefore);if(c.modified){const h=Phe(d,g=>g.lengthBefore),u=vi(l,h);a(l,u,c.lengthAfter),l=u}else for(const h of d){const u=l;l=vi(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return r}class vh{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Hv(e,this.lengthAfter);return dq(t,Fs)?[this,void 0]:this.modified?[new vh(this.modified,this.lengthBefore,e),new vh(this.modified,Fs,t)]:[new vh(this.modified,e,e),new vh(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Mr(this.lengthBefore)} -> ${Mr(this.lengthAfter)}`}}function Q9(o){const e=[];let t=Fs;for(const i of o){const n=Hv(t,i.startOffset);nL(n)||e.push(new vh(!1,n,n));const s=Hv(i.startOffset,i.endOffset);e.push(new vh(!0,s,i.newLength)),t=i.endOffset}return e}class Zhe extends F{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new P,this.denseKeyProvider=new hq,this.brackets=new gq(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new zhe(this.textModel.getValue(),i);this.initialAstWithoutTokens=iR(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new Qc(Oi(i.fromLineNumber-1,0),Oi(i.toLineNumber,0),Oi(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Qc.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=rL(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=rL(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t,s=new uq(this.textModel,this.brackets);return iR(s,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Oi(e.startLineNumber-1,e.startColumn-1),n=Oi(e.endLineNumber-1,e.endColumn-1);return new od(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens;nR(r,Fs,r.length,i,n,s,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=zp(e.getStartPosition()),n=zp(e.getEndPosition());return new od(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Yhe(s,t,this.textModel);sR(r,Fs,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return mq(t,Fs,t.length,zp(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pq(t,Fs,t.length,zp(e))}}function pq(o,e,t,i){if(o.kind===4||o.kind===2){const n=[];for(const s of o.children)t=vi(e,s.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let s=n.length-1;s>=0;s--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[s];if(pm(r,i)){const l=pq(o.children[s],r,a,i);if(l)return l}}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=Pg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function mq(o,e,t,i){if(o.kind===4||o.kind===2){for(const n of o.children){if(t=vi(e,n.length),pm(i,t)){const s=mq(n,e,t,i);if(s)return s}e=t}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=Pg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function nR(o,e,t,i,n,s,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(o.kind){case 4:{const h=o.childrenLength;for(let u=0;u200)return!0;let l=!0;if(o.kind===2){let c=0;if(a){let u=a.get(o.openingBracket.text);u===void 0&&(u=0),c=u,u++,a.set(o.openingBracket.text,u)}const d=vi(e,o.openingBracket.length);let h=-1;if(s.includeMinIndentation&&(h=o.computeMinIndentation(e,s.textModel)),l=s.push(new The(Pg(e,t),Pg(e,d),o.closingBracket?Pg(vi(d,o.child?.length||Fs),t):void 0,r,c,o,h)),e=d,l&&o.child){const u=o.child;if(t=vi(e,u.length),mm(e,n)&&Ub(t,i)&&(l=sR(u,e,t,i,n,s,r+1,a),!l))return!1}a?.set(o.openingBracket.text,c)}else{let c=e;for(const d of o.children){const h=c;if(c=vi(c,d.length),mm(h,n)&&mm(i,c)&&(l=sR(d,h,c,i,n,s,r,a),!l))return!1}}return l}class Xhe extends F{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new _t),this.onDidChangeEmitter=new P,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new z;this.bracketPairsTree.value=Qhe(e.add(new Zhe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||od.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||od.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||od.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(D.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?rS(this._findMatchingBracketUp(l,n,rE(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(D.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Kn(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,D.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=rE(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=n-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(ml(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=n+1;c=l)break;if(ml(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!ml(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Yr.findNextBracketInRange(a.forwardRegex,i,s,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(g){if(g instanceof Wc)return null;d=g}}l=h.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(l)).brackets;if(c&&!ml(n.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,c,l),u=Yr.findPrevBracketInRange(c.reversedRegex,i,s,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const g=s.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(f)return f instanceof Wc?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof Wc?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let r=-1,a=0;const l=(c,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return Wc.INSTANCE;const g=Yr.findPrevBracketInRange(s,c,d,h,u);if(!g)break;const f=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(f)?r++:e.isClose(f)&&r--,r===0)return g;u=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c);let g=h-1,f=u.length,p=u.length;c===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),f=t.column-1,p=t.column-1);let _=!0;for(;g>=0;g--){const b=d.getLanguageId(g)===n&&!ml(d.getStandardTokenType(g));if(b)_?f=d.getStartOffset(g):(f=d.getStartOffset(g),p=d.getEndOffset(g));else if(_&&f!==p){const C=l(c,u,f,p);if(C)return C}_=b}if(_&&f!==p){const b=l(c,u,f,p);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let r=1,a=0;const l=(d,h,u,g)=>{for(;;){if(i&&++a%100===0&&!i())return Wc.INSTANCE;const f=Yr.findNextBracketInRange(s,d,h,u,g);if(!f)break;const p=h.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),g=this.textModel.getLineContent(d);let f=0,p=0,_=0;d===t.lineNumber&&(f=h.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let b=!0;for(;f=1;r--){const a=this.textModel.tokenization.getLineTokens(r),l=a.getCount(),c=this.textModel.getLineContent(r);let d=l-1,h=c.length,u=c.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const f=a.getLanguageId(d);i!==f&&(i=f,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let g=!0;for(;d>=0;d--){const f=a.getLanguageId(d);if(i!==f){if(n&&s&&g&&h!==u){const _=Yr.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(_)return this._toFoundBracket(s,_);g=!1}i=f,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const p=!!n&&!ml(a.getStandardTokenType(d));if(p)g?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(s&&n&&g&&h!==u){const _=Yr.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(_)return this._toFoundBracket(s,_)}g=p}if(s&&n&&g&&h!==u){const f=Yr.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(f)return this._toFoundBracket(s,f)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let n=null,s=null,r=null;for(let a=t.lineNumber;a<=i;a++){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,g=0;if(a===t.lineNumber){h=l.findTokenIndexAtOffset(t.column-1),u=t.column-1,g=t.column-1;const p=l.getLanguageId(h);n!==p&&(n=p,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let f=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(g));return f?[f.openingBracketRange,f.closingBracketRange]:null}const n=rE(t),s=this.textModel.getLineCount(),r=new Map;let a=[];const l=(g,f)=>{if(!r.has(g)){const p=[];for(let _=0,b=f?f.brackets.length:0;_{for(;;){if(n&&++c%100===0&&!n())return Wc.INSTANCE;const C=Yr.findNextBracketInRange(g.forwardRegex,f,p,_,b);if(!C)break;const w=p.substring(C.startColumn-1,C.endColumn-1).toLowerCase(),v=g.textIsBracket[w];if(v&&(v.isOpen(w)?a[v.index]++:v.isClose(w)&&a[v.index]--,a[v.index]===-1))return this._matchFoundBracket(C,v,!1,n);_=C.endColumn-1}return null};let h=null,u=null;for(let g=i.lineNumber;g<=s;g++){const f=this.textModel.tokenization.getLineTokens(g),p=f.getCount(),_=this.textModel.getLineContent(g);let b=0,C=0,w=0;if(g===i.lineNumber){b=f.findTokenIndexAtOffset(i.column-1),C=i.column-1,w=i.column-1;const S=f.getLanguageId(b);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let v=!0;for(;be?.dispose()}}function rE(o){if(typeof o>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=o}}class Wc{static{this.INSTANCE=new Wc}constructor(){this._searchCanceledBrand=void 0}}function rS(o){return o instanceof Wc?null:o}class Jhe extends F{constructor(e){super(),this.textModel=e,this.colorProvider=new _q,this.onDidChangeEmitter=new P,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new D(1,1,this.textModel.getLineCount(),1),e,t):[]}}class _q{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}jr((o,e)=>{const t=[Oj,Fj,Wj,Bj,Hj,Vj],i=new _q;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${o.getColor(rce)}; }`);const n=t.map(s=>o.getColor(s)).filter(s=>!!s).filter(s=>!s.isTransparent());for(let s=0;s<30;s++){const r=n[s%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(s)} { color: ${r}; }`)}});function aS(o){return o.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Vn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${aS(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${aS(this.oldText)}")`:`(replace@${this.oldPosition} "${aS(this.oldText)}" with "${aS(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Ra(e,n,i),i+=4;for(let s=0;s{const a=t[s];return a!==void 0?a:(s.match(/\$/g)||[]).length<=e&&r!==void 0&&r!==null&&r!==""}).map(([s,r])=>`${s}:${r}`).join("-")}}function Ks(o){return new bq(o,tue)}const Jn={unknown(o){return Ks({source:"unknown",name:o.name})},rename:()=>Ks({source:"rename"}),chatApplyEdits(o){return Ks({source:"Chat.applyEdits",$modelId:J9(o.modelId),$extensionId:o.extensionId?.extensionId,$extensionVersion:o.extensionId?.version,$$languageId:o.languageId,$$sessionId:o.sessionId,$$requestId:o.requestId,$$mode:o.mode,$$codeBlockSuggestionId:o.codeBlockSuggestionId})},chatUndoEdits:()=>Ks({source:"Chat.undoEdits"}),chatReset:()=>Ks({source:"Chat.reset"}),inlineCompletionAccept(o){return Ks({source:"inlineCompletionAccept",$nes:o.nes,...lS(o.providerId),$$requestUuid:o.requestUuid,$$languageId:o.languageId})},inlineCompletionPartialAccept(o){return Ks({source:"inlineCompletionPartialAccept",type:o.type,$nes:o.nes,...lS(o.providerId),$$requestUuid:o.requestUuid,$$languageId:o.languageId})},inlineChatApplyEdit(o){return Ks({source:"inlineChat.applyEdits",$modelId:J9(o.modelId),$extensionId:o.extensionId?.extensionId,$extensionVersion:o.extensionId?.version,$$sessionId:o.sessionId,$$requestId:o.requestId,$$languageId:o.languageId})},reloadFromDisk:()=>Ks({source:"reloadFromDisk"}),cursor(o){return Ks({source:"cursor",kind:o.kind,detailedSource:o.detailedSource})},setValue:()=>Ks({source:"setValue"}),eolChange:()=>Ks({source:"eolChange"}),applyEdits:()=>Ks({source:"applyEdits"}),snippet:()=>Ks({source:"snippet"}),suggest:o=>Ks({source:"suggest",...lS(o.providerId)}),codeAction:o=>Ks({source:"codeAction",$kind:o.kind,...lS(o.providerId)})};function lS(o){return o?{$extensionId:o.extensionId,$extensionVersion:o.extensionVersion,$providerId:o.providerId}:{}}function J9(o){if(o!==void 0)return o.replaceAll("/","|")}class Uv{static fromText(e){const t=di.ofText(e).lineCount,i=e.length;return new Uv(t,0,i,0)}static tryCreate(e,t,i,n){if(!(e===void 0||t===void 0||i===void 0||n===void 0))return new Uv(e,t,i,n)}constructor(e,t,i,n){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=i,this.charsRemoved=n}}var eB;(function(o){function e(t){const i=t?t("sgt"):Dj("sgt");return i}o.newId=e})(eB||(eB={}));function np(o){return o.toString()}class _n{static create(e,t){const i=e.getAlternativeVersionId(),n=oR(e);return new _n(i,i,n,n,t,t,[])}constructor(e,t,i,n,s,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=s,this.afterCursorState=r,this.changes=a}append(e,t,i,n,s){t.length>0&&(this.changes=eue(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Ra(e,t?t.length:0,i),i+=4,t)for(const n of t)Ra(e,n.selectionStartLineNumber,i),i+=4,Ra(e,n.selectionStartColumn,i),i+=4,Ra(e,n.positionLineNumber,i),i+=4,Ra(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Ta(e,t);t+=4;for(let s=0;st.toString()).join(", ")}matchesResource(e){return(be.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof _n}append(e,t,i,n,s){this._data instanceof _n&&this._data.append(e,t,i,n,s)}close(){this._data instanceof _n&&(this._data=this._data.serialize())}open(){this._data instanceof _n||(this._data=_n.deserialize(this._data))}undo(){if(be.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof _n&&(this._data=this._data.serialize());const e=_n.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(be.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof _n&&(this._data=this._data.serialize());const e=_n.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof _n&&(this._data=this._data.serialize()),this._data.byteLength+168}}class iue{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const s=np(n.resource);this._editStackElementsMap.set(s,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=np(e);return this._editStackElementsMap.has(t)}setModel(e){const t=np(be.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=np(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,s){const r=np(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,s)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=np(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Br(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function oR(o){return o.getEOL()===` -`?0:1}function Bc(o){return o?o instanceof Cq||o instanceof iue:!1}class IF{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Bc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Bc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Bc(i)&&i.canAppend(this._model))return i;const n=new Cq(m(785,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],oR(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n,s=Jn.unknown({name:"pushEditOperation"})){const r=this._getOrCreateEditStackElement(e,n),a=this._model.applyEdits(t,!0,s),l=IF._computeCursorState(i,a),c=a.map((d,h)=>({index:h,textChange:d.textChange}));return c.sort((d,h)=>d.textChange.oldPosition===h.textChange.oldPosition?d.index-h.index:d.textChange.oldPosition-h.textChange.oldPosition),r.append(this._model,c.map(d=>d.textChange),oR(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Te(i),null}}}class nue{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function sue(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-10?n++:v>1&&s++,sue(r,a,_,w,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=c&&d[L]++,r=_,a=w}let u=t;n!==s&&(u=n{const _=d[p];_>f&&(f=_,g=p)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Gs(o){return(o.metadata&1)>>>0}function Gt(o,e){o.metadata=o.metadata&254|e<<0}function Gn(o){return(o.metadata&2)>>>1===1}function $t(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function vq(o){return(o.metadata&4)>>>2===1}function iB(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function wq(o){return(o.metadata&64)>>>6===1}function nB(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function Sq(o){return(o.metadata&128)>>>7===1}function sB(o,e){o.metadata=o.metadata&127|(e?1:0)<<7}function oue(o){return(o.metadata&24)>>>3}function oB(o,e){o.metadata=o.metadata&231|e<<3}function rue(o){return(o.metadata&32)>>>5===1}function rB(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class yq{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Gt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,iB(this,!1),nB(this,!1),oB(this,1),rB(this,!1),sB(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,$t(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;iB(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),nB(this,this.options.glyphMarginClassName!==null),oB(this,this.options.stickiness),rB(this,this.options.collapseOnReplaceEdit),sB(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Ze=new yq(null,0,0);Ze.parent=Ze;Ze.left=Ze;Ze.right=Ze;Gt(Ze,0);class aE{constructor(){this.root=Ze,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,r,a){return this.root===Ze?[]:fue(this,e,t,i,n,s,r,a)}search(e,t,i,n,s){return this.root===Ze?[]:gue(this,e,t,i,n,s)}collectNodesFromOwner(e){return hue(this,e)}collectNodesPostOrder(){return uue(this)}insert(e){aB(this,e),this._normalizeDeltaIfNecessary()}delete(e){lB(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const s=i.start+n,r=i.end+n;i.setCachedOffsets(s,r,t)}acceptReplace(e,t,i,n){const s=cue(this,e,e+t);for(let r=0,a=s.length;rt||i===1?!1:i===2?!0:e}function lue(o,e,t,i,n){const s=oue(o),r=s===0||s===2,a=s===1||s===2,l=t-e,c=i,d=Math.min(l,c),h=o.start;let u=!1;const g=o.end;let f=!1;e<=h&&g<=t&&rue(o)&&(o.start=e,u=!0,o.end=e,f=!0);{const _=n?1:l>0?2:0;!u&&sp(h,r,e,_)&&(u=!0),!f&&sp(g,a,e,_)&&(f=!0)}if(d>0&&!n){const _=l>c?2:0;!u&&sp(h,r,e+d,_)&&(u=!0),!f&&sp(g,a,e+d,_)&&(f=!0)}{const _=n?1:0;!u&&sp(h,r,t,_)&&(o.start=e+c,u=!0),!f&&sp(g,a,t,_)&&(o.end=e+c,f=!0)}const p=c-l;u||(o.start=Math.max(0,h+p)),f||(o.end=Math.max(0,g+p)),o.start>o.end&&(o.end=o.start)}function cue(o,e,t){let i=o.root,n=0,s=0,r=0,a=0;const l=[];let c=0;for(;i!==Ze;){if(Gn(i)){$t(i.left,!1),$t(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Gn(i.left)){if(s=n+i.maxEnd,st){$t(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),$t(i,!0),i.right!==Ze&&!Gn(i.right)){n+=i.delta,i=i.right;continue}}return $t(o.root,!1),l}function due(o,e,t,i){let n=o.root,s=0,r=0,a=0;const l=i-(t-e);for(;n!==Ze;){if(Gn(n)){$t(n.left,!1),$t(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),Kh(n),n=n.parent;continue}if(!Gn(n.left)){if(r=s+n.maxEnd,rt){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(o.requestNormalizeDelta=!0),$t(n,!0);continue}if($t(n,!0),n.right!==Ze&&!Gn(n.right)){s+=n.delta,n=n.right;continue}}$t(o.root,!1)}function hue(o,e){let t=o.root;const i=[];let n=0;for(;t!==Ze;){if(Gn(t)){$t(t.left,!1),$t(t.right,!1),t=t.parent;continue}if(t.left!==Ze&&!Gn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),$t(t,!0),t.right!==Ze&&!Gn(t.right)){t=t.right;continue}}return $t(o.root,!1),i}function uue(o){let e=o.root;const t=[];let i=0;for(;e!==Ze;){if(Gn(e)){$t(e.left,!1),$t(e.right,!1),e=e.parent;continue}if(e.left!==Ze&&!Gn(e.left)){e=e.left;continue}if(e.right!==Ze&&!Gn(e.right)){e=e.right;continue}t[i++]=e,$t(e,!0)}return $t(o.root,!1),t}function gue(o,e,t,i,n,s){let r=o.root,a=0,l=0,c=0;const d=[];let h=0;for(;r!==Ze;){if(Gn(r)){$t(r.left,!1),$t(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(r.left!==Ze&&!Gn(r.left)){r=r.left;continue}l=a+r.start,c=a+r.end,r.setCachedOffsets(l,c,n);let u=!0;if(e&&r.ownerId&&r.ownerId!==e&&(u=!1),t&&vq(r)&&(u=!1),i&&Sq(r)&&(u=!1),s&&!wq(r)&&(u=!1),u&&(d[h++]=r),$t(r,!0),r.right!==Ze&&!Gn(r.right)){a+=r.delta,r=r.right;continue}}return $t(o.root,!1),d}function fue(o,e,t,i,n,s,r,a){let l=o.root,c=0,d=0,h=0,u=0;const g=[];let f=0;for(;l!==Ze;){if(Gn(l)){$t(l.left,!1),$t(l.right,!1),l===l.parent.right&&(c-=l.parent.delta),l=l.parent;continue}if(!Gn(l.left)){if(d=c+l.maxEnd,dt){$t(l,!0);continue}if(u=c+l.end,u>=e){l.setCachedOffsets(h,u,r);let p=!0;i&&l.ownerId&&l.ownerId!==i&&(p=!1),n&&vq(l)&&(p=!1),s&&Sq(l)&&(p=!1),a&&!wq(l)&&(p=!1),p&&(g[f++]=l)}if($t(l,!0),l.right!==Ze&&!Gn(l.right)){c+=l.delta,l=l.right;continue}}return $t(o.root,!1),g}function aB(o,e){if(o.root===Ze)return e.parent=Ze,e.left=Ze,e.right=Ze,Gt(e,0),o.root=e,o.root;pue(o,e),jd(e.parent);let t=e;for(;t!==o.root&&Gs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Gs(i)===1?(Gt(t.parent,0),Gt(i,0),Gt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,bC(o,t)),Gt(t.parent,0),Gt(t.parent.parent,1),CC(o,t.parent.parent))}else{const i=t.parent.parent.left;Gs(i)===1?(Gt(t.parent,0),Gt(i,0),Gt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,CC(o,t)),Gt(t.parent,0),Gt(t.parent.parent,1),bC(o,t.parent.parent))}return Gt(o.root,0),e}function pue(o,e){let t=0,i=o.root;const n=e.start,s=e.end;for(;;)if(_ue(n,s,i.start+t,i.end+t)<0)if(i.left===Ze){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Ze){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=Ze,e.right=Ze,Gt(e,1)}function lB(o,e){let t,i;if(e.left===Ze?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Ze?(t=e.left,i=e):(i=mue(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(o.requestNormalizeDelta=!0)),i===o.root){o.root=t,Gt(t,0),e.detach(),lE(),Kh(t),o.root.parent=Ze;return}const n=Gs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Gt(i,Gs(e)),e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ze&&(i.left.parent=i),i.right!==Ze&&(i.right.parent=i)),e.detach(),n){jd(t.parent),i!==e&&(jd(i),jd(i.parent)),lE();return}jd(t),jd(t.parent),i!==e&&(jd(i),jd(i.parent));let s;for(;t!==o.root&&Gs(t)===0;)t===t.parent.left?(s=t.parent.right,Gs(s)===1&&(Gt(s,0),Gt(t.parent,1),bC(o,t.parent),s=t.parent.right),Gs(s.left)===0&&Gs(s.right)===0?(Gt(s,1),t=t.parent):(Gs(s.right)===0&&(Gt(s.left,0),Gt(s,1),CC(o,s),s=t.parent.right),Gt(s,Gs(t.parent)),Gt(t.parent,0),Gt(s.right,0),bC(o,t.parent),t=o.root)):(s=t.parent.left,Gs(s)===1&&(Gt(s,0),Gt(t.parent,1),CC(o,t.parent),s=t.parent.left),Gs(s.left)===0&&Gs(s.right)===0?(Gt(s,1),t=t.parent):(Gs(s.left)===0&&(Gt(s.right,0),Gt(s,1),bC(o,s),s=t.parent.left),Gt(s,Gs(t.parent)),Gt(t.parent,0),Gt(s.left,0),CC(o,t.parent),t=o.root));Gt(t,0),lE()}function mue(o){for(;o.left!==Ze;)o=o.left;return o}function lE(){Ze.parent=Ze,Ze.delta=0,Ze.start=0,Ze.end=0}function bC(o,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Ze&&(t.left.parent=e),t.parent=e.parent,e.parent===Ze?o.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Kh(e),Kh(t)}function CC(o,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(o.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Ze&&(t.right.parent=e),t.parent=e.parent,e.parent===Ze?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Kh(e),Kh(t)}function Lq(o){let e=o.end;if(o.left!==Ze){const t=o.left.maxEnd;t>e&&(e=t)}if(o.right!==Ze){const t=o.right.maxEnd+o.delta;t>e&&(e=t)}return e}function Kh(o){o.maxEnd=Lq(o)}function jd(o){for(;o!==Ze;){const e=Lq(o);if(o.maxEnd===e)return;o.maxEnd=e,o=o.parent}}function _ue(o,e,t,i){return o===t?e-i:o-t}class rR{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==He)return EF(this.right);let e=this;for(;e.parent!==He&&e.parent.left!==e;)e=e.parent;return e.parent===He?He:e.parent}prev(){if(this.left!==He)return xq(this.left);let e=this;for(;e.parent!==He&&e.parent.right!==e;)e=e.parent;return e.parent===He?He:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const He=new rR(null,0);He.parent=He;He.left=He;He.right=He;He.color=0;function EF(o){for(;o.left!==He;)o=o.left;return o}function xq(o){for(;o.right!==He;)o=o.right;return o}function NF(o){return o===He?0:o.size_left+o.piece.length+NF(o.right)}function TF(o){return o===He?0:o.lf_left+o.piece.lineFeedCnt+TF(o.right)}function cE(){He.parent=He}function vC(o,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==He&&(t.left.parent=e),t.parent=e.parent,e.parent===He?o.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function wC(o,e){const t=e.left;e.left=t.right,t.right!==He&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===He?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function cS(o,e){let t,i;if(e.left===He?(i=e,t=i.right):e.right===He?(i=e,t=i.left):(i=EF(e.right),t=i.right),i===o.root){o.root=t,t.color=0,e.detach(),cE(),o.root.parent=He;return}const n=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,$b(o,t)):(i.parent===e?t.parent=i:t.parent=i.parent,$b(o,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==He&&(i.left.parent=i),i.right!==He&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,$b(o,i)),e.detach(),t.parent.left===t){const r=NF(t),a=TF(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,Dc(o,t.parent,l,c)}}if($b(o,t.parent),n){cE();return}let s;for(;t!==o.root&&t.color===0;)t===t.parent.left?(s=t.parent.right,s.color===1&&(s.color=0,t.parent.color=1,vC(o,t.parent),s=t.parent.right),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.right.color===0&&(s.left.color=0,s.color=1,wC(o,s),s=t.parent.right),s.color=t.parent.color,t.parent.color=0,s.right.color=0,vC(o,t.parent),t=o.root)):(s=t.parent.left,s.color===1&&(s.color=0,t.parent.color=1,wC(o,t.parent),s=t.parent.left),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.left.color===0&&(s.right.color=0,s.color=1,vC(o,s),s=t.parent.left),s.color=t.parent.color,t.parent.color=0,s.left.color=0,wC(o,t.parent),t=o.root));t.color=0,cE()}function cB(o,e){for($b(o,e);e!==o.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,vC(o,e)),e.parent.color=0,e.parent.parent.color=1,wC(o,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,wC(o,e)),e.parent.color=0,e.parent.parent.color=1,vC(o,e.parent.parent))}o.root.color=0}function Dc(o,e,t,i){for(;e!==o.root&&e!==He;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function $b(o,e){let t=0,i=0;if(e!==o.root){for(;e!==o.root&&e===e.parent.right;)e=e.parent;if(e!==o.root)for(e=e.parent,t=NF(e.left)-e.size_left,i=TF(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==o.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const bue=999;class Mu{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Dq(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=vU(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new fne(t,this.wordSeparators?Hr(this.wordSeparators,[]):null,i?this.searchString:null)}}function Dq(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Zu(o,e,t){if(!t)return new _v(o,null);const i=[];for(let n=0,s=e.length;n>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class dS{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Up(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+g}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new D(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new dB(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Zu(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c=l))return s;return s}const d=new Up(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Zu(new D(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Up(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new R(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new D(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new dB(l):null;i.reset(t.column-1);const d=i.next(l);return d?Zu(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new R(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Zu(new D(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Up(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new D(1,1,t.lineNumber,t.column),i,n,10*bue);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new R(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Zu(new D(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function Cue(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function vue(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function RF(o,e,t,i,n){return Cue(o,e,t,i,n)&&vue(o,e,t,i,n)}class Up{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){gy(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||RF(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const pc=65535;function kq(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class wue{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function Tc(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n126)&&(r=!1)}const a=new wue(kq(o),i,n,s,r);return o.length=0,a}class go{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Yu{constructor(e,t){this.buffer=e,this.lineStarts=t}}class yue{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==He&&e.iterate(e.root,i=>(i!==He&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class Lue{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const s of i)s!==null&&n.push(s);this._cache=n}}}class xue{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Yu("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=He,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let s=0,r=e.length;s0){e[s].lineStarts||(e[s].lineStarts=Tc(e[s].buffer));const a=new go(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),n=this.rbInsertRight(n,a)}this._searchCache=new Lue(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=pc,i=t-Math.floor(t/3),n=i*2;let s="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=s.replace(/\r\n|\r|\n/g,e);a.push(new Yu(l,Tc(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new yue(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==He;)if(n.left!==He&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const s=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=s+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==He;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,s.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new R(i+1,a+1)}return new R(i+1,s.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===He){const s=this.getOffsetAt(i+1,1),r=n-e-s;return new R(i+1,r+1)}else t=t.right;return new R(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),s=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?s.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==He;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,s=>{if(s===He)return!0;const r=s.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=c[d]+r.start.column;if(n&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(n=!0,i+=l.substr(u,a-1)):i+=l.substr(u,a),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,c[d+1]-this._EOLLength)):l.substring(u,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=d+1;gv+f,t.reset(0)):(C=u.buffer,w=v=>v,t.reset(f));do if(_=t.next(C),_){if(w(_.index)>=p)return d;this.positionInBuffer(e,w(_.index)-g,b);const v=this.getLineFeedCnt(e.piece.bufferIndex,s,b),S=b.line===s.line?b.column-s.column+n:b.column+1,L=S+_[0].length;if(h[d++]=Zu(new D(i+v,S,i+v,L),_,l),w(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,n){const s=[];let r=0;const a=new Up(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const h=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,h,t,i,n,r,s),s;let u=e.startLineNumber,g=l.node;for(;g!==c.node;){const p=this.getLineFeedCnt(g.piece.bufferIndex,d,g.piece.end);if(p>=1){const b=this._buffers[g.piece.bufferIndex].lineStarts,C=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),w=b[d.line+p],v=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(g,a,u,v,d,this.positionInBuffer(g,w-C),t,i,n,r,s),r>=n)return s;u+=p}const _=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,_,r,s,i,n),s}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(_),u,_,r,s,i,n),r>=n)return s;u++,l=this.nodeAt2(u,1),g=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){const p=u===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(u).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,s,i,n),s}const f=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,u,f,d,h,t,i,n,r,s),s}_findMatchesInLine(e,t,i,n,s,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=i.length;let p=-g;for(;(p=i.indexOf(u,p+g))!==-1;)if((!d||RF(d,i,f,p,g))&&(a[r++]=new _v(new D(n,p+1+s,n,p+1+g+s),null),r>=c))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=Zu(new D(n,h.index+1+s,n,h.index+1+h[0].length+s),h,l),r>=c))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==He){const{node:n,remainder:s,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,c=this.positionInBuffer(n,s);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new go(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,s)===10){const p={line:h.start.line+1,column:0};h=new go(h.bufferIndex,p,h.end,this.getLineFeedCnt(h.bufferIndex,p,h.end),h.length-1),t+=` -`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const p=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,p),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r=u)c=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tpc){const d=[];for(;e.length>pc;){const u=e.charCodeAt(pc-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,pc-1),e=e.substring(pc-1)):(g=e.substring(0,pc),e=e.substring(pc));const f=Tc(g);d.push(new go(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Yu(g,f))}const h=Tc(e);return d.push(new go(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Yu(e,h)),d}let t=this._buffers[0].buffer.length;const i=Tc(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==He;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==He;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(r!==s)return{index:r,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-n,d=a-s,h=i.length+d;e.piece=new go(i.bufferIndex,i.start,r,l,h),Dc(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-n,d=s-l,h=i.length+d;e.piece=new go(i.bufferIndex,r,i.end,a,h),Dc(this,e,d,c)}shrinkNode(e,t,i){const n=e.piece,s=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,c=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,c),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new go(n.bufferIndex,n.start,c,d,h),Dc(this,e,h-a,d-l);const u=new go(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),g=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` -`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=Tc(t,!1);for(let g=0;ge)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==He;)if(i.left!==He&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==He;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` -`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===He||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===He||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new go(e.piece.bufferIndex,e.piece.start,s,a,r),Dc(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new go(t.piece.bufferIndex,l,t.piece.end,d,c),Dc(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r -`);this.rbInsertRight(e,h[0]);for(let u=0;u ${t.lineNumber},${t.column}): "${this.text}"`}}function h1(o,e){if(o.lineNumber===e.lineNumber&&o.column===Number.MAX_SAFE_INTEGER)return L.fromPositions(e,e);if(!o.isBeforeOrEqual(e))throw new Ce("start must be before end");return new L(o.lineNumber,o.column,e.lineNumber,e.column)}uce({StringEdit:Ra,StringReplacement:yn,TextReplacement:Ni,TextEdit:ho,TextLength:si});var fce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pce=function(o,e){return function(t,i){e(t,i,o)}};let VN=class extends A{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new ut),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new b$,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,i=_t().document.activeElement;if(!i||i!==t)return;if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const s=_t().document.getSelection();if(!s)return;const r=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!r)return;this._setIgnoreSelectionChangeTime("setRange"),s.setBaseAndExtent(r.anchorNode,r.anchorOffset,r.focusNode,r.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),s=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-n}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return W(this._domNode.domNode.ownerDocument,"selectionchange",()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!xl.enabled||!(_t().document.activeElement===this._domNode.domNode))return;const s=_t().document.getSelection();if(!s||s.rangeCount===0)return;const a=s.getRangeAt(0),l=Date.now(),c=l-e;if(e=l,c<5)return;const d=l-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,!(d<100)&&this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,s.direction,a))})}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,this._accessibilityService.getAccessibilitySupport()===0),i=this._context.viewModel.model.getPositionAt(1/0);let n=t.value;return i.column===1&&e.getEndPosition().equals(i)&&(n+=` +`),t.value=n,t}_getScreenReaderRange(e,t){const i=this._domNode.domNode.firstChild;if(!i)return;const n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){const s=e.viewModel,r=s.model,l=s.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),c=r.getOffsetAt(l);let d=n.startOffset+c,h=n.endOffset+c;if(r.getEndOfLineSequence()===1){const b=t.value,C=new nk(b),w=C.getPosition(n.startOffset),v=C.getPosition(n.endOffset);d+=w.lineNumber-1,h+=v.lineNumber-1}const g=r.getPositionAt(d),f=r.getPositionAt(h),p=i==="forward"?g:f,_=i==="forward"?f:g;return ae.fromPositions(p,_)}};VN=fce([pce(3,kn)],VN);var mce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gW=function(o,e){return function(t,i){e(t,i,o)}};let zN=class extends A{constructor(e,t,i,n,s){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=s,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new ae(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new ut),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new HN(this._domNode,this._context,this._viewController,this._accessibilityService):new VN(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",m(60,"editor")),this._domNode.domNode.setAttribute("aria-label",FN(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=`${t*i}px`;const n=e.get(154),s=n==="inherit"?e.get(153):n,r=s==="inherit"?e.get(149):s;this._domNode.domNode.style.textWrap=r==="off"?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new ae(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(ithis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const n=this._context.viewLayout.getCurrentScrollTop(),s=this._primarySelection.positionLineNumber,r=this._context.viewLayout.getVerticalOffsetForLineNumber(s)-n;if(r<0||r>this._contentHeight){this._renderAtTopLeft();return}const a=this._context.viewLayout.getLineHeightForLineNumber(s);this._doRender(r,this._contentLeft,this._divWidth,a),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,i,n){gn(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};zN=mce([gW(3,st),gW(4,kn)],zN);var UN;(function(o){function e(t,i){return new t.EditContext(i)}o.create=e})(UN||(UN={}));class _ce{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}}const l4=new _ce;var bce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fW=function(o,e){return function(t,i){e(t,i,o)}},Rb;(function(o){o.NONE="edit-context-composition-none",o.SECONDARY="edit-context-composition-secondary",o.PRIMARY="edit-context-composition-primary"})(Rb||(Rb={}));let ay=class extends _${constructor(e,t,i,n,s,r,a){super(t),this._viewController=n,this._visibleRangeProvider=s,this.logService=a,this._previousEditContextSelection=new ge(0,0),this._editContextPrimarySelection=new ae(1,1,1,1),this._decorations=[],this._primarySelection=new ae(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this._linesVisibleRanges=null,this.domNode=new z0(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new z0(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new BN(a,this.domNode.domNode,h=>{a.trace("NativeEditContext#handleFocusChange : ",h),this._screenReaderSupport.handleFocusChange(h),this._context.viewModel.setHasFocus(h)}));const l=pe(this.domNode.domNode);this._editContext=UN.create(l),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(r.createInstance(zN,this.domNode,t,this._viewController)),this._register(W(this.domNode.domNode,"copy",h=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(h)})),this._register(W(this.domNode.domNode,"cut",h=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(h),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register(W(this.domNode.domNode,"keyup",h=>this._onKeyUp(h))),this._register(W(this.domNode.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(W(this._imeTextArea.domNode,"keyup",h=>this._onKeyUp(h))),this._register(W(this._imeTextArea.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(W(this.domNode.domNode,"beforeinput",async h=>{(h.inputType==="insertParagraph"||h.inputType==="insertLineBreak")&&this._onType(this._viewController,{text:` +`,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(W(this.domNode.domNode,"paste",h=>{if(this.logService.trace("NativeEditContext#paste"),h.preventDefault(),!h.clipboardData)return;let[u,g]=ag.getTextData(h.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",g?.id," with text.length: ",u.length),!u)return;g=g||Sl.INSTANCE.get(u);let f=!1,p=null,_=null;g&&(f=this._context.configuration.options.get(45)&&!!g.isFromEmptySelection,p=typeof g.multicursorText<"u"?g.multicursorText:null,_=g.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(u,f,p,_)})),this._register(R_(this._editContext,"textformatupdate",h=>this._handleTextFormatUpdate(h))),this._register(R_(this._editContext,"characterboundsupdate",h=>this._updateCharacterBounds(h)));let c;this._register(R_(this._editContext,"textupdate",h=>{const u=h.text;if(u.length===1){const g=u.charCodeAt(0);if(Vi(g)){c=u;return}if(bh(g)&&c){const f={text:c+u,selectionEnd:h.selectionEnd,selectionStart:h.selectionStart,updateRangeStart:h.updateRangeStart-1,updateRangeEnd:h.updateRangeEnd-1};c=void 0,this._emitTypeEvent(this._viewController,f);return}}this._emitTypeEvent(this._viewController,h)})),this._register(R_(this._editContext,"compositionstart",h=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(R_(this._editContext,"compositionend",h=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(xl.onDidChange(()=>{xl.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!xl.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(l4.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBoundsData(e)}onDidRender(){this._updateSelectionAndControlBoundsAfterRender()}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new ae(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumbert||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===ji())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=pe(this.domNode.domNode),t=DC(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){this._viewController.emitKeyUp(new yt(e))}_onKeyDown(e){const t=new yt(e);t.keyCode===114&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){const e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){const e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new ge(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;const i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new ge(t.selectionStart,t.selectionEnd);let s=0,r=0;t.updateRangeEnd>i&&(s=t.updateRangeEnd-i),t.updateRangeStartt.updateRangeEnd&&(a+=this._editContext.text.substring(t.updateRangeEnd,i));let l=0;t.selectionStart===t.selectionEnd&&n===i&&(l=t.selectionStart-(t.updateRangeStart+t.text.length));const c={text:a,replacePrevCharCnt:r,replaceNextCharCnt:s,positionDelta:l};this._onType(e,c)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){const e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;const i=e.startLineNumber,n=e.endLineNumber,s=t.getLineMaxColumn(n),r=new L(i,1,n,s),a=t.getValueInRange(r,0),l=e.startColumn-1,c=a.length+e.endColumn-s;return{text:a,selectionStartOffset:l,selectionEndOffset:c,editContextPrimarySelection:e}}_editContextStartPosition(){return new R(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;const t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];t.forEach(s=>{const r=this._context.viewModel.model,a=r.getOffsetAt(i),l=r.getPositionAt(a+s.rangeStart),c=r.getPositionAt(a+s.rangeEnd),d=L.fromPositions(l,c),h=s.underlineThickness.toLowerCase();let u=Rb.NONE;switch(h){case"thin":u=Rb.SECONDARY;break;case"thick":u=Rb.PRIMARY;break}n.push({range:d,options:{description:"textFormatDecoration",inlineClassName:u}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBoundsData(e){const t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);if(this._primarySelection.isEmpty()){const i=e.visibleRangeForPosition(t.getStartPosition());this._linesVisibleRanges=i}else this._linesVisibleRanges=null}_updateSelectionAndControlBoundsAfterRender(){const t=this._context.configuration.options.get(165).contentLeft,i=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),n=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),s=this._context.viewLayout.getVerticalOffsetAfterLineNumber(i.endLineNumber),r=this._parent.getBoundingClientRect(),a=r.top+n-this._scrollTop,l=s-n;let c=r.left+t-this._scrollLeft,d;this._primarySelection.isEmpty()?(this._linesVisibleRanges&&(c+=this._linesVisibleRanges.left),d=0):d=r.width-t;const h=new DOMRect(c,a,d,l);this._editContext.updateSelectionBounds(h),this._editContext.updateControlBounds(h)}_updateCharacterBounds(e){const t=this._context.configuration.options,i=t.get(59).typicalHalfwidthCharacterWidth,n=t.get(165).contentLeft,s=this._parent.getBoundingClientRect(),r=[],a=new nk(this._editContext.text);for(let l=e.rangeStart;l0)for(const x of p[0].ranges){w=x.left,v=x.width;break}const S=this._context.viewLayout.getLineHeightForLineNumber(_);r.push(new DOMRect(s.left+n+w-this._scrollLeft,C,v,S))}this._editContext.updateCharacterBounds(e.rangeStart,r)}_ensureClipboardGetsEditorSelection(e){const t=this._context.configuration.options,i=t.get(45),n=t.get(31),s=this._context.viewModel.getCursorStates().map(c=>c.modelState.selection),r=HU(this._context.viewModel,s,i,n);let a;this.logService.getLevel()===Ji.Trace&&(a=cf());const l={version:1,id:a,isFromEmptySelection:r.isFromEmptySelection,multicursorText:r.multicursorText,mode:r.mode};Sl.INSTANCE.set(Ks?r.text.replace(/\r\n/g,` +`):r.text,l),e.preventDefault(),e.clipboardData&&ag.setTextData(e.clipboardData,r.text,r.html,l),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",a," with text.length: ",r.text.length)}};ay=bce([fW(5,fe),fW(6,Mt)],ay);class Cce extends Rs{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(xe(i=>this._updateEntries(i)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,s=this._viewGpuContext.devicePixelRatio.read(e);for(let r=0,a=i.length;ri.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}class c4 extends Bh{static{this.CLASS_NAME="gpu-mark"}constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,s=new ty(this._context.configuration,this._context.theme.type),r=[];for(let a=t;a<=i;a++){const l=a-t,c=this._viewGpuContext.canRenderDetailed(s,n,a);r[l]=c.length?`
`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var vce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wce=function(o,e){return function(t,i){e(t,i,o)}};let $N=class extends lf{constructor(e,t,i,n,s,r,a,l,c){super(),this._instantiationService=c,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new Sce(e,l)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new ae(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=ht(document.createElement("div")),Oa.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new Ere(n,r,a,i),this._context=new Cle(n,s,r),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=ht(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ht(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._context.configuration.options.get(46)==="on"&&(this._viewGpuContext=this._instantiationService.createInstance(as,this._context)),this._scrollbar=new kae(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new e4(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(ON,this._context,this._viewGpuContext)),this._viewZones=new fle(this._context),this._viewParts.push(this._viewZones);const d=new ole(this._context);this._viewParts.push(d);const h=new cle(this._context);this._viewParts.push(h);const u=new Tre(this._context);this._viewParts.push(u),u.addDynamicOverlay(new yae(this._context)),u.addDynamicOverlay(new bn(this._context)),u.addDynamicOverlay(new Wae(this._context)),u.addDynamicOverlay(new Lae(this._context)),u.addDynamicOverlay(new mle(this._context));const g=new Rre(this._context);this._viewParts.push(g),g.addDynamicOverlay(new xae(this._context)),g.addDynamicOverlay(new Uae(this._context)),g.addDynamicOverlay(new zae(this._context)),g.addDynamicOverlay(new QL(this._context)),this._viewGpuContext&&g.addDynamicOverlay(new c4(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new Eae(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new qC(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(g.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Pre(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new sy(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ile(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new Cce(this._context,this._viewGpuContext):new lle(this._context);this._viewParts.push(p);const _=new Mre(this._context);this._viewParts.push(_);const b=new tle(this._context);if(this._viewParts.push(b),d){const C=this._scrollbar.getOverviewRulerLayoutInfo();C.parent.insertBefore(d.getDomNode(),C.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(b.getDomNode()),this._overflowGuardContainer.appendChild(_.domNode),this.domNode.appendChild(this._overflowGuardContainer),l?(l.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),l.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Ire(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(ay,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(WN,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),n!==-1&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(s=>{const r=s.options.glyphMargin?.position??Aa.Center;return n=Math.max(n,s.range.endLineNumber),{range:s.range,lane:r,persist:s.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(s=>{const r=e.validateRange(s.preference.range);return n=Math.max(n,r.endLineNumber),{range:r,lane:s.preference.lane}})),i.sort((s,r)=>L.compareRangesUsingStarts(s.range,r.range)),t.reset(n);for(const s of i)t.push(s.lane,s.range,s.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new tre(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const i=new R(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(t!==void 0)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const t=this._context.configuration.options.get(165);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+NN(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new Ce;if(this._renderAnimationFrame===null){this._editContext instanceof ay&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=d4.INSTANCE.scheduleCoordinatedRendering({window:pe(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ce;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ce;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ce;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ce;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Qd(()=>e.prepareRenderText());const t=Qd(()=>e.renderText());if(t){const[i,n]=t;Qd(()=>e.prepareRender(i,n)),Qd(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}qd.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new _le(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new Foe(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const s=this._viewLines.visibleRangeForPosition(new R(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?GL.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new ale(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};$N=vce([wce(8,fe)],$N);function Qd(o){try{return o()}catch(e){return Ee(e),null}}class d4{static{this.INSTANCE=new d4}constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,E0(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Qd(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;is.renderText())}for(let i=0,n=e.length;is.prepareRender(a,l))}for(let i=0,n=e.length;is.render(a,l))}}}class Sce extends A{constructor(e,t){super(),this._onChange=this._register(new P),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(xr(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(xr(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class Mb{constructor(e,t,i,n,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=s}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let s=0;sthis.injectionOffsets[s];s++)n0?this.breakOffsets[s-1]:0,t===0)if(e<=r)n=s-1;else if(e>l)i=s+1;else break;else if(e=l)i=s+1;else break}let a=e-r;return s>0&&(a+=this.wrappedTextIndentLength),new u1(s,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new u1(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const n=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&pW(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(mW(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let s=i.injectedTextIndex-1;for(;s>=0&&this.injectionOffsets[s]===this.injectionOffsets[i.injectedTextIndex]&&!(pW(this.injectionOptions[s].cursorStops)||(n-=this.injectionOptions[s].content.length,mW(this.injectionOptions[s].cursorStops)));)s--;return n}}else if(t===1||t===4){let n=i.offsetInInputWithInjections+i.length,s=i.injectedTextIndex;for(;s+1=0&&this.injectionOffsets[s-1]===this.injectionOffsets[s];)n-=this.injectionOptions[s-1].content.length,s--;return n}ow()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let s=0;se)break;if(e<=l)return{injectedTextIndex:s,offsetInInputWithInjections:a,length:r};n+=r}}}}function pW(o){return o==null?!0:o===dr.Right||o===dr.Both}function mW(o){return o==null?!0:o===dr.Left||o===dr.Both}class u1{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new R(e+this.outputLineIndex,this.outputOffset+1)}}class yce{constructor(){this.changeType=1}}class Fa{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Fa(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Fa(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class _W{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class xce{constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class Lce{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class kce{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Dce{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Ice{constructor(){this.changeType=5}}class Wp{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;to});class h4{static create(e){return new h4(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,s,r){const a=[],l=[];return{addRequest:(c,d,h)=>{a.push(c),l.push(d)},finalize:()=>Nce(Ud(this.targetWindow.deref()),a,e,t,i,n,s,l)}}}function Nce(o,e,t,i,n,s,r,a){function l(I){const T=a[I];if(T){const F=Fa.applyInjectedText(e[I],T),O=T.map(U=>U.options),B=T.map(U=>U.column-1);return new Mb(B,O,[F.length],[],0)}else return null}if(n===-1){const I=[];for(let T=0,F=e.length;Tc?(F=0,O=0):B=c-ie}const U=T.substr(F),K=Tce(U,O,i,B,f,u);p[I]=F,_[I]=O,b[I]=U,C[I]=K[0],w[I]=K[1]}const v=f.build(),S=Ece?.createHTML(v)??v;g.innerHTML=S,g.style.position="absolute",g.style.top="10000",r==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),o.document.body.appendChild(g);const x=document.createRange(),k=Array.prototype.slice.call(g.children,0),D=[];for(let I=0;Ice.options),X=ne.map(ce=>ce.column-1)):(ie=null,X=null),D[I]=new Mb(X,ie,F,K,B)}return g.remove(),D}function Tce(o,e,t,i,n,s){if(s!==0){const u=String(s);n.appendString('
');const r=o.length;let a=e,l=0;const c=[],d=[];let h=0");for(let u=0;u"),c[u]=l,d[u]=a;const g=h;h=u+1"),c[o.length]=l,d[o.length]=a,n.appendString("
"),[c,d]}function Rce(o,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),s=[];try{jN(o,n,i,0,null,t.length-1,null,s)}catch(r){return console.log(r),null}return s.length===0?null:(s.push(t.length),s)}function jN(o,e,t,i,n,s,r,a){if(i===s||(n=n||JD(o,e,t[i],t[i+1]),r=r||JD(o,e,t[s],t[s+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===s){a.push(s);return}const l=i+(s-i)/2|0,c=JD(o,e,t[l],t[l+1]);jN(o,e,t,i,n,l,c,a),jN(o,e,t,l,c,s,r,a)}function JD(o,e,t,i){return o.setStart(e[t/16384|0].firstChild,t%16384),o.setEnd(e[i/16384|0].firstChild,i%16384),o.getClientRects()}class Mce extends A{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new aL),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){Ee(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(0),this._register(ib(pe(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(ib(pe(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(ib(pe(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return ib(pe(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){Ee(i)}}}}class x${constructor(e,t,i,n,s,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=s,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const xw={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};function Lh(o){let e=0,t=0,i=0,n=0;for(let s=0,r=o.length;s=zo&&(t=t-o%zo),t}function Wce(o,e){return o.reduce((t,i)=>fi(t,e(i)),Ds)}function L$(o,e){return o===e}function iv(o,e){const t=o,i=e;if(i-t<=0)return Ds;const s=Math.floor(t/zo),r=Math.floor(i/zo),a=i-r*zo;if(s===r){const l=t-s*zo;return Ei(0,a-l)}else return Ei(r-s,a)}function Bp(o,e){return o=e}function up(o){return Ei(o.lineNumber-1,o.column-1)}function hg(o,e){const t=o,i=Math.floor(t/zo),n=t-i*zo,s=e,r=Math.floor(s/zo),a=s-r*zo;return new L(i+1,n+1,r+1,a+1)}function Bce(o){const e=bo(o);return Ei(e.length-1,e[e.length-1].length)}class Tc{static fromModelContentChanges(e){return e.map(i=>{const n=L.lift(i.range);return new Tc(up(n.getStartPosition()),up(n.getEndPosition()),Bce(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Cr(this.startOffset)}...${Cr(this.endOffset)}) -> ${Cr(this.newLength)}`}}class Hce{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>u4.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:iv(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ei(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ei(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Cr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ei(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ei(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(n===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const s=this.lineTokens,r=s.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=Oce(e,t,this.lineIdx,this.lineCharOffset);return new Od(n,0,-1,Xi.getEmpty(),new Lu(n))}}class qce{constructor(e,t){this.text=e,this._offset=Ds,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| +`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let f=0;f<60;f++)h.push(new Od(Ei(0,f),0,-1,Xi.getEmpty(),new Lu(Ei(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new Od(Ei(1,f),0,-1,Xi.getEmpty(),new Lu(Ei(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,p=r[0];if(p===` +`)a++,l=f+1;else{if(c!==f){let _;if(d===a){const b=f-c;if(bKce(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Kce(o){let e=_o(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class I${constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=p4.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Gce(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e=2?E$(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())vW(i,n)<=vW(n,r)?(i=eI(i,n),n=r):n=eI(n,r);return eI(i,n)}function E$(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?o[2]:null,e)}function vW(o,e){return Math.abs(o.listHeight-e.listHeight)}function eI(o,e){return o.listHeight===e.listHeight?Rl.create23(o,e,null,!1):o.listHeight>e.listHeight?Zce(o,e):Yce(e,o)}function Zce(o,e){o=o.toMutable();let t=o;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Rl.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Rl.create23(o,n,null,!1):o}function Yce(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Rl.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Rl.create23(n,o,null,!1):o}class Xce{constructor(e){this.lastOffset=Ds,this.nextNodes=[e],this.offsets=[Ds],this.idxs=[]}readLongestNodeAt(e,t){if(Bp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=M_(this.nextNodes);if(!i)return;const n=M_(this.offsets);if(Bp(e,n))return;if(Bp(n,e))if(fi(n,i.length)<=e)this.nextNodeAfterCurrent();else{const s=tI(i);s!==-1?(this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const s=tI(i);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){const e=M_(this.offsets),t=M_(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=M_(this.nextNodes),n=tI(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(fi(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function tI(o,e=-1){for(;;){if(e++,e>=o.childrenLength)return-1;if(o.getChild(e))return e}}function M_(o){return o.length>0?o[o.length-1]:void 0}function qN(o,e,t,i){return new Qce(o,e,t,i).parseDocument()}class Qce{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Xce(i):void 0,this.positionMapper=new Hce(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Xi.getEmpty(),0);return e||(e=Rl.getEmpty()),e}parseList(e,t){const i=[];for(;;){let s=this.tryReadChildFromCache(e);if(!s){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;s=this.parseChild(e,t+1)}s.kind===4&&s.childrenLength===0||i.push(s)}return this.oldNodeReader?Gce(i):E$(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!ly(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!Bp(n.length,t)?!1:n.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new $ce(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Lu(i.length);const n=e.merge(i.bracketIds),s=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),nv.create(i.astNode,s,r.astNode)):nv.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function hy(o,e){if(o.length===0)return e;if(e.length===0)return o;const t=new Qc(wW(o)),i=wW(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function s(c){if(c===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!ly(c);){const[h,u]=n.splitAt(c);d.push(h),c=iv(h.lengthAfter,c),n=u??t.dequeue()}return ly(c)||d.push(new Jd(!1,c,c)),d}const r=[];function a(c,d,h){if(r.length>0&&L$(r[r.length-1].endOffset,c)){const u=r[r.length-1];r[r.length-1]=new Tc(u.startOffset,d,fi(u.newLength,h))}else r.push({startOffset:c,endOffset:d,newLength:h})}let l=Ds;for(const c of i){const d=s(c.lengthBefore);if(c.modified){const h=Wce(d,g=>g.lengthBefore),u=fi(l,h);a(l,u,c.lengthAfter),l=u}else for(const h of d){const u=l;l=fi(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return r}class Jd{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=iv(e,this.lengthAfter);return L$(t,Ds)?[this,void 0]:this.modified?[new Jd(this.modified,this.lengthBefore,e),new Jd(this.modified,Ds,t)]:[new Jd(this.modified,e,e),new Jd(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Cr(this.lengthBefore)} -> ${Cr(this.lengthAfter)}`}}function wW(o){const e=[];let t=Ds;for(const i of o){const n=iv(t,i.startOffset);ly(n)||e.push(new Jd(!1,n,n));const s=iv(i.startOffset,i.endOffset);e.push(new Jd(!0,s,i.newLength)),t=i.endOffset}return e}class Jce extends A{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new P,this.denseKeyProvider=new k$,this.brackets=new I$(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new qce(this.textModel.getValue(),i);this.initialAstWithoutTokens=qN(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new Tc(Ei(i.fromLineNumber-1,0),Ei(i.toLineNumber,0),Ei(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Tc.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=hy(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=hy(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t,s=new D$(this.textModel,this.brackets);return qN(s,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ei(e.startLineNumber-1,e.startColumn-1),n=Ei(e.endLineNumber-1,e.endColumn-1);return new Wc(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens;KN(r,Ds,r.length,i,n,s,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=up(e.getStartPosition()),n=up(e.getEndPosition());return new Wc(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new ede(s,t,this.textModel);GN(r,Ds,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return T$(t,Ds,t.length,up(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return N$(t,Ds,t.length,up(e))}}function N$(o,e,t,i){if(o.kind===4||o.kind===2){const n=[];for(const s of o.children)t=fi(e,s.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let s=n.length-1;s>=0;s--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[s];if(Bp(r,i)){const l=N$(o.children[s],r,a,i);if(l)return l}}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=hg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function T$(o,e,t,i){if(o.kind===4||o.kind===2){for(const n of o.children){if(t=fi(e,n.length),Bp(i,t)){const s=T$(n,e,t,i);if(s)return s}e=t}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=hg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function KN(o,e,t,i,n,s,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(o.kind){case 4:{const h=o.childrenLength;for(let u=0;u200)return!0;let l=!0;if(o.kind===2){let c=0;if(a){let u=a.get(o.openingBracket.text);u===void 0&&(u=0),c=u,u++,a.set(o.openingBracket.text,u)}const d=fi(e,o.openingBracket.length);let h=-1;if(s.includeMinIndentation&&(h=o.computeMinIndentation(e,s.textModel)),l=s.push(new Ace(hg(e,t),hg(e,d),o.closingBracket?hg(fi(d,o.child?.length||Ds),t):void 0,r,c,o,h)),e=d,l&&o.child){const u=o.child;if(t=fi(e,u.length),Hp(e,n)&&ob(t,i)&&(l=GN(u,e,t,i,n,s,r+1,a),!l))return!1}a?.set(o.openingBracket.text,c)}else{let c=e;for(const d of o.children){const h=c;if(c=fi(c,d.length),Hp(h,n)&&Hp(i,c)&&(l=GN(d,h,c,i,n,s,r,a),!l))return!1}}return l}class tde extends A{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new ut),this.onDidChangeEmitter=new P,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new z;this.bracketPairsTree.value=ide(e.add(new Jce(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||Wc.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||Wc.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||Wc.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(L.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?f1(this._findMatchingBracketUp(l,n,iI(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(L.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Bn(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,L.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=iI(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=n-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(Ja(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=n+1;c=l)break;if(Ja(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Ja(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Or.findNextBracketInRange(a.forwardRegex,i,s,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(g){if(g instanceof _c)return null;d=g}}l=h.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(l)).brackets;if(c&&!Ja(n.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,c,l),u=Or.findPrevBracketInRange(c.reversedRegex,i,s,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const g=s.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(f)return f instanceof _c?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof _c?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let r=-1,a=0;const l=(c,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return _c.INSTANCE;const g=Or.findPrevBracketInRange(s,c,d,h,u);if(!g)break;const f=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(f)?r++:e.isClose(f)&&r--,r===0)return g;u=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c);let g=h-1,f=u.length,p=u.length;c===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),f=t.column-1,p=t.column-1);let _=!0;for(;g>=0;g--){const b=d.getLanguageId(g)===n&&!Ja(d.getStandardTokenType(g));if(b)_?f=d.getStartOffset(g):(f=d.getStartOffset(g),p=d.getEndOffset(g));else if(_&&f!==p){const C=l(c,u,f,p);if(C)return C}_=b}if(_&&f!==p){const b=l(c,u,f,p);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let r=1,a=0;const l=(d,h,u,g)=>{for(;;){if(i&&++a%100===0&&!i())return _c.INSTANCE;const f=Or.findNextBracketInRange(s,d,h,u,g);if(!f)break;const p=h.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),g=this.textModel.getLineContent(d);let f=0,p=0,_=0;d===t.lineNumber&&(f=h.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let b=!0;for(;f=1;r--){const a=this.textModel.tokenization.getLineTokens(r),l=a.getCount(),c=this.textModel.getLineContent(r);let d=l-1,h=c.length,u=c.length;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const f=a.getLanguageId(d);i!==f&&(i=f,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let g=!0;for(;d>=0;d--){const f=a.getLanguageId(d);if(i!==f){if(n&&s&&g&&h!==u){const _=Or.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(_)return this._toFoundBracket(s,_);g=!1}i=f,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const p=!!n&&!Ja(a.getStandardTokenType(d));if(p)g?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(s&&n&&g&&h!==u){const _=Or.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(_)return this._toFoundBracket(s,_)}g=p}if(s&&n&&g&&h!==u){const f=Or.findPrevBracketInRange(n.reversedRegex,r,c,h,u);if(f)return this._toFoundBracket(s,f)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let n=null,s=null,r=null;for(let a=t.lineNumber;a<=i;a++){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,g=0;if(a===t.lineNumber){h=l.findTokenIndexAtOffset(t.column-1),u=t.column-1,g=t.column-1;const p=l.getLanguageId(h);n!==p&&(n=p,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let f=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(g));return f?[f.openingBracketRange,f.closingBracketRange]:null}const n=iI(t),s=this.textModel.getLineCount(),r=new Map;let a=[];const l=(g,f)=>{if(!r.has(g)){const p=[];for(let _=0,b=f?f.brackets.length:0;_{for(;;){if(n&&++c%100===0&&!n())return _c.INSTANCE;const C=Or.findNextBracketInRange(g.forwardRegex,f,p,_,b);if(!C)break;const w=p.substring(C.startColumn-1,C.endColumn-1).toLowerCase(),v=g.textIsBracket[w];if(v&&(v.isOpen(w)?a[v.index]++:v.isClose(w)&&a[v.index]--,a[v.index]===-1))return this._matchFoundBracket(C,v,!1,n);_=C.endColumn-1}return null};let h=null,u=null;for(let g=i.lineNumber;g<=s;g++){const f=this.textModel.tokenization.getLineTokens(g),p=f.getCount(),_=this.textModel.getLineContent(g);let b=0,C=0,w=0;if(g===i.lineNumber){b=f.findTokenIndexAtOffset(i.column-1),C=i.column-1,w=i.column-1;const S=f.getLanguageId(b);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let v=!0;for(;be?.dispose()}}function iI(o){if(typeof o>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=o}}class _c{static{this.INSTANCE=new _c}constructor(){this._searchCanceledBrand=void 0}}function f1(o){return o instanceof _c?null:o}class nde extends A{constructor(e){super(),this.textModel=e,this.colorProvider=new R$,this.onDidChangeEmitter=new P,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new L(1,1,this.textModel.getLineCount(),1),e,t):[]}}class R${constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Tr((o,e)=>{const t=[XU,QU,JU,e$,t$,i$],i=new R$;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${o.getColor(dae)}; }`);const n=t.map(s=>o.getColor(s)).filter(s=>!!s).filter(s=>!s.isTransparent());for(let s=0;s<30;s++){const r=n[s%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(s)} { color: ${r}; }`)}});function p1(o){return o.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Mn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${p1(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${p1(this.oldText)}")`:`(replace@${this.oldPosition} "${p1(this.oldText)}" with "${p1(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;ma(e,n,i),i+=4;for(let s=0;s{const a=t[s];return a!==void 0?a:(s.match(/\$/g)||[]).length<=e&&r!==void 0&&r!==null&&r!==""}).map(([s,r])=>`${s}:${r}`).join("-")}}function Os(o){return new M$(o,ode)}const jn={unknown(o){return Os({source:"unknown",name:o.name})},rename:()=>Os({source:"rename"}),chatApplyEdits(o){return Os({source:"Chat.applyEdits",$modelId:SW(o.modelId),$extensionId:o.extensionId?.extensionId,$extensionVersion:o.extensionId?.version,$$languageId:o.languageId,$$sessionId:o.sessionId,$$requestId:o.requestId,$$mode:o.mode,$$codeBlockSuggestionId:o.codeBlockSuggestionId})},chatUndoEdits:()=>Os({source:"Chat.undoEdits"}),chatReset:()=>Os({source:"Chat.reset"}),inlineCompletionAccept(o){return Os({source:"inlineCompletionAccept",$nes:o.nes,...m1(o.providerId),$$requestUuid:o.requestUuid,$$languageId:o.languageId})},inlineCompletionPartialAccept(o){return Os({source:"inlineCompletionPartialAccept",type:o.type,$nes:o.nes,...m1(o.providerId),$$requestUuid:o.requestUuid,$$languageId:o.languageId})},inlineChatApplyEdit(o){return Os({source:"inlineChat.applyEdits",$modelId:SW(o.modelId),$extensionId:o.extensionId?.extensionId,$extensionVersion:o.extensionId?.version,$$sessionId:o.sessionId,$$requestId:o.requestId,$$languageId:o.languageId})},reloadFromDisk:()=>Os({source:"reloadFromDisk"}),cursor(o){return Os({source:"cursor",kind:o.kind,detailedSource:o.detailedSource})},setValue:()=>Os({source:"setValue"}),eolChange:()=>Os({source:"eolChange"}),applyEdits:()=>Os({source:"applyEdits"}),snippet:()=>Os({source:"snippet"}),suggest:o=>Os({source:"suggest",...m1(o.providerId)}),codeAction:o=>Os({source:"codeAction",$kind:o.kind,...m1(o.providerId)})};function m1(o){return o?{$extensionId:o.extensionId,$extensionVersion:o.extensionVersion,$providerId:o.providerId}:{}}function SW(o){if(o!==void 0)return o.replaceAll("/","|")}class ov{static fromText(e){const t=si.ofText(e).lineCount,i=e.length;return new ov(t,0,i,0)}static tryCreate(e,t,i,n){if(!(e===void 0||t===void 0||i===void 0||n===void 0))return new ov(e,t,i,n)}constructor(e,t,i,n){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=i,this.charsRemoved=n}}var yW;(function(o){function e(t){const i=t?t("sgt"):VU("sgt");return i}o.newId=e})(yW||(yW={}));function Df(o){return o.toString()}class cn{static create(e,t){const i=e.getAlternativeVersionId(),n=ZN(e);return new cn(i,i,n,n,t,t,[])}constructor(e,t,i,n,s,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=s,this.afterCursorState=r,this.changes=a}append(e,t,i,n,s){t.length>0&&(this.changes=sde(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(ma(e,t?t.length:0,i),i+=4,t)for(const n of t)ma(e,n.selectionStartLineNumber,i),i+=4,ma(e,n.selectionStartColumn,i),i+=4,ma(e,n.positionLineNumber,i),i+=4,ma(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=pa(e,t);t+=4;for(let s=0;st.toString()).join(", ")}matchesResource(e){return(_e.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof cn}append(e,t,i,n,s){this._data instanceof cn&&this._data.append(e,t,i,n,s)}close(){this._data instanceof cn&&(this._data=this._data.serialize())}open(){this._data instanceof cn||(this._data=cn.deserialize(this._data))}undo(){if(_e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof cn&&(this._data=this._data.serialize());const e=cn.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(_e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof cn&&(this._data=this._data.serialize());const e=cn.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof cn&&(this._data=this._data.serialize()),this._data.byteLength+168}}class rde{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const s=Df(n.resource);this._editStackElementsMap.set(s,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Df(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Df(_e.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Df(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,s){const r=Df(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,s)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=Df(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Lr(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function ZN(o){return o.getEOL()===` +`?0:1}function bc(o){return o?o instanceof P$||o instanceof rde:!1}class m4{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);bc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);bc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(bc(i)&&i.canAppend(this._model))return i;const n=new P$(m(785,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],ZN(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n,s=jn.unknown({name:"pushEditOperation"})){const r=this._getOrCreateEditStackElement(e,n),a=this._model.applyEdits(t,!0,s),l=m4._computeCursorState(i,a),c=a.map((d,h)=>({index:h,textChange:d.textChange}));return c.sort((d,h)=>d.textChange.oldPosition===h.textChange.oldPosition?d.index-h.index:d.textChange.oldPosition-h.textChange.oldPosition),r.append(this._model,c.map(d=>d.textChange),ZN(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Ee(i),null}}}class ade{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function lde(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-10?n++:v>1&&s++,lde(r,a,_,w,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const x=h.spacesDiff;x<=c&&d[x]++,r=_,a=w}let u=t;n!==s&&(u=n{const _=d[p];_>f&&(f=_,g=p)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Fs(o){return(o.metadata&1)>>>0}function Vt(o,e){o.metadata=o.metadata&254|e<<0}function Hn(o){return(o.metadata&2)>>>1===1}function Ft(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function A$(o){return(o.metadata&4)>>>2===1}function LW(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function O$(o){return(o.metadata&64)>>>6===1}function kW(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function F$(o){return(o.metadata&128)>>>7===1}function DW(o,e){o.metadata=o.metadata&127|(e?1:0)<<7}function cde(o){return(o.metadata&24)>>>3}function IW(o,e){o.metadata=o.metadata&231|e<<3}function dde(o){return(o.metadata&32)>>>5===1}function EW(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class W${constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Vt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,LW(this,!1),kW(this,!1),IW(this,1),EW(this,!1),DW(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ft(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;LW(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),kW(this,this.options.glyphMarginClassName!==null),IW(this,this.options.stickiness),EW(this,this.options.collapseOnReplaceEdit),DW(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const je=new W$(null,0,0);je.parent=je;je.left=je;je.right=je;Vt(je,0);class nI{constructor(){this.root=je,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,r,a){return this.root===je?[]:bde(this,e,t,i,n,s,r,a)}search(e,t,i,n,s){return this.root===je?[]:_de(this,e,t,i,n,s)}collectNodesFromOwner(e){return pde(this,e)}collectNodesPostOrder(){return mde(this)}insert(e){NW(this,e),this._normalizeDeltaIfNecessary()}delete(e){TW(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const s=i.start+n,r=i.end+n;i.setCachedOffsets(s,r,t)}acceptReplace(e,t,i,n){const s=gde(this,e,e+t);for(let r=0,a=s.length;rt||i===1?!1:i===2?!0:e}function ude(o,e,t,i,n){const s=cde(o),r=s===0||s===2,a=s===1||s===2,l=t-e,c=i,d=Math.min(l,c),h=o.start;let u=!1;const g=o.end;let f=!1;e<=h&&g<=t&&dde(o)&&(o.start=e,u=!0,o.end=e,f=!0);{const _=n?1:l>0?2:0;!u&&If(h,r,e,_)&&(u=!0),!f&&If(g,a,e,_)&&(f=!0)}if(d>0&&!n){const _=l>c?2:0;!u&&If(h,r,e+d,_)&&(u=!0),!f&&If(g,a,e+d,_)&&(f=!0)}{const _=n?1:0;!u&&If(h,r,t,_)&&(o.start=e+c,u=!0),!f&&If(g,a,t,_)&&(o.end=e+c,f=!0)}const p=c-l;u||(o.start=Math.max(0,h+p)),f||(o.end=Math.max(0,g+p)),o.start>o.end&&(o.end=o.start)}function gde(o,e,t){let i=o.root,n=0,s=0,r=0,a=0;const l=[];let c=0;for(;i!==je;){if(Hn(i)){Ft(i.left,!1),Ft(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Hn(i.left)){if(s=n+i.maxEnd,st){Ft(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Ft(i,!0),i.right!==je&&!Hn(i.right)){n+=i.delta,i=i.right;continue}}return Ft(o.root,!1),l}function fde(o,e,t,i){let n=o.root,s=0,r=0,a=0;const l=i-(t-e);for(;n!==je;){if(Hn(n)){Ft(n.left,!1),Ft(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),kh(n),n=n.parent;continue}if(!Hn(n.left)){if(r=s+n.maxEnd,rt){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(o.requestNormalizeDelta=!0),Ft(n,!0);continue}if(Ft(n,!0),n.right!==je&&!Hn(n.right)){s+=n.delta,n=n.right;continue}}Ft(o.root,!1)}function pde(o,e){let t=o.root;const i=[];let n=0;for(;t!==je;){if(Hn(t)){Ft(t.left,!1),Ft(t.right,!1),t=t.parent;continue}if(t.left!==je&&!Hn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),Ft(t,!0),t.right!==je&&!Hn(t.right)){t=t.right;continue}}return Ft(o.root,!1),i}function mde(o){let e=o.root;const t=[];let i=0;for(;e!==je;){if(Hn(e)){Ft(e.left,!1),Ft(e.right,!1),e=e.parent;continue}if(e.left!==je&&!Hn(e.left)){e=e.left;continue}if(e.right!==je&&!Hn(e.right)){e=e.right;continue}t[i++]=e,Ft(e,!0)}return Ft(o.root,!1),t}function _de(o,e,t,i,n,s){let r=o.root,a=0,l=0,c=0;const d=[];let h=0;for(;r!==je;){if(Hn(r)){Ft(r.left,!1),Ft(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(r.left!==je&&!Hn(r.left)){r=r.left;continue}l=a+r.start,c=a+r.end,r.setCachedOffsets(l,c,n);let u=!0;if(e&&r.ownerId&&r.ownerId!==e&&(u=!1),t&&A$(r)&&(u=!1),i&&F$(r)&&(u=!1),s&&!O$(r)&&(u=!1),u&&(d[h++]=r),Ft(r,!0),r.right!==je&&!Hn(r.right)){a+=r.delta,r=r.right;continue}}return Ft(o.root,!1),d}function bde(o,e,t,i,n,s,r,a){let l=o.root,c=0,d=0,h=0,u=0;const g=[];let f=0;for(;l!==je;){if(Hn(l)){Ft(l.left,!1),Ft(l.right,!1),l===l.parent.right&&(c-=l.parent.delta),l=l.parent;continue}if(!Hn(l.left)){if(d=c+l.maxEnd,dt){Ft(l,!0);continue}if(u=c+l.end,u>=e){l.setCachedOffsets(h,u,r);let p=!0;i&&l.ownerId&&l.ownerId!==i&&(p=!1),n&&A$(l)&&(p=!1),s&&F$(l)&&(p=!1),a&&!O$(l)&&(p=!1),p&&(g[f++]=l)}if(Ft(l,!0),l.right!==je&&!Hn(l.right)){c+=l.delta,l=l.right;continue}}return Ft(o.root,!1),g}function NW(o,e){if(o.root===je)return e.parent=je,e.left=je,e.right=je,Vt(e,0),o.root=e,o.root;Cde(o,e),xd(e.parent);let t=e;for(;t!==o.root&&Fs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Fs(i)===1?(Vt(t.parent,0),Vt(i,0),Vt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,Pb(o,t)),Vt(t.parent,0),Vt(t.parent.parent,1),Ab(o,t.parent.parent))}else{const i=t.parent.parent.left;Fs(i)===1?(Vt(t.parent,0),Vt(i,0),Vt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,Ab(o,t)),Vt(t.parent,0),Vt(t.parent.parent,1),Pb(o,t.parent.parent))}return Vt(o.root,0),e}function Cde(o,e){let t=0,i=o.root;const n=e.start,s=e.end;for(;;)if(wde(n,s,i.start+t,i.end+t)<0)if(i.left===je){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===je){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=je,e.right=je,Vt(e,1)}function TW(o,e){let t,i;if(e.left===je?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===je?(t=e.left,i=e):(i=vde(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(o.requestNormalizeDelta=!0)),i===o.root){o.root=t,Vt(t,0),e.detach(),sI(),kh(t),o.root.parent=je;return}const n=Fs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Vt(i,Fs(e)),e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==je&&(i.left.parent=i),i.right!==je&&(i.right.parent=i)),e.detach(),n){xd(t.parent),i!==e&&(xd(i),xd(i.parent)),sI();return}xd(t),xd(t.parent),i!==e&&(xd(i),xd(i.parent));let s;for(;t!==o.root&&Fs(t)===0;)t===t.parent.left?(s=t.parent.right,Fs(s)===1&&(Vt(s,0),Vt(t.parent,1),Pb(o,t.parent),s=t.parent.right),Fs(s.left)===0&&Fs(s.right)===0?(Vt(s,1),t=t.parent):(Fs(s.right)===0&&(Vt(s.left,0),Vt(s,1),Ab(o,s),s=t.parent.right),Vt(s,Fs(t.parent)),Vt(t.parent,0),Vt(s.right,0),Pb(o,t.parent),t=o.root)):(s=t.parent.left,Fs(s)===1&&(Vt(s,0),Vt(t.parent,1),Ab(o,t.parent),s=t.parent.left),Fs(s.left)===0&&Fs(s.right)===0?(Vt(s,1),t=t.parent):(Fs(s.left)===0&&(Vt(s.right,0),Vt(s,1),Pb(o,s),s=t.parent.left),Vt(s,Fs(t.parent)),Vt(t.parent,0),Vt(s.left,0),Ab(o,t.parent),t=o.root));Vt(t,0),sI()}function vde(o){for(;o.left!==je;)o=o.left;return o}function sI(){je.parent=je,je.delta=0,je.start=0,je.end=0}function Pb(o,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==je&&(t.left.parent=e),t.parent=e.parent,e.parent===je?o.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,kh(e),kh(t)}function Ab(o,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(o.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==je&&(t.right.parent=e),t.parent=e.parent,e.parent===je?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,kh(e),kh(t)}function B$(o){let e=o.end;if(o.left!==je){const t=o.left.maxEnd;t>e&&(e=t)}if(o.right!==je){const t=o.right.maxEnd+o.delta;t>e&&(e=t)}return e}function kh(o){o.maxEnd=B$(o)}function xd(o){for(;o!==je;){const e=B$(o);if(o.maxEnd===e)return;o.maxEnd=e,o=o.parent}}function wde(o,e,t,i){return o===t?e-i:o-t}class YN{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Fe)return _4(this.right);let e=this;for(;e.parent!==Fe&&e.parent.left!==e;)e=e.parent;return e.parent===Fe?Fe:e.parent}prev(){if(this.left!==Fe)return H$(this.left);let e=this;for(;e.parent!==Fe&&e.parent.right!==e;)e=e.parent;return e.parent===Fe?Fe:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Fe=new YN(null,0);Fe.parent=Fe;Fe.left=Fe;Fe.right=Fe;Fe.color=0;function _4(o){for(;o.left!==Fe;)o=o.left;return o}function H$(o){for(;o.right!==Fe;)o=o.right;return o}function b4(o){return o===Fe?0:o.size_left+o.piece.length+b4(o.right)}function C4(o){return o===Fe?0:o.lf_left+o.piece.lineFeedCnt+C4(o.right)}function oI(){Fe.parent=Fe}function Ob(o,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Fe&&(t.left.parent=e),t.parent=e.parent,e.parent===Fe?o.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function Fb(o,e){const t=e.left;e.left=t.right,t.right!==Fe&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Fe?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function _1(o,e){let t,i;if(e.left===Fe?(i=e,t=i.right):e.right===Fe?(i=e,t=i.left):(i=_4(e.right),t=i.right),i===o.root){o.root=t,t.color=0,e.detach(),oI(),o.root.parent=Fe;return}const n=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,rb(o,t)):(i.parent===e?t.parent=i:t.parent=i.parent,rb(o,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Fe&&(i.left.parent=i),i.right!==Fe&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,rb(o,i)),e.detach(),t.parent.left===t){const r=b4(t),a=C4(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,rc(o,t.parent,l,c)}}if(rb(o,t.parent),n){oI();return}let s;for(;t!==o.root&&t.color===0;)t===t.parent.left?(s=t.parent.right,s.color===1&&(s.color=0,t.parent.color=1,Ob(o,t.parent),s=t.parent.right),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.right.color===0&&(s.left.color=0,s.color=1,Fb(o,s),s=t.parent.right),s.color=t.parent.color,t.parent.color=0,s.right.color=0,Ob(o,t.parent),t=o.root)):(s=t.parent.left,s.color===1&&(s.color=0,t.parent.color=1,Fb(o,t.parent),s=t.parent.left),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.left.color===0&&(s.right.color=0,s.color=1,Ob(o,s),s=t.parent.left),s.color=t.parent.color,t.parent.color=0,s.left.color=0,Fb(o,t.parent),t=o.root));t.color=0,oI()}function RW(o,e){for(rb(o,e);e!==o.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,Ob(o,e)),e.parent.color=0,e.parent.parent.color=1,Fb(o,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,Fb(o,e)),e.parent.color=0,e.parent.parent.color=1,Ob(o,e.parent.parent))}o.root.color=0}function rc(o,e,t,i){for(;e!==o.root&&e!==Fe;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function rb(o,e){let t=0,i=0;if(e!==o.root){for(;e!==o.root&&e===e.parent.right;)e=e.parent;if(e!==o.root)for(e=e.parent,t=b4(e.left)-e.size_left,i=C4(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==o.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const Sde=999;class du{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=V$(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=AV(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new bte(t,this.wordSeparators?kr(this.wordSeparators,[]):null,i?this.searchString:null)}}function V$(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function ku(o,e,t){if(!t)return new MC(o,null);const i=[];for(let n=0,s=e.length;n>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class b1{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new gp(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+g}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new L(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new MW(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=ku(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c=l))return s;return s}const d=new gp(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=ku(new L(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new gp(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new R(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new L(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new MW(l):null;i.reset(t.column-1);const d=i.next(l);return d?ku(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new R(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?ku(new L(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new gp(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new L(1,1,t.lineNumber,t.column),i,n,10*Sde);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new R(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=ku(new L(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function yde(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function xde(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function v4(o,e,t,i,n){return yde(o,e,t,i,n)&&xde(o,e,t,i,n)}class gp{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){b0(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||v4(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const Zl=65535;function z$(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class Lde{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function dc(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n126)&&(r=!1)}const a=new Lde(z$(o),i,n,s,r);return o.length=0,a}class to{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Du{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Dde{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Fe&&e.iterate(e.root,i=>(i!==Fe&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class Ide{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const s of i)s!==null&&n.push(s);this._cache=n}}}class Ede{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Du("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Fe,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let s=0,r=e.length;s0){e[s].lineStarts||(e[s].lineStarts=dc(e[s].buffer));const a=new to(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),n=this.rbInsertRight(n,a)}this._searchCache=new Ide(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Zl,i=t-Math.floor(t/3),n=i*2;let s="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=s.replace(/\r\n|\r|\n/g,e);a.push(new Du(l,dc(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Dde(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Fe;)if(n.left!==Fe&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const s=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=s+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Fe;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,s.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new R(i+1,a+1)}return new R(i+1,s.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Fe){const s=this.getOffsetAt(i+1,1),r=n-e-s;return new R(i+1,r+1)}else t=t.right;return new R(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),s=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?s.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==Fe;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,s=>{if(s===Fe)return!0;const r=s.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line;let u=c[d]+r.start.column;if(n&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(n=!0,i+=l.substr(u,a-1)):i+=l.substr(u,a),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,c[d+1]-this._EOLLength)):l.substring(u,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=d+1;gv+f,t.reset(0)):(C=u.buffer,w=v=>v,t.reset(f));do if(_=t.next(C),_){if(w(_.index)>=p)return d;this.positionInBuffer(e,w(_.index)-g,b);const v=this.getLineFeedCnt(e.piece.bufferIndex,s,b),S=b.line===s.line?b.column-s.column+n:b.column+1,x=S+_[0].length;if(h[d++]=ku(new L(i+v,S,i+v,x),_,l),w(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,n){const s=[];let r=0;const a=new gp(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const h=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,h,t,i,n,r,s),s;let u=e.startLineNumber,g=l.node;for(;g!==c.node;){const p=this.getLineFeedCnt(g.piece.bufferIndex,d,g.piece.end);if(p>=1){const b=this._buffers[g.piece.bufferIndex].lineStarts,C=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),w=b[d.line+p],v=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(g,a,u,v,d,this.positionInBuffer(g,w-C),t,i,n,r,s),r>=n)return s;u+=p}const _=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,_,r,s,i,n),s}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(_),u,_,r,s,i,n),r>=n)return s;u++,l=this.nodeAt2(u,1),g=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){const p=u===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(u).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,s,i,n),s}const f=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,u,f,d,h,t,i,n,r,s),s}_findMatchesInLine(e,t,i,n,s,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=i.length;let p=-g;for(;(p=i.indexOf(u,p+g))!==-1;)if((!d||v4(d,i,f,p,g))&&(a[r++]=new MC(new L(n,p+1+s,n,p+1+g+s),null),r>=c))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=ku(new L(n,h.index+1+s,n,h.index+1+h[0].length+s),h,l),r>=c))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Fe){const{node:n,remainder:s,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,c=this.positionInBuffer(n,s);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let h=new to(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,s)===10){const p={line:h.start.line+1,column:0};h=new to(h.bufferIndex,p,h.end,this.getLineFeedCnt(h.bufferIndex,p,h.end),h.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const p=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,p),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r=u)c=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tZl){const d=[];for(;e.length>Zl;){const u=e.charCodeAt(Zl-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,Zl-1),e=e.substring(Zl-1)):(g=e.substring(0,Zl),e=e.substring(Zl));const f=dc(g);d.push(new to(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Du(g,f))}const h=dc(e);return d.push(new to(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Du(e,h)),d}let t=this._buffers[0].buffer.length;const i=dc(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Fe;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Fe;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(r!==s)return{index:r,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-n,d=a-s,h=i.length+d;e.piece=new to(i.bufferIndex,i.start,r,l,h),rc(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-n,d=s-l,h=i.length+d;e.piece=new to(i.bufferIndex,r,i.end,a,h),rc(this,e,d,c)}shrinkNode(e,t,i){const n=e.piece,s=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,c=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,c),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new to(n.bufferIndex,n.start,c,d,h),rc(this,e,h-a,d-l);const u=new to(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),g=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=dc(t,!1);for(let g=0;ge)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Fe;)if(i.left!==Fe&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Fe;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Fe||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Fe||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new to(e.piece.bufferIndex,e.piece.start,s,a,r),rc(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new to(t.piece.bufferIndex,l,t.piece.end,d,c),rc(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r +`);this.rbInsertRight(e,h[0]);for(let u=0;u_.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((p,_)=>_.lineNumber-p.lineNumber),f=[];for(let p=0,_=h.length;p<_;p++){const b=h[p].lineNumber;if(p>0&&h[p-1].lineNumber===b)continue;const C=h[p].oldContent,w=this.getLineContent(b);w.length===0||w===C||vs(w)!==-1||f.push(b)}}return this._onDidChangeContent.fire(),new pne(u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new D(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,h,u]=qh(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(_m._sortOpsDescending);const t=[];for(let i=0;i0){const u=l.eolCount+1;u===1?h=new D(c,d,c,d+l.firstLineLength):h=new D(c,d,c+u-1,l.lastLineLength+1)}else h=new D(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=D.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=D.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Due{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;p_.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((p,_)=>_.lineNumber-p.lineNumber),f=[];for(let p=0,_=h.length;p<_;p++){const b=h[p].lineNumber;if(p>0&&h[p-1].lineNumber===b)continue;const C=h[p].oldContent,w=this.getLineContent(b);w.length===0||w===C||hs(w)!==-1||f.push(b)}}return this._onDidChangeContent.fire(),new Cte(u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new L(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,h,u]=Lh(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Vp._sortOpsDescending);const t=[];for(let i=0;i0){const u=l.eolCount+1;u===1?h=new L(c,d,c,d+l.firstLineLength):h=new L(c,d,c+u-1,l.lastLineLength+1)}else h=new L(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Nde{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Sue(this._tmpLineStarts,e);this.chunks.push(new Yu(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=zm(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=LU(e)))}finish(e=!0){return this._finish(),new Due(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Tc(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}function Er(o,e=en.ofCaller()){return typeof o=="string"?new hB(o,void 0,e):new hB(void 0,o,e)}class hB extends E_{get debugName(){return new Zn(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,i){super(i),this._debugName=e,this._owner=t}trigger(e,t){if(!e){At(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this._observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}class kue extends E_{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){ns()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{ns()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new T_(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(s,r)=>{},handlePossibleChange:s=>{}},this),this._updateCounter>1)for(const s of this._observers)s.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function SC(o,e,t=en.ofCaller()){return o.lazy?new kue(new Zn(o.owner,o.debugName,void 0),e,o.equalsFn??lr,t):new dv(new Zn(o.owner,o.debugName,void 0),e,o.equalsFn??lr,t)}class Iue{constructor(){this._onDidChangeVisibleRanges=new P,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=Er(this),this.visibleLineRanges=Un({owner:this,equalsFn:lv(v4())},e=>(this._viewsChanged.read(e),Ce.joinMany([...this._views].map(i=>i.state.read(e)?.visibleLineRanges??[]))))}attachView(){const e=new Nue(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}}class Eue{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e?!0:!(!Qt(this.visibleLineRanges,e.visibleLineRanges,(t,i)=>t.equals(i))||this.stabilized!==e.stabilized)}}class Nue{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=SC({owner:this,equalsFn:dg((t,i)=>t.equals(i))},void 0)}setVisibleLines(e,t){const i=e.map(s=>new Ce(s.startLineNumber,s.endLineNumber+1)),n=new Eue(i,t);this._state.set(n,void 0,void 0),this.handleStateChange(n)}}class Tue extends F{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new It(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Qt(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class Eq extends F{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}function Rue(o,e){const t=o.gotoNextSibling(),i=e.gotoNextSibling();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function Nq(o,e){const t=o.gotoParent(),i=e.gotoParent();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function Mue(o,e,t){const i=o.gotoFirstChild(),n=e.gotoFirstChild();if(i!==n)throw new Error("Trees are out of sync");if(t===0)return i&&n;for(let s=1;s<=t;s++){const r=o.gotoNextSibling(),a=e.gotoNextSibling();if(r!==a)throw new Error("Trees are out of sync");if(!r||!a)return!1}return i&&n}function uB(o,e){do{if(o.currentNode.nextSibling)return Rue(o,e);o.currentNode.parent&&Nq(o,e)}while(o.currentNode.nextSibling||o.currentNode.parent);return!1}function Pue(o,e){const t=e.walk();t.resetTo(o);const i=o.currentNode;do if(t.currentNode.previousSibling&&t.currentNode.endIndex-t.currentNode.startIndex!==0)t.gotoPreviousSibling();else{for(;!t.currentNode.previousSibling&&t.currentNode.parent;)t.gotoParent();t.gotoPreviousSibling()}while(t.currentNode.endIndex>i.startIndex&&(t.currentNode.parent||t.currentNode.previousSibling)&&t.currentNode.id!==i.id);if(t.currentNode.id!==i.id&&t.currentNode.endIndex<=i.startIndex)return t.currentNode}var Aue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gB=function(o,e){return function(t,i){e(t,i,o)}};let aR=class extends F{constructor(e,t,i,n,s,r,a){super(),this.languageId=e,this._ranges=t,this._parser=i,this._parserClass=n,this.textModel=s,this._logService=r,this._telemetryService=a,this._tree=Ee(this,void 0),this.tree=this._tree,this._treeLastParsedVersion=Ee(this,-1),this.treeLastParsedVersion=this._treeLastParsedVersion,this._onDidChangeContentQueue=new bee,this._tree=Ee(this,void 0),this.tree=this._tree,this._register(ge(()=>{this._tree.get()?.delete(),this._lastFullyParsed?.delete(),this._lastFullyParsedWithEdits?.delete(),this._parser.delete()})),this.handleContentChange(void 0,this._ranges)}handleContentChange(e,t){const i=this.textModel.getVersionId();let n=[];t&&(n=this._setRanges(t)),e&&this._applyEdits(e.changes),this._onDidChangeContentQueue.clearPending(),this._onDidChangeContentQueue.schedule(async()=>{if(this._store.isDisposed)return;const s=this._lastFullyParsed;let r;this._lastFullyParsedWithEdits&&this._lastFullyParsed&&(r=this._findChangedNodes(this._lastFullyParsedWithEdits,this._lastFullyParsed));const a=await this._parseAndUpdateTree(i);if(a){let l;r?s&&r&&(l=this._findTreeChanges(a,r,n)):this._ranges&&(l=this._ranges.map(d=>({newRange:new D(d.startPosition.row+1,d.startPosition.column+1,d.endPosition.row+1,d.endPosition.column+1),oldRangeLength:d.endIndex-d.startIndex,newRangeStartOffset:d.startIndex,newRangeEndOffset:d.endIndex}))),l||(l=[{newRange:this.textModel.getFullModelRange(),newRangeStartOffset:0,newRangeEndOffset:this.textModel.getValueLength()}]);const c=this._tree.get();At(d=>{this._tree.set(a,d,{ranges:l,versionId:i}),this._treeLastParsedVersion.set(i,d)}),c?.delete()}})}_applyEdits(e){for(const t of e){const i=di.ofRange(D.lift(t.range)),n=di.ofText(t.text),s=t.text.length===0?n:i.add(n),r={startIndex:t.rangeOffset,oldEndIndex:t.rangeOffset+t.rangeLength,newEndIndex:t.rangeOffset+t.text.length,startPosition:{row:t.range.startLineNumber-1,column:t.range.startColumn-1},oldEndPosition:{row:t.range.endLineNumber-1,column:t.range.endColumn-1},newEndPosition:{row:t.range.startLineNumber+s.lineCount-1,column:s.lineCount?s.columnCount:t.range.endColumn+s.columnCount}};this._tree.get()?.edit(r),this._lastFullyParsedWithEdits?.edit(r)}}_findChangedNodes(e,t){if(this._ranges&&this._ranges.every(a=>a.startPosition.row!==e.rootNode.startPosition.row)||e.rootNode.startPosition.row!==0)return[];const i=e.walk(),n=t.walk(),s=[];let r=!0;do if(i.currentNode.hasChanges){const a=i.currentNode.children,l=[],c=a.filter((d,h)=>d?.hasChanges||n.currentNode.children.length<=h?(l.push(h),!0):!1);if(c.length===0||i.currentNode.hasError!==n.currentNode.hasError){for(;i.currentNode.parent&&r&&!i.currentNode.isNamed;)r=Nq(i,n);const d=i.currentNode,h=Pue(i,e)??d;s.push({startIndex:h.startIndex,endIndex:d.endIndex,startPosition:h.startPosition,endPosition:d.endPosition}),r=uB(i,n)}else c.length>=1&&(r=Mue(i,n,l[0]))}else r=uB(i,n);while(r);return i.delete(),n.delete(),s}_findTreeChanges(e,t,i){let n=0;const s=[];for(let r=0;r0&&a.startIndex>=s[s.length-1].newRangeStartOffset&&a.endIndex<=s[s.length-1].newRangeEndOffset)continue;const l=e.walk(),c=()=>l.startIndexa.endIndex;for(;c();){let p=l.gotoFirstChild(),_=!1;for(;p;)if(c()&&l.currentNode.isNamed){_=!0;break}else p=l.gotoNextSibling();if(!_){l.gotoParent();break}if(l.currentNode.childCount===0)break}const d=l.currentNode.startPosition,h=l.currentNode.endPosition,u=l.currentNode.startIndex,g=l.currentNode.endIndex,f={newRange:new D(d.row+1,d.column+1,h.row+1,h.column+1),newRangeStartOffset:u,newRangeEndOffset:g};nf.newRangeEndOffset&&(f.newRange=f.newRange.setEndPosition(i[n].endPosition.row+1,i[n].endPosition.column+1),f.newRangeEndOffset=i[n].endIndex),n++):n0&&s[s.length-1].newRangeEndOffset>=f.newRangeStartOffset?(s[s.length-1].newRange=D.fromPositions(s[s.length-1].newRange.getStartPosition(),f.newRange.getEndPosition()),s[s.length-1].newRangeEndOffset=f.newRangeEndOffset):s.push(f)}return this._constrainRanges(s)}_constrainRanges(e){if(!this._ranges)return e;const t=[];let i=0,n=0;for(;ir.endIndex)n++;else{const a=Math.max(s.newRangeStartOffset,r.startIndex),l=Math.min(s.newRangeEndOffset,r.endIndex),c=s.newRange.intersectRanges(new D(r.startPosition.row+1,r.startPosition.column+1,r.endPosition.row+1,r.endPosition.column+1));t.push({newRange:c,newRangeEndOffset:l,newRangeStartOffset:a}),lthis._parseCallback(l),this._tree.get(),{progressCallback:r,includedRanges:this._ranges}),t+=performance.now()-a,i++,await new Promise(l=>jw(l))}while(!this._store.isDisposed&&!s&&n===this.textModel.getVersionId());return this._sendParseTimeTelemetry(e,t,i),s&&n===this.textModel.getVersionId()?s:void 0}_parseCallback(e){try{return this.textModel.getTextBuffer().getNearestChunk(e)}catch(t){this._logService.debug("Error getting chunk for tree-sitter parsing",t)}}_setRanges(e){const t=[];if(this._ranges)for(const i of e){let n=!1;for(let s=0;s50?(o=i,!0):!1}}function Fue(o,e){return o.startPosition.row===e.startPosition.row&&o.startPosition.column===e.startPosition.column&&o.endPosition.row===e.endPosition.row&&o.endPosition.column===e.endPosition.column&&o.startIndex===e.startIndex&&o.endIndex===e.endIndex}function fB(o,e){return o.startIndex<=e.startIndex&&o.endIndex>=e.startIndex||e.startIndex<=o.startIndex&&e.endIndex>=o.startIndex}const s_=new class{clone(){return this}equals(o){return this===o}};function MF(o,e){return new gF([new Tv(0,"",o)],e)}function JD(o,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(o<<0|0|0|32768|2<<24)>>>0,new GD(t,e===null?s_:e)}class Wue{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),s=this._store.slice(e+t),r=Bue(i,this._default);this._store=n.concat(r,s)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new Hue(e,[t]))}finalize(){return this._tokens}}class Vue{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new cR(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class zue extends Vue{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),r=gb(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=gb(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new Xt(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLinesAt(e,t){const i=this.getStartState(e);if(!i)return null;const n=this._textModel.getLanguageId(),s=[];let r=i;for(const a of t){const l=gb(this._languageIdCodec,n,this.tokenizationSupport,a,!0,r);s.push(new Xt(l.tokens,a,this._languageIdCodec)),r=l.endState}return s}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&r>=1;r--){const a=o.getLineFirstNonWhitespaceColumn(r);if(a!==0&&a0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class $ue{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new fe(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new fe(i.start,e):this._ranges.splice(t,1,new fe(i.start,e),new fe(e+1,i.endExclusive))}}addRange(e){fe.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function gb(o,e,t,i,n,s){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,s.clone())}catch(a){Te(a)}return r||(r=JD(o.encodeLanguageId(e),s)),Xt.convertToEndOffset(r.tokens,i.length),r}class jue{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,r4(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Ce(e,t))}}class tf{get children(){return this._children}get length(){return this._length}constructor(e){this.height=e,this._children=[],this._length=0}static create(e,t){const i=new tf(e.height+1);return i.appendChild(e),i.appendChild(t),i}canAppendChild(){return this._children.length<3}appendChild(e){if(!this.canAppendChild())throw new Error("Cannot insert more than 3 children in a ListNode");this._children.push(e),this._length+=e.length,this._updateParentLength(e.length),Es(e)||(e.parent=this)}_updateParentLength(e){let t=this.parent;for(;t;)t._length+=e,t=t.parent}unappendChild(){const e=this._children.pop();return this._length-=e.length,this._updateParentLength(-e.length),e}prependChild(e){if(this._children.length>=3)throw new Error("Cannot prepend more than 3 children in a ListNode");this._children.unshift(e),this._length+=e.length,this._updateParentLength(e.length),Es(e)||(e.parent=this)}unprependChild(){const e=this._children.shift();return this._length-=e.length,this._updateParentLength(-e.length),e}lastChild(){return this._children[this._children.length-1]}dispose(){this._children.splice(0,this._children.length)}}var Yo;(function(o){o[o.None=0]="None",o[o.ViewportGuess=1]="ViewportGuess",o[o.EditGuess=2]="EditGuess",o[o.Accurate=3]="Accurate"})(Yo||(Yo={}));function Es(o){return o.token!==void 0}function Rq(o,e){let t=o;const i=[];let n;for(;;){if(e.height===t.height){n=e;break}if(Es(t))throw new Error("unexpected");i.push(t),t=t.lastChild()}for(let s=i.length-1;s>=0;s--){const r=i[s];n&&(r.children.length>=3?n=tf.create(r.unappendChild(),n):(r.appendChild(n),n=void 0))}if(n){const s=new tf(n.height+1);return s.appendChild(o),s.appendChild(n),s}else return o}function que(o,e){let t=o;const i=[];for(;e.height!==t.height;){if(Es(t))throw new Error("unexpected");i.push(t),t=t.children[0]}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n&&(r.children.length>=3?n=tf.create(n,r.unprependChild()):(r.prependChild(n),n=void 0))}return n?tf.create(n,o):o}function Kue(o,e){return o.height===e.height?tf.create(o,e):o.height>e.height?Rq(o,e):que(e,o)}class Gue{constructor(e){this._textModel=e,this._root=this.createEmptyRoot()}createEmptyRoot(){return{length:this._textModel.getValueLength(),token:0,height:0,tokenQuality:Yo.None}}buildStore(e,t){this._root=this.createFromUpdates(e,t)}createFromUpdates(e,t){if(e.length===0)return this.createEmptyRoot();let i={length:e[0].length,token:e[0].token,height:0,tokenQuality:t};for(let n=1;n0;){const h=l.pop(),u=h.offset;if(u=s){Es(h.node)||(h.node.parent=void 0),a.push(h.node);continue}else if(Es(h.node)&&u+h.node.length>s){a.push({length:u+h.node.length-s,token:h.node.token,height:0,tokenQuality:h.node.tokenQuality});continue}if(!Es(h.node)){let g=u+h.node.length;for(let f=h.node.children.length-1;f>=0;f--)g-=h.node.children[f].length,l.push({node:h.node.children[f],offset:g})}}}let c;i.length>0?c=r.concat(this.createFromUpdates(i,n),a):c=r.concat(a);let d=c[0];for(let h=1;h0;){const{node:s,offset:r}=n.pop();if(!(r+s.length<=e||r>=t)){if(i(s,r))return;if(!Es(s)){let l=r+s.length;for(let c=s.children.length-1;c>=0;c--)l-=s.children[c].length,n.push({node:s.children[c],offset:l})}}}}getTokenAt(e){let t;return this.traverseInOrderInRange(e,this._root.length,(i,n)=>Es(i)?(t={token:i.token,startOffsetInclusive:n,length:i.length},!0):!1),t}getTokensInRange(e,t){const i=[];return this.traverseInOrderInRange(e,t,(n,s)=>{if(Es(n)){let r=n.length,a=s;st?(a=e,r=t-e):st&&(r-=s+n.length-t),i.push({token:n.token,startOffsetInclusive:a,length:r})}return!1}),i}markForRefresh(e,t){this.traverseInOrderInRange(e,t,i=>(Es(i)&&(i.tokenQuality=Yo.None),!1))}rangeHasTokens(e,t,i){let n=!0;return this.traverseInOrderInRange(e,t,s=>(Es(s)&&s.tokenQuality(Es(n)&&n.tokenQuality!==Yo.Accurate&&(i=!0),!1)),i}getNeedsRefresh(){const e=[];return this.traverseInOrderInRange(0,this._textModel.getValueLength(),(t,i)=>(Es(t)&&t.tokenQuality!==Yo.Accurate&&(e.length>0&&e[e.length-1].endOffset===i?e[e.length-1].endOffset+=t.length:e.push({startOffset:i,endOffset:i+t.length})),!1)),e}dispose(){const e=[[this._root,!1]];for(;e.length>0;){const[t,i]=e.pop();if(!Es(t))if(i)t.dispose(),t.parent=void 0;else{e.push([t,!0]);for(let n=t.children.length-1;n>=0;n--)e.push([t.children[n],!1])}}this._root=void 0}}const Zue=Ve("treeSitterThemeService");function Yue(o){return{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(const i in o)e.didChange(o[i])&&t.changes.push({key:i,change:e.change});return!0},beforeUpdate(e,t){for(const i in o){if(i==="changes")throw new ve('property name "changes" is reserved for change tracking');t[i]=o[i].read(e)}}}}function Xue(o){let e;return{createChangeSummary:t=>({changes:[]}),handleChange(t,i){e||(e=o());for(const n in e)t.didChange(e[n])&&i.changes.push({key:n,change:t.change});return!0},beforeUpdate(t,i){e||(e=o());for(const n in e){if(n==="changes")throw new ve('property name "changes" is reserved for change tracking');i[n]=e[n].read(t)}}}}var Que=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jue=function(o,e){return function(t,i){e(t,i,o)}};let dR=class extends F{get _textModel(){return this._tree.textModel}constructor(e,t,i,n,s){super(),this._tree=e,this._highlightingQueries=t,this._languageIdCodec=i,this._visibleLineRanges=n,this._treeSitterThemeService=s,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidCompleteBackgroundTokenization=this._register(new P),this.onDidChangeBackgroundTokenization=this._onDidCompleteBackgroundTokenization.event,this._encodedLanguageId=this._languageIdCodec.encodeLanguageId(this._tree.languageId),this._register(Ka(this._treeSitterThemeService.onChange,()=>{this._updateTheme()})),this._tokenStore=this._register(new Gue(this._textModel)),this._accurateVersion=this._textModel.getVersionId(),this._guessVersion=this._textModel.getVersionId(),this._tokenStore.buildStore(this._createEmptyTokens(),Yo.None),this._register(ke(r=>{const a=this._visibleLineRanges.read(r);this._parseAndTokenizeViewPort(a)})),this._register(N_({owner:this,changeTracker:Yue({tree:this._tree.tree})},(r,a)=>{const l=a.changes.at(0)?.change;if(a.changes.length>1)throw new ve("The tree changed twice in one transaction. This is currently not supported and should not happen.");if(!l)a.tree&&this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(r));else{if(this.hasTokens())for(const c of l.ranges)this._markForRefresh(c.newRange);this.hasTokens()?this._handleTreeUpdate(l.ranges,l.versionId):this._firstTreeUpdate(l.versionId)}}))}handleContentChanged(e){this._guessVersion=e.versionId;for(const t of e.changes)if(t.text.length>t.rangeLength){const i=t.rangeOffset>0?t.rangeOffset-1:t.rangeOffset,n=this._tokenStore.getTokenAt(i);let s;n?(s={startOffsetInclusive:n.startOffsetInclusive,length:n.length+t.text.length-t.rangeLength,token:n.token},this._tokenStore.markForRefresh(i,t.rangeOffset+(t.text.length>t.rangeLength?t.text.length:t.rangeLength))):s={startOffsetInclusive:i,length:t.text.length,token:0},this._tokenStore.update(n?.length??0,[s],Yo.EditGuess)}else if(t.text.length0?n.newTokens[n.newTokens.length-1]:void 0;let r;s&&this._guessVersion>=e?r=s.startOffsetInclusive+s.length-n.newTokens[0].startOffsetInclusive:n.oldRangeLength?r=n.oldRangeLength:r=0,this._tokenStore.update(r,n.newTokens,i)}}_markForRefresh(e){this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}_getNeedsRefresh(){const e=this._tokenStore.getNeedsRefresh();return e?e.map(t=>({range:D.fromPositions(this._textModel.getPositionAt(t.startOffset),this._textModel.getPositionAt(t.endOffset)),startOffset:t.startOffset,endOffset:t.endOffset})):[]}_parseAndTokenizeViewPort(e){const t=e.map(i=>i.toInclusiveRange()).filter(Cn);for(const i of t){const n=this._textModel.getOffsetAt(i.getStartPosition()),s=this._textModel.getOffsetAt(i.getEndPosition()),r=this._textModel.getVersionId();if(this._rangeHasTokens(i,Yo.ViewportGuess))continue;const a=this._textModel.getValueInRange(i),l=this._forceParseAndTokenizeContent(i,n,s,a,!0);if(!l||this._rangeHasTokens(i,Yo.ViewportGuess)||l.length===0)continue;const c=l[l.length-1],d=c.startOffsetInclusive+c.length-l[0].startOffsetInclusive;this._updateTokensInStore(r,[{newTokens:l,oldRangeLength:d}],Yo.ViewportGuess),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]}})}}_guessTokensForLinesContent(e,t){if(t.length===0)return;const i=t.join(this._textModel.getEOL()),n=new D(1,1,e+t.length,t[t.length-1].length+1),s=this._textModel.getOffsetAt({lineNumber:e,column:1}),r=this._forceParseAndTokenizeContent(n,s,s+i.length,i,!1);if(!r)return;const a=new Array(t.length);let l=0,c=0,d=0;for(let h=0;h{const n=i.toInclusiveRange();if(!n)return;const s=this._textModel.getOffsetAt(n.getStartPosition()),r=this._textModel.getOffsetAt(n.getEndPosition());return{newRange:n,newRangeEndOffset:r,newRangeStartOffset:s}}).filter(Cn);return this._handleTreeUpdate(t,e)}_handleTreeUpdate(e,t){const i=[];for(let r=0;r1e3){const l=e[r].newRange.endLineNumber;let c=e[r].newRange.startLineNumber,d=e[r].newRange.startColumn,h=c+1e3;do{const u=new R(c,d),g=h===e[r].newRange.endLineNumber?e[r].newRange.endColumn:this._textModel.getLineMaxColumn(h),f=new R(h,g),p=D.fromPositions(u,f);i.push({range:p,startOffset:this._textModel.getOffsetAt(p.getStartPosition()),endOffset:this._textModel.getOffsetAt(p.getEndPosition())}),c=h+1,d=1,hl?h=l:h=h+1e3}while(h<=l)}else if(r===0||i[r-1].endOffsetthis._getCaptures(r.range));return this._updateTreeForRanges(i,t,s).then(()=>{!this._textModel.isDisposed()&&this._tree.treeLastParsedVersion.get()===this._textModel.getVersionId()&&this._refreshNeedsRefresh(t)})}async _updateTreeForRanges(e,t,i){let n;for(let s=0;sjw(c))}this._onDidCompleteBackgroundTokenization.fire()}_refreshNeedsRefresh(e){const t=this._getNeedsRefresh();if(t.length===0)return;const i=new Array(t.length);for(let n=0;n({name:i.name,text:i.node.text,node:{startIndex:i.node.startIndex,endIndex:i.node.endIndex,startPosition:{lineNumber:i.node.startPosition.row+1,column:i.node.startPosition.column+1},endPosition:{lineNumber:i.node.endPosition.row+1,column:i.node.endPosition.column+1}},encodedLanguageId:this._encodedLanguageId})):[]}captureAtRangeWithInjections(e){const t=this.captureAtRange(e);for(let i=0;ie.startLineNumber&&se.startLineNumber&&re.endColumn?e.endColumn:l:r>e.endLineNumber?e.endColumn:l,g=new D(c,h,d,u),f=this._getInjectionCaptures(n,g);f&&f.length>0&&(t.splice(i+1,0,...f),i+=f.length)}return t}tokenizeEncoded(e){const t=this._tokenizeEncoded(e);if(!t)return;const i=this._rangeTokensAsUpdates(this._textModel.getOffsetAt({lineNumber:e,column:1}),t.result);t.versionId===this._textModel.getVersionId()&&this._updateTokensInStore(t.versionId,[{newTokens:i,oldRangeLength:this._textModel.getLineLength(e)}],Yo.Accurate)}_getCaptures(e){return this.captureAtRangeWithInjections(e)}_tokenize(e,t,i){const n=this._getCaptures(e),s=this._tokenizeCapturesWithMetadata(n,t,i);if(s)return{...s,versionId:this._tree.treeLastParsedVersion.get()}}_createTokensFromCaptures(e,t,i){const n=this._tree.tree.get(),s=fn.create(),r=i-t,a=this._languageIdCodec.encodeLanguageId(this._tree.languageId),l=ege[this._tree.languageId]||"source";if(e.length===0)return n?(s.stop(),{endOffsets:[{endOffset:r,scopes:[],encodedLanguageId:a}],captureTime:s.elapsed()}):void 0;const c=Array(e.length);c.fill({endOffset:0,scopes:[l],encodedLanguageId:a});let d=0;const h=()=>{c.push({endOffset:0,scopes:[l],encodedLanguageId:a})},u=(p,_)=>p.name.includes("punctuation")&&p.text?Array.from(p.text.matchAll(tge)).map(b=>_+b.index):void 0,g=(p,_,b,C)=>{if(C!==void 0){const w=c[C].scopes;let v=c[C].bracket;if((C>0?c[C-1].endOffset:0)!==_){let L;if(v&&v.length>0){L=[];const x=[];for(let k=0;kb&&x.push(I)}L.length===0&&(L=void 0),x.length===0?v=void 0:v=x}c.splice(C,0,{endOffset:_,scopes:[...w],bracket:L,encodedLanguageId:p.encodedLanguageId}),C++,h(),d++}c.splice(C,0,{endOffset:b,scopes:[...w,p.name],bracket:u(p,_),encodedLanguageId:p.encodedLanguageId}),c[d].bracket=v}else c[d]={endOffset:b,scopes:[l,p.name],bracket:u(p,_),encodedLanguageId:p.encodedLanguageId};d++};for(let p=0;p0?v=c[d-1].endOffset:v=C-t-1;const L=w-S;if(v>=0&&v=w){let x=d-1,k=c[x].endOffset,I=x>=2?c[x-1].endOffset:0;do{if(I+S===k){if(I===L){c[x].scopes.push(_.name);const T=c[x].bracket;c[x].bracket=T&&T.length>0?T:u(_,L)}}else if(I<=L){g(_,L,w,x);break}x--,I=x>=1?c[x-1].endOffset:0,k=x>=0?c[x].endOffset:0}while(k>L)}else g(_,L,w)}c[d-1].endOffset0&&(h(),c[d]={endOffset:r,scopes:c[d].scopes,encodedLanguageId:this._encodedLanguageId},d++);for(let p=0;p0,void 0)}const a=n.elapsed();return{endOffsetsAndMetadata:r,captureTime:s.captureTime,metadataTime:a}}_tokenizeEncoded(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=this._textModel.getLineCount(),n=e+1<=i?this._textModel.getOffsetAt({lineNumber:e+1,column:1}):this._textModel.getValueLength(),s=n-t,r=this._tokenize(new D(e,1,e,s+1),t,n);if(r)return{result:r.endOffsetsAndMetadata,captureTime:r.captureTime,metadataTime:r.metadataTime,versionId:r.versionId}}_endOffsetTokensToUint32Array(e){const t=new Uint32Array(e.length*2);for(let i=0;i\(\)]/g,PF=Ve("treeSitterLibraryService");class ige{constructor(e){this._value=Ee(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(At(i=>{this._value.set(new pB(t,void 0),i)}),t),t=>{throw At(i=>{this._value.set(new pB(void 0,t),i)}),t})}}class pB{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}var nge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mB=function(o,e){return function(t,i){e(t,i,o)}};let hR=class extends Eq{constructor(e,t,i,n,s,r){super(t,i),this._languageIdObs=e,this._treeSitterLibraryService=s,this._instantiationService=r,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new P),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event;const a=new ige(this._treeSitterLibraryService.getParserClass()),l=$(this,c=>a.promiseResult?.read(c)?.getDataOrThrow());this._tree=$(this,c=>{const d=l.read(c);if(!d)return;const h=this._languageIdObs.read(c),u=this._treeSitterLibraryService.getLanguage(h,!1,c);if(!u)return;const g=new d;if(c.store.add(ge(()=>{g.delete()})),g.setLanguage(u),this._treeSitterLibraryService.getInjectionQueries(h,c)!==void 0)return c.store.add(this._instantiationService.createInstance(aR,h,void 0,g,d,this._textModel))}),this._tokenizationImpl=$(this,c=>{const d=this._tree.read(c);if(!d)return;const h=this._treeSitterLibraryService.getHighlightingQueries(d.languageId,c);if(h)return c.store.add(this._instantiationService.createInstance(dR,d,h,this._languageIdCodec,n))}),this._register(ke(c=>{const d=this._tokenizationImpl.read(c);d&&(c.store.add(d.onDidChangeTokens(h=>{this._onDidChangeTokens.fire(h.changes)})),c.store.add(d.onDidChangeBackgroundTokenization(h=>{this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()})))}))}getLineTokens(e){const t=this._tokenizationImpl.get();if(!t){const i=this._textModel.getLineContent(e);return Xt.createEmpty(i,this._languageIdCodec)}return t.getLineTokens(e)}todo_resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}handleDidChangeAttached(){}handleDidChangeContent(e){e.isFlush?this.todo_resetTokenization(!1):this._tokenizationImpl.get()?.handleContentChanged(e),this._tree.get()?.handleContentChange(e)}forceTokenization(e){const t=this._tokenizationImpl.get();t&&(t.hasAccurateTokensForLine(e)||t.tokenizeEncoded(e))}hasAccurateTokensForLine(e){const t=this._tokenizationImpl.get();return t?t.hasAccurateTokensForLine(e):!1}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLinesAt(e,t){const i=this._tokenizationImpl.get();return i?i.tokenizeLinesAt(e,t):null}get hasTokens(){const e=this._tokenizationImpl.get();return e?e.hasTokens():!1}};hR=nge([mB(4,PF),mB(5,pe)],hR);class AF{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t,i=void 0){if(this._pieces=e||[],this._isComplete=t,i)for(const n of this._pieces)n.reportIfInvalid(i)}setPartial(e,t){let i=e;if(t.length>0){const s=t[0].getRange(),r=t[t.length-1].getRange();if(!s||!r)return e;i=e.plusRange(s).plusRange(r)}let n=null;for(let s=0,r=this._pieces.length;si.endLineNumber){n=n||{index:s};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(s,1),s--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:s};continue}const[l,c]=a.split(i);if(l.isEmpty()){n=n||{index:s};continue}c.isEmpty()||(this._pieces.splice(s,1,l,c),s++,r++,n=n||{index:s})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=oD(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getTextLength()===0)return t;const i=this._pieces;if(i.length===0)return t;const n=AF._findFirstPieceWithLine(i,e),s=i[n].getLineTokens(e);if(!s)return t;const r=t.getCount(),a=s.getCount();let l=0;const c=[];let d=0,h=0;const u=(g,f)=>{g!==h&&(h=g,c[d++]=g,c[d++]=f)};for(let g=0;g>>0,C=~b>>>0;for(;lt)n=s-1;else{for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}}return i}acceptEdit(e,t,i,n,s){for(let r=0;r>>1;if(t===0&&n[n.length-2]===i)return Rc;const r=Xt.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,l=n[r<<1];if(id&&(n[c++]=f,n[c++]=n[(g<<1)+1],d=f)}if(c===n.length)return e;const u=new Uint32Array(c);return u.set(n.subarray(0,c),0),u.buffer}static append(e,t){if(t===Rc)return e;if(e===Rc)return t;if(e===null)return e;if(t===null)return null;const i=$c(e),n=$c(t),s=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=Xt.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let n=null;if(t1&&(s=es.getLanguageId(n[1])!==e),!s)return Rc}if(!n||n.length===0){const s=new Uint32Array(2);return s[0]=t,s[1]=_B(e),s.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Sl.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Sl.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Sl.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Sl.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Sl.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,s=e.length;n>>0}class sge extends Eq{constructor(e,t,i,n){super(e,t),this.getLanguageId=i,this._tokenizer=null,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new P),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new _t),this._tokens=new $v(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new _t),this._attachedViewStates=this._register(new iD),this._register(bi.onDidChange(s=>{const r=this.getLanguageId();s.changedLanguages.indexOf(r)!==-1&&this.todo_resetTokenization()})),this.todo_resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:s,state:r})=>{if(r){let a=this._attachedViewStates.get(s);a||(a=new Tue(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(s,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(s)}))}todo_resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new cR(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=bi.get(this.getLanguageId());if(!s)return[null,null];let r;try{r=s.getInitialState()}catch(a){return Te(a),[null,null]}return[s,r]},[i,n]=t();if(i&&n?this._tokenizer=new zue(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const r=2;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const l=this._tokenizer.store.getFirstInvalidEndStateLineNumber();l!==null&&r>=l&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new jue(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new $v(this._languageIdCodec),this._debugBackgroundStates=new cR(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,n]=qh(t.text);this._tokens.acceptEdit(t.range,i,n),this._debugBackgroundTokens?.acceptEdit(t.range,i,n)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Ce.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new lR,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),s=this.setTokens(i.finalize());if(n)for(const r of s.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new lR;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new R(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLinesAt(e,t){return this._tokenizer?(this.forceTokenization(e),this._tokenizer.tokenizeLinesAt(e,t)):null}get hasTokens(){return this._tokens.hasTokens}}var oge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hS=function(o,e){return function(t,i){e(t,i,o)}},A0;let uR=A0=class extends qj{constructor(e,t,i,n,s,r,a,l){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=n,this._languageService=s,this._languageConfigurationService=r,this._instantiationService=a,this._treeSitterLibraryService=l,this._languageIdObs=Ee(this,this._languageId),this._useTreeSitter=$(this,d=>{const h=this._languageIdObs.read(d);return this._treeSitterLibraryService.supportsLanguage(h,d)}),this.tokens=$(this,d=>{let h;return this._useTreeSitter.read(d)?h=d.store.add(this._instantiationService.createInstance(hR,this._languageIdObs,this._languageService.languageIdCodec,this._textModel,this._attachedViews.visibleLineRanges)):h=d.store.add(new sge(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),d.store.add(h.onDidChangeTokens(u=>{this._emitModelTokensChangedEvent(u)})),d.store.add(h.onDidChangeBackgroundTokenizationState(u=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),h});let c=!1;this.tokens.recomputeInitiallyAndOnChange(this._store,d=>{c&&d.todo_resetTokenization(),c=!0}),this._semanticTokens=new AF(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new P),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new P),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,s]=qh(t.text);this._semanticTokens.acceptEdit(t.range,i,n,s,t.text.length>0?t.text.charCodeAt(0):0)}this.tokens.get().handleDidChangeContent(e)}handleDidChangeAttached(){this.tokens.get().handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.tokens.get().getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new ve("Illegal value for lineNumber")}get hasTokens(){return this.tokens.get().hasTokens}resetTokenization(){this.tokens.get().todo_resetTokenization()}get backgroundTokenizationState(){return this.tokens.get().backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.tokens.get().forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.tokens.get().hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.tokens.get().isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.tokens.get().tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.tokens.get().getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLinesAt(e,t){return this.tokens.get().tokenizeLinesAt(e,t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t,this._textModel),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),s=n.findTokenIndexAtOffset(t.column-1),[r,a]=A0._findLanguageBoundaries(n,s),l=bv(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(s>0&&r===t.column-1){const[c,d]=A0._findLanguageBoundaries(n,s-1),h=bv(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(c,d),c);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=e.getStartOffset(r);let s=e.getLineContent().length;for(let r=t,a=e.getCount();re.call(t,i,i,this))}[Symbol.iterator](){return this.values()}}var lge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uS=function(o,e){return function(t,i){e(t,i,o)}},Pu;function cge(o){const e=new Iq;return e.acceptChunk(o),e.finish()}function dge(o){const e=new Iq;let t;for(;typeof(t=o.read())=="string";)e.acceptChunk(t);return e.finish()}function vB(o,e){let t;return typeof o=="string"?t=cge(o):gne(o)?t=dge(o):t=o,t.create(e)}let gS=0;const hge=999,uge=1e4,gge=300;class fge{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const fb=()=>{throw new Error("Invalid change accessor")};let nf=class extends F{static{Pu=this}static{this._MODEL_SYNC_LIMIT=50*1024*1024}static{this.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024}static{this.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3}static{this.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024}static{this.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:zn.tabSize,indentSize:zn.indentSize,insertSpaces:zn.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:zn.trimAutoWhitespace,largeFileOptimizations:zn.largeFileOptimizations,bracketPairColorizationOptions:zn.bracketPairColorizationOptions}}static resolveOptions(e,t){if(t.detectIndentation){const i=tB(e,t.tabSize,t.insertSpaces);return new I0({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new I0(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}get onDidChangeOptions(){return this._onDidChangeOptions.event}get onDidChangeAttached(){return this._onDidChangeAttached.event}get onDidChangeLineHeight(){return this._onDidChangeLineHeight.event}get onDidChangeFont(){return this._onDidChangeFont.event}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return da(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,s,r,a,l){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this.instantiationService=l,this._onWillDispose=this._register(new P),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Cge((f,p,_)=>this.handleBeforeFireDecorationsChangedEvent(f,p,_))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new P),this._onDidChangeAttached=this._register(new P),this._onDidChangeInjectedText=this._register(new P),this._onDidChangeLineHeight=this._register(new P),this._onDidChangeFont=this._register(new P),this._eventEmitter=this._register(new vge),this._languageSelectionListener=this._register(new _t),this._deltaDecorationCallCnt=0,this._attachedViews=new Iue,gS++,this.id="$model"+gS,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=be.parse("inmemory://model/"+gS):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:d}=vB(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=d;const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new D(1,1,h,this._buffer.getLineLength(h)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>Pu.LARGE_FILE_SIZE_THRESHOLD||h>Pu.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>Pu.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._options=Pu.resolveOptions(this._buffer,i);const g=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Xhe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Mce(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Jhe(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(uR,this,this._bracketPairs,g,this._attachedViews),this._isTooLargeForSyncing=u>Pu._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=xU(gS),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new wB,this._commandManager=new IF(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(g),this._register(this._languageConfigurationService.onDidChange(f=>{this._bracketPairs.handleLanguageConfigurationServiceChange(f),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(f)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new _m([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=F.None}_assertNotDisposed(){if(this._isDisposed)throw new ve("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Mg(e,t)))}setValue(e,t=Jn.setValue()){if(this._assertNotDisposed(),e==null)throw Rr();const{textBuffer:i,disposable:n}=vB(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,s,r,a,l,c,d){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:r,isRedoing:a,isFlush:l,detailedReasons:[d],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();const n=this.getFullModelRange(),s=this.getValueLengthInRange(n),r=this.getLineCount(),a=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new wB,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new fm([new Che],this._versionId,!1,!1),this._createContentChanged2(new D(1,1,r,a),0,s,new R(r,a),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=kde(this._tmpLineStarts,e);this.chunks.push(new Du(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=um(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=BV(e)))}finish(e=!0){return this._finish(),new Nde(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=dc(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}function pr(o,e=qi.ofCaller()){return typeof o=="string"?new PW(o,void 0,e):new PW(void 0,o,e)}class PW extends Jm{get debugName(){return new Vn(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,i){super(i),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Et(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this._observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}class Tde extends Jm{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){Zn()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{Zn()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new t_(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(s,r)=>{},handlePossibleChange:s=>{}},this),this._updateCounter>1)for(const s of this._observers)s.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function Wb(o,e,t=qi.ofCaller()){return o.lazy?new Tde(new Vn(o.owner,o.debugName,void 0),e,o.equalsFn??Go,t):new kC(new Vn(o.owner,o.debugName,void 0),e,o.equalsFn??Go,t)}class Rde{constructor(){this._onDidChangeVisibleRanges=new P,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=pr(this),this.visibleLineRanges=An({owner:this,equalsFn:xC(lO())},e=>(this._viewsChanged.read(e),be.joinMany([...this._views].map(i=>i.state.read(e)?.visibleLineRanges??[]))))}attachView(){const e=new Pde(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}}class Mde{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e?!0:!(!jt(this.visibleLineRanges,e.visibleLineRanges,(t,i)=>t.equals(i))||this.stabilized!==e.stabilized)}}class Pde{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=Wb({owner:this,equalsFn:Vu((t,i)=>t.equals(i))},void 0)}setVisibleLines(e,t){const i=e.map(s=>new be(s.startLineNumber,s.endLineNumber+1)),n=new Mde(i,t);this._state.set(n,void 0,void 0),this.handleStateChange(n)}}class Ade extends A{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new St(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){jt(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class $$ extends A{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}function Ode(o,e){const t=o.gotoNextSibling(),i=e.gotoNextSibling();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function j$(o,e){const t=o.gotoParent(),i=e.gotoParent();if(t!==i)throw new Error("Trees are out of sync");return t&&i}function Fde(o,e,t){const i=o.gotoFirstChild(),n=e.gotoFirstChild();if(i!==n)throw new Error("Trees are out of sync");if(t===0)return i&&n;for(let s=1;s<=t;s++){const r=o.gotoNextSibling(),a=e.gotoNextSibling();if(r!==a)throw new Error("Trees are out of sync");if(!r||!a)return!1}return i&&n}function AW(o,e){do{if(o.currentNode.nextSibling)return Ode(o,e);o.currentNode.parent&&j$(o,e)}while(o.currentNode.nextSibling||o.currentNode.parent);return!1}function Wde(o,e){const t=e.walk();t.resetTo(o);const i=o.currentNode;do if(t.currentNode.previousSibling&&t.currentNode.endIndex-t.currentNode.startIndex!==0)t.gotoPreviousSibling();else{for(;!t.currentNode.previousSibling&&t.currentNode.parent;)t.gotoParent();t.gotoPreviousSibling()}while(t.currentNode.endIndex>i.startIndex&&(t.currentNode.parent||t.currentNode.previousSibling)&&t.currentNode.id!==i.id);if(t.currentNode.id!==i.id&&t.currentNode.endIndex<=i.startIndex)return t.currentNode}var Bde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},OW=function(o,e){return function(t,i){e(t,i,o)}};let XN=class extends A{constructor(e,t,i,n,s,r,a){super(),this.languageId=e,this._ranges=t,this._parser=i,this._parserClass=n,this.textModel=s,this._logService=r,this._telemetryService=a,this._tree=De(this,void 0),this.tree=this._tree,this._treeLastParsedVersion=De(this,-1),this.treeLastParsedVersion=this._treeLastParsedVersion,this._onDidChangeContentQueue=new SQ,this._tree=De(this,void 0),this.tree=this._tree,this._register(ue(()=>{this._tree.get()?.delete(),this._lastFullyParsed?.delete(),this._lastFullyParsedWithEdits?.delete(),this._parser.delete()})),this.handleContentChange(void 0,this._ranges)}handleContentChange(e,t){const i=this.textModel.getVersionId();let n=[];t&&(n=this._setRanges(t)),e&&this._applyEdits(e.changes),this._onDidChangeContentQueue.clearPending(),this._onDidChangeContentQueue.schedule(async()=>{if(this._store.isDisposed)return;const s=this._lastFullyParsed;let r;this._lastFullyParsedWithEdits&&this._lastFullyParsed&&(r=this._findChangedNodes(this._lastFullyParsedWithEdits,this._lastFullyParsed));const a=await this._parseAndUpdateTree(i);if(a){let l;r?s&&r&&(l=this._findTreeChanges(a,r,n)):this._ranges&&(l=this._ranges.map(d=>({newRange:new L(d.startPosition.row+1,d.startPosition.column+1,d.endPosition.row+1,d.endPosition.column+1),oldRangeLength:d.endIndex-d.startIndex,newRangeStartOffset:d.startIndex,newRangeEndOffset:d.endIndex}))),l||(l=[{newRange:this.textModel.getFullModelRange(),newRangeStartOffset:0,newRangeEndOffset:this.textModel.getValueLength()}]);const c=this._tree.get();Et(d=>{this._tree.set(a,d,{ranges:l,versionId:i}),this._treeLastParsedVersion.set(i,d)}),c?.delete()}})}_applyEdits(e){for(const t of e){const i=si.ofRange(L.lift(t.range)),n=si.ofText(t.text),s=t.text.length===0?n:i.add(n),r={startIndex:t.rangeOffset,oldEndIndex:t.rangeOffset+t.rangeLength,newEndIndex:t.rangeOffset+t.text.length,startPosition:{row:t.range.startLineNumber-1,column:t.range.startColumn-1},oldEndPosition:{row:t.range.endLineNumber-1,column:t.range.endColumn-1},newEndPosition:{row:t.range.startLineNumber+s.lineCount-1,column:s.lineCount?s.columnCount:t.range.endColumn+s.columnCount}};this._tree.get()?.edit(r),this._lastFullyParsedWithEdits?.edit(r)}}_findChangedNodes(e,t){if(this._ranges&&this._ranges.every(a=>a.startPosition.row!==e.rootNode.startPosition.row)||e.rootNode.startPosition.row!==0)return[];const i=e.walk(),n=t.walk(),s=[];let r=!0;do if(i.currentNode.hasChanges){const a=i.currentNode.children,l=[],c=a.filter((d,h)=>d?.hasChanges||n.currentNode.children.length<=h?(l.push(h),!0):!1);if(c.length===0||i.currentNode.hasError!==n.currentNode.hasError){for(;i.currentNode.parent&&r&&!i.currentNode.isNamed;)r=j$(i,n);const d=i.currentNode,h=Wde(i,e)??d;s.push({startIndex:h.startIndex,endIndex:d.endIndex,startPosition:h.startPosition,endPosition:d.endPosition}),r=AW(i,n)}else c.length>=1&&(r=Fde(i,n,l[0]))}else r=AW(i,n);while(r);return i.delete(),n.delete(),s}_findTreeChanges(e,t,i){let n=0;const s=[];for(let r=0;r0&&a.startIndex>=s[s.length-1].newRangeStartOffset&&a.endIndex<=s[s.length-1].newRangeEndOffset)continue;const l=e.walk(),c=()=>l.startIndexa.endIndex;for(;c();){let p=l.gotoFirstChild(),_=!1;for(;p;)if(c()&&l.currentNode.isNamed){_=!0;break}else p=l.gotoNextSibling();if(!_){l.gotoParent();break}if(l.currentNode.childCount===0)break}const d=l.currentNode.startPosition,h=l.currentNode.endPosition,u=l.currentNode.startIndex,g=l.currentNode.endIndex,f={newRange:new L(d.row+1,d.column+1,h.row+1,h.column+1),newRangeStartOffset:u,newRangeEndOffset:g};nf.newRangeEndOffset&&(f.newRange=f.newRange.setEndPosition(i[n].endPosition.row+1,i[n].endPosition.column+1),f.newRangeEndOffset=i[n].endIndex),n++):n0&&s[s.length-1].newRangeEndOffset>=f.newRangeStartOffset?(s[s.length-1].newRange=L.fromPositions(s[s.length-1].newRange.getStartPosition(),f.newRange.getEndPosition()),s[s.length-1].newRangeEndOffset=f.newRangeEndOffset):s.push(f)}return this._constrainRanges(s)}_constrainRanges(e){if(!this._ranges)return e;const t=[];let i=0,n=0;for(;ir.endIndex)n++;else{const a=Math.max(s.newRangeStartOffset,r.startIndex),l=Math.min(s.newRangeEndOffset,r.endIndex),c=s.newRange.intersectRanges(new L(r.startPosition.row+1,r.startPosition.column+1,r.endPosition.row+1,r.endPosition.column+1));t.push({newRange:c,newRangeEndOffset:l,newRangeStartOffset:a}),lthis._parseCallback(l),this._tree.get(),{progressCallback:r,includedRanges:this._ranges}),t+=performance.now()-a,i++,await new Promise(l=>aw(l))}while(!this._store.isDisposed&&!s&&n===this.textModel.getVersionId());return this._sendParseTimeTelemetry(e,t,i),s&&n===this.textModel.getVersionId()?s:void 0}_parseCallback(e){try{return this.textModel.getTextBuffer().getNearestChunk(e)}catch(t){this._logService.debug("Error getting chunk for tree-sitter parsing",t)}}_setRanges(e){const t=[];if(this._ranges)for(const i of e){let n=!1;for(let s=0;s50?(o=i,!0):!1}}function Vde(o,e){return o.startPosition.row===e.startPosition.row&&o.startPosition.column===e.startPosition.column&&o.endPosition.row===e.endPosition.row&&o.endPosition.column===e.endPosition.column&&o.startIndex===e.startIndex&&o.endIndex===e.endIndex}function FW(o,e){return o.startIndex<=e.startIndex&&o.endIndex>=e.startIndex||e.startIndex<=o.startIndex&&e.endIndex>=o.startIndex}const Im=new class{clone(){return this}equals(o){return this===o}};function w4(o,e){return new t4([new KC(0,"",o)],e)}function sk(o,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(o<<0|0|0|32768|2<<24)>>>0,new JL(t,e===null?Im:e)}class zde{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),s=this._store.slice(e+t),r=Ude(i,this._default);this._store=n.concat(r,s)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new $de(e,[t]))}finalize(){return this._tokens}}class jde{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new JN(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class qde extends jde{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),r=P_(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=P_(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new $t(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLinesAt(e,t){const i=this.getStartState(e);if(!i)return null;const n=this._textModel.getLanguageId(),s=[];let r=i;for(const a of t){const l=P_(this._languageIdCodec,n,this.tokenizationSupport,a,!0,r);s.push(new $t(l.tokens,a,this._languageIdCodec)),r=l.endState}return s}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&r>=1;r--){const a=o.getLineFirstNonWhitespaceColumn(r);if(a!==0&&a0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class Gde{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new ge(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new ge(i.start,e):this._ranges.splice(t,1,new ge(i.start,e),new ge(e+1,i.endExclusive))}}addRange(e){ge.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function P_(o,e,t,i,n,s){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,s.clone())}catch(a){Ee(a)}return r||(r=sk(o.encodeLanguageId(e),s)),$t.convertToEndOffset(r.tokens,i.length),r}class Zde{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,GA(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new be(e,t))}}class Rg{get children(){return this._children}get length(){return this._length}constructor(e){this.height=e,this._children=[],this._length=0}static create(e,t){const i=new Rg(e.height+1);return i.appendChild(e),i.appendChild(t),i}canAppendChild(){return this._children.length<3}appendChild(e){if(!this.canAppendChild())throw new Error("Cannot insert more than 3 children in a ListNode");this._children.push(e),this._length+=e.length,this._updateParentLength(e.length),Cs(e)||(e.parent=this)}_updateParentLength(e){let t=this.parent;for(;t;)t._length+=e,t=t.parent}unappendChild(){const e=this._children.pop();return this._length-=e.length,this._updateParentLength(-e.length),e}prependChild(e){if(this._children.length>=3)throw new Error("Cannot prepend more than 3 children in a ListNode");this._children.unshift(e),this._length+=e.length,this._updateParentLength(e.length),Cs(e)||(e.parent=this)}unprependChild(){const e=this._children.shift();return this._length-=e.length,this._updateParentLength(-e.length),e}lastChild(){return this._children[this._children.length-1]}dispose(){this._children.splice(0,this._children.length)}}var Oo;(function(o){o[o.None=0]="None",o[o.ViewportGuess=1]="ViewportGuess",o[o.EditGuess=2]="EditGuess",o[o.Accurate=3]="Accurate"})(Oo||(Oo={}));function Cs(o){return o.token!==void 0}function K$(o,e){let t=o;const i=[];let n;for(;;){if(e.height===t.height){n=e;break}if(Cs(t))throw new Error("unexpected");i.push(t),t=t.lastChild()}for(let s=i.length-1;s>=0;s--){const r=i[s];n&&(r.children.length>=3?n=Rg.create(r.unappendChild(),n):(r.appendChild(n),n=void 0))}if(n){const s=new Rg(n.height+1);return s.appendChild(o),s.appendChild(n),s}else return o}function Yde(o,e){let t=o;const i=[];for(;e.height!==t.height;){if(Cs(t))throw new Error("unexpected");i.push(t),t=t.children[0]}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n&&(r.children.length>=3?n=Rg.create(n,r.unprependChild()):(r.prependChild(n),n=void 0))}return n?Rg.create(n,o):o}function Xde(o,e){return o.height===e.height?Rg.create(o,e):o.height>e.height?K$(o,e):Yde(e,o)}class Qde{constructor(e){this._textModel=e,this._root=this.createEmptyRoot()}createEmptyRoot(){return{length:this._textModel.getValueLength(),token:0,height:0,tokenQuality:Oo.None}}buildStore(e,t){this._root=this.createFromUpdates(e,t)}createFromUpdates(e,t){if(e.length===0)return this.createEmptyRoot();let i={length:e[0].length,token:e[0].token,height:0,tokenQuality:t};for(let n=1;n0;){const h=l.pop(),u=h.offset;if(u=s){Cs(h.node)||(h.node.parent=void 0),a.push(h.node);continue}else if(Cs(h.node)&&u+h.node.length>s){a.push({length:u+h.node.length-s,token:h.node.token,height:0,tokenQuality:h.node.tokenQuality});continue}if(!Cs(h.node)){let g=u+h.node.length;for(let f=h.node.children.length-1;f>=0;f--)g-=h.node.children[f].length,l.push({node:h.node.children[f],offset:g})}}}let c;i.length>0?c=r.concat(this.createFromUpdates(i,n),a):c=r.concat(a);let d=c[0];for(let h=1;h0;){const{node:s,offset:r}=n.pop();if(!(r+s.length<=e||r>=t)){if(i(s,r))return;if(!Cs(s)){let l=r+s.length;for(let c=s.children.length-1;c>=0;c--)l-=s.children[c].length,n.push({node:s.children[c],offset:l})}}}}getTokenAt(e){let t;return this.traverseInOrderInRange(e,this._root.length,(i,n)=>Cs(i)?(t={token:i.token,startOffsetInclusive:n,length:i.length},!0):!1),t}getTokensInRange(e,t){const i=[];return this.traverseInOrderInRange(e,t,(n,s)=>{if(Cs(n)){let r=n.length,a=s;st?(a=e,r=t-e):st&&(r-=s+n.length-t),i.push({token:n.token,startOffsetInclusive:a,length:r})}return!1}),i}markForRefresh(e,t){this.traverseInOrderInRange(e,t,i=>(Cs(i)&&(i.tokenQuality=Oo.None),!1))}rangeHasTokens(e,t,i){let n=!0;return this.traverseInOrderInRange(e,t,s=>(Cs(s)&&s.tokenQuality(Cs(n)&&n.tokenQuality!==Oo.Accurate&&(i=!0),!1)),i}getNeedsRefresh(){const e=[];return this.traverseInOrderInRange(0,this._textModel.getValueLength(),(t,i)=>(Cs(t)&&t.tokenQuality!==Oo.Accurate&&(e.length>0&&e[e.length-1].endOffset===i?e[e.length-1].endOffset+=t.length:e.push({startOffset:i,endOffset:i+t.length})),!1)),e}dispose(){const e=[[this._root,!1]];for(;e.length>0;){const[t,i]=e.pop();if(!Cs(t))if(i)t.dispose(),t.parent=void 0;else{e.push([t,!0]);for(let n=t.children.length-1;n>=0;n--)e.push([t.children[n],!1])}}this._root=void 0}}const Jde=We("treeSitterThemeService");function ehe(o){return{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(const i in o)e.didChange(o[i])&&t.changes.push({key:i,change:e.change});return!0},beforeUpdate(e,t){for(const i in o){if(i==="changes")throw new Ce('property name "changes" is reserved for change tracking');t[i]=o[i].read(e)}}}}function the(o){let e;return{createChangeSummary:t=>({changes:[]}),handleChange(t,i){e||(e=o());for(const n in e)t.didChange(e[n])&&i.changes.push({key:n,change:t.change});return!0},beforeUpdate(t,i){e||(e=o());for(const n in e){if(n==="changes")throw new Ce('property name "changes" is reserved for change tracking');i[n]=e[n].read(t)}}}}var ihe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nhe=function(o,e){return function(t,i){e(t,i,o)}};let eT=class extends A{get _textModel(){return this._tree.textModel}constructor(e,t,i,n,s){super(),this._tree=e,this._highlightingQueries=t,this._languageIdCodec=i,this._visibleLineRanges=n,this._treeSitterThemeService=s,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidCompleteBackgroundTokenization=this._register(new P),this.onDidChangeBackgroundTokenization=this._onDidCompleteBackgroundTokenization.event,this._encodedLanguageId=this._languageIdCodec.encodeLanguageId(this._tree.languageId),this._register(Ta(this._treeSitterThemeService.onChange,()=>{this._updateTheme()})),this._tokenStore=this._register(new Qde(this._textModel)),this._accurateVersion=this._textModel.getVersionId(),this._guessVersion=this._textModel.getVersionId(),this._tokenStore.buildStore(this._createEmptyTokens(),Oo.None),this._register(xe(r=>{const a=this._visibleLineRanges.read(r);this._parseAndTokenizeViewPort(a)})),this._register(e_({owner:this,changeTracker:ehe({tree:this._tree.tree})},(r,a)=>{const l=a.changes.at(0)?.change;if(a.changes.length>1)throw new Ce("The tree changed twice in one transaction. This is currently not supported and should not happen.");if(!l)a.tree&&this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(r));else{if(this.hasTokens())for(const c of l.ranges)this._markForRefresh(c.newRange);this.hasTokens()?this._handleTreeUpdate(l.ranges,l.versionId):this._firstTreeUpdate(l.versionId)}}))}handleContentChanged(e){this._guessVersion=e.versionId;for(const t of e.changes)if(t.text.length>t.rangeLength){const i=t.rangeOffset>0?t.rangeOffset-1:t.rangeOffset,n=this._tokenStore.getTokenAt(i);let s;n?(s={startOffsetInclusive:n.startOffsetInclusive,length:n.length+t.text.length-t.rangeLength,token:n.token},this._tokenStore.markForRefresh(i,t.rangeOffset+(t.text.length>t.rangeLength?t.text.length:t.rangeLength))):s={startOffsetInclusive:i,length:t.text.length,token:0},this._tokenStore.update(n?.length??0,[s],Oo.EditGuess)}else if(t.text.length0?n.newTokens[n.newTokens.length-1]:void 0;let r;s&&this._guessVersion>=e?r=s.startOffsetInclusive+s.length-n.newTokens[0].startOffsetInclusive:n.oldRangeLength?r=n.oldRangeLength:r=0,this._tokenStore.update(r,n.newTokens,i)}}_markForRefresh(e){this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}_getNeedsRefresh(){const e=this._tokenStore.getNeedsRefresh();return e?e.map(t=>({range:L.fromPositions(this._textModel.getPositionAt(t.startOffset),this._textModel.getPositionAt(t.endOffset)),startOffset:t.startOffset,endOffset:t.endOffset})):[]}_parseAndTokenizeViewPort(e){const t=e.map(i=>i.toInclusiveRange()).filter(hn);for(const i of t){const n=this._textModel.getOffsetAt(i.getStartPosition()),s=this._textModel.getOffsetAt(i.getEndPosition()),r=this._textModel.getVersionId();if(this._rangeHasTokens(i,Oo.ViewportGuess))continue;const a=this._textModel.getValueInRange(i),l=this._forceParseAndTokenizeContent(i,n,s,a,!0);if(!l||this._rangeHasTokens(i,Oo.ViewportGuess)||l.length===0)continue;const c=l[l.length-1],d=c.startOffsetInclusive+c.length-l[0].startOffsetInclusive;this._updateTokensInStore(r,[{newTokens:l,oldRangeLength:d}],Oo.ViewportGuess),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]}})}}_guessTokensForLinesContent(e,t){if(t.length===0)return;const i=t.join(this._textModel.getEOL()),n=new L(1,1,e+t.length,t[t.length-1].length+1),s=this._textModel.getOffsetAt({lineNumber:e,column:1}),r=this._forceParseAndTokenizeContent(n,s,s+i.length,i,!1);if(!r)return;const a=new Array(t.length);let l=0,c=0,d=0;for(let h=0;h{const n=i.toInclusiveRange();if(!n)return;const s=this._textModel.getOffsetAt(n.getStartPosition()),r=this._textModel.getOffsetAt(n.getEndPosition());return{newRange:n,newRangeEndOffset:r,newRangeStartOffset:s}}).filter(hn);return this._handleTreeUpdate(t,e)}_handleTreeUpdate(e,t){const i=[];for(let r=0;r1e3){const l=e[r].newRange.endLineNumber;let c=e[r].newRange.startLineNumber,d=e[r].newRange.startColumn,h=c+1e3;do{const u=new R(c,d),g=h===e[r].newRange.endLineNumber?e[r].newRange.endColumn:this._textModel.getLineMaxColumn(h),f=new R(h,g),p=L.fromPositions(u,f);i.push({range:p,startOffset:this._textModel.getOffsetAt(p.getStartPosition()),endOffset:this._textModel.getOffsetAt(p.getEndPosition())}),c=h+1,d=1,hl?h=l:h=h+1e3}while(h<=l)}else if(r===0||i[r-1].endOffsetthis._getCaptures(r.range));return this._updateTreeForRanges(i,t,s).then(()=>{!this._textModel.isDisposed()&&this._tree.treeLastParsedVersion.get()===this._textModel.getVersionId()&&this._refreshNeedsRefresh(t)})}async _updateTreeForRanges(e,t,i){let n;for(let s=0;saw(c))}this._onDidCompleteBackgroundTokenization.fire()}_refreshNeedsRefresh(e){const t=this._getNeedsRefresh();if(t.length===0)return;const i=new Array(t.length);for(let n=0;n({name:i.name,text:i.node.text,node:{startIndex:i.node.startIndex,endIndex:i.node.endIndex,startPosition:{lineNumber:i.node.startPosition.row+1,column:i.node.startPosition.column+1},endPosition:{lineNumber:i.node.endPosition.row+1,column:i.node.endPosition.column+1}},encodedLanguageId:this._encodedLanguageId})):[]}captureAtRangeWithInjections(e){const t=this.captureAtRange(e);for(let i=0;ie.startLineNumber&&se.startLineNumber&&re.endColumn?e.endColumn:l:r>e.endLineNumber?e.endColumn:l,g=new L(c,h,d,u),f=this._getInjectionCaptures(n,g);f&&f.length>0&&(t.splice(i+1,0,...f),i+=f.length)}return t}tokenizeEncoded(e){const t=this._tokenizeEncoded(e);if(!t)return;const i=this._rangeTokensAsUpdates(this._textModel.getOffsetAt({lineNumber:e,column:1}),t.result);t.versionId===this._textModel.getVersionId()&&this._updateTokensInStore(t.versionId,[{newTokens:i,oldRangeLength:this._textModel.getLineLength(e)}],Oo.Accurate)}_getCaptures(e){return this.captureAtRangeWithInjections(e)}_tokenize(e,t,i){const n=this._getCaptures(e),s=this._tokenizeCapturesWithMetadata(n,t,i);if(s)return{...s,versionId:this._tree.treeLastParsedVersion.get()}}_createTokensFromCaptures(e,t,i){const n=this._tree.tree.get(),s=rn.create(),r=i-t,a=this._languageIdCodec.encodeLanguageId(this._tree.languageId),l=she[this._tree.languageId]||"source";if(e.length===0)return n?(s.stop(),{endOffsets:[{endOffset:r,scopes:[],encodedLanguageId:a}],captureTime:s.elapsed()}):void 0;const c=Array(e.length);c.fill({endOffset:0,scopes:[l],encodedLanguageId:a});let d=0;const h=()=>{c.push({endOffset:0,scopes:[l],encodedLanguageId:a})},u=(p,_)=>p.name.includes("punctuation")&&p.text?Array.from(p.text.matchAll(ohe)).map(b=>_+b.index):void 0,g=(p,_,b,C)=>{if(C!==void 0){const w=c[C].scopes;let v=c[C].bracket;if((C>0?c[C-1].endOffset:0)!==_){let x;if(v&&v.length>0){x=[];const k=[];for(let D=0;Db&&k.push(I)}x.length===0&&(x=void 0),k.length===0?v=void 0:v=k}c.splice(C,0,{endOffset:_,scopes:[...w],bracket:x,encodedLanguageId:p.encodedLanguageId}),C++,h(),d++}c.splice(C,0,{endOffset:b,scopes:[...w,p.name],bracket:u(p,_),encodedLanguageId:p.encodedLanguageId}),c[d].bracket=v}else c[d]={endOffset:b,scopes:[l,p.name],bracket:u(p,_),encodedLanguageId:p.encodedLanguageId};d++};for(let p=0;p0?v=c[d-1].endOffset:v=C-t-1;const x=w-S;if(v>=0&&v=w){let k=d-1,D=c[k].endOffset,I=k>=2?c[k-1].endOffset:0;do{if(I+S===D){if(I===x){c[k].scopes.push(_.name);const T=c[k].bracket;c[k].bracket=T&&T.length>0?T:u(_,x)}}else if(I<=x){g(_,x,w,k);break}k--,I=k>=1?c[k-1].endOffset:0,D=k>=0?c[k].endOffset:0}while(D>x)}else g(_,x,w)}c[d-1].endOffset0&&(h(),c[d]={endOffset:r,scopes:c[d].scopes,encodedLanguageId:this._encodedLanguageId},d++);for(let p=0;p0,void 0)}const a=n.elapsed();return{endOffsetsAndMetadata:r,captureTime:s.captureTime,metadataTime:a}}_tokenizeEncoded(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=this._textModel.getLineCount(),n=e+1<=i?this._textModel.getOffsetAt({lineNumber:e+1,column:1}):this._textModel.getValueLength(),s=n-t,r=this._tokenize(new L(e,1,e,s+1),t,n);if(r)return{result:r.endOffsetsAndMetadata,captureTime:r.captureTime,metadataTime:r.metadataTime,versionId:r.versionId}}_endOffsetTokensToUint32Array(e){const t=new Uint32Array(e.length*2);for(let i=0;i\(\)]/g,S4=We("treeSitterLibraryService");class rhe{constructor(e){this._value=De(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(Et(i=>{this._value.set(new WW(t,void 0),i)}),t),t=>{throw Et(i=>{this._value.set(new WW(void 0,t),i)}),t})}}class WW{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}var ahe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},BW=function(o,e){return function(t,i){e(t,i,o)}};let tT=class extends $${constructor(e,t,i,n,s,r){super(t,i),this._languageIdObs=e,this._treeSitterLibraryService=s,this._instantiationService=r,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new P),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event;const a=new rhe(this._treeSitterLibraryService.getParserClass()),l=$(this,c=>a.promiseResult?.read(c)?.getDataOrThrow());this._tree=$(this,c=>{const d=l.read(c);if(!d)return;const h=this._languageIdObs.read(c),u=this._treeSitterLibraryService.getLanguage(h,!1,c);if(!u)return;const g=new d;if(c.store.add(ue(()=>{g.delete()})),g.setLanguage(u),this._treeSitterLibraryService.getInjectionQueries(h,c)!==void 0)return c.store.add(this._instantiationService.createInstance(XN,h,void 0,g,d,this._textModel))}),this._tokenizationImpl=$(this,c=>{const d=this._tree.read(c);if(!d)return;const h=this._treeSitterLibraryService.getHighlightingQueries(d.languageId,c);if(h)return c.store.add(this._instantiationService.createInstance(eT,d,h,this._languageIdCodec,n))}),this._register(xe(c=>{const d=this._tokenizationImpl.read(c);d&&(c.store.add(d.onDidChangeTokens(h=>{this._onDidChangeTokens.fire(h.changes)})),c.store.add(d.onDidChangeBackgroundTokenization(h=>{this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()})))}))}getLineTokens(e){const t=this._tokenizationImpl.get();if(!t){const i=this._textModel.getLineContent(e);return $t.createEmpty(i,this._languageIdCodec)}return t.getLineTokens(e)}todo_resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}handleDidChangeAttached(){}handleDidChangeContent(e){e.isFlush?this.todo_resetTokenization(!1):this._tokenizationImpl.get()?.handleContentChanged(e),this._tree.get()?.handleContentChange(e)}forceTokenization(e){const t=this._tokenizationImpl.get();t&&(t.hasAccurateTokensForLine(e)||t.tokenizeEncoded(e))}hasAccurateTokensForLine(e){const t=this._tokenizationImpl.get();return t?t.hasAccurateTokensForLine(e):!1}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLinesAt(e,t){const i=this._tokenizationImpl.get();return i?i.tokenizeLinesAt(e,t):null}get hasTokens(){const e=this._tokenizationImpl.get();return e?e.hasTokens():!1}};tT=ahe([BW(4,S4),BW(5,fe)],tT);class y4{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t,i=void 0){if(this._pieces=e||[],this._isComplete=t,i)for(const n of this._pieces)n.reportIfInvalid(i)}setPartial(e,t){let i=e;if(t.length>0){const s=t[0].getRange(),r=t[t.length-1].getRange();if(!s||!r)return e;i=e.plusRange(s).plusRange(r)}let n=null;for(let s=0,r=this._pieces.length;si.endLineNumber){n=n||{index:s};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(s,1),s--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:s};continue}const[l,c]=a.split(i);if(l.isEmpty()){n=n||{index:s};continue}c.isEmpty()||(this._pieces.splice(s,1,l,c),s++,r++,n=n||{index:s})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=dL(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getTextLength()===0)return t;const i=this._pieces;if(i.length===0)return t;const n=y4._findFirstPieceWithLine(i,e),s=i[n].getLineTokens(e);if(!s)return t;const r=t.getCount(),a=s.getCount();let l=0;const c=[];let d=0,h=0;const u=(g,f)=>{g!==h&&(h=g,c[d++]=g,c[d++]=f)};for(let g=0;g>>0,C=~b>>>0;for(;lt)n=s-1;else{for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}}return i}acceptEdit(e,t,i,n,s){for(let r=0;r>>1;if(t===0&&n[n.length-2]===i)return hc;const r=$t.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,l=n[r<<1];if(id&&(n[c++]=f,n[c++]=n[(g<<1)+1],d=f)}if(c===n.length)return e;const u=new Uint32Array(c);return u.set(n.subarray(0,c),0),u.buffer}static append(e,t){if(t===hc)return e;if(e===hc)return t;if(e===null)return e;if(t===null)return null;const i=yc(e),n=yc(t),s=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=$t.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let n=null;if(t1&&(s=qn.getLanguageId(n[1])!==e),!s)return hc}if(!n||n.length===0){const s=new Uint32Array(2);return s[0]=t,s[1]=HW(e),s.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ol.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ol.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=ol.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=ol.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=ol.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,s=e.length;n>>0}class lhe extends $${constructor(e,t,i,n){super(e,t),this.getLanguageId=i,this._tokenizer=null,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new P),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new ut),this._tokens=new rv(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new ut),this._attachedViewStates=this._register(new aL),this._register(ui.onDidChange(s=>{const r=this.getLanguageId();s.changedLanguages.indexOf(r)!==-1&&this.todo_resetTokenization()})),this.todo_resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:s,state:r})=>{if(r){let a=this._attachedViewStates.get(s);a||(a=new Ade(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(s,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(s)}))}todo_resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new JN(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=ui.get(this.getLanguageId());if(!s)return[null,null];let r;try{r=s.getInitialState()}catch(a){return Ee(a),[null,null]}return[s,r]},[i,n]=t();if(i&&n?this._tokenizer=new qde(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:r=>{this.setTokens(r)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const r=2;this._backgroundTokenizationState=r,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(r,a)=>{if(!this._tokenizer)return;const l=this._tokenizer.store.getFirstInvalidEndStateLineNumber();l!==null&&r>=l&&this._tokenizer?.store.setEndState(r,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,s)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Zde(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new rv(this._languageIdCodec),this._debugBackgroundStates=new JN(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:r=>{this._debugBackgroundTokens?.setMultilineTokens(r,this._textModel)},backgroundTokenizationFinished(){},setEndState:(r,a)=>{this._debugBackgroundStates?.setEndState(r,a)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[i,n]=Lh(t.text);this._tokens.acceptEdit(t.range,i,n),this._debugBackgroundTokens?.acceptEdit(t.range,i,n)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=be.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new QN,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),s=this.setTokens(i.finalize());if(n)for(const r of s.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new QN;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new R(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLinesAt(e,t){return this._tokenizer?(this.forceTokenization(e),this._tokenizer.tokenizeLinesAt(e,t)):null}get hasTokens(){return this._tokens.hasTokens}}var che=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},C1=function(o,e){return function(t,i){e(t,i,o)}},VS;let iT=VS=class extends a${constructor(e,t,i,n,s,r,a,l){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=n,this._languageService=s,this._languageConfigurationService=r,this._instantiationService=a,this._treeSitterLibraryService=l,this._languageIdObs=De(this,this._languageId),this._useTreeSitter=$(this,d=>{const h=this._languageIdObs.read(d);return this._treeSitterLibraryService.supportsLanguage(h,d)}),this.tokens=$(this,d=>{let h;return this._useTreeSitter.read(d)?h=d.store.add(this._instantiationService.createInstance(tT,this._languageIdObs,this._languageService.languageIdCodec,this._textModel,this._attachedViews.visibleLineRanges)):h=d.store.add(new lhe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),d.store.add(h.onDidChangeTokens(u=>{this._emitModelTokensChangedEvent(u)})),d.store.add(h.onDidChangeBackgroundTokenizationState(u=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),h});let c=!1;this.tokens.recomputeInitiallyAndOnChange(this._store,d=>{c&&d.todo_resetTokenization(),c=!0}),this._semanticTokens=new y4(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new P),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new P),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new P),this.onDidChangeTokens=this._onDidChangeTokens.event}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,s]=Lh(t.text);this._semanticTokens.acceptEdit(t.range,i,n,s,t.text.length>0?t.text.charCodeAt(0):0)}this.tokens.get().handleDidChangeContent(e)}handleDidChangeAttached(){this.tokens.get().handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.tokens.get().getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Ce("Illegal value for lineNumber")}get hasTokens(){return this.tokens.get().hasTokens}resetTokenization(){this.tokens.get().todo_resetTokenization()}get backgroundTokenizationState(){return this.tokens.get().backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.tokens.get().forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.tokens.get().hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.tokens.get().isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.tokens.get().tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.tokens.get().getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLinesAt(e,t){return this.tokens.get().tokenizeLinesAt(e,t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t,this._textModel),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),s=n.findTokenIndexAtOffset(t.column-1),[r,a]=VS._findLanguageBoundaries(n,s),l=PC(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(s>0&&r===t.column-1){const[c,d]=VS._findLanguageBoundaries(n,s-1),h=PC(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(c,d),c);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=e.getStartOffset(r);let s=e.getLineContent().length;for(let r=t,a=e.getCount();re.call(t,i,i,this))}[Symbol.iterator](){return this.values()}}var uhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},v1=function(o,e){return function(t,i){e(t,i,o)}},hu;function ghe(o){const e=new U$;return e.acceptChunk(o),e.finish()}function fhe(o){const e=new U$;let t;for(;typeof(t=o.read())=="string";)e.acceptChunk(t);return e.finish()}function UW(o,e){let t;return typeof o=="string"?t=ghe(o):_te(o)?t=fhe(o):t=o,t.create(e)}let w1=0;const phe=999,mhe=1e4,_he=300;class bhe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const A_=()=>{throw new Error("Invalid change accessor")};let Mg=class extends A{static{hu=this}static{this._MODEL_SYNC_LIMIT=50*1024*1024}static{this.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024}static{this.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3}static{this.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024}static{this.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Pn.tabSize,indentSize:Pn.indentSize,insertSpaces:Pn.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Pn.trimAutoWhitespace,largeFileOptimizations:Pn.largeFileOptimizations,bracketPairColorizationOptions:Pn.bracketPairColorizationOptions}}static resolveOptions(e,t){if(t.detectIndentation){const i=xW(e,t.tabSize,t.insertSpaces);return new PS({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new PS(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}get onDidChangeOptions(){return this._onDidChangeOptions.event}get onDidChangeAttached(){return this._onDidChangeAttached.event}get onDidChangeLineHeight(){return this._onDidChangeLineHeight.event}get onDidChangeFont(){return this._onDidChangeFont.event}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Yr(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,s,r,a,l){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this.instantiationService=l,this._onWillDispose=this._register(new P),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new yhe((f,p,_)=>this.handleBeforeFireDecorationsChangedEvent(f,p,_))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new P),this._onDidChangeAttached=this._register(new P),this._onDidChangeInjectedText=this._register(new P),this._onDidChangeLineHeight=this._register(new P),this._onDidChangeFont=this._register(new P),this._eventEmitter=this._register(new xhe),this._languageSelectionListener=this._register(new ut),this._deltaDecorationCallCnt=0,this._attachedViews=new Rde,w1++,this.id="$model"+w1,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=_e.parse("inmemory://model/"+w1):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:d}=UW(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=d;const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new L(1,1,h,this._buffer.getLineLength(h)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>hu.LARGE_FILE_SIZE_THRESHOLD||h>hu.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>hu.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._options=hu.resolveOptions(this._buffer,i);const g=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new tde(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Fae(this,this._languageConfigurationService)),this._decorationProvider=this._register(new nde(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(iT,this,this._bracketPairs,g,this._attachedViews),this._isTooLargeForSyncing=u>hu._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=HV(w1),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new $W,this._commandManager=new m4(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(g),this._register(this._languageConfigurationService.onDidChange(f=>{this._bracketPairs.handleLanguageConfigurationServiceChange(f),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(f)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Vp([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=A.None}_assertNotDisposed(){if(this._isDisposed)throw new Ce("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new dg(e,t)))}setValue(e,t=jn.setValue()){if(this._assertNotDisposed(),e==null)throw br();const{textBuffer:i,disposable:n}=UW(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,s,r,a,l,c,d){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:r,isRedoing:a,isFlush:l,detailedReasons:[d],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();const n=this.getFullModelRange(),s=this.getValueLengthInRange(n),r=this.getLineCount(),a=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new $W,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Wp([new yce],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,r,a),0,s,new R(r,a),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new fm([new Lhe],this._versionId,!1,!1),this._createContentChanged2(new D(1,1,s,r),0,n,new R(s,r),this.getValue(),!1,!1,!1,!0,Jn.eolChange()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=uge?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new I0({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=tB(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),R4(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(yU.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new ve("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new fge(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ve("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ve("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new ve("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ve("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ve("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ve("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof D&&!(e instanceof le)?e:new D(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Zi(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new R(1,1);if(n>r)return new R(r,this.getLineMaxColumn(r));if(s<=1)return new R(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new R(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Zi(l))return new R(n,s-1)}return new R(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof R&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=Zi(a),d=Zi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof D&&!(e instanceof le)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Zi(c),u=Zi(d);return!h&&!u?new D(s,r,a,l):s===a&&r===l?new D(s,r-1,a,l-1):h&&u?new D(s,r-1,a,l+1):h?new D(s,r-1,a,l):new D(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new D(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=hge){this._assertNotDisposed();let l=null;t!==null&&typeof t!="boolean"&&(Array.isArray(t)||(t=[t]),t.every(h=>D.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>D.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(` -`)<0){const u=new Mu(e,i,n,s).parseSearchRequest();if(!u)return[];d=g=>this.findMatchesLineByLine(g,u,r,a)}else d=h=>dS.findMatches(this,new Mu(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` -`)<0){const c=new Mu(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new D(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return dS.findNextMatch(this,new Mu(e,i,n,s),a,r),u.length>0||(h=new D(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return dS.findNextMatch(this,new Mu(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return dS.findPreviousMatch(this,new Mu(e,i,n,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof FI?e:new FI(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(l.range),text:l.text}));let a=!0;if(e)for(let l=0,c=e.length;ld.endLineNumber,_=d.startLineNumber>f.endLineNumber;if(!p&&!_){h=!0;break}}if(!h){a=!1;break}}if(a)for(let l=0,c=this._trimAutoWhitespaceLines.length;lp.endLineNumber)&&!(d===p.startLineNumber&&p.startColumn===h&&p.isEmpty()&&_&&_.length>0&&_.charAt(0)===` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Wp([new Ice],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,r),0,n,new R(s,r),this.getValue(),!1,!1,!1,!0,jn.eolChange()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=mhe?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new PS({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=xW(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),vO(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(WV.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ce("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new bhe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ce("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ce("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof L&&!(e instanceof ae)?e:new L(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Vi(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new R(1,1);if(n>r)return new R(r,this.getLineMaxColumn(r));if(s<=1)return new R(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new R(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Vi(l))return new R(n,s-1)}return new R(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof R&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=Vi(a),d=Vi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof L&&!(e instanceof ae)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Vi(c),u=Vi(d);return!h&&!u?new L(s,r,a,l):s===a&&r===l?new L(s,r-1,a,l-1):h&&u?new L(s,r-1,a,l+1):h?new L(s,r-1,a,l):new L(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new L(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=phe){this._assertNotDisposed();let l=null;t!==null&&typeof t!="boolean"&&(Array.isArray(t)||(t=[t]),t.every(h=>L.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>L.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(` +`)<0){const u=new du(e,i,n,s).parseSearchRequest();if(!u)return[];d=g=>this.findMatchesLineByLine(g,u,r,a)}else d=h=>b1.findMatches(this,new du(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const c=new du(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new L(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return b1.findNextMatch(this,new du(e,i,n,s),a,r),u.length>0||(h=new L(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return b1.findNextMatch(this,new du(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return b1.findPreviousMatch(this,new du(e,i,n,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof MD?e:new MD(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(l.range),text:l.text}));let a=!0;if(e)for(let l=0,c=e.length;ld.endLineNumber,_=d.startLineNumber>f.endLineNumber;if(!p&&!_){h=!0;break}}if(!h){a=!1;break}}if(a)for(let l=0,c=this._trimAutoWhitespaceLines.length;lp.endLineNumber)&&!(d===p.startLineNumber&&p.startColumn===h&&p.isEmpty()&&_&&_.length>0&&_.charAt(0)===` `)&&!(d===p.startLineNumber&&p.startColumn===1&&p.isEmpty()&&_&&_.length>0&&_.charAt(_.length-1)===` -`)){u=!1;break}}if(u){const g=new D(d,1,d,h);t.push(new FI(null,g,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,s)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new D(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new D(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??Jn.applyEdits())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){const n=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),a=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,a.length!==0){for(let d=0,h=a.length;d=0;T--){const A=f+T,O=v+T;I.takeFromEndWhile(U=>U.lineNumber>O);const W=I.takeFromEndWhile(U=>U.lineNumber===O);l.push(new G9(A,this.getLineContent(O),W))}if(C<_){const T=f+C;l.push(new She(T+1,p))}if(Cne.lineNumberne.lineNumber===Q)}l.push(new yhe(A+1,f+b,q,U))}c+=w}this._emitContentChangedEvent(new fm(l,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:a,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1,detailedReasons:[i],detailedReasonsChangeLengths:[a.length]})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e,t,i){if(e&&e.size>0){const s=Array.from(e).map(r=>new G9(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new rq(s))}if(t&&t.size>0){const s=Array.from(t).map(r=>new vhe(r.ownerId,r.decorationId,r.lineNumber,r.lineHeight));this._onDidChangeLineHeight.fire(new aq(s))}if(i&&i.size>0){const s=Array.from(i).map(r=>new whe(r.ownerId,r.lineNumber));this._onDidChangeFont.fire(new lq(s))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(e,s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(e,s,yB(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Te(s)}return i.addDecoration=fb,i.changeDecoration=fb,i.changeDecorationOptions=fb,i.removeDecoration=fb,i.deltaDecorations=fb,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Te(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:SB[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,s),n.setOptions(SB[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i,n)}getLinesDecorations(e,t,i=0,n=!1,s=!1,r=!1){const a=this.getLineCount(),l=Math.min(a,Math.max(1,e)),c=Math.min(a,Math.max(1,t)),d=this.getLineMaxColumn(c),h=new D(l,1,c,d),u=this._getDecorationsInRange(h,i,n,s,r);return rT(u,this._decorationProvider.getDecorationsInRange(h,i,n)),u}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1,r=!1){const a=this.validateRange(e),l=this._getDecorationsInRange(a,t,i,n,r);return rT(l,this._decorationProvider.getDecorationsInRange(a,t,i,s)),l}getOverviewRulerDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}getCustomLineHeightsDecorations(e=0){return this._decorationsTree.getAllCustomLineHeights(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Ja.fromDecorations(n).filter(s=>s.lineNumber===e)}getFontDecorationsInRange(e,t=0){const i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),n=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getFontDecorationsInInterval(this,i,n,t)}getAllDecorations(e=0,t=!1,i=!1){let n=this._decorationsTree.getAll(this,e,t,i,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!1,!0)}_getDecorationsInRange(e,t,i,n,s){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),a=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,a,t,i,n,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t,i){const n=this._decorations[t];if(!n)return;if(n.options.after){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}if(n.options.lineHeight!==null){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,l.startLineNumber,null)}if(n.options.affectsFont){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,l.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(i),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,s),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),n.options.lineHeight!==null&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,s.startLineNumber,n.options.lineHeight),n.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,s.startLineNumber)}_changeDecorationOptionsImpl(e,t,i){const n=this._decorations[t];if(!n)return;const s=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(i.overviewRuler&&i.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(i),n.options.after||i.after){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(n.options.before||i.before){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}if(n.options.lineHeight!==null||i.lineHeight!==null){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,c.startLineNumber,i.lineHeight)}if(n.options.affectsFont||i.affectsFont){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,t,c.startLineNumber)}const a=s!==r,l=pge(i)!==O0(n);a||l?(this._decorationsTree.delete(n),n.setOptions(i),this._decorationsTree.insert(n)):n.setOptions(i)}_deltaDecorationsImpl(e,t,i,n=!1){const s=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return gR(this.getLineContent(e))+1}toString(){return`TextModel(${this.uri.toString()})`}};nf=Pu=lge([uS(4,OF),uS(5,yi),uS(6,ai),uS(7,pe)],nf);function gR(o){let e=0;for(const t of o)if(t===" "||t===" ")e++;else break;return e}function dE(o){return!!(o.options.overviewRuler&&o.options.overviewRuler.color)}function pge(o){return!!o.after||!!o.before}function O0(o){return!!o.options.after||!!o.options.before}class wB{constructor(){this._decorationsTree0=new aE,this._decorationsTree1=new aE,this._injectedTextDecorationsTree=new aE}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,r,a){const l=e.getVersionId(),c=this._intervalSearch(t,i,n,s,r,l,a);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,s,r,a){const l=this._decorationsTree0.intervalSearch(e,t,i,n,s,r,a),c=this._decorationsTree1.intervalSearch(e,t,i,n,s,r,a),d=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,r,a);return l.concat(c).concat(d)}getInjectedTextInInterval(e,t,i,n){const s=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getFontDecorationsInInterval(e,t,i,n){const s=e.getVersionId(),r=this._decorationsTree0.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.affectsFont)}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(s=>s.options.showIfCollapsed||!s.range.isEmpty())}getAllCustomLineHeights(e,t){const i=e.getVersionId(),n=this._search(t,!1,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(s=>typeof s.options.lineHeight=="number")}getAll(e,t,i,n,s,r){const a=e.getVersionId(),l=this._search(t,i,n,s,a,r);return this._ensureNodesHaveRanges(e,l)}_search(e,t,i,n,s,r){if(n)return this._decorationsTree1.search(e,t,i,s,r);{const a=this._decorationsTree0.search(e,t,i,s,r),l=this._decorationsTree1.search(e,t,i,s,r),c=this._injectedTextDecorationsTree.search(e,t,i,s,r);return a.concat(l).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){O0(e)?this._injectedTextDecorationsTree.insert(e):dE(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){O0(e)?this._injectedTextDecorationsTree.delete(e):dE(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){O0(e)?this._injectedTextDecorationsTree.resolveNode(e,t):dE(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function cl(o){return o.replace(/[^a-z0-9\-_]/gi," ")}class Aq{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class mge extends Aq{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:or.Center}getColor(e){return this._resolvedColor||(Sd(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class _ge{constructor(e){this.position=e?.position??Xa.Center,this.persistLane=e?.persistLane}}class bge extends Aq{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(Sd(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?V.fromHex(e):t.getColor(e.id)}}class Gh{static from(e){return e instanceof Gh?e:new Gh(e)}constructor(e){this.content=e.content||"",this.tokens=e.tokens??null,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Me{static register(e){return new Me(e)}static createDynamic(e){return new Me(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?cl(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?cl(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.lineHeight=e.lineHeight?Math.min(e.lineHeight,gge):null,this.fontSize=e.fontSize||null,this.affectsFont=!!e.fontSize||!!e.fontFamily||!!e.fontWeight||!!e.fontStyle,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new mge(e.overviewRuler):null,this.minimap=e.minimap?new bge(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new _ge(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?cl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?cl(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?cl(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?xee(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?cl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?cl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?cl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?cl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?cl(e.afterContentClassName):null,this.after=e.after?Gh.from(e.after):null,this.before=e.before?Gh.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1,this.textDirection=e.textDirection??null}}Me.EMPTY=Me.register({description:"empty"});const SB=[Me.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Me.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Me.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Me.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function yB(o){return o instanceof Me?o:Me.createDynamic(o)}class LB{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class xB{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i){this.ownerId=e,this.decorationId=t,this.lineNumber=i}}class Cge extends F{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new P),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._affectedLineHeights=null,this._affectedFontLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null,this._affectedLineHeights?.clear(),this._affectedLineHeights=null,this._affectedFontLines?.clear(),this._affectedFontLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}recordLineAffectedByLineHeightChange(e,t,i,n){this._affectedLineHeights||(this._affectedLineHeights=new CB([],LB.toKey)),this._affectedLineHeights.add(new LB(e,t,i,n))}recordLineAffectedByFontChange(e,t,i){this._affectedFontLines||(this._affectedFontLines=new CB([],xB.toKey)),this._affectedFontLines.add(new xB(e,t,i))}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines,this._affectedLineHeights,this._affectedFontLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class vge extends F{constructor(){super(),this._fastEmitter=this._register(new P),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new P),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}const ue=Ve("ILanguageFeaturesService");class FF{static create(e){return new FF(e.get(151),e.get(150))}constructor(e,t){this.classifier=new wge(e,t)}createLineBreaksComputer(e,t,i,n,s,r){const a=[],l=[],c=[];return{addRequest:(d,h,u)=>{a.push(d),l.push(h),c.push(u)},finalize:()=>{const d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let u=0,g=a.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let fR=[],pR=[];function Sge(o,e,t,i,n,s,r,a){if(n===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=Oq(t,i,n,s,r),g=n-u,f=fR,p=pR;let _=0,b=0,C=0,w=n;const v=d.length;let S=0;if(S>=0){let L=Math.abs(h[S]-w);for(;S+1=L)break;L=x,S++}}for(;SL&&(L=b,x=C);let k=0,I=0,T=0,A=0;if(x<=w){let W=x,U=L===0?0:t.charCodeAt(L-1),q=L===0?0:o.get(U),ie=!0;for(let Q=L;Qb&&mR(U,q,ce,De,c)&&(k=ne,I=W),W+=We,W>w){ne>b?(T=ne,A=W-We):(T=Q+1,A=W),W-I>g&&(k=0),ie=!1;break}U=ce,q=De}if(ie){_>0&&(f[_]=d[d.length-1],p[_]=h[d.length-1],_++);break}}if(k===0){let W=x,U=t.charCodeAt(L),q=o.get(U),ie=!1;for(let Q=L-1;Q>=b;Q--){const ne=Q+1,ce=t.charCodeAt(Q);if(ce===9){ie=!0;break}let De,We;if(Bh(ce)?(Q--,De=0,We=2):(De=o.get(ce),We=_d(ce)?s:1),W<=w){if(T===0&&(T=ne,A=W),W<=w-g)break;if(mR(ce,De,U,q,c)){k=ne,I=W;break}}W-=We,U=ce,q=De}if(k!==0){const Q=g-(A-I);if(Q<=i){const ne=t.charCodeAt(T);let ce;Zi(ne)?ce=2:ce=yC(ne,A,i,s),Q-ce<0&&(k=0)}}if(ie){S--;continue}}if(k===0&&(k=T,I=A),k<=b){const W=t.charCodeAt(b);Zi(W)?(k=b+2,I=C+2):(k=b+1,I=C+yC(W,C,i,s))}for(b=k,f[_]=k,C=I,p[_]=I,_++,w=I+g;S<0||S=O)break;O=W,S++}}return _===0?null:(f.length=_,p.length=_,fR=e.breakOffsets,pR=e.breakOffsetsVisibleColumn,e.breakOffsets=f,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=u,e)}function yge(o,e,t,i,n,s,r,a,l){const c=Ja.applyInjectedText(e,t);let d,h;if(t&&t.length>0?(d=t.map(T=>T.options),h=t.map(T=>T.column-1)):(d=null,h=null),n===-1)return d?new _C(h,d,[c.length],[],0):null;const u=c.length;if(u<=1)return d?new _C(h,d,[c.length],[],0):null;const g=a==="keepAll",f=Oq(c,i,n,s,r),p=n-f,_=[],b=[];let C=0,w=0,v=0,S=n,L=c.charCodeAt(0),x=o.get(L),k=yC(L,0,i,s),I=1;Zi(L)&&(k+=1,L=c.charCodeAt(1),x=o.get(L),I++);for(let T=I;TS||q)&&((w===0||k-v>p)&&(w=A,v=k-U),_[C]=w,b[C]=v,C++,S=v+p,w=0),L=O,x=W}return C===0&&(!t||t.length===0)?null:(_[C]=u,b[C]=k,new _C(h,d,_,b,f))}function yC(o,e,t,i){return o===9?t-e%t:_d(o)||o<32?i:1}function DB(o,e){return e-o%e}function Lge(o,e){if(e>=2&&o.charAt(e-1)==="n"){let t=0;for(let i=e-2;i>=0;i--)if(o.charAt(i)==="\\")t++;else return t%2===1}return!1}function mR(o,e,t,i,n){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!n&&e===3&&i!==2||!n&&i===3&&e!==1)}function Oq(o,e,t,i,n){let s=0;if(n!==0){const r=vs(o);if(r!==-1){for(let l=0;lt&&(s=0)}}return s}class lL{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new In(new D(1,1,1,1),0,0,new R(1,1),0),new In(new D(1,1,1,1),0,0,new R(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new lt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?le.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):le.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,r),l=this._validatePositionWithCache(e,s,n,a);return i.equals(r)&&n.equals(a)&&s.equals(l)?t:new In(D.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=lL._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),s=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new In(n,t.selectionStartKind,s,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new In(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new In(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new R(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new R(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new D(n.lineNumber,n.column,s.lineNumber,s.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new In(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class kB{constructor(e){this.context=e,this.cursors=[new lL(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return jj(this.cursors,Kn(e=>e.viewState.position,R.compare)).viewState.position}getBottomMostViewPosition(){return $j(this.cursors,Kn(e=>e.viewState.position,R.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(lt.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const n=t-i;for(let s=0;s=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ii.selection,D.compareRangesUsingStarts));for(let i=0;ih&&p.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class IB{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class xge{constructor(){this.type=0}}class Dge{constructor(){this.type=1}}class kge{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Ige{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class _u{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class fS{constructor(){this.type=5}}class Ege{constructor(e){this.type=6,this.isFocused=e}}class Nge{constructor(){this.type=7}}class pS{constructor(){this.type=8}}class Fq{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class _R{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class bR{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class LC{constructor(e,t,i,n,s,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class Tge{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Rge{constructor(e){this.theme=e,this.type=14}}class Mge{constructor(e){this.type=15,this.ranges=e}}class Pge{constructor(){this.type=16}}let Age=class{constructor(){this.type=17}};class Oge extends F{constructor(){super(),this._onEvent=this._register(new P),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Fge{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class WF{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new WF(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class ek{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ek(this.oldHasFocus,e.hasFocus)}}class Wge{constructor(e,t){this.kind=2,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ek(this.oldHasFocus,e.hasFocus)}}class BF{constructor(e,t,i,n,s,r,a,l){this.kind=3,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new BF(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Bge{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Hge{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class cL{constructor(e,t,i,n,s,r,a){this.kind=7,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let s=0;s0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),s=!0);const a=xC.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,s,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=D.fromPositions(a[0],a[0]),e.emitViewEvent(new LC(t,i,l,c,n,s,r))}revealPrimary(e,t,i,n,s,r){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new LC(t,i,null,l,n,s,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const s=lt.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,s)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,lt.fromModelSelections(s))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,lt.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){const r=xC.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Ige(l,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(n.cursorState[d].modelState))){const c=n?n.cursorState.map(h=>h.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new cL(c,a,d,r.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n,s){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);const a=[],l=[],c=this._model.pushEditOperations(this.getSelections(),i,d=>{if(r)for(let u=0,g=r.length;u0&&this._pushAutoClosedAction(a,l)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=xC.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Te(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return EB.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new DC(this._model,this.getSelections())}endComposition(e,t){const i=Jn.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(th.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){const n=Jn.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let r=0;for(;r{const d=c.getPosition();return new le(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,r,l,0)}return}this._executeEdit(()=>{this._executeEditOperation(th.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s),a)},e,r)}paste(e,t,i,n,s){const r=Jn.cursor({kind:"paste",detailedSource:s});this._executeEdit(()=>{this._executeEditOperation(th.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),r)},e,s,4)}cut(e,t){const i=Jn.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(Yg.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){const n=Jn.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Hs(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){const n=Jn.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new Hs(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}}class xC{static from(e,t){return new xC(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Xge{static executeCommands(e,t,i,n=Jn.unknown({name:"executeCommands"})){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(s,i,n);for(let a=0,l=s.trackedRanges.length;a0&&(a[0]._isTracked=!0);let l=e.model.pushEditOperations(e.selectionsBefore,a,d=>{const h=[];for(let f=0;ff.identifier.minor-p.identifier.minor,g=[];for(let f=0;f0?(h[f].sort(u),g[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>h[f],getTrackedSelection:p=>{const _=parseInt(p,10),b=e.model._getTrackedRange(e.trackedRanges[_]);return e.trackedRangesDirection[_]===0?new le(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn):new le(b.endLineNumber,b.endColumn,b.startLineNumber,b.startColumn)}})):g[f]=e.selectionsBefore[f];return g},void 0,i);l||(l=e.selectionsBefore);const c=[];for(const d in r)r.hasOwnProperty(d)&&c.push(parseInt(d,10));c.sort((d,h)=>h-d);for(const d of c)l.splice(d,1);return l}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{D.isEmpty(h)&&u===""||n.push({identifier:{major:t,minor:s++},range:h,text:u,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,g)=>{a=!0,r(h,u,g)},trackSelection:(h,u)=>{const g=le.liftSelection(h);let f;if(g.isEmpty())if(typeof u=="boolean")u?f=2:f=3;else{const b=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===b?f=2:f=3}else f=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,g,f);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=g.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return Te(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-D.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;is.identifier.major?r=n.identifier.major:r=s.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Qge{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}}class DC{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;const s=n.startLineNumber;i.push(new Qge(e.getLineContent(s),s,n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=DC._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=DC._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let s=0,r=this._original.length;ss_,tokenizeEncoded:(o,e,t)=>JD(0,t)};async function Jge(o,e,t){if(!t)return TB(e,o.languageIdCodec,NB);const i=await bi.getOrCreate(t);return TB(e,o.languageIdCodec,i||NB)}function efe(o,e,t,i,n,s,r){let a="
",l=0,c=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(f+=" ",d=!1):(f+=" ",d=!0),w--;break}case 60:f+="<",d=!1;break;case 62:f+=">",d=!1;break;case 38:f+="&",d=!1;break;case 0:f+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:f+="�",d=!1;break;case 13:f+="​",d=!1;break;case 32:r&&d?(f+=" ",d=!1):(f+=" ",d=!0);break;default:f+=String.fromCharCode(p),d=!1}}if(!(g<=i)&&(a+=`${f}`,g>n||l>=n||i>=n))break}return a+="
",a}function TB(o,e,t){let i='
';const n=No(o);let s=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,s);Xt.convertToEndOffset(c.tokens,l.length);const h=new Xt(c.tokens,l,e).inflate();let u=0;for(let g=0,f=h.getCount();g${ha(l.substring(u,_))}`,u=_}s=c.endState}return i+="
",i}class tfe{constructor(e,t,i,n,s){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=s,this.maximumSpecialHeight=n,this.deleted=!1}}class RB{constructor(e,t){if(this._decorationIDToCustomLine=new hE,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(const i of t)this.insertOrChangeCustomLineHeight(i.decorationId,i.startLineNumber,i.endLineNumber,i.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){const t=this._decorationIDToCustomLine.get(e);if(t){this._decorationIDToCustomLine.delete(e);for(const i of t)i.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,i.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let s=t;s<=i;s++){const r=new tfe(e,-1,s,n,0);this._pendingSpecialLinesToInsert.push(r)}this._hasPending=!0}heightForLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(t===-1)return this._defaultLineHeight*e;const i=-(t+1),n=this._orderedCustomLines[i-1];return n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(e-n.lineNumber)}onLinesDeleted(e,t){const i=t-e+1,n=this._orderedCustomLines.length,s=this._binarySearchOverOrderedCustomLinesArray(e);let r;if(s>=0){r=s;for(let h=s-1;h>=0&&this._orderedCustomLines[h].lineNumber===e;h--)r--}else r=s===-(n+1)&&s!==-1?n-1:-(s+1);const a=this._binarySearchOverOrderedCustomLinesArray(t);let l;if(a>=0){l=a;for(let h=a+1;hr,d=l===r&&this._orderedCustomLines[r]&&this._orderedCustomLines[r].lineNumber>=e&&this._orderedCustomLines[r].lineNumber<=t;if(c||d){let h=0;for(let L=r;L<=l;L++)h=Math.max(h,this._orderedCustomLines[L].maximumSpecialHeight);let u=0;if(r>0){const L=this._orderedCustomLines[r-1];u=L.prefixSum+L.maximumSpecialHeight+this._defaultLineHeight*(e-L.lineNumber-1)}else u=e>0?(e-1)*this._defaultLineHeight:0;const g=this._orderedCustomLines[r],f=this._orderedCustomLines[l],p=this._orderedCustomLines[l+1],_=p&&p.lineNumber===t+1?p.maximumSpecialHeight:this._defaultLineHeight,b=f.prefixSum+f.maximumSpecialHeight-g.prefixSum+this._defaultLineHeight*(t-f.lineNumber)+this._defaultLineHeight*(g.lineNumber-e)+_-h,C=new Set,w=[],v=new hE;let S=0;for(let L=0;L=r&&L<=l){const k=x.decorationId;C.has(k)?S++:(x.index-=S,x.lineNumber=e,x.prefixSum=u,x.maximumSpecialHeight=h,w.push(x),v.add(x.decorationId,x))}else L>l&&(x.index-=S,x.lineNumber-=i,x.prefixSum-=b,w.push(x),v.add(x.decorationId,x));C.add(x.decorationId)}this._orderedCustomLines=w,this._decorationIDToCustomLine=v}else{const h=i*this._defaultLineHeight;for(let u=l;ut&&(g.lineNumber-=i,g.prefixSum-=h)}}}onLinesInserted(e,t){const i=t-e+1,n=this._binarySearchOverOrderedCustomLinesArray(e);let s;if(n>=0){s=n;for(let d=n-1;d>=0&&this._orderedCustomLines[d].lineNumber===e;d--)s--}else s=-(n+1);const r=[],a=new Set;for(let d=s;d=0;d--)this._orderedCustomLines[d].lineNumber===e-1&&l.add(this._orderedCustomLines[d].decorationId);const c=Pq(l,a);for(let d=s;d0){for(const d of c){const h=this._decorationIDToCustomLine.get(d);if(h){const u=h.reduce((p,_)=>Math.min(p,_.lineNumber),e),g=h.reduce((p,_)=>Math.max(p,_.lineNumber),e),f=h.reduce((p,_)=>Math.max(p,_.specialHeight),0);r.push({decorationId:d,startLineNumber:u,endLineNumber:g,lineHeight:f})}}for(const d of r)this.insertOrChangeCustomLineHeight(d.decorationId,d.startLineNumber,d.endLineNumber,d.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(const s of this._pendingSpecialLinesToInsert){const r=this._binarySearchOverOrderedCustomLinesArray(s.lineNumber),a=r>=0?r:-(r+1);this._orderedCustomLines.splice(a,0,s),this._invalidIndex=Math.min(this._invalidIndex,a)}this._pendingSpecialLinesToInsert=[];const e=new hE,t=[];for(let s=0;s0?t[this._invalidIndex-1]:void 0;for(let s=this._invalidIndex;s{const i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber>>1;t===e[r].afterLineNumber?i{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(n,s,r,a)},removeCustomLineHeight:n=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(n)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(n,s,r,a)=>{t=!0,n=n|0,s=s|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new nfe(l,n,s,r,a)),l},changeOneWhitespace:(n,s,r)=>{t=!0,s=s|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:s,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const n=new Set;for(const l of i)n.add(l.id);const s=new Map;for(const l of t)s.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!n.has(d.id)){if(s.has(d.id)){const h=s.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_insertWhitespace(e){const t=CR.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):i=0;const n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){e=e|0;const i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e),n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+this._paddingTop}getWhitespaceMinWidth(){if(this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(e=e|0,e<0)return 1;const t=this._lineCount|0;let i=1,n=t;for(;i=a+r)i=s+1;else{if(e>=a)return s;n=s}}return i>t?t:i}getLinesViewportData(e,t){e=e|0,t=t|0;const i=this.getLineNumberAtOrAfterVerticalOffset(e)|0,n=this.getVerticalOffsetForLineNumber(i)|0;let s=this._lineCount|0,r=this.getFirstWhitespaceIndexAfterLineNumber(i)|0;const a=this.getWhitespacesCount()|0;let l,c;r===-1?(r=a,c=s+1,l=0):(c=this.getAfterLineNumberForWhitespaceIndex(r)|0,l=this.getHeightForWhitespaceIndex(r)|0);let d=n,h=d;const u=5e5;let g=0;n>=u&&(g=Math.floor(n/u)*u,g=Math.floor(g/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight,h-=g);const f=[],p=e+(t-e)/2;let _=-1;for(let v=i;v<=s;v++){const S=this.getLineHeightForLineNumber(v);if(_===-1){const L=d,x=d+S;(L<=p&&pp)&&(_=v)}for(d+=S,f[v-i]=h,h+=S;c===v;)h+=l,d+=l,r++,r>=a?c=s+1:(c=this.getAfterLineNumberForWhitespaceIndex(r)|0,l=this.getHeightForWhitespaceIndex(r)|0);if(d>=t){s=v;break}}_===-1&&(_=s);const b=this.getVerticalOffsetForLineNumber(s)|0;let C=i,w=s;if(Ct&&w--}return{bigNumbersDelta:g,startLineNumber:i,endLineNumber:s,relativeVerticalOffset:f,centeredLineNumber:_,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),s=this.getHeightForWhitespaceIndex(i);if(e>=n+s)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t),s=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:s,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const s=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;s.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return s}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e=e|0,this._arr[e].height}};const ofe=125;class jb{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class rfe extends F{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new P),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new jb(0,0,0,0),this._scrollable=this._register(new z_({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new WF(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class afe extends F{constructor(e,t,i,n){super(),this._configuration=e;const s=this._configuration.options,r=s.get(165),a=s.get(96);this._linesLayout=new sfe(t,s.get(75),a.top,a.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new rfe(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new jb(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130)?ofe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(75)&&this._linesLayout.setDefaultLineHeight(t.get(75)),e.hasChanged(96)){const i=t.get(96);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(165)){const i=t.get(165),n=i.contentWidth,s=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new jb(n,r.contentWidth,s,this._getContentHeight(n,s,a)))}else this._updateHeight();e.hasChanged(130)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const n=this._configuration.options.get(117);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return n.get(119)?s+=Math.max(0,t-n.get(75)-n.get(96).bottom):n.get(117).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new jb(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new R9(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new R9(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(166),n=e.get(59),s=e.get(165);if(i.isViewportWrapping){const r=e.get(81);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+s.verticalScrollbarWidth:t}else{const r=e.get(118)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+s.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new jb(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){const t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Ag{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class lfe{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Ag(new D(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class cfe{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,s=e.options;let r;if(s.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new R(n.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new R(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);r=new D(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new Zj(r,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){const n=new D(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,By(this.configuration.options),Hy(this.configuration.options),t,i),s=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let h=s;h<=r;h++)c[h-s]=[];let d=!1;for(let h=0,u=n.length;h0?this._projectionData.breakOffsets[i-1]:0,s=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new Ja(0,0,c+1,this._projectionData.injectionOptions[d],0));r=Ja.applyInjectedText(e.getLineContent(t),a).substring(n,s)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1});return i>0&&(r=MB(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,s,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let h=null;if(c){h=[];let g=0,f=0;for(let p=0;p0?l.breakOffsets[p-1]:0,C=l.breakOffsets[p];for(;fC)break;if(b0?l.wrappedTextIndentLength:0,k=x+Math.max(v-b,0),I=x+Math.min(S-b,C-b);k!==I&&_.push(new lfe(k,I,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(S<=C)g+=w,f++;else break}}}let u;if(c){const g=[];for(let f=0;f{g.push({offset:p,text:b.substring(d[f].content),tokenMetadata:C.metadata})}):g.push({offset:p,text:d[f].content,tokenMetadata:Xt.defaultTokenMetadata})}u=e.tokenization.getLineTokens(t).withInserted(g)}else u=e.tokenization.getLineTokens(t);for(let g=i;g0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],l=e.sliceAndInflate(r,a,s);let c=l.getLineContent();i>0&&(c=MB(n.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,h=c.length+1,u=i+1=gE.length)for(let e=1;e<=o;e++)gE[e]=hfe(e);return gE[o]}function hfe(o){return new Array(o+1).join(" ")}class ufe{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=tp(e);const i=this.values,n=this.prefixSum,s=t.length;return s===0?!1:(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=tp(e),t=tp(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=tp(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,s=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],r=s-this.values[n],e=s)t=n+1;else break;return new Wq(n,e-r)}}class gfe{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Wq(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=oD(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+i;for(let s=0;st)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class pfe{constructor(e,t,i,n,s,r,a,l,c,d,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this.wrapOnEscapedLineFeeds=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new _fe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),s=i.length,r=this.createLineBreaksComputer(),a=new Cd(Ja.fromDecorations(n));for(let p=0;pb.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(D.compareRangesUsingStarts);let h=1,u=0,g=-1,f=g+1=h&&_<=u,C=uE(l[p],!b);c[p]=C.getViewLineCount(),this.modelLineProjections[p]=C}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new gfe(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=mfe(t),n=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(D.compareRangesUsingStarts);if(i.length===n.length){let u=!1;for(let g=0;g({range:u,options:Me.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,s);const r=i;let a=1,l=0,c=-1,d=c+1=a&&g<=l?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),f=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),f=!0)),f){const p=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,p)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===n,d=this.wordBreak===s;if(r&&a&&l&&c&&d)return!1;const h=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let u=null;if(h){u=[];for(let g=0,f=this.modelLineProjections.length;g2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,h=n.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+l-1,f=h+1,p=f+(s-l)-1,c=!0):st?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new PB(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new R(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new R(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=n.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=l===n.modelLineNumber?n.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let u=d;u{if(g.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||g.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,g.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new mg(g.visibleColumn,f,g.className,new uC(g.horizontalLine.top,p.column),-1,-1):_.lineNumber!!g))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let s=[];const r=[],a=[],l=i.lineNumber-1,c=n.lineNumber-1;let d=null;for(let f=l;f<=c;f++){const p=this.modelLineProjections[f];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,f===l?i.column:1),b=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(f+1)),C=b-_+1;let w=0;C>1&&p.getViewLineMinColumn(this.model,f+1,b)===1&&(w=_===0?1:2),r.push(C),a.push(w),d===null&&(d=new R(f+1,0))}else d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,f)),d=null)}d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let g=0;for(let f=0,p=s.length;ft&&(f=!0,g=t-s+1),h.getViewLinesData(this.model,c+1,u,g,s-e,i,l),s+=g,f)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,r=n.remainder,a=this.modelLineProjections[s],l=a.getViewLineMinColumn(this.model,s+1,r),c=a.getViewLineMaxColumn(this.model,s+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new R(s+1,d)).equals(i)?new R(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new D(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new R(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new D(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){const r=this.model.validatePosition(new R(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(s)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new R(n?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(c);let u;return d?s?u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(c+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,l,i),u}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return D.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new D(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,s,r){const a=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),l=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(l.lineNumber-a.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new D(a.lineNumber,1,l.lineNumber,l.column),t,i,n,s,r);let c=[];const d=a.lineNumber-1,h=l.lineNumber-1;let u=null;for(let _=d;_<=h;_++)if(this.modelLineProjections[_].isVisible())u===null&&(u=new R(_+1,_===d?a.column:1));else if(u!==null){const C=this.model.getLineMaxColumn(_);c=c.concat(this.model.getDecorationsInRange(new D(u.lineNumber,u.column,_,C),t,i,n,s)),u=null}u!==null&&(c=c.concat(this.model.getDecorationsInRange(new D(u.lineNumber,u.column,l.lineNumber,l.column),t,i,n,s)),u=null),c.sort((_,b)=>{const C=D.compareRangesUsingStarts(_.range,b.range);return C===0?_.idb.id?1:0:C});const g=[];let f=0,p=null;for(const _ of c){const b=_.id;p!==b&&(p=b,g[f++]=_)}return g}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function mfe(o){if(o.length===0)return[];const e=o.slice();e.sort(D.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let s=1,r=e.length;sn+1?(t.push(new D(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new D(i,1,n,1)),t}class PB{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class AB{constructor(e,t){this.modelRange=e,this.viewLines=t}}class _fe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class bfe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new ffe(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new _R(t,i)}onModelLinesInserted(e,t,i,n){return new bR(t,i)}onModelLineChanged(e,t,i){return[!1,new Fq(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let s=0;s>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=HF.create(this.model),this.glyphLanes=new Cfe(0),this.model.isTooLargeForTokenization())this._lines=new bfe(this.model);else{const h=this._configuration.options,u=h.get(59),g=h.get(156),f=h.get(166),p=h.get(155),_=h.get(146),b=h.get(160);this._lines=new pfe(this._editorId,this.model,n,s,u,this.model.getOptions().tabSize,g,f.wrappingColumn,p,_,b)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Yge(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new afe(this._configuration,this.getLineCount(),this._getCustomLineHeights(),r)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Tge(h)),this._eventDispatcher.emitOutgoingEvent(new BF(h.oldScrollWidth,h.oldScrollLeft,h.oldScrollHeight,h.oldScrollTop,h.scrollWidth,h.scrollLeft,h.scrollHeight,h.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(h=>{this._eventDispatcher.emitOutgoingEvent(h)})),this._decorations=new cfe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(h=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,h)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(YD.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Pge)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Rge(h))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(5)?this.model.getCustomLineHeightsDecorations(this._editorId).map(i=>{const n=i.range.startLineNumber,s=this.coordinatesConverter.convertModelRangeToViewRange(new D(n,1,n,this.model.getLineMaxColumn(n)));return{decorationId:i.id,startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,lineHeight:i.options.lineHeight||0}}):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new D(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Ege(e)),this._eventDispatcher.emitOutgoingEvent(new ek(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new Wge(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new xge)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Dge)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new R(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new FB(t,this._viewportStart.startLineDelta)}return new FB(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,s=n.get(59),r=n.get(156),a=n.get(166),l=n.get(155),c=n.get(146);this._lines.setWrappingSettings(s,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new fS),e.emitViewEvent(new pS),e.emitViewEvent(new _u(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(104)&&(this._decorations.reset(),e.emitViewEvent(new _u(null))),t.hasChanged(112)&&(this._decorations.reset(),e.emitViewEvent(new _u(null))),e.emitViewEvent(new kge(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),ep.shouldRecreate(t)&&(this.cursorConfig=new ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(i=>{try{const s=this._eventDispatcher.beginEmitViewEvents();let r=!1,a=!1;const l=i instanceof Mg?i.rawContentChangedEvent.changes:i.changes,c=i instanceof Mg?i.rawContentChangedEvent.versionId:null,d=this._lines.createLineBreaksComputer();for(const g of l)switch(g.changeType){case 4:{for(let f=0;f!b.ownerId||b.ownerId===this._editorId)),d.addRequest(p,_,null)}break}case 2:{let f=null;g.injectedText&&(f=g.injectedText.filter(p=>!p.ownerId||p.ownerId===this._editorId)),d.addRequest(g.detail,f,null);break}}const h=d.finalize(),u=new Cd(h);for(const g of l)switch(g.changeType){case 1:{this._lines.onModelFlushed(),s.emitViewEvent(new fS),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),r=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(c,g.fromLineNumber,g.toLineNumber);f!==null&&(s.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 4:{const f=u.takeCount(g.detail.length),p=this._lines.onModelLinesInserted(c,g.fromLineNumber,g.toLineNumber,f);p!==null&&(s.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),r=!0;break}case 2:{const f=u.dequeue(),[p,_,b,C]=this._lines.onModelLineChanged(c,g.lineNumber,f);a=p,_&&s.emitViewEvent(_),b&&(s.emitViewEvent(b),this.viewLayout.onLinesInserted(b.fromLineNumber,b.toLineNumber)),C&&(s.emitViewEvent(C),this.viewLayout.onLinesDeleted(C.fromLineNumber,C.toLineNumber));break}case 5:break}c!==null&&this._lines.acceptVersionId(c),this.viewLayout.onHeightMaybeChanged(),!r&&a&&(s.emitViewEvent(new pS),s.emitViewEvent(new _u(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const n=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&n){const s=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(s){const r=this.coordinatesConverter.convertModelPositionToViewPosition(s.getStartPosition()),a=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:a+this._viewportStart.startLineDelta},1)}}try{const s=this._eventDispatcher.beginEmitViewEvents();i instanceof Mg&&s.emitOutgoingEvent(new jge(i.contentChangedEvent)),this._cursor.onModelContentChanged(s,i)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._configuration.options.get(5)&&this._register(this.model.onDidChangeLineHeight(i=>{const n=i.changes.filter(s=>s.ownerId===this._editorId||s.ownerId===0);if(this.viewLayout.changeSpecialLineHeights(s=>{for(const r of n){const{decorationId:a,lineNumber:l,lineHeight:c}=r,d=this.coordinatesConverter.convertModelRangeToViewRange(new D(l,1,l,this.model.getLineMaxColumn(l)));c!==null?s.insertOrChangeCustomLineHeight(a,d.startLineNumber,d.endLineNumber,c):s.removeCustomLineHeight(a)}}),n.length>0){const s=new aq(n);this._eventDispatcher.emitOutgoingEvent(new Gge(s))}})),this._configuration.options.get(172)&&this._register(this.model.onDidChangeFont(i=>{const n=i.changes.filter(s=>s.ownerId===this._editorId||s.ownerId===0);if(n.length>0){const s=new lq(n);this._eventDispatcher.emitOutgoingEvent(new Zge(s))}})),this._register(this.model.onDidChangeTokens(i=>{const n=[];for(let s=0,r=i.ranges.length;s{this._eventDispatcher.emitSingleViewEvent(new Nge),this.cursorConfig=new ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new $ge(i))})),this._register(this.model.onDidChangeLanguage(i=>{this.cursorConfig=new ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Uge(i))})),this._register(this.model.onDidChangeOptions(i=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const n=this._eventDispatcher.beginEmitViewEvents();n.emitViewEvent(new fS),n.emitViewEvent(new pS),n.emitViewEvent(new _u(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new qge(i))})),this._register(this.model.onDidChangeDecorations(i=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new _u(i)),this._eventDispatcher.emitOutgoingEvent(new zge(i))}))}getFontSizeAtPosition(e){if(!this._configuration.options.get(172))return null;const i=this.model.getFontDecorationsInRange(D.fromPositions(e),this._editorId);let n=this._configuration.options.get(59).fontSize+"px";for(const s of i)if(s.options.fontSize){n=s.options.fontSize;break}return n}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;const s=this._captureStableViewport();let r=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(a.emitViewEvent(new fS),a.emitViewEvent(new pS),a.emitViewEvent(new _u(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());const l=s.viewportStartModelPosition?.lineNumber;l&&n.some(d=>d.startLineNumber<=l&&l<=d.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new Hge)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(165),t=this._configuration.options.get(75),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new D(s,this.getLineMinColumn(s),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const n=[];let s=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,h=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=vs(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=ua(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(const n of t){const s=n.range;if(s.startLineNumber>e||s.endLineNumber0?er.RTL:er.LTR}getTextDirection(e){const t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){const t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){const s=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),a=this.getTabSize(),l=this._lines.getViewLineData(e);return l.inlineDecorations&&(t=[...t,...l.inlineDecorations.map(c=>c.toInlineDecoration(e))]),new cr(l.minColumn,l.maxColumn,l.content,l.continuesWithWrappedLine,s,r,l.tokens,t,a,l.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Jce(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,By(this._configuration.options),Hy(this._configuration.options)),i=new wfe;for(const n of t){const s=n.options,r=s.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(l,s.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(D.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===rr||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new D(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(59),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===io.fontFamily;let c;return l?c=io.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${io.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,g=c===s?r-1:h.length;h===""?l+="
":l+=efe(h,d.inflate(),t,u,g,a,Rn)}return l}_getColorMap(){const e=bi.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Vge);return}this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new D(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new LC(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new D(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new LC(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,s){this._withViewEventsCollector(r=>r.emitViewEvent(new LC(e,!1,i,null,n,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Age),this._eventDispatcher.emitOutgoingEvent(new Bge))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class HF{static create(e){const t=e._setTrackedRange(null,new D(1,1,1,1),1);return new HF(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new R(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new D(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-s}invalidate(){this._isValid=!1}}class wfe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===s&&c+1>=i){n>c&&(a[a.length-1]=n);return}a.push(s,i,n)}else{const a=new Ov(e,t,[s,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class Sfe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&OB(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>yfe(t,i),[]);return OB(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function yfe(o,e){const t=[];let i=0,n=0;for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mc=function(o,e){return function(t,i){e(t,i,o)}},Au;let sf=class extends F{static{Au=this}static{this.dropIntoEditorDecorationOptions=Me.register({description:"workbench-dnd-target",className:"dnd-target"})}get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,s,r,a,l,c,d,h,u){super(),this.languageConfigurationService=h,this._deliveryQueue=hee(),this._contributions=this._register(new Ehe),this._onDidDispose=this._register(new P),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new WB({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new WB({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new hs(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new hs(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new hs(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new hs(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new hs(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new hs(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new P),this._onBeginUpdate=this._register(new P),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new P),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new P),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,s.willCreateCodeEditor();const g={...t};if(this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++xfe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?M.SimpleEditorContext:M.EditorContext),g,d)),this._register(this._configuration.onDidChange(_=>{this._onDidChangeConfiguration.fire(_);const b=this._configuration.options;if(_.hasChanged(165)){const C=b.get(165);this._onDidLayoutChange.fire(C)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),i.contextKeyValues)for(const[_,b]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(_,b);this._notificationService=c,this._codeEditorService=s,this._commandService=r,this._themeService=l,this._register(new kfe(this,this._contextKeyService)),this._register(new Ife(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new $_([Ne,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let f;Array.isArray(i.contributions)?f=i.contributions:f=om.getEditorContributions(),this._contributions.initialize(this,f,this._instantiationService);for(const _ of om.getEditorActions()){if(this._actions.has(_.id)){Te(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const b=new cq(_.id,_.label,_.alias,_.metadata,_.precondition??void 0,C=>this._instantiationService.invokeFunction(w=>Promise.resolve(_.runEditorCommand(w,this,C))),this._contextKeyService);this._actions.set(b.id,b)}const p=()=>!this._configuration.options.get(104)&&this._configuration.options.get(43).enabled;this._register(new aie(this._domElement,{onDragOver:_=>{if(!p())return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b?.position&&this.showDropIndicatorAt(b.position)},onDrop:async _=>{if(!p()||(this.removeDropIndicator(),!_.dataTransfer))return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b?.position&&this._onDropIntoEditor.fire({position:b.position,event:_})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new IT(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return l1.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Ct.getWordAtPosition(this._modelData.model,this._configuration.options.get(148),this._configuration.options.get(147),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` +`)){u=!1;break}}if(u){const g=new L(d,1,d,h);t.push(new MD(null,g,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,s)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??jn.applyEdits())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){const n=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),a=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,a.length!==0){for(let d=0,h=a.length;d=0;T--){const F=f+T,O=v+T;I.takeFromEndWhile(U=>U.lineNumber>O);const B=I.takeFromEndWhile(U=>U.lineNumber===O);l.push(new _W(F,this.getLineContent(O),B))}if(C<_){const T=f+C;l.push(new kce(T+1,p))}if(Cne.lineNumberne.lineNumber===X)}l.push(new Dce(F+1,f+b,K,U))}c+=w}this._emitContentChangedEvent(new Wp(l,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:a,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1,detailedReasons:[i],detailedReasonsChangeLengths:[a.length]})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e,t,i){if(e&&e.size>0){const s=Array.from(e).map(r=>new _W(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new w$(s))}if(t&&t.size>0){const s=Array.from(t).map(r=>new xce(r.ownerId,r.decorationId,r.lineNumber,r.lineHeight));this._onDidChangeLineHeight.fire(new S$(s))}if(i&&i.size>0){const s=Array.from(i).map(r=>new Lce(r.ownerId,r.lineNumber));this._onDidChangeFont.fire(new y$(s))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(e,s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(e,s,qW(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Ee(s)}return i.addDecoration=A_,i.changeDecoration=A_,i.changeDecorationOptions=A_,i.removeDecoration=A_,i.deltaDecorations=A_,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),Ee(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:jW[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,s),n.setOptions(jW[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i,n)}getLinesDecorations(e,t,i=0,n=!1,s=!1,r=!1){const a=this.getLineCount(),l=Math.min(a,Math.max(1,e)),c=Math.min(a,Math.max(1,t)),d=this.getLineMaxColumn(c),h=new L(l,1,c,d),u=this._getDecorationsInRange(h,i,n,s,r);return YE(u,this._decorationProvider.getDecorationsInRange(h,i,n)),u}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1,r=!1){const a=this.validateRange(e),l=this._getDecorationsInRange(a,t,i,n,r);return YE(l,this._decorationProvider.getDecorationsInRange(a,t,i,s)),l}getOverviewRulerDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}getCustomLineHeightsDecorations(e=0){return this._decorationsTree.getAllCustomLineHeights(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Fa.fromDecorations(n).filter(s=>s.lineNumber===e)}getFontDecorationsInRange(e,t=0){const i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),n=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getFontDecorationsInInterval(this,i,n,t)}getAllDecorations(e=0,t=!1,i=!1){let n=this._decorationsTree.getAll(this,e,t,i,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!1,!0)}_getDecorationsInRange(e,t,i,n,s){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),a=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,a,t,i,n,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t,i){const n=this._decorations[t];if(!n)return;if(n.options.after){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(n.options.before){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}if(n.options.lineHeight!==null){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,l.startLineNumber,null)}if(n.options.affectsFont){const l=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,l.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(i),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,s),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),n.options.lineHeight!==null&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,s.startLineNumber,n.options.lineHeight),n.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,s.startLineNumber)}_changeDecorationOptionsImpl(e,t,i){const n=this._decorations[t];if(!n)return;const s=!!(n.options.overviewRuler&&n.options.overviewRuler.color),r=!!(i.overviewRuler&&i.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(i),n.options.after||i.after){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber)}if(n.options.before||i.before){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber)}if(n.options.lineHeight!==null||i.lineHeight!==null){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,c.startLineNumber,i.lineHeight)}if(n.options.affectsFont||i.affectsFont){const c=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,t,c.startLineNumber)}const a=s!==r,l=Che(i)!==zS(n);a||l?(this._decorationsTree.delete(n),n.setOptions(i),this._decorationsTree.insert(n)):n.setOptions(i)}_deltaDecorationsImpl(e,t,i,n=!1){const s=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return nT(this.getLineContent(e))+1}toString(){return`TextModel(${this.uri.toString()})`}};Mg=hu=uhe([v1(4,x4),v1(5,_i),v1(6,ti),v1(7,fe)],Mg);function nT(o){let e=0;for(const t of o)if(t===" "||t===" ")e++;else break;return e}function rI(o){return!!(o.options.overviewRuler&&o.options.overviewRuler.color)}function Che(o){return!!o.after||!!o.before}function zS(o){return!!o.options.after||!!o.options.before}class $W{constructor(){this._decorationsTree0=new nI,this._decorationsTree1=new nI,this._injectedTextDecorationsTree=new nI}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,r,a){const l=e.getVersionId(),c=this._intervalSearch(t,i,n,s,r,l,a);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,s,r,a){const l=this._decorationsTree0.intervalSearch(e,t,i,n,s,r,a),c=this._decorationsTree1.intervalSearch(e,t,i,n,s,r,a),d=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,r,a);return l.concat(c).concat(d)}getInjectedTextInInterval(e,t,i,n){const s=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getFontDecorationsInInterval(e,t,i,n){const s=e.getVersionId(),r=this._decorationsTree0.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.affectsFont)}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(s=>s.options.showIfCollapsed||!s.range.isEmpty())}getAllCustomLineHeights(e,t){const i=e.getVersionId(),n=this._search(t,!1,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(s=>typeof s.options.lineHeight=="number")}getAll(e,t,i,n,s,r){const a=e.getVersionId(),l=this._search(t,i,n,s,a,r);return this._ensureNodesHaveRanges(e,l)}_search(e,t,i,n,s,r){if(n)return this._decorationsTree1.search(e,t,i,s,r);{const a=this._decorationsTree0.search(e,t,i,s,r),l=this._decorationsTree1.search(e,t,i,s,r),c=this._injectedTextDecorationsTree.search(e,t,i,s,r);return a.concat(l).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){zS(e)?this._injectedTextDecorationsTree.insert(e):rI(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){zS(e)?this._injectedTextDecorationsTree.delete(e):rI(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){zS(e)?this._injectedTextDecorationsTree.resolveNode(e,t):rI(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function qa(o){return o.replace(/[^a-z0-9\-_]/gi," ")}class Y${constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class vhe extends Y${constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:jo.Center}getColor(e){return this._resolvedColor||(td(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class whe{constructor(e){this.position=e?.position??Aa.Center,this.persistLane=e?.persistLane}}class She extends Y${constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(td(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?V.fromHex(e):t.getColor(e.id)}}class Dh{static from(e){return e instanceof Dh?e:new Dh(e)}constructor(e){this.content=e.content||"",this.tokens=e.tokens??null,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Te{static register(e){return new Te(e)}static createDynamic(e){return new Te(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?qa(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?qa(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.lineHeight=e.lineHeight?Math.min(e.lineHeight,_he):null,this.fontSize=e.fontSize||null,this.affectsFont=!!e.fontSize||!!e.fontFamily||!!e.fontWeight||!!e.fontStyle,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new vhe(e.overviewRuler):null,this.minimap=e.minimap?new She(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new whe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?qa(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?qa(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?qa(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?EQ(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?qa(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?qa(e.marginClassName):null,this.inlineClassName=e.inlineClassName?qa(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?qa(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?qa(e.afterContentClassName):null,this.after=e.after?Dh.from(e.after):null,this.before=e.before?Dh.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1,this.textDirection=e.textDirection??null}}Te.EMPTY=Te.register({description:"empty"});const jW=[Te.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Te.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Te.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Te.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function qW(o){return o instanceof Te?o:Te.createDynamic(o)}class KW{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class GW{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i){this.ownerId=e,this.decorationId=t,this.lineNumber=i}}class yhe extends A{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new P),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._affectedLineHeights=null,this._affectedFontLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null,this._affectedLineHeights?.clear(),this._affectedLineHeights=null,this._affectedFontLines?.clear(),this._affectedFontLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}recordLineAffectedByLineHeightChange(e,t,i,n){this._affectedLineHeights||(this._affectedLineHeights=new zW([],KW.toKey)),this._affectedLineHeights.add(new KW(e,t,i,n))}recordLineAffectedByFontChange(e,t,i){this._affectedFontLines||(this._affectedFontLines=new zW([],GW.toKey)),this._affectedFontLines.add(new GW(e,t,i))}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines,this._affectedLineHeights,this._affectedFontLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class xhe extends A{constructor(){super(),this._fastEmitter=this._register(new P),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new P),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}const he=We("ILanguageFeaturesService");class L4{static create(e){return new L4(e.get(151),e.get(150))}constructor(e,t){this.classifier=new Lhe(e,t)}createLineBreaksComputer(e,t,i,n,s,r){const a=[],l=[],c=[];return{addRequest:(d,h,u)=>{a.push(d),l.push(h),c.push(u)},finalize:()=>{const d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let u=0,g=a.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let sT=[],oT=[];function khe(o,e,t,i,n,s,r,a){if(n===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=X$(t,i,n,s,r),g=n-u,f=sT,p=oT;let _=0,b=0,C=0,w=n;const v=d.length;let S=0;if(S>=0){let x=Math.abs(h[S]-w);for(;S+1=x)break;x=k,S++}}for(;Sx&&(x=b,k=C);let D=0,I=0,T=0,F=0;if(k<=w){let B=k,U=x===0?0:t.charCodeAt(x-1),K=x===0?0:o.get(U),ie=!0;for(let X=x;Xb&&rT(U,K,ce,ke,c)&&(D=ne,I=B),B+=it,B>w){ne>b?(T=ne,F=B-it):(T=X+1,F=B),B-I>g&&(D=0),ie=!1;break}U=ce,K=ke}if(ie){_>0&&(f[_]=d[d.length-1],p[_]=h[d.length-1],_++);break}}if(D===0){let B=k,U=t.charCodeAt(x),K=o.get(U),ie=!1;for(let X=x-1;X>=b;X--){const ne=X+1,ce=t.charCodeAt(X);if(ce===9){ie=!0;break}let ke,it;if(bh(ce)?(X--,ke=0,it=2):(ke=o.get(ce),it=Yc(ce)?s:1),B<=w){if(T===0&&(T=ne,F=B),B<=w-g)break;if(rT(ce,ke,U,K,c)){D=ne,I=B;break}}B-=it,U=ce,K=ke}if(D!==0){const X=g-(F-I);if(X<=i){const ne=t.charCodeAt(T);let ce;Vi(ne)?ce=2:ce=Bb(ne,F,i,s),X-ce<0&&(D=0)}}if(ie){S--;continue}}if(D===0&&(D=T,I=F),D<=b){const B=t.charCodeAt(b);Vi(B)?(D=b+2,I=C+2):(D=b+1,I=C+Bb(B,C,i,s))}for(b=D,f[_]=D,C=I,p[_]=I,_++,w=I+g;S<0||S=O)break;O=B,S++}}return _===0?null:(f.length=_,p.length=_,sT=e.breakOffsets,oT=e.breakOffsetsVisibleColumn,e.breakOffsets=f,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=u,e)}function Dhe(o,e,t,i,n,s,r,a,l){const c=Fa.applyInjectedText(e,t);let d,h;if(t&&t.length>0?(d=t.map(T=>T.options),h=t.map(T=>T.column-1)):(d=null,h=null),n===-1)return d?new Mb(h,d,[c.length],[],0):null;const u=c.length;if(u<=1)return d?new Mb(h,d,[c.length],[],0):null;const g=a==="keepAll",f=X$(c,i,n,s,r),p=n-f,_=[],b=[];let C=0,w=0,v=0,S=n,x=c.charCodeAt(0),k=o.get(x),D=Bb(x,0,i,s),I=1;Vi(x)&&(D+=1,x=c.charCodeAt(1),k=o.get(x),I++);for(let T=I;TS||K)&&((w===0||D-v>p)&&(w=F,v=D-U),_[C]=w,b[C]=v,C++,S=v+p,w=0),x=O,k=B}return C===0&&(!t||t.length===0)?null:(_[C]=u,b[C]=D,new Mb(h,d,_,b,f))}function Bb(o,e,t,i){return o===9?t-e%t:Yc(o)||o<32?i:1}function ZW(o,e){return e-o%e}function Ihe(o,e){if(e>=2&&o.charAt(e-1)==="n"){let t=0;for(let i=e-2;i>=0;i--)if(o.charAt(i)==="\\")t++;else return t%2===1}return!1}function rT(o,e,t,i,n){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!n&&e===3&&i!==2||!n&&i===3&&e!==1)}function X$(o,e,t,i,n){let s=0;if(n!==0){const r=hs(o);if(r!==-1){for(let l=0;lt&&(s=0)}}return s}class gy{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new wn(new L(1,1,1,1),0,0,new R(1,1),0),new wn(new L(1,1,1,1),0,0,new R(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new tt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ae.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ae.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,r),l=this._validatePositionWithCache(e,s,n,a);return i.equals(r)&&n.equals(a)&&s.equals(l)?t:new wn(L.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=gy._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),s=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new wn(n,t.selectionStartKind,s,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new wn(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new wn(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new R(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new R(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new L(n.lineNumber,n.column,s.lineNumber,s.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new wn(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class YW{constructor(e){this.context=e,this.cursors=[new gy(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return r$(this.cursors,Bn(e=>e.viewState.position,R.compare)).viewState.position}getBottomMostViewPosition(){return o$(this.cursors,Bn(e=>e.viewState.position,R.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(tt.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const n=t-i;for(let s=0;s=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ii.selection,L.compareRangesUsingStarts));for(let i=0;ih&&p.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class XW{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class Ehe{constructor(){this.type=0}}class Nhe{constructor(){this.type=1}}class The{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Rhe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class Gh{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class S1{constructor(){this.type=5}}class Mhe{constructor(e){this.type=6,this.isFocused=e}}class Phe{constructor(){this.type=7}}class y1{constructor(){this.type=8}}class Q${constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class aT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class lT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class Hb{constructor(e,t,i,n,s,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class Ahe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Ohe{constructor(e){this.theme=e,this.type=14}}class Fhe{constructor(e){this.type=15,this.ranges=e}}class Whe{constructor(){this.type=16}}let Bhe=class{constructor(){this.type=17}};class Hhe extends A{constructor(){super(),this._onEvent=this._register(new P),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Vhe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class k4{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new k4(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class ok{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ok(this.oldHasFocus,e.hasFocus)}}class zhe{constructor(e,t){this.kind=2,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ok(this.oldHasFocus,e.hasFocus)}}class D4{constructor(e,t,i,n,s,r,a,l){this.kind=3,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new D4(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Uhe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class $he{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class fy{constructor(e,t,i,n,s,r,a){this.kind=7,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let s=0;s0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),s=!0);const a=Vb.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,s,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=L.fromPositions(a[0],a[0]),e.emitViewEvent(new Hb(t,i,l,c,n,s,r))}revealPrimary(e,t,i,n,s,r){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new Hb(t,i,null,l,n,s,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const s=tt.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,s)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,tt.fromModelSelections(s))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,tt.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(n,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){const r=Vb.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Rhe(l,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(n.cursorState[d].modelState))){const c=n?n.cursorState.map(h=>h.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new fy(c,a,d,r.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n,s){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);const a=[],l=[],c=this._model.pushEditOperations(this.getSelections(),i,d=>{if(r)for(let u=0,g=r.length;u0&&this._pushAutoClosedAction(a,l)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=Vb.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Ee(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return QW.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new zb(this._model,this.getSelections())}endComposition(e,t){const i=jn.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Pd.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){const n=jn.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let r=0;for(;r{const d=c.getPosition();return new ae(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,r,l,0)}return}this._executeEdit(()=>{this._executeEditOperation(Pd.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s),a)},e,r)}paste(e,t,i,n,s){const r=jn.cursor({kind:"paste",detailedSource:s});this._executeEdit(()=>{this._executeEditOperation(Pd.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),r)},e,s,4)}cut(e,t){const i=jn.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(Dg.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){const n=jn.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Ns(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){const n=jn.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new Ns(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}}class Vb{static from(e,t){return new Vb(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class tue{static executeCommands(e,t,i,n=jn.unknown({name:"executeCommands"})){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(s,i,n);for(let a=0,l=s.trackedRanges.length;a0&&(a[0]._isTracked=!0);let l=e.model.pushEditOperations(e.selectionsBefore,a,d=>{const h=[];for(let f=0;ff.identifier.minor-p.identifier.minor,g=[];for(let f=0;f0?(h[f].sort(u),g[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>h[f],getTrackedSelection:p=>{const _=parseInt(p,10),b=e.model._getTrackedRange(e.trackedRanges[_]);return e.trackedRangesDirection[_]===0?new ae(b.startLineNumber,b.startColumn,b.endLineNumber,b.endColumn):new ae(b.endLineNumber,b.endColumn,b.startLineNumber,b.startColumn)}})):g[f]=e.selectionsBefore[f];return g},void 0,i);l||(l=e.selectionsBefore);const c=[];for(const d in r)r.hasOwnProperty(d)&&c.push(parseInt(d,10));c.sort((d,h)=>h-d);for(const d of c)l.splice(d,1);return l}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{L.isEmpty(h)&&u===""||n.push({identifier:{major:t,minor:s++},range:h,text:u,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(h,u,g)=>{a=!0,r(h,u,g)},trackSelection:(h,u)=>{const g=ae.liftSelection(h);let f;if(g.isEmpty())if(typeof u=="boolean")u?f=2:f=3;else{const b=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===b?f=2:f=3}else f=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,g,f);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=g.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return Ee(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-L.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;is.identifier.major?r=n.identifier.major:r=s.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class iue{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}}class zb{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;const s=n.startLineNumber;i.push(new iue(e.getLineContent(s),s,n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=zb._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=zb._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let s=0,r=this._original.length;sIm,tokenizeEncoded:(o,e,t)=>sk(0,t)};async function nue(o,e,t){if(!t)return e9(e,o.languageIdCodec,JW);const i=await ui.getOrCreate(t);return e9(e,o.languageIdCodec,i||JW)}function sue(o,e,t,i,n,s,r){let a="
",l=0,c=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(f+=" ",d=!1):(f+=" ",d=!0),w--;break}case 60:f+="<",d=!1;break;case 62:f+=">",d=!1;break;case 38:f+="&",d=!1;break;case 0:f+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:f+="�",d=!1;break;case 13:f+="​",d=!1;break;case 32:r&&d?(f+=" ",d=!1):(f+=" ",d=!0);break;default:f+=String.fromCharCode(p),d=!1}}if(!(g<=i)&&(a+=`${f}`,g>n||l>=n||i>=n))break}return a+="
",a}function e9(o,e,t){let i='
';const n=bo(o);let s=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,s);$t.convertToEndOffset(c.tokens,l.length);const h=new $t(c.tokens,l,e).inflate();let u=0;for(let g=0,f=h.getCount();g${Xr(l.substring(u,_))}`,u=_}s=c.endState}return i+="
",i}class oue{constructor(e,t,i,n,s){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=s,this.maximumSpecialHeight=n,this.deleted=!1}}class t9{constructor(e,t){if(this._decorationIDToCustomLine=new aI,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(const i of t)this.insertOrChangeCustomLineHeight(i.decorationId,i.startLineNumber,i.endLineNumber,i.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){const t=this._decorationIDToCustomLine.get(e);if(t){this._decorationIDToCustomLine.delete(e);for(const i of t)i.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,i.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let s=t;s<=i;s++){const r=new oue(e,-1,s,n,0);this._pendingSpecialLinesToInsert.push(r)}this._hasPending=!0}heightForLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(t===-1)return this._defaultLineHeight*e;const i=-(t+1),n=this._orderedCustomLines[i-1];return n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(e-n.lineNumber)}onLinesDeleted(e,t){const i=t-e+1,n=this._orderedCustomLines.length,s=this._binarySearchOverOrderedCustomLinesArray(e);let r;if(s>=0){r=s;for(let h=s-1;h>=0&&this._orderedCustomLines[h].lineNumber===e;h--)r--}else r=s===-(n+1)&&s!==-1?n-1:-(s+1);const a=this._binarySearchOverOrderedCustomLinesArray(t);let l;if(a>=0){l=a;for(let h=a+1;hr,d=l===r&&this._orderedCustomLines[r]&&this._orderedCustomLines[r].lineNumber>=e&&this._orderedCustomLines[r].lineNumber<=t;if(c||d){let h=0;for(let x=r;x<=l;x++)h=Math.max(h,this._orderedCustomLines[x].maximumSpecialHeight);let u=0;if(r>0){const x=this._orderedCustomLines[r-1];u=x.prefixSum+x.maximumSpecialHeight+this._defaultLineHeight*(e-x.lineNumber-1)}else u=e>0?(e-1)*this._defaultLineHeight:0;const g=this._orderedCustomLines[r],f=this._orderedCustomLines[l],p=this._orderedCustomLines[l+1],_=p&&p.lineNumber===t+1?p.maximumSpecialHeight:this._defaultLineHeight,b=f.prefixSum+f.maximumSpecialHeight-g.prefixSum+this._defaultLineHeight*(t-f.lineNumber)+this._defaultLineHeight*(g.lineNumber-e)+_-h,C=new Set,w=[],v=new aI;let S=0;for(let x=0;x=r&&x<=l){const D=k.decorationId;C.has(D)?S++:(k.index-=S,k.lineNumber=e,k.prefixSum=u,k.maximumSpecialHeight=h,w.push(k),v.add(k.decorationId,k))}else x>l&&(k.index-=S,k.lineNumber-=i,k.prefixSum-=b,w.push(k),v.add(k.decorationId,k));C.add(k.decorationId)}this._orderedCustomLines=w,this._decorationIDToCustomLine=v}else{const h=i*this._defaultLineHeight;for(let u=l;ut&&(g.lineNumber-=i,g.prefixSum-=h)}}}onLinesInserted(e,t){const i=t-e+1,n=this._binarySearchOverOrderedCustomLinesArray(e);let s;if(n>=0){s=n;for(let d=n-1;d>=0&&this._orderedCustomLines[d].lineNumber===e;d--)s--}else s=-(n+1);const r=[],a=new Set;for(let d=s;d=0;d--)this._orderedCustomLines[d].lineNumber===e-1&&l.add(this._orderedCustomLines[d].decorationId);const c=Z$(l,a);for(let d=s;d0){for(const d of c){const h=this._decorationIDToCustomLine.get(d);if(h){const u=h.reduce((p,_)=>Math.min(p,_.lineNumber),e),g=h.reduce((p,_)=>Math.max(p,_.lineNumber),e),f=h.reduce((p,_)=>Math.max(p,_.specialHeight),0);r.push({decorationId:d,startLineNumber:u,endLineNumber:g,lineHeight:f})}}for(const d of r)this.insertOrChangeCustomLineHeight(d.decorationId,d.startLineNumber,d.endLineNumber,d.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(const s of this._pendingSpecialLinesToInsert){const r=this._binarySearchOverOrderedCustomLinesArray(s.lineNumber),a=r>=0?r:-(r+1);this._orderedCustomLines.splice(a,0,s),this._invalidIndex=Math.min(this._invalidIndex,a)}this._pendingSpecialLinesToInsert=[];const e=new aI,t=[];for(let s=0;s0?t[this._invalidIndex-1]:void 0;for(let s=this._invalidIndex;s{const i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber>>1;t===e[r].afterLineNumber?i{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(n,s,r,a)},removeCustomLineHeight:n=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(n)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(n,s,r,a)=>{t=!0,n=n|0,s=s|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new aue(l,n,s,r,a)),l},changeOneWhitespace:(n,s,r)=>{t=!0,s=s|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:s,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const n=new Set;for(const l of i)n.add(l.id);const s=new Map;for(const l of t)s.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!n.has(d.id)){if(s.has(d.id)){const h=s.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_insertWhitespace(e){const t=cT.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):i=0;const n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){e=e|0;const i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e),n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+this._paddingTop}getWhitespaceMinWidth(){if(this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(e=e|0,e<0)return 1;const t=this._lineCount|0;let i=1,n=t;for(;i=a+r)i=s+1;else{if(e>=a)return s;n=s}}return i>t?t:i}getLinesViewportData(e,t){e=e|0,t=t|0;const i=this.getLineNumberAtOrAfterVerticalOffset(e)|0,n=this.getVerticalOffsetForLineNumber(i)|0;let s=this._lineCount|0,r=this.getFirstWhitespaceIndexAfterLineNumber(i)|0;const a=this.getWhitespacesCount()|0;let l,c;r===-1?(r=a,c=s+1,l=0):(c=this.getAfterLineNumberForWhitespaceIndex(r)|0,l=this.getHeightForWhitespaceIndex(r)|0);let d=n,h=d;const u=5e5;let g=0;n>=u&&(g=Math.floor(n/u)*u,g=Math.floor(g/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight,h-=g);const f=[],p=e+(t-e)/2;let _=-1;for(let v=i;v<=s;v++){const S=this.getLineHeightForLineNumber(v);if(_===-1){const x=d,k=d+S;(x<=p&&pp)&&(_=v)}for(d+=S,f[v-i]=h,h+=S;c===v;)h+=l,d+=l,r++,r>=a?c=s+1:(c=this.getAfterLineNumberForWhitespaceIndex(r)|0,l=this.getHeightForWhitespaceIndex(r)|0);if(d>=t){s=v;break}}_===-1&&(_=s);const b=this.getVerticalOffsetForLineNumber(s)|0;let C=i,w=s;if(Ct&&w--}return{bigNumbersDelta:g,startLineNumber:i,endLineNumber:s,relativeVerticalOffset:f,centeredLineNumber:_,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),s=this.getHeightForWhitespaceIndex(i);if(e>=n+s)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t),s=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:s,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const s=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;s.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return s}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e=e|0,this._arr[e].height}};const cue=125;class ab{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class due extends A{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new P),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new ab(0,0,0,0),this._scrollable=this._register(new u_({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new k4(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class hue extends A{constructor(e,t,i,n){super(),this._configuration=e;const s=this._configuration.options,r=s.get(165),a=s.get(96);this._linesLayout=new lue(t,s.get(75),a.top,a.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new due(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new ab(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130)?cue:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(75)&&this._linesLayout.setDefaultLineHeight(t.get(75)),e.hasChanged(96)){const i=t.get(96);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(165)){const i=t.get(165),n=i.contentWidth,s=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new ab(n,r.contentWidth,s,this._getContentHeight(n,s,a)))}else this._updateHeight();e.hasChanged(130)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const n=this._configuration.options.get(117);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return n.get(119)?s+=Math.max(0,t-n.get(75)-n.get(96).bottom):n.get(117).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new ab(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new tW(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new tW(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(166),n=e.get(59),s=e.get(165);if(i.isViewportWrapping){const r=e.get(81);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+s.verticalScrollbarWidth:t}else{const r=e.get(118)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+s.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new ab(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){const t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class ug{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class uue{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new ug(new L(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class gue{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,s=e.options;let r;if(s.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new R(n.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new R(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);r=new L(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new d$(r,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){const n=new L(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,$0(this.configuration.options),j0(this.configuration.options),t,i),s=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let h=s;h<=r;h++)c[h-s]=[];let d=!1;for(let h=0,u=n.length;h0?this._projectionData.breakOffsets[i-1]:0,s=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new Fa(0,0,c+1,this._projectionData.injectionOptions[d],0));r=Fa.applyInjectedText(e.getLineContent(t),a).substring(n,s)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1});return i>0&&(r=i9(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,s,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let h=null;if(c){h=[];let g=0,f=0;for(let p=0;p0?l.breakOffsets[p-1]:0,C=l.breakOffsets[p];for(;fC)break;if(b0?l.wrappedTextIndentLength:0,D=k+Math.max(v-b,0),I=k+Math.min(S-b,C-b);D!==I&&_.push(new uue(D,I,x.inlineClassName,x.inlineClassNameAffectsLetterSpacing))}}if(S<=C)g+=w,f++;else break}}}let u;if(c){const g=[];for(let f=0;f{g.push({offset:p,text:b.substring(d[f].content),tokenMetadata:C.metadata})}):g.push({offset:p,text:d[f].content,tokenMetadata:$t.defaultTokenMetadata})}u=e.tokenization.getLineTokens(t).withInserted(g)}else u=e.tokenization.getLineTokens(t);for(let g=i;g0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],l=e.sliceAndInflate(r,a,s);let c=l.getLineContent();i>0&&(c=i9(n.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,h=c.length+1,u=i+1=cI.length)for(let e=1;e<=o;e++)cI[e]=pue(e);return cI[o]}function pue(o){return new Array(o+1).join(" ")}class mue{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Lf(e);const i=this.values,n=this.prefixSum,s=t.length;return s===0?!1:(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Lf(e),t=Lf(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Lf(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,s=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],r=s-this.values[n],e=s)t=n+1;else break;return new J$(n,e-r)}}class _ue{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new J$(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=dL(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+i;for(let s=0;st)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class Cue{constructor(e,t,i,n,s,r,a,l,c,d,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this.wrapOnEscapedLineFeeds=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new wue(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),s=i.length,r=this.createLineBreaksComputer(),a=new Qc(Fa.fromDecorations(n));for(let p=0;pb.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(L.compareRangesUsingStarts);let h=1,u=0,g=-1,f=g+1=h&&_<=u,C=lI(l[p],!b);c[p]=C.getViewLineCount(),this.modelLineProjections[p]=C}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new _ue(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=vue(t),n=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(L.compareRangesUsingStarts);if(i.length===n.length){let u=!1;for(let g=0;g({range:u,options:Te.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,s);const r=i;let a=1,l=0,c=-1,d=c+1=a&&g<=l?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),f=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),f=!0)),f){const p=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,p)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===n,d=this.wordBreak===s;if(r&&a&&l&&c&&d)return!1;const h=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let u=null;if(h){u=[];for(let g=0,f=this.modelLineProjections.length;g2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,h=n.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+l-1,f=h+1,p=f+(s-l)-1,c=!0):st?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new n9(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new R(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new R(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=n.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=l===n.modelLineNumber?n.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let u=d;u{if(g.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||g.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,g.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new Ku(g.visibleColumn,f,g.className,new Ib(g.horizontalLine.top,p.column),-1,-1):_.lineNumber!!g))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let s=[];const r=[],a=[],l=i.lineNumber-1,c=n.lineNumber-1;let d=null;for(let f=l;f<=c;f++){const p=this.modelLineProjections[f];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,f===l?i.column:1),b=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(f+1)),C=b-_+1;let w=0;C>1&&p.getViewLineMinColumn(this.model,f+1,b)===1&&(w=_===0?1:2),r.push(C),a.push(w),d===null&&(d=new R(f+1,0))}else d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,f)),d=null)}d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,u=new Array(h);let g=0;for(let f=0,p=s.length;ft&&(f=!0,g=t-s+1),h.getViewLinesData(this.model,c+1,u,g,s-e,i,l),s+=g,f)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,r=n.remainder,a=this.modelLineProjections[s],l=a.getViewLineMinColumn(this.model,s+1,r),c=a.getViewLineMaxColumn(this.model,s+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new R(s+1,d)).equals(i)?new R(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new L(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new R(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new L(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){const r=this.model.validatePosition(new R(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(s)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new R(n?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(c);let u;return d?s?u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(c+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,l,i),u}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return L.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new L(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,s,r){const a=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),l=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(l.lineNumber-a.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new L(a.lineNumber,1,l.lineNumber,l.column),t,i,n,s,r);let c=[];const d=a.lineNumber-1,h=l.lineNumber-1;let u=null;for(let _=d;_<=h;_++)if(this.modelLineProjections[_].isVisible())u===null&&(u=new R(_+1,_===d?a.column:1));else if(u!==null){const C=this.model.getLineMaxColumn(_);c=c.concat(this.model.getDecorationsInRange(new L(u.lineNumber,u.column,_,C),t,i,n,s)),u=null}u!==null&&(c=c.concat(this.model.getDecorationsInRange(new L(u.lineNumber,u.column,l.lineNumber,l.column),t,i,n,s)),u=null),c.sort((_,b)=>{const C=L.compareRangesUsingStarts(_.range,b.range);return C===0?_.idb.id?1:0:C});const g=[];let f=0,p=null;for(const _ of c){const b=_.id;p!==b&&(p=b,g[f++]=_)}return g}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function vue(o){if(o.length===0)return[];const e=o.slice();e.sort(L.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let s=1,r=e.length;sn+1?(t.push(new L(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new L(i,1,n,1)),t}class n9{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class s9{constructor(e,t){this.modelRange=e,this.viewLines=t}}class wue{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class Sue{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new bue(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new aT(t,i)}onModelLinesInserted(e,t,i,n){return new lT(t,i)}onModelLineChanged(e,t,i){return[!1,new Q$(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let s=0;s>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=I4.create(this.model),this.glyphLanes=new yue(0),this.model.isTooLargeForTokenization())this._lines=new Sue(this.model);else{const h=this._configuration.options,u=h.get(59),g=h.get(156),f=h.get(166),p=h.get(155),_=h.get(146),b=h.get(160);this._lines=new Cue(this._editorId,this.model,n,s,u,this.model.getOptions().tabSize,g,f.wrappingColumn,p,_,b)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new eue(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new hue(this._configuration,this.getLineCount(),this._getCustomLineHeights(),r)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Ahe(h)),this._eventDispatcher.emitOutgoingEvent(new D4(h.oldScrollWidth,h.oldScrollLeft,h.oldScrollHeight,h.oldScrollTop,h.scrollWidth,h.scrollLeft,h.scrollHeight,h.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(h=>{this._eventDispatcher.emitOutgoingEvent(h)})),this._decorations=new gue(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(h=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,h)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(tk.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Whe)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Ohe(h))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(5)?this.model.getCustomLineHeightsDecorations(this._editorId).map(i=>{const n=i.range.startLineNumber,s=this.coordinatesConverter.convertModelRangeToViewRange(new L(n,1,n,this.model.getLineMaxColumn(n)));return{decorationId:i.id,startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,lineHeight:i.options.lineHeight||0}}):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new L(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Mhe(e)),this._eventDispatcher.emitOutgoingEvent(new ok(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new zhe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Ehe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Nhe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new R(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new r9(t,this._viewportStart.startLineDelta)}return new r9(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,s=n.get(59),r=n.get(156),a=n.get(166),l=n.get(155),c=n.get(146);this._lines.setWrappingSettings(s,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new S1),e.emitViewEvent(new y1),e.emitViewEvent(new Gh(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(104)&&(this._decorations.reset(),e.emitViewEvent(new Gh(null))),t.hasChanged(112)&&(this._decorations.reset(),e.emitViewEvent(new Gh(null))),e.emitViewEvent(new The(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),xf.shouldRecreate(t)&&(this.cursorConfig=new xf(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(i=>{try{const s=this._eventDispatcher.beginEmitViewEvents();let r=!1,a=!1;const l=i instanceof dg?i.rawContentChangedEvent.changes:i.changes,c=i instanceof dg?i.rawContentChangedEvent.versionId:null,d=this._lines.createLineBreaksComputer();for(const g of l)switch(g.changeType){case 4:{for(let f=0;f!b.ownerId||b.ownerId===this._editorId)),d.addRequest(p,_,null)}break}case 2:{let f=null;g.injectedText&&(f=g.injectedText.filter(p=>!p.ownerId||p.ownerId===this._editorId)),d.addRequest(g.detail,f,null);break}}const h=d.finalize(),u=new Qc(h);for(const g of l)switch(g.changeType){case 1:{this._lines.onModelFlushed(),s.emitViewEvent(new S1),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),r=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(c,g.fromLineNumber,g.toLineNumber);f!==null&&(s.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),r=!0;break}case 4:{const f=u.takeCount(g.detail.length),p=this._lines.onModelLinesInserted(c,g.fromLineNumber,g.toLineNumber,f);p!==null&&(s.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),r=!0;break}case 2:{const f=u.dequeue(),[p,_,b,C]=this._lines.onModelLineChanged(c,g.lineNumber,f);a=p,_&&s.emitViewEvent(_),b&&(s.emitViewEvent(b),this.viewLayout.onLinesInserted(b.fromLineNumber,b.toLineNumber)),C&&(s.emitViewEvent(C),this.viewLayout.onLinesDeleted(C.fromLineNumber,C.toLineNumber));break}case 5:break}c!==null&&this._lines.acceptVersionId(c),this.viewLayout.onHeightMaybeChanged(),!r&&a&&(s.emitViewEvent(new y1),s.emitViewEvent(new Gh(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const n=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&n){const s=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(s){const r=this.coordinatesConverter.convertModelPositionToViewPosition(s.getStartPosition()),a=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:a+this._viewportStart.startLineDelta},1)}}try{const s=this._eventDispatcher.beginEmitViewEvents();i instanceof dg&&s.emitOutgoingEvent(new Zhe(i.contentChangedEvent)),this._cursor.onModelContentChanged(s,i)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._configuration.options.get(5)&&this._register(this.model.onDidChangeLineHeight(i=>{const n=i.changes.filter(s=>s.ownerId===this._editorId||s.ownerId===0);if(this.viewLayout.changeSpecialLineHeights(s=>{for(const r of n){const{decorationId:a,lineNumber:l,lineHeight:c}=r,d=this.coordinatesConverter.convertModelRangeToViewRange(new L(l,1,l,this.model.getLineMaxColumn(l)));c!==null?s.insertOrChangeCustomLineHeight(a,d.startLineNumber,d.endLineNumber,c):s.removeCustomLineHeight(a)}}),n.length>0){const s=new S$(n);this._eventDispatcher.emitOutgoingEvent(new Qhe(s))}})),this._configuration.options.get(172)&&this._register(this.model.onDidChangeFont(i=>{const n=i.changes.filter(s=>s.ownerId===this._editorId||s.ownerId===0);if(n.length>0){const s=new y$(n);this._eventDispatcher.emitOutgoingEvent(new Jhe(s))}})),this._register(this.model.onDidChangeTokens(i=>{const n=[];for(let s=0,r=i.ranges.length;s{this._eventDispatcher.emitSingleViewEvent(new Phe),this.cursorConfig=new xf(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Ghe(i))})),this._register(this.model.onDidChangeLanguage(i=>{this.cursorConfig=new xf(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Khe(i))})),this._register(this.model.onDidChangeOptions(i=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const n=this._eventDispatcher.beginEmitViewEvents();n.emitViewEvent(new S1),n.emitViewEvent(new y1),n.emitViewEvent(new Gh(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new xf(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Yhe(i))})),this._register(this.model.onDidChangeDecorations(i=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Gh(i)),this._eventDispatcher.emitOutgoingEvent(new qhe(i))}))}getFontSizeAtPosition(e){if(!this._configuration.options.get(172))return null;const i=this.model.getFontDecorationsInRange(L.fromPositions(e),this._editorId);let n=this._configuration.options.get(59).fontSize+"px";for(const s of i)if(s.options.fontSize){n=s.options.fontSize;break}return n}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;const s=this._captureStableViewport();let r=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(a.emitViewEvent(new S1),a.emitViewEvent(new y1),a.emitViewEvent(new Gh(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());const l=s.viewportStartModelPosition?.lineNumber;l&&n.some(d=>d.startLineNumber<=l&&l<=d.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new $he)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(165),t=this._configuration.options.get(75),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new L(s,this.getLineMinColumn(s),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const n=[];let s=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,h=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=hs(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Qr(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(const n of t){const s=n.range;if(s.startLineNumber>e||s.endLineNumber0?Ho.RTL:Ho.LTR}getTextDirection(e){const t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){const t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){const s=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),a=this.getTabSize(),l=this._lines.getViewLineData(e);return l.inlineDecorations&&(t=[...t,...l.inlineDecorations.map(c=>c.toInlineDecoration(e))]),new Zo(l.minColumn,l.maxColumn,l.content,l.continuesWithWrappedLine,s,r,l.tokens,t,a,l.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new nle(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,$0(this._configuration.options),j0(this._configuration.options)),i=new Lue;for(const n of t){const s=n.options,r=s.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(l,s.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(L.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===qo||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new L(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(59),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===js.fontFamily;let c;return l?c=js.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${js.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,g=c===s?r-1:h.length;h===""?l+="
":l+=sue(h,d.inflate(),t,u,g,a,Ln)}return l}_getColorMap(){const e=ui.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new jhe);return}this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new Hb(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new Hb(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,s){this._withViewEventsCollector(r=>r.emitViewEvent(new Hb(e,!1,i,null,n,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Bhe),this._eventDispatcher.emitOutgoingEvent(new Uhe))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class I4{static create(e){const t=e._setTrackedRange(null,new L(1,1,1,1),1);return new I4(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new R(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new L(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-s}invalidate(){this._isValid=!1}}class Lue{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===s&&c+1>=i){n>c&&(a[a.length-1]=n);return}a.push(s,i,n)}else{const a=new QC(e,t,[s,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class kue{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&o9(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>Due(t,i),[]);return o9(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Due(o,e){const t=[];let i=0,n=0;for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Yl=function(o,e){return function(t,i){e(t,i,o)}},uu;let Pg=class extends A{static{uu=this}static{this.dropIntoEditorDecorationOptions=Te.register({description:"workbench-dnd-target",className:"dnd-target"})}get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,s,r,a,l,c,d,h,u){super(),this.languageConfigurationService=h,this._deliveryQueue=pQ(),this._contributions=this._register(new Mce),this._onDidDispose=this._register(new P),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new is(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new a9({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new a9({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new is(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new is(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new is(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new is(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new is(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new is(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new is(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new is(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new is(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new is(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new P({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new P),this._onBeginUpdate=this._register(new P),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new P),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new P),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,s.willCreateCodeEditor();const g={...t};if(this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Eue,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?M.SimpleEditorContext:M.EditorContext),g,d)),this._register(this._configuration.onDidChange(_=>{this._onDidChangeConfiguration.fire(_);const b=this._configuration.options;if(_.hasChanged(165)){const C=b.get(165);this._onDidLayoutChange.fire(C)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),i.contextKeyValues)for(const[_,b]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(_,b);this._notificationService=c,this._codeEditorService=s,this._commandService=r,this._themeService=l,this._register(new Tue(this,this._contextKeyService)),this._register(new Rue(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new f_([Ie,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let f;Array.isArray(i.contributions)?f=i.contributions:f=Ep.getEditorContributions(),this._contributions.initialize(this,f,this._instantiationService);for(const _ of Ep.getEditorActions()){if(this._actions.has(_.id)){Ee(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const b=new x$(_.id,_.label,_.alias,_.metadata,_.precondition??void 0,C=>this._instantiationService.invokeFunction(w=>Promise.resolve(_.runEditorCommand(w,this,C))),this._contextKeyService);this._actions.set(b.id,b)}const p=()=>!this._configuration.options.get(104)&&this._configuration.options.get(43).enabled;this._register(new hee(this._domElement,{onDragOver:_=>{if(!p())return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b?.position&&this.showDropIndicatorAt(b.position)},onDrop:async _=>{if(!p()||(this.removeDropIndicator(),!_.dataTransfer))return;const b=this.getTargetAtClientPoint(_.clientX,_.clientY);b?.position&&this._onDropIntoEditor.fire({position:b.position,event:_})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new bN(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return xw.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?ft.getWordAtPosition(this._modelData.model,this._configuration.options.get(148),this._configuration.options.get(147),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` `?i=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),this.hasModel()?n&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Au._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Au._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return Au._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return-1;const t=this._modelData.viewModel,i=t.coordinatesConverter,n=R.lift(e);if(i.modelPositionIsVisible(n)){const s=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(s.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(n=>D.lift(n)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return hi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!R.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!D.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new D(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!R.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new D(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=le.isISelection(e),n=D.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new le(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new D(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!D.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(D.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,s=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const s=i;this._type(e,s.text||"");return}case"replacePreviousChar":{const s=i;this._compositionType(e,s.text||"",s.replaceCharCnt||0,0,0);return}case"compositionType":{const s=i;this._compositionType(e,s.text||"",s.replacePrevCharCnt||0,s.replaceNextCharCnt||0,s.positionDelta||0);return}case"paste":{const s=i;this._paste(e,s.text||"",s.pasteOnNewLine||!1,s.multicursorText||null,s.mode||null,s.clipboardEvent);return}case"cut":this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,Te);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s,r){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,n,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new D(l.lineNumber,l.column,c.lineNumber,c.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=om.getEditorCommand(t);return n?(i=i||{},Xi(i)&&(i.source=e),this._instantiationService.invokeFunction(s=>{Promise.resolve(n.runEditorCommand(s,this,i)).then(void 0,Te)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(104)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(104)?!1:(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map(i=>({range:i.range,text:i.text})),void 0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(104))return!1;let n;i?Array.isArray(i)?n=()=>i:n=i:n=()=>null;let s,r;return e instanceof bq?(r=e,s=e.metadata.source):(r=Jn.unknown({name:s}),s=e),this._onBeforeExecuteEdit.fire({source:s??void 0}),this._modelData.viewModel.executeEdits(s,t,n,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Efe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,By(t),Hy(t))}getDecorationsInRange(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,By(t),Hy(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(165)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isWidgetFocused()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),n=this._configuration.options.get(165),s=Au._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),a=this.getLineHeightForPosition(t);return{top:s,left:r,height:a}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){wn(e,this._configuration.options.get(59))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new vfe(this._id,this._configuration,e,yF.create(me(this._domElement)),FF.create(this._configuration.options),a=>ro(me(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._editorWidgetFocus.setValue(a.hasFocus);break;case 3:this._onDidScrollChange.fire(a);break;case 4:this._onDidChangeViewZones.fire();break;case 5:this._onDidChangeHiddenAreas.fire();break;case 6:this._onDidAttemptReadOnlyEdit.fire();break;case 7:{if(a.reachedMaxCursorCount){const h=this.getOption(89),u=m(83,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(U_.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m(84,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",s,r,a,l)},type:s=>{this._type("keyboard",s)},compositionType:(s,r,a,l)=>{this._compositionType("keyboard",s,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(s,r,a,l)=>{const c={text:s,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:s=>{const r={text:s};this._commandService.executeCommand("type",r)},compositionType:(s,r,a,l)=>{if(a||l){const c={text:s,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:s,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new UD(e.coordinatesConverter);return i.onKeyDown=s=>this._onKeyDown.fire(s),i.onKeyUp=s=>this._onKeyUp.fire(s),i.onContextMenu=s=>this._onContextMenu.fire(s),i.onMouseMove=s=>this._onMouseMove.fire(s),i.onMouseLeave=s=>this._onMouseLeave.fire(s),i.onMouseDown=s=>this._onMouseDown.fire(s),i.onMouseUp=s=>this._onMouseUp.fire(s),i.onMouseDrag=s=>this._onMouseDrag.fire(s),i.onMouseDrop=s=>this._onMouseDrop.fire(s),i.onMouseDropCanceled=s=>this._onMouseDropCanceled.fire(s),i.onMouseWheel=s=>this._onMouseWheel.fire(s),[new eR(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),options:Au.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}};sf=Au=Lfe([mc(3,pe),mc(4,at),mc(5,Vt),mc(6,Ne),mc(7,pi),mc(8,Li),mc(9,Mn),mc(10,ai),mc(11,ue)],sf);let xfe=0,Dfe=class{constructor(e,t,i,n,s,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=r}dispose(){vt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};class WB extends F{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new P(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new P(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class hs extends P{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class kfe extends F{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=N.editorSimpleInput.bindTo(t),this._editorFocus=N.focus.bindTo(t),this._textInputFocus=N.textInputFocus.bindTo(t),this._editorTextFocus=N.editorTextFocus.bindTo(t),this._tabMovesFocus=N.tabMovesFocus.bindTo(t),this._editorReadonly=N.readOnly.bindTo(t),this._inDiffEditor=N.inDiffEditor.bindTo(t),this._editorColumnSelection=N.columnSelection.bindTo(t),this._hasMultipleSelections=N.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=N.hasNonEmptySelection.bindTo(t),this._canUndo=N.canUndo.bindTo(t),this._canRedo=N.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Km.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(e.get(164)||Km.getTabFocusMode()),this._editorReadonly.set(e.get(104)),this._inDiffEditor.set(e.get(70)),this._editorColumnSelection.set(e.get(28))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Ife extends F{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=N.languageId.bindTo(t),this._hasCompletionItemProvider=N.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=N.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=N.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=N.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=N.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=N.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=N.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=N.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=N.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=N.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=N.hasReferenceProvider.bindTo(t),this._hasRenameProvider=N.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=N.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=N.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=N.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=N.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=N.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=N.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=N.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===Ie.walkThroughSnippet||e.uri.scheme===Ie.vscodeChatCodeBlock)})}}class Efe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(n=>{this._isChangingDecorations||e.call(t,n)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const Nfe=encodeURIComponent("");function op(o){return Nfe+encodeURIComponent(o.toString())+Tfe}const Rfe=encodeURIComponent('');function BB(o){return Rfe+encodeURIComponent(o.toString())+Mfe}jr((o,e)=>{const t=o.getColor(MD);t&&(e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${op(t)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${op(t)}"); }`));const i=o.getColor(vd);i&&(e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${op(i)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${op(i)}"); }`));const n=o.getColor(Gl);n&&(e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${op(n)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${op(n)}"); }`));const s=o.getColor(Xoe);s&&(e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${BB(s)}") no-repeat bottom left; }`),e.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${BB(s)}"); }`));const r=o.getColor(ece);r&&(e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`),e.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${r.rgba.a}; }`))});function Ot(o){return new Pfe(o)}class Pfe extends zU{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function kc(o,e){return o}function nk(o){return Ot(o)}const Td=Ve("accessibilitySignalService");class Ae{static register(e){return new Ae(e.fileName)}static{this.error=Ae.register({fileName:"error.mp3"})}static{this.warning=Ae.register({fileName:"warning.mp3"})}static{this.success=Ae.register({fileName:"success.mp3"})}static{this.foldedArea=Ae.register({fileName:"foldedAreas.mp3"})}static{this.break=Ae.register({fileName:"break.mp3"})}static{this.quickFixes=Ae.register({fileName:"quickFixes.mp3"})}static{this.taskCompleted=Ae.register({fileName:"taskCompleted.mp3"})}static{this.taskFailed=Ae.register({fileName:"taskFailed.mp3"})}static{this.terminalBell=Ae.register({fileName:"terminalBell.mp3"})}static{this.diffLineInserted=Ae.register({fileName:"diffLineInserted.mp3"})}static{this.diffLineDeleted=Ae.register({fileName:"diffLineDeleted.mp3"})}static{this.diffLineModified=Ae.register({fileName:"diffLineModified.mp3"})}static{this.requestSent=Ae.register({fileName:"requestSent.mp3"})}static{this.responseReceived1=Ae.register({fileName:"responseReceived1.mp3"})}static{this.responseReceived2=Ae.register({fileName:"responseReceived2.mp3"})}static{this.responseReceived3=Ae.register({fileName:"responseReceived3.mp3"})}static{this.responseReceived4=Ae.register({fileName:"responseReceived4.mp3"})}static{this.clear=Ae.register({fileName:"clear.mp3"})}static{this.save=Ae.register({fileName:"save.mp3"})}static{this.format=Ae.register({fileName:"format.mp3"})}static{this.voiceRecordingStarted=Ae.register({fileName:"voiceRecordingStarted.mp3"})}static{this.voiceRecordingStopped=Ae.register({fileName:"voiceRecordingStopped.mp3"})}static{this.progress=Ae.register({fileName:"progress.mp3"})}static{this.chatEditModifiedFile=Ae.register({fileName:"chatEditModifiedFile.mp3"})}static{this.editsKept=Ae.register({fileName:"editsKept.mp3"})}static{this.editsUndone=Ae.register({fileName:"editsUndone.mp3"})}static{this.nextEditSuggestion=Ae.register({fileName:"nextEditSuggestion.mp3"})}static{this.terminalCommandSucceeded=Ae.register({fileName:"terminalCommandSucceeded.mp3"})}static{this.chatUserActionRequired=Ae.register({fileName:"chatUserActionRequired.mp3"})}static{this.codeActionTriggered=Ae.register({fileName:"codeActionTriggered.mp3"})}static{this.codeActionApplied=Ae.register({fileName:"codeActionApplied.mp3"})}constructor(e){this.fileName=e}}class Afe{constructor(e){this.randomOneOf=e}}class tt{constructor(e,t,i,n,s,r,a=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=r,this.managesOwnEnablement=a}static{this._signals=new Set}static register(e){const t=new Afe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new tt(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return tt._signals.add(i),i}static{this.errorAtPosition=tt.register({name:m(1576,"Error at Position"),sound:Ae.error,announcementMessage:m(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"})}static{this.warningAtPosition=tt.register({name:m(1578,"Warning at Position"),sound:Ae.warning,announcementMessage:m(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"})}static{this.errorOnLine=tt.register({name:m(1580,"Error on Line"),sound:Ae.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:m(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"})}static{this.warningOnLine=tt.register({name:m(1582,"Warning on Line"),sound:Ae.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:m(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"})}static{this.foldedArea=tt.register({name:m(1584,"Folded Area on Line"),sound:Ae.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:m(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"})}static{this.break=tt.register({name:m(1586,"Breakpoint on Line"),sound:Ae.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:m(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"})}static{this.inlineSuggestion=tt.register({name:m(1588,"Inline Suggestion on Line"),sound:Ae.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"})}static{this.nextEditSuggestion=tt.register({name:m(1589,"Next Edit Suggestion on Line"),sound:Ae.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:m(1590,"Next Edit Suggestion")})}static{this.terminalQuickFix=tt.register({name:m(1591,"Terminal Quick Fix"),sound:Ae.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:m(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"})}static{this.onDebugBreak=tt.register({name:m(1593,"Debugger Stopped on Breakpoint"),sound:Ae.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:m(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"})}static{this.noInlayHints=tt.register({name:m(1595,"No Inlay Hints on Line"),sound:Ae.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:m(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"})}static{this.taskCompleted=tt.register({name:m(1597,"Task Completed"),sound:Ae.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:m(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"})}static{this.taskFailed=tt.register({name:m(1599,"Task Failed"),sound:Ae.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:m(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"})}static{this.terminalCommandFailed=tt.register({name:m(1601,"Terminal Command Failed"),sound:Ae.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:m(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"})}static{this.terminalCommandSucceeded=tt.register({name:m(1603,"Terminal Command Succeeded"),sound:Ae.terminalCommandSucceeded,announcementMessage:m(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"})}static{this.terminalBell=tt.register({name:m(1605,"Terminal Bell"),sound:Ae.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:m(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"})}static{this.notebookCellCompleted=tt.register({name:m(1607,"Notebook Cell Completed"),sound:Ae.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:m(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"})}static{this.notebookCellFailed=tt.register({name:m(1609,"Notebook Cell Failed"),sound:Ae.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:m(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"})}static{this.diffLineInserted=tt.register({name:m(1611,"Diff Line Inserted"),sound:Ae.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"})}static{this.diffLineDeleted=tt.register({name:m(1612,"Diff Line Deleted"),sound:Ae.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"})}static{this.diffLineModified=tt.register({name:m(1613,"Diff Line Modified"),sound:Ae.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"})}static{this.chatEditModifiedFile=tt.register({name:m(1614,"Chat Edit Modified File"),sound:Ae.chatEditModifiedFile,announcementMessage:m(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"})}static{this.chatRequestSent=tt.register({name:m(1616,"Chat Request Sent"),sound:Ae.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:m(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"})}static{this.chatResponseReceived=tt.register({name:m(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Ae.responseReceived1,Ae.responseReceived2,Ae.responseReceived3,Ae.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"})}static{this.codeActionTriggered=tt.register({name:m(1619,"Code Action Request Triggered"),sound:Ae.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:m(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"})}static{this.codeActionApplied=tt.register({name:m(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:Ae.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"})}static{this.progress=tt.register({name:m(1622,"Progress"),sound:Ae.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:m(1623,"Progress"),settingsKey:"accessibility.signals.progress"})}static{this.clear=tt.register({name:m(1624,"Clear"),sound:Ae.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:m(1625,"Clear"),settingsKey:"accessibility.signals.clear"})}static{this.save=tt.register({name:m(1626,"Save"),sound:Ae.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:m(1627,"Save"),settingsKey:"accessibility.signals.save"})}static{this.format=tt.register({name:m(1628,"Format"),sound:Ae.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:m(1629,"Format"),settingsKey:"accessibility.signals.format"})}static{this.voiceRecordingStarted=tt.register({name:m(1630,"Voice Recording Started"),sound:Ae.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"})}static{this.voiceRecordingStopped=tt.register({name:m(1631,"Voice Recording Stopped"),sound:Ae.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"})}static{this.editsKept=tt.register({name:m(1632,"Edits Kept"),sound:Ae.editsKept,announcementMessage:m(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"})}static{this.editsUndone=tt.register({name:m(1634,"Undo Edits"),sound:Ae.editsUndone,announcementMessage:m(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"})}static{this.chatUserActionRequired=tt.register({name:m(1636,"Chat User Action Required"),sound:Ae.chatUserActionRequired,announcementMessage:m(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0})}}function HB(o,e,t,i=en.ofCaller()){return $U({debugName:()=>`Configuration Key "${o}"`},n=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(o)&&n(s)}),()=>t.getValue(o)??e,i)}function bl(o,e,t,i=en.ofCaller()){const n=o.bindTo(e),s=new z;return Un({debugName:()=>`Set Context Key "${o.key}"`},r=>{const a=t(r);return n.set(a),a},i).recomputeInitiallyAndOnChange(s),s}const Bq=Ve("progressService");class Jc{static{this.None=Object.freeze({report(){}})}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}const yd=Ve("editorProgressService");class el{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new el(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new el(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}const of={RESOURCES:"ResourceURLs",TEXT:Di.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},Ofe=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let sk=Ofe;const Ffe=new $n(()=>sk("mouse",!1)),Wfe=new $n(()=>sk("element",!1));function Bfe(o){sk=o}function oc(o){return o==="element"?Wfe.value:Ffe.value}function Hq(){return sk("element",!0)}function ad(o,e){if(o!==void 0){const t=o.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=ad(i[1].trim(),e)),`var(${i[0]}, ${e})`}return o}return e}function VB(o){const e=o.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==o&&console.warn(`CSS ident value ${o} modified to ${e} to be safe for CSS`),e}function Hd(o){return`'${o.replaceAll(/'/g,"\\000027")}'`}function Yl(o){return o?po`url('${CSS.escape(PU.uriToBrowserUri(o).toString(!0))}')`:"url('')"}function mS(o,e=!1){const t=CSS.escape(o);return!e&&t!==o&&console.warn(`CSS class name ${o} modified to ${t} to be safe for CSS`),t}function po(o,...e){return o.reduce((t,i,n)=>{const s=e[n]||"";return t+i+s},"")}class fE{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=` -`){return this._parts.join(e)}}function Hfe(o){const e=Vfe(o);if(e&&e.length>0)return new Uint32Array(e)}let jo=0;const oh=new Uint32Array(10);function Vfe(o){if(jo=0,dl(o,pE,4352),jo>0||(dl(o,mE,4449),jo>0)||(dl(o,_E,4520),jo>0)||(dl(o,Cu,12593),jo))return oh.subarray(0,jo);if(o>=44032&&o<=55203){const e=o-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i=0&&(s<_E.length?dl(s,_E,0):4520+s-125930)return oh.subarray(0,jo)}}function dl(o,e,t){o>=t&&o>8&&(oh[jo++]=o>>8&255),o>>16&&(oh[jo++]=o>>16&255))}const pE=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),mE=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),_E=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Cu=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function VF(...o){return function(e,t){for(let i=0,n=o.length;i0?[{start:0,end:e.length}]:[]:null}function zq(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t===-1?null:[{start:t,end:t+o.length}]}function Uq(o,e){return vR(o.toLowerCase(),e.toLowerCase(),0,0)}function vR(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]===e[i]){let n=null;return(n=vR(o,e,t+1,i+1))?$F({start:i,end:i+1},n):null}return vR(o,e,t,i+1)}function zF(o){return 97<=o&&o<=122}function ok(o){return 65<=o&&o<=90}function UF(o){return 48<=o&&o<=57}function $q(o){return o===32||o===9||o===10||o===13}const jq=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>jq.add(o.charCodeAt(0)));function dL(o){return $q(o)||jq.has(o)}function zB(o,e){return o===e||dL(o)&&dL(e)}const bE=new Map;function UB(o){if(bE.has(o))return bE.get(o);let e;const t=Hfe(o);return t&&(e=t),bE.set(o,e),e}function qq(o){return zF(o)||ok(o)||UF(o)}function $F(o,e){return e.length===0?e=[o]:o.end===e[0].start?e[0].start=o.start:e.unshift(o),e}function Kq(o,e){for(let t=e;t0&&!qq(o.charCodeAt(t-1)))return t}return o.length}function wR(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=wR(o,e,t+1,i+1);!n&&(s=Kq(e,s)).6}function jfe(o){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=o;return t>.2&&e<.8&&i>.6&&n<.2}function qfe(o){let e=0,t=0,i=0,n=0;for(let s=0;s60&&(e=e.substring(0,60));const t=Ufe(e);if(!jfe(t)){if(!$fe(t))return null;e=e.toLowerCase()}let i=null,n=0;for(o=o.toLowerCase();n0&&dL(o.charCodeAt(t-1)))return t;return o.length}const Gfe=VF(jv,Gq,zq),Zfe=VF(jv,Gq,Uq),$B=new ba(1e4);function jB(o,e,t=!1){if(typeof o!="string"||typeof e!="string")return null;let i=$B.get(o);i||(i=new RegExp(kee(o),"i"),$B.set(o,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?Zfe(o,e):Gfe(o,e)}function Yfe(o,e){const t=rf(o,o.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?c1(t):null}function Xfe(o,e,t,i,n,s){const r=Math.min(13,o.length);for(;t"u")return[];const e=[],t=o[1];for(let i=o.length-1;i>1;i--){const n=o[i]+t,s=e[e.length-1];s&&s.end===n?s.end=n+1:e.push({start:n,end:n+1})}return e}const wh=128;function jF(){const o=[],e=[];for(let t=0;t<=wh;t++)e[t]=0;for(let t=0;t<=wh;t++)o.push(e.slice(0));return o}function Yq(o){const e=[];for(let t=0;t<=o;t++)e[t]=0;return e}const Xq=Yq(2*wh),yR=Yq(2*wh),_c=jF(),vu=jF(),_S=jF();function bS(o,e){if(e<0||e>=o.length)return!1;const t=o.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!u4(t)}}function qB(o,e){if(e<0||e>=o.length)return!1;switch(o.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function F0(o,e,t){return e[o]!==t[o]}function Qfe(o,e,t,i,n,s,r=!1){for(;ewh?wh:o.length,l=i.length>wh?wh:i.length;if(t>=a||s>=l||a-t>l-s||!Qfe(e,t,a,n,s,l,!0))return;Jfe(a,l,t,s,e,n);let c=1,d=1,h=t,u=s;const g=[!1];for(c=1,h=t;hC,I=k?vu[c][d-1]+(_c[c][d-1]>0?-5:0):0,T=u>C+1&&_c[c][d-1]>0,A=T?vu[c][d-2]+(_c[c][d-2]>0?-5:0):0;if(T&&(!k||A>=I)&&(!L||A>=x))vu[c][d]=A,_S[c][d]=3,_c[c][d]=0;else if(k&&(!L||I>=x))vu[c][d]=I,_S[c][d]=2,_c[c][d]=0;else if(L)vu[c][d]=x,_S[c][d]=1,_c[c][d]=_c[c-1][d-1]+1;else throw new Error("not possible")}}if(!g[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const f=[vu[c][d],s];let p=0,_=0;for(;c>=1;){let C=d;do{const w=_S[c][C];if(w===3)C=C-2;else if(w===2)C=C-1;else break}while(C>=1);p>1&&e[t+c-1]===n[s+d-1]&&!F0(C+s-1,i,n)&&p+1>_c[c][C]&&(C=d),C===d?p++:p=1,_||(_=C),c--,d=C-1,f.push(d)}l-s===a&&r.boostFullMatch&&(f[0]+=2);const b=_-a;return f[0]-=b,f}function Jfe(o,e,t,i,n,s){let r=o-1,a=e-1;for(;r>=t&&a>=i;)n[r]===s[a]&&(yR[r]=a,r--),a--}function epe(o,e,t,i,n,s,r,a,l,c,d){if(e[t]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=o[t]===n[r]?7:5:F0(r,n,s)&&(r===0||!F0(r-1,n,s))?(h=o[t]===n[r]?7:5,u=!0):bS(s,r)&&(r===0||!bS(s,r-1))?h=5:(bS(s,r-1)||qB(s,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=F0(r,n,s)||bS(s,r-1)||qB(s,r-1)),t===i?r>l&&(h-=u?3:5):c?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function tpe(o,e,t,i,n,s,r){return ipe(o,e,t,i,n,s,!0,r)}function ipe(o,e,t,i,n,s,r,a){let l=rf(o,e,t,i,n,s,a);if(o.length>=3){const c=Math.min(7,o.length-1);for(let d=t+1;dl[0])&&(l=u))}}}return l}function npe(o,e){if(e+1>=o.length)return;const t=o[e],i=o[e+1];if(t!==i)return o.slice(0,e)+i+t+o.slice(e+2)}const spe="$(",KF=new RegExp(`\\$\\(${ye.iconNameExpression}(?:${ye.iconModifierExpression})?\\)`,"g"),ope=new RegExp(`(\\\\)?${KF.source}`,"g");function rpe(o){return o.replace(ope,(e,t)=>t?e:`\\${e}`)}const ape=new RegExp(`\\\\${KF.source}`,"g");function lpe(o){return o.replace(ape,e=>`\\${e}`)}const cpe=new RegExp(`(\\s)?(\\\\)?${KF.source}(\\s)?`,"g");function GF(o){return o.indexOf(spe)===-1?o:o.replace(cpe,(e,t,i,n)=>i?e:t||n||"")}function Qq(o){return o?o.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const CE=new RegExp(`\\$\\(${ye.iconNameCharacter}+\\)`,"g");function _g(o){CE.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=CE.lastIndex,s=CE.exec(o),r=o.substring(n,s?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),this.hasModel()?n&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(s),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?uu._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?uu._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return uu._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return-1;const t=this._modelData.viewModel,i=t.coordinatesConverter,n=R.lift(e);if(i.modelPositionIsVisible(n)){const s=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(s.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(n=>L.lift(n)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return oi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!R.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!L.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!R.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new L(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=ae.isISelection(e),n=L.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ae(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!L.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(L.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,s=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const s=i;this._type(e,s.text||"");return}case"replacePreviousChar":{const s=i;this._compositionType(e,s.text||"",s.replaceCharCnt||0,0,0);return}case"compositionType":{const s=i;this._compositionType(e,s.text||"",s.replacePrevCharCnt||0,s.replaceNextCharCnt||0,s.positionDelta||0);return}case"paste":{const s=i;this._paste(e,s.text||"",s.pasteOnNewLine||!1,s.multicursorText||null,s.mode||null,s.clipboardEvent);return}case"cut":this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,Ee);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s,r){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,n,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new L(l.lineNumber,l.column,c.lineNumber,c.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Ep.getEditorCommand(t);return n?(i=i||{},Ui(i)&&(i.source=e),this._instantiationService.invokeFunction(s=>{Promise.resolve(n.runEditorCommand(s,this,i)).then(void 0,Ee)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(104)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(104)?!1:(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map(i=>({range:i.range,text:i.text})),void 0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(104))return!1;let n;i?Array.isArray(i)?n=()=>i:n=i:n=()=>null;let s,r;return e instanceof M$?(r=e,s=e.metadata.source):(r=jn.unknown({name:s}),s=e),this._onBeforeExecuteEdit.fire({source:s??void 0}),this._modelData.viewModel.executeEdits(s,t,n,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Mue(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,$0(t),j0(t))}getDecorationsInRange(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,$0(t),j0(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(165)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isWidgetFocused()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),n=this._configuration.options.get(165),s=uu._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),a=this.getLineHeightForPosition(t);return{top:s,left:r,height:a}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){gn(e,this._configuration.options.get(59))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new xue(this._id,this._configuration,e,h4.create(pe(this._domElement)),L4.create(this._configuration.options),a=>Zs(pe(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._editorWidgetFocus.setValue(a.hasFocus);break;case 3:this._onDidScrollChange.fire(a);break;case 4:this._onDidChangeViewZones.fire();break;case 5:this._onDidChangeHiddenAreas.fire();break;case 6:this._onDidAttemptReadOnlyEdit.fire();break;case 7:{if(a.reachedMaxCursorCount){const h=this.getOption(89),u=m(83,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(g_.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m(84,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",s,r,a,l)},type:s=>{this._type("keyboard",s)},compositionType:(s,r,a,l)=>{this._compositionType("keyboard",s,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(s,r,a,l)=>{const c={text:s,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:s=>{const r={text:s};this._commandService.executeCommand("type",r)},compositionType:(s,r,a,l)=>{if(a||l){const c={text:s,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:s,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new GL(e.coordinatesConverter);return i.onKeyDown=s=>this._onKeyDown.fire(s),i.onKeyUp=s=>this._onKeyUp.fire(s),i.onContextMenu=s=>this._onContextMenu.fire(s),i.onMouseMove=s=>this._onMouseMove.fire(s),i.onMouseLeave=s=>this._onMouseLeave.fire(s),i.onMouseDown=s=>this._onMouseDown.fire(s),i.onMouseUp=s=>this._onMouseUp.fire(s),i.onMouseDrag=s=>this._onMouseDrag.fire(s),i.onMouseDrop=s=>this._onMouseDrop.fire(s),i.onMouseDropCanceled=s=>this._onMouseDropCanceled.fire(s),i.onMouseWheel=s=>this._onMouseWheel.fire(s),[new $N(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),options:uu.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}};Pg=uu=Iue([Yl(3,fe),Yl(4,et),Yl(5,Pt),Yl(6,Ie),Yl(7,ci),Yl(8,bi),Yl(9,kn),Yl(10,ti),Yl(11,he)],Pg);let Eue=0,Nue=class{constructor(e,t,i,n,s,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=r}dispose(){pt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};class a9 extends A{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new P(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new P(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class is extends P{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Tue extends A{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=N.editorSimpleInput.bindTo(t),this._editorFocus=N.focus.bindTo(t),this._textInputFocus=N.textInputFocus.bindTo(t),this._editorTextFocus=N.editorTextFocus.bindTo(t),this._tabMovesFocus=N.tabMovesFocus.bindTo(t),this._editorReadonly=N.readOnly.bindTo(t),this._inDiffEditor=N.inDiffEditor.bindTo(t),this._editorColumnSelection=N.columnSelection.bindTo(t),this._hasMultipleSelections=N.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=N.hasNonEmptySelection.bindTo(t),this._canUndo=N.canUndo.bindTo(t),this._canRedo=N.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(_m.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(e.get(164)||_m.getTabFocusMode()),this._editorReadonly.set(e.get(104)),this._inDiffEditor.set(e.get(70)),this._editorColumnSelection.set(e.get(28))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Rue extends A{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=N.languageId.bindTo(t),this._hasCompletionItemProvider=N.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=N.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=N.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=N.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=N.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=N.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=N.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=N.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=N.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=N.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=N.hasReferenceProvider.bindTo(t),this._hasRenameProvider=N.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=N.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=N.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=N.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=N.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=N.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=N.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=N.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===Le.walkThroughSnippet||e.uri.scheme===Le.vscodeChatCodeBlock)})}}class Mue{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(n=>{this._isChangingDecorations||e.call(t,n)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const Pue=encodeURIComponent("");function Ef(o){return Pue+encodeURIComponent(o.toString())+Aue}const Oue=encodeURIComponent('');function l9(o){return Oue+encodeURIComponent(o.toString())+Fue}Tr((o,e)=>{const t=o.getColor(WL);t&&(e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Ef(t)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${Ef(t)}"); }`));const i=o.getColor(Jc);i&&(e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Ef(i)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${Ef(i)}"); }`));const n=o.getColor(Tl);n&&(e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Ef(n)}") repeat-x bottom left; }`),e.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${Ef(n)}"); }`));const s=o.getColor(tse);s&&(e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${l9(s)}") no-repeat bottom left; }`),e.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${l9(s)}"); }`));const r=o.getColor(sae);r&&(e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`),e.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${r.rgba.a}; }`))});function Nt(o){return new Wue(o)}class Wue extends nz{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function ac(o,e){return o}function lk(o){return Nt(o)}const dd=We("accessibilitySignalService");class Me{static register(e){return new Me(e.fileName)}static{this.error=Me.register({fileName:"error.mp3"})}static{this.warning=Me.register({fileName:"warning.mp3"})}static{this.success=Me.register({fileName:"success.mp3"})}static{this.foldedArea=Me.register({fileName:"foldedAreas.mp3"})}static{this.break=Me.register({fileName:"break.mp3"})}static{this.quickFixes=Me.register({fileName:"quickFixes.mp3"})}static{this.taskCompleted=Me.register({fileName:"taskCompleted.mp3"})}static{this.taskFailed=Me.register({fileName:"taskFailed.mp3"})}static{this.terminalBell=Me.register({fileName:"terminalBell.mp3"})}static{this.diffLineInserted=Me.register({fileName:"diffLineInserted.mp3"})}static{this.diffLineDeleted=Me.register({fileName:"diffLineDeleted.mp3"})}static{this.diffLineModified=Me.register({fileName:"diffLineModified.mp3"})}static{this.requestSent=Me.register({fileName:"requestSent.mp3"})}static{this.responseReceived1=Me.register({fileName:"responseReceived1.mp3"})}static{this.responseReceived2=Me.register({fileName:"responseReceived2.mp3"})}static{this.responseReceived3=Me.register({fileName:"responseReceived3.mp3"})}static{this.responseReceived4=Me.register({fileName:"responseReceived4.mp3"})}static{this.clear=Me.register({fileName:"clear.mp3"})}static{this.save=Me.register({fileName:"save.mp3"})}static{this.format=Me.register({fileName:"format.mp3"})}static{this.voiceRecordingStarted=Me.register({fileName:"voiceRecordingStarted.mp3"})}static{this.voiceRecordingStopped=Me.register({fileName:"voiceRecordingStopped.mp3"})}static{this.progress=Me.register({fileName:"progress.mp3"})}static{this.chatEditModifiedFile=Me.register({fileName:"chatEditModifiedFile.mp3"})}static{this.editsKept=Me.register({fileName:"editsKept.mp3"})}static{this.editsUndone=Me.register({fileName:"editsUndone.mp3"})}static{this.nextEditSuggestion=Me.register({fileName:"nextEditSuggestion.mp3"})}static{this.terminalCommandSucceeded=Me.register({fileName:"terminalCommandSucceeded.mp3"})}static{this.chatUserActionRequired=Me.register({fileName:"chatUserActionRequired.mp3"})}static{this.codeActionTriggered=Me.register({fileName:"codeActionTriggered.mp3"})}static{this.codeActionApplied=Me.register({fileName:"codeActionApplied.mp3"})}constructor(e){this.fileName=e}}class Bue{constructor(e){this.randomOneOf=e}}class Ze{constructor(e,t,i,n,s,r,a=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=r,this.managesOwnEnablement=a}static{this._signals=new Set}static register(e){const t=new Bue("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ze(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return Ze._signals.add(i),i}static{this.errorAtPosition=Ze.register({name:m(1576,"Error at Position"),sound:Me.error,announcementMessage:m(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"})}static{this.warningAtPosition=Ze.register({name:m(1578,"Warning at Position"),sound:Me.warning,announcementMessage:m(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"})}static{this.errorOnLine=Ze.register({name:m(1580,"Error on Line"),sound:Me.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:m(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"})}static{this.warningOnLine=Ze.register({name:m(1582,"Warning on Line"),sound:Me.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:m(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"})}static{this.foldedArea=Ze.register({name:m(1584,"Folded Area on Line"),sound:Me.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:m(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"})}static{this.break=Ze.register({name:m(1586,"Breakpoint on Line"),sound:Me.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:m(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"})}static{this.inlineSuggestion=Ze.register({name:m(1588,"Inline Suggestion on Line"),sound:Me.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"})}static{this.nextEditSuggestion=Ze.register({name:m(1589,"Next Edit Suggestion on Line"),sound:Me.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:m(1590,"Next Edit Suggestion")})}static{this.terminalQuickFix=Ze.register({name:m(1591,"Terminal Quick Fix"),sound:Me.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:m(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"})}static{this.onDebugBreak=Ze.register({name:m(1593,"Debugger Stopped on Breakpoint"),sound:Me.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:m(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"})}static{this.noInlayHints=Ze.register({name:m(1595,"No Inlay Hints on Line"),sound:Me.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:m(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"})}static{this.taskCompleted=Ze.register({name:m(1597,"Task Completed"),sound:Me.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:m(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"})}static{this.taskFailed=Ze.register({name:m(1599,"Task Failed"),sound:Me.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:m(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"})}static{this.terminalCommandFailed=Ze.register({name:m(1601,"Terminal Command Failed"),sound:Me.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:m(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"})}static{this.terminalCommandSucceeded=Ze.register({name:m(1603,"Terminal Command Succeeded"),sound:Me.terminalCommandSucceeded,announcementMessage:m(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"})}static{this.terminalBell=Ze.register({name:m(1605,"Terminal Bell"),sound:Me.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:m(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"})}static{this.notebookCellCompleted=Ze.register({name:m(1607,"Notebook Cell Completed"),sound:Me.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:m(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"})}static{this.notebookCellFailed=Ze.register({name:m(1609,"Notebook Cell Failed"),sound:Me.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:m(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"})}static{this.diffLineInserted=Ze.register({name:m(1611,"Diff Line Inserted"),sound:Me.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"})}static{this.diffLineDeleted=Ze.register({name:m(1612,"Diff Line Deleted"),sound:Me.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"})}static{this.diffLineModified=Ze.register({name:m(1613,"Diff Line Modified"),sound:Me.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"})}static{this.chatEditModifiedFile=Ze.register({name:m(1614,"Chat Edit Modified File"),sound:Me.chatEditModifiedFile,announcementMessage:m(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"})}static{this.chatRequestSent=Ze.register({name:m(1616,"Chat Request Sent"),sound:Me.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:m(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"})}static{this.chatResponseReceived=Ze.register({name:m(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Me.responseReceived1,Me.responseReceived2,Me.responseReceived3,Me.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"})}static{this.codeActionTriggered=Ze.register({name:m(1619,"Code Action Request Triggered"),sound:Me.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:m(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"})}static{this.codeActionApplied=Ze.register({name:m(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:Me.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"})}static{this.progress=Ze.register({name:m(1622,"Progress"),sound:Me.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:m(1623,"Progress"),settingsKey:"accessibility.signals.progress"})}static{this.clear=Ze.register({name:m(1624,"Clear"),sound:Me.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:m(1625,"Clear"),settingsKey:"accessibility.signals.clear"})}static{this.save=Ze.register({name:m(1626,"Save"),sound:Me.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:m(1627,"Save"),settingsKey:"accessibility.signals.save"})}static{this.format=Ze.register({name:m(1628,"Format"),sound:Me.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:m(1629,"Format"),settingsKey:"accessibility.signals.format"})}static{this.voiceRecordingStarted=Ze.register({name:m(1630,"Voice Recording Started"),sound:Me.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"})}static{this.voiceRecordingStopped=Ze.register({name:m(1631,"Voice Recording Stopped"),sound:Me.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"})}static{this.editsKept=Ze.register({name:m(1632,"Edits Kept"),sound:Me.editsKept,announcementMessage:m(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"})}static{this.editsUndone=Ze.register({name:m(1634,"Undo Edits"),sound:Me.editsUndone,announcementMessage:m(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"})}static{this.chatUserActionRequired=Ze.register({name:m(1636,"Chat User Action Required"),sound:Me.chatUserActionRequired,announcementMessage:m(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0})}}function c9(o,e,t,i=qi.ofCaller()){return oz({debugName:()=>`Configuration Key "${o}"`},n=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(o)&&n(s)}),()=>t.getValue(o)??e,i)}function tl(o,e,t,i=qi.ofCaller()){const n=o.bindTo(e),s=new z;return An({debugName:()=>`Set Context Key "${o.key}"`},r=>{const a=t(r);return n.set(a),a},i).recomputeInitiallyAndOnChange(s),s}const ej=We("progressService");class Rc{static{this.None=Object.freeze({report(){}})}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}const id=We("editorProgressService");class Wa{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Wa(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new Wa(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}const Ag={RESOURCES:"ResourceURLs",TEXT:vi.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},Hue=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let ck=Hue;const Vue=new On(()=>ck("mouse",!1)),zue=new On(()=>ck("element",!1));function Uue(o){ck=o}function zl(o){return o==="element"?zue.value:Vue.value}function tj(){return ck("element",!0)}function Hc(o,e){if(o!==void 0){const t=o.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Hc(i[1].trim(),e)),`var(${i[0]}, ${e})`}return o}return e}function d9(o){const e=o.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==o&&console.warn(`CSS ident value ${o} modified to ${e} to be safe for CSS`),e}function Cd(o){return`'${o.replaceAll(/'/g,"\\000027")}'`}function Ml(o){return o?io`url('${CSS.escape(ZV.uriToBrowserUri(o).toString(!0))}')`:"url('')"}function x1(o,e=!1){const t=CSS.escape(o);return!e&&t!==o&&console.warn(`CSS class name ${o} modified to ${t} to be safe for CSS`),t}function io(o,...e){return o.reduce((t,i,n)=>{const s=e[n]||"";return t+i+s},"")}class dI{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=` +`){return this._parts.join(e)}}function $ue(o){const e=jue(o);if(e&&e.length>0)return new Uint32Array(e)}let To=0;const Wd=new Uint32Array(10);function jue(o){if(To=0,Ka(o,hI,4352),To>0||(Ka(o,uI,4449),To>0)||(Ka(o,gI,4520),To>0)||(Ka(o,Yh,12593),To))return Wd.subarray(0,To);if(o>=44032&&o<=55203){const e=o-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i=0&&(s0)return Wd.subarray(0,To)}}function Ka(o,e,t){o>=t&&o>8&&(Wd[To++]=o>>8&255),o>>16&&(Wd[To++]=o>>16&255))}const hI=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),uI=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),gI=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Yh=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function E4(...o){return function(e,t){for(let i=0,n=o.length;i0?[{start:0,end:e.length}]:[]:null}function nj(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t===-1?null:[{start:t,end:t+o.length}]}function sj(o,e){return dT(o.toLowerCase(),e.toLowerCase(),0,0)}function dT(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]===e[i]){let n=null;return(n=dT(o,e,t+1,i+1))?R4({start:i,end:i+1},n):null}return dT(o,e,t,i+1)}function N4(o){return 97<=o&&o<=122}function dk(o){return 65<=o&&o<=90}function T4(o){return 48<=o&&o<=57}function oj(o){return o===32||o===9||o===10||o===13}const rj=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>rj.add(o.charCodeAt(0)));function py(o){return oj(o)||rj.has(o)}function h9(o,e){return o===e||py(o)&&py(e)}const fI=new Map;function u9(o){if(fI.has(o))return fI.get(o);let e;const t=$ue(o);return t&&(e=t),fI.set(o,e),e}function aj(o){return N4(o)||dk(o)||T4(o)}function R4(o,e){return e.length===0?e=[o]:o.end===e[0].start?e[0].start=o.start:e.unshift(o),e}function lj(o,e){for(let t=e;t0&&!aj(o.charCodeAt(t-1)))return t}return o.length}function hT(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=hT(o,e,t+1,i+1);!n&&(s=lj(e,s)).6}function Zue(o){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=o;return t>.2&&e<.8&&i>.6&&n<.2}function Yue(o){let e=0,t=0,i=0,n=0;for(let s=0;s60&&(e=e.substring(0,60));const t=Kue(e);if(!Zue(t)){if(!Gue(t))return null;e=e.toLowerCase()}let i=null,n=0;for(o=o.toLowerCase();n0&&py(o.charCodeAt(t-1)))return t;return o.length}const Que=E4(av,cj,nj),Jue=E4(av,cj,sj),g9=new na(1e4);function f9(o,e,t=!1){if(typeof o!="string"||typeof e!="string")return null;let i=g9.get(o);i||(i=new RegExp(TQ(o),"i"),g9.set(o,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?Jue(o,e):Que(o,e)}function ege(o,e){const t=Og(o,o.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?Lw(t):null}function tge(o,e,t,i,n,s){const r=Math.min(13,o.length);for(;t"u")return[];const e=[],t=o[1];for(let i=o.length-1;i>1;i--){const n=o[i]+t,s=e[e.length-1];s&&s.end===n?s.end=n+1:e.push({start:n,end:n+1})}return e}const eh=128;function M4(){const o=[],e=[];for(let t=0;t<=eh;t++)e[t]=0;for(let t=0;t<=eh;t++)o.push(e.slice(0));return o}function hj(o){const e=[];for(let t=0;t<=o;t++)e[t]=0;return e}const uj=hj(2*eh),gT=hj(2*eh),Xl=M4(),Xh=M4(),L1=M4();function k1(o,e){if(e<0||e>=o.length)return!1;const t=o.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!eO(t)}}function p9(o,e){if(e<0||e>=o.length)return!1;switch(o.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function US(o,e,t){return e[o]!==t[o]}function ige(o,e,t,i,n,s,r=!1){for(;eeh?eh:o.length,l=i.length>eh?eh:i.length;if(t>=a||s>=l||a-t>l-s||!ige(e,t,a,n,s,l,!0))return;nge(a,l,t,s,e,n);let c=1,d=1,h=t,u=s;const g=[!1];for(c=1,h=t;hC,I=D?Xh[c][d-1]+(Xl[c][d-1]>0?-5:0):0,T=u>C+1&&Xl[c][d-1]>0,F=T?Xh[c][d-2]+(Xl[c][d-2]>0?-5:0):0;if(T&&(!D||F>=I)&&(!x||F>=k))Xh[c][d]=F,L1[c][d]=3,Xl[c][d]=0;else if(D&&(!x||I>=k))Xh[c][d]=I,L1[c][d]=2,Xl[c][d]=0;else if(x)Xh[c][d]=k,L1[c][d]=1,Xl[c][d]=Xl[c-1][d-1]+1;else throw new Error("not possible")}}if(!g[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const f=[Xh[c][d],s];let p=0,_=0;for(;c>=1;){let C=d;do{const w=L1[c][C];if(w===3)C=C-2;else if(w===2)C=C-1;else break}while(C>=1);p>1&&e[t+c-1]===n[s+d-1]&&!US(C+s-1,i,n)&&p+1>Xl[c][C]&&(C=d),C===d?p++:p=1,_||(_=C),c--,d=C-1,f.push(d)}l-s===a&&r.boostFullMatch&&(f[0]+=2);const b=_-a;return f[0]-=b,f}function nge(o,e,t,i,n,s){let r=o-1,a=e-1;for(;r>=t&&a>=i;)n[r]===s[a]&&(gT[r]=a,r--),a--}function sge(o,e,t,i,n,s,r,a,l,c,d){if(e[t]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=o[t]===n[r]?7:5:US(r,n,s)&&(r===0||!US(r-1,n,s))?(h=o[t]===n[r]?7:5,u=!0):k1(s,r)&&(r===0||!k1(s,r-1))?h=5:(k1(s,r-1)||p9(s,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=US(r,n,s)||k1(s,r-1)||p9(s,r-1)),t===i?r>l&&(h-=u?3:5):c?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function oge(o,e,t,i,n,s,r){return rge(o,e,t,i,n,s,!0,r)}function rge(o,e,t,i,n,s,r,a){let l=Og(o,e,t,i,n,s,a);if(o.length>=3){const c=Math.min(7,o.length-1);for(let d=t+1;dl[0])&&(l=u))}}}return l}function age(o,e){if(e+1>=o.length)return;const t=o[e],i=o[e+1];if(t!==i)return o.slice(0,e)+i+t+o.slice(e+2)}const lge="$(",A4=new RegExp(`\\$\\(${Se.iconNameExpression}(?:${Se.iconModifierExpression})?\\)`,"g"),cge=new RegExp(`(\\\\)?${A4.source}`,"g");function dge(o){return o.replace(cge,(e,t)=>t?e:`\\${e}`)}const hge=new RegExp(`\\\\${A4.source}`,"g");function uge(o){return o.replace(hge,e=>`\\${e}`)}const gge=new RegExp(`(\\s)?(\\\\)?${A4.source}(\\s)?`,"g");function O4(o){return o.indexOf(lge)===-1?o:o.replace(gge,(e,t,i,n)=>i?e:t||n||"")}function gj(o){return o?o.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const pI=new RegExp(`\\$\\(${Se.iconNameCharacter}+\\)`,"g");function Gu(o){pI.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=pI.lastIndex,s=pI.exec(o),r=o.substring(n,s?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` -${upe(t,e)} -`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Eo(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function o_(o){return ld(o)?!o.value:Array.isArray(o)?o.every(o_):!0}function ld(o){return o instanceof ts?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0)&&(typeof o.supportAlertSyntax=="boolean"||o.supportAlertSyntax===void 0):!1}function dpe(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&o.supportAlertSyntax===e.supportAlertSyntax&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&zh(be.from(o.baseUri),be.from(e.baseUri)))}function hpe(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function upe(o,e){const t=o.match(/^`+/gm)?.reduce((n,s)=>n.length>s.length?n:s).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,o,`${"`".repeat(i)}`].join(` -`)}function CS(o){return o.replace(/"/g,""")}function vE(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function gpe(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}function Jq(o,...e){return be.from({scheme:Ie.command,path:o,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}class ZF{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const LR=new ZF("id#");function YF(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Pf=YF();function eK(o){Pf=o}const tK=/[&<>"']/,fpe=new RegExp(tK.source,"g"),iK=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ppe=new RegExp(iK.source,"g"),mpe={"&":"&","<":"<",">":">",'"':""","'":"'"},KB=o=>mpe[o];function vr(o,e){if(e){if(tK.test(o))return o.replace(fpe,KB)}else if(iK.test(o))return o.replace(ppe,KB);return o}const _pe=/(^|[^\[])\^/g;function Mi(o,e){let t=typeof o=="string"?o:o.source;e=e||"";const i={replace:(n,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(_pe,"$1"),t=t.replace(n,r),i},getRegex:()=>new RegExp(t,e)};return i}function GB(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const IC={exec:()=>null};function ZB(o,e){const t=o.replace(/\|/g,(s,r,a)=>{let l=!1,c=r;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.lengthe.charAt(s-1)!=="\\"?`\\${n}`:n)}}function Em(o){return Vc(o)?!o.value:Array.isArray(o)?o.every(Em):!0}function Vc(o){return o instanceof Kn?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0)&&(typeof o.supportAlertSyntax=="boolean"||o.supportAlertSyntax===void 0):!1}function fge(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&o.supportAlertSyntax===e.supportAlertSyntax&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&wh(_e.from(o.baseUri),_e.from(e.baseUri)))}function pge(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function mge(o,e){const t=o.match(/^`+/gm)?.reduce((n,s)=>n.length>s.length?n:s).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,o,`${"`".repeat(i)}`].join(` +`)}function D1(o){return o.replace(/"/g,""")}function mI(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function _ge(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}function fj(o,...e){return _e.from({scheme:Le.command,path:o,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}class F4{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const fT=new F4("id#");function W4(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let hf=W4();function pj(o){hf=o}const mj=/[&<>"']/,bge=new RegExp(mj.source,"g"),_j=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Cge=new RegExp(_j.source,"g"),vge={"&":"&","<":"<",">":">",'"':""","'":"'"},m9=o=>vge[o];function rr(o,e){if(e){if(mj.test(o))return o.replace(bge,m9)}else if(_j.test(o))return o.replace(Cge,m9);return o}const wge=/(^|[^\[])\^/g;function Di(o,e){let t=typeof o=="string"?o:o.source;e=e||"";const i={replace:(n,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(wge,"$1"),t=t.replace(n,r),i},getRegex:()=>new RegExp(t,e)};return i}function _9(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const $b={exec:()=>null};function b9(o,e){const t=o.replace(/\|/g,(s,r,a)=>{let l=!1,c=r;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length{const s=n.match(/^\s+/);if(s===null)return n;const[r]=s;return r.length>=i.length?n.slice(i.length):n}).join(` -`)}class hL{options;rules;lexer;constructor(e){this.options=e||Pf}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:pb(i,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=Cpe(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const n=pb(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:pb(t[0],` -`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let i=pb(t[0],` +`)}class my{options;rules;lexer;constructor(e){this.options=e||hf}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:O_(i,` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=yge(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const n=O_(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:O_(t[0],` +`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let i=O_(t[0],` `).split(` `),n="",s="";const r=[];for(;i.length>0;){let a=!1;const l=[];let c;for(c=0;c/.test(i[c]))l.push(i[c]),a=!0;else if(!a)l.push(i[c]);else break;i=i.slice(c);const d=l.join(` `),h=d.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` @@ -284,10 +284,10 @@ ${h}`:h;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block `,1)[0];if(u=S,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(u)||v.test(u)||b.test(u)||C.test(e))break;if(u.search(/[^ ]/)>=f||!u.trim())d+=` `+u.slice(f);else{if(g||h.search(/[^ ]/)>=4||w.test(h)||v.test(h)||C.test(h))break;d+=` `+u}!g&&!u.trim()&&(g=!0),c+=S+` -`,e=e.substring(S.length+1),h=u.slice(f)}}s.loose||(a?s.loose=!0:/\n *\n *$/.test(c)&&(a=!0));let p=null,_;this.options.gfm&&(p=/^\[[ xX]\] /.exec(d),p&&(_=p[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:c,task:!!p,checked:_,loose:!1,text:d,tokens:[]}),s.raw+=c}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let l=0;lh.type==="space"),d=c.length>0&&c.some(h=>/\n.*\n/.test(h.raw));s.loose=d}if(s.loose)for(let l=0;l$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const i=ZB(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` -`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(const a of n)/^ *-+: *$/.test(a)?r.align.push("right"):/^ *:-+: *$/.test(a)?r.align.push("center"):/^ *:-+ *$/.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const i=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:vr(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^
/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=pb(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=bpe(t[2],"()");if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],s=r[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),YB(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const n=(i[2]||i[1]).replace(/\s+/g," "),s=t[n.toLowerCase()];if(!s){const r=i[0].charAt(0);return{type:"text",raw:r,text:r}}return YB(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const r=[...n[0]].length-1;let a,l,c=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&r%3&&!((r+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);const u=[...n[0]][0].length,g=e.slice(0,r+n.index+u+l);if(Math.min(r,l)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const f=g.slice(2,-2);return{type:"strong",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=vr(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=vr(t[1]),n="mailto:"+i):(i=vr(t[1]),n=i),{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=vr(t[0]),n="mailto:"+i;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);i=vr(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let i;return this.lexer.state.inRawBlock?i=t[0]:i=vr(t[0]),{type:"text",raw:t[0],text:i}}}}const vpe=/^(?: *(?:\n|$))+/,wpe=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Spe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,d1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ype=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,nK=/(?:[*+-]|\d{1,9}[.)])/,sK=Mi(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,nK).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),XF=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lpe=/^[^\n]+/,QF=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xpe=Mi(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",QF).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Dpe=Mi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,nK).getRegex(),rk="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",JF=/|$))/,kpe=Mi("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",JF).replace("tag",rk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oK=Mi(XF).replace("hr",d1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rk).getRegex(),Ipe=Mi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oK).getRegex(),e5={blockquote:Ipe,code:wpe,def:xpe,fences:Spe,heading:ype,hr:d1,html:kpe,lheading:sK,list:Dpe,newline:vpe,paragraph:oK,table:IC,text:Lpe},XB=Mi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",d1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rk).getRegex(),Epe={...e5,table:XB,paragraph:Mi(XF).replace("hr",d1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",XB).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rk).getRegex()},Npe={...e5,html:Mi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",JF).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:IC,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Mi(XF).replace("hr",d1).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",sK).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tpe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aK=/^( {2,}|\\)\n(?!\s*$)/,Rpe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Ape=Mi(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,h1).getRegex(),Ope=Mi("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,h1).getRegex(),Fpe=Mi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,h1).getRegex(),Wpe=Mi(/\\([punct])/,"gu").replace(/punct/g,h1).getRegex(),Bpe=Mi(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Hpe=Mi(JF).replace("(?:-->|$)","-->").getRegex(),Vpe=Mi("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Hpe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),uL=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zpe=Mi(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",uL).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lK=Mi(/^!?\[(label)\]\[(ref)\]/).replace("label",uL).replace("ref",QF).getRegex(),cK=Mi(/^!?\[(ref)\](?:\[\])?/).replace("ref",QF).getRegex(),Upe=Mi("reflink|nolink(?!\\()","g").replace("reflink",lK).replace("nolink",cK).getRegex(),t5={_backpedal:IC,anyPunctuation:Wpe,autolink:Bpe,blockSkip:Ppe,br:aK,code:Tpe,del:IC,emStrongLDelim:Ape,emStrongRDelimAst:Ope,emStrongRDelimUnd:Fpe,escape:rK,link:zpe,nolink:cK,punctuation:Mpe,reflink:lK,reflinkSearch:Upe,tag:Vpe,text:Rpe,url:IC},$pe={...t5,link:Mi(/^!?\[(label)\]\((.*?)\)/).replace("label",uL).getRegex(),reflink:Mi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",uL).getRegex()},xR={...t5,escape:Mi(rK).replace("])","~|])").getRegex(),url:Mi(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\h.type==="space"),d=c.length>0&&c.some(h=>/\n.*\n/.test(h.raw));s.loose=d}if(s.loose)for(let l=0;l$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const i=b9(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` +`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(const a of n)/^ *-+: *$/.test(a)?r.align.push("right"):/^ *:-+: *$/.test(a)?r.align.push("center"):/^ *:-+ *$/.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const i=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:rr(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const r=O_(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=Sge(t[2],"()");if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],s=r[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),C9(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const n=(i[2]||i[1]).replace(/\s+/g," "),s=t[n.toLowerCase()];if(!s){const r=i[0].charAt(0);return{type:"text",raw:r,text:r}}return C9(i,s,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const r=[...n[0]].length-1;let a,l,c=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&r%3&&!((r+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);const u=[...n[0]][0].length,g=e.slice(0,r+n.index+u+l);if(Math.min(r,l)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const f=g.slice(2,-2);return{type:"strong",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," ");const n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=rr(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=rr(t[1]),n="mailto:"+i):(i=rr(t[1]),n=i),{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=rr(t[0]),n="mailto:"+i;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);i=rr(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let i;return this.lexer.state.inRawBlock?i=t[0]:i=rr(t[0]),{type:"text",raw:t[0],text:i}}}}const xge=/^(?: *(?:\n|$))+/,Lge=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,kge=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kw=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dge=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bj=/(?:[*+-]|\d{1,9}[.)])/,Cj=Di(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bj).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),B4=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ige=/^[^\n]+/,H4=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ege=Di(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",H4).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Nge=Di(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bj).getRegex(),hk="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V4=/|$))/,Tge=Di("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",V4).replace("tag",hk).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vj=Di(B4).replace("hr",kw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",hk).getRegex(),Rge=Di(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vj).getRegex(),z4={blockquote:Rge,code:Lge,def:Ege,fences:kge,heading:Dge,hr:kw,html:Tge,lheading:Cj,list:Nge,newline:xge,paragraph:vj,table:$b,text:Ige},v9=Di("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",hk).getRegex(),Mge={...z4,table:v9,paragraph:Di(B4).replace("hr",kw).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",v9).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",hk).getRegex()},Pge={...z4,html:Di(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",V4).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$b,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Di(B4).replace("hr",kw).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Cj).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Age=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Sj=/^( {2,}|\\)\n(?!\s*$)/,Oge=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Bge=Di(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Dw).getRegex(),Hge=Di("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Dw).getRegex(),Vge=Di("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Dw).getRegex(),zge=Di(/\\([punct])/,"gu").replace(/punct/g,Dw).getRegex(),Uge=Di(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$ge=Di(V4).replace("(?:-->|$)","-->").getRegex(),jge=Di("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",$ge).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_y=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,qge=Di(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_y).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yj=Di(/^!?\[(label)\]\[(ref)\]/).replace("label",_y).replace("ref",H4).getRegex(),xj=Di(/^!?\[(ref)\](?:\[\])?/).replace("ref",H4).getRegex(),Kge=Di("reflink|nolink(?!\\()","g").replace("reflink",yj).replace("nolink",xj).getRegex(),U4={_backpedal:$b,anyPunctuation:zge,autolink:Uge,blockSkip:Wge,br:Sj,code:Age,del:$b,emStrongLDelim:Bge,emStrongRDelimAst:Hge,emStrongRDelimUnd:Vge,escape:wj,link:qge,nolink:xj,punctuation:Fge,reflink:yj,reflinkSearch:Kge,tag:jge,text:Oge,url:$b},Gge={...U4,link:Di(/^!?\[(label)\]\((.*?)\)/).replace("label",_y).getRegex(),reflink:Di(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_y).getRegex()},pT={...U4,escape:Di(wj).replace("])","~|])").getRegex(),url:Di(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\l+" ".repeat(c.length));let n,s,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+n.raw,s.text+=` @@ -297,9 +297,9 @@ ${h}`:h;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block `+n.raw,s.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=` `+n.raw,s.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,s,r=e,a,l,c;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,c)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),t.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(g=>{u=g.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(s=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(s)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(c=i.raw.slice(-1)),l=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class qv{options;parser;constructor(e){this.options=e||Pf}space(e){return""}code({text:e,lang:t,escaped:i}){const n=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+` -`;return n?'
'+(i?s:vr(s,!0))+`
-`:"
"+(i?s:vr(s,!0))+`
+`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,s,r=e,a,l,c;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,c)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),t.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(g=>{u=g.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(s=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(s)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(c=i.raw.slice(-1)),l=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class lv{options;parser;constructor(e){this.options=e||hf}space(e){return""}code({text:e,lang:t,escaped:i}){const n=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+` +`;return n?'
'+(i?s:rr(s,!0))+`
+`:"
"+(i?s:rr(s,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} @@ -315,11 +315,10 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return` ${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:i}){const n=this.parser.parseInline(i),s=GB(e);if(s===null)return n;e=s;let r='
",r}image({href:e,title:t,text:i}){const n=GB(e);if(n===null)return i;e=n;let s=`${i}{const a=s[r].flat(1/0);i=i.concat(this.walkTokens(a,t))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{const n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=t.renderers[s.name];r?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[s.level];r?r.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),i.renderer){const s=this.defaults.renderer||new qv(this.defaults);for(const r in i.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=i.renderer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h||""}}n.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new hL(this.defaults);for(const r in i.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=i.tokenizer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}n.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new W0;for(const r in i.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,l=i.hooks[a],c=s[a];W0.passThroughHooks.has(r)?s[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(s,d)).then(u=>c.call(s,u));const h=l.call(s,d);return c.call(s,h)}:s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}n.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens,r=i.walkTokens;n.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ol.lex(e,t??this.defaults)}parser(e,t){return Fl.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,s)=>{const r={...s},a={...this.defaults,...r},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let c=e(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=t(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const n="

An error occurred:

"+vr(i.message+"",!0)+"
";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}}const af=new dK;function ki(o,e){return af.parse(o,e)}ki.options=ki.setOptions=function(o){return af.setOptions(o),ki.defaults=af.defaults,eK(ki.defaults),ki};ki.getDefaults=YF;ki.defaults=Pf;ki.use=function(...o){return af.use(...o),ki.defaults=af.defaults,eK(ki.defaults),ki};ki.walkTokens=function(o,e){return af.walkTokens(o,e)};ki.parseInline=af.parseInline;ki.Parser=Fl;ki.parser=Fl.parse;ki.Renderer=qv;ki.TextRenderer=i5;ki.Lexer=Ol;ki.lexer=Ol.lex;ki.Tokenizer=hL;ki.Hooks=W0;ki.parse=ki;ki.options;ki.setOptions;ki.use;ki.walkTokens;ki.parseInline;const qpe=ki;Fl.parse;const Kv=Ol.lex;function Kpe(o){return JSON.stringify(o,Gpe)}function DR(o){let e=JSON.parse(o);return e=kR(e),e}function Gpe(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function kR(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return be.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof Eh||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t2?i-2:0),s=2;s1?t-1:0),n=1;n1?t-1:0),n=1;n2&&arguments[2]!==void 0?arguments[2]:B0;QB&&QB(o,null);let i=e.length;for(;i--;){let n=e[i];if(typeof n=="string"){const s=t(n);s!==n&&(Zpe(e)||(e[i]=s),n=s)}o[n]=!0}return o}function nme(o){for(let e=0;e/gm),lme=ma(/\$\{[\w\W]*/gm),cme=ma(/^data-[\-\w.\u00B7-\uFFFF]+$/),dme=ma(/^aria-[\-\w]+$/),gK=ma(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hme=ma(/^(?:\w+script|data):/i),ume=ma(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fK=ma(/^html$/i),gme=ma(/^[a-z][.\w]*(-[.\w]+)+$/i);var s8=Object.freeze({__proto__:null,ARIA_ATTR:dme,ATTR_WHITESPACE:ume,CUSTOM_ELEMENT:gme,DATA_ATTR:cme,DOCTYPE_NAME:fK,ERB_EXPR:ame,IS_ALLOWED_URI:gK,IS_SCRIPT_OR_DATA:hme,MUSTACHE_EXPR:rme,TMPLIT_EXPR:lme});const wb={element:1,text:3,progressingInstruction:7,comment:8,document:9},fme=function(){return typeof window>"u"?null:window},pme=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},o8=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pK(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fme();const e=Qe=>pK(Qe);if(e.version="3.2.7",e.removed=[],!o||!o.document||o.document.nodeType!==wb.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o;const i=t,n=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:g}=o,f=l.prototype,p=vb(f,"cloneNode"),_=vb(f,"remove"),b=vb(f,"nextSibling"),C=vb(f,"childNodes"),w=vb(f,"parentNode");if(typeof r=="function"){const Qe=t.createElement("template");Qe.content&&Qe.content.ownerDocument&&(t=Qe.content.ownerDocument)}let v,S="";const{implementation:L,createNodeIterator:x,createDocumentFragment:k,getElementsByTagName:I}=t,{importNode:T}=i;let A=o8();e.isSupported=typeof hK=="function"&&typeof w=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:W,TMPLIT_EXPR:U,DATA_ATTR:q,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:ce}=s8;let{IS_ALLOWED_URI:De}=s8,We=null;const st=Mt({},[...e8,...yE,...LE,...xE,...t8]);let Ye=null;const Ft=Mt({},[...i8,...DE,...n8,...SS]);let yt=Object.seal(uK(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),nn=null,Pi=null,xs=!0,tb=!0,O1=!1,FW=!0,qf=!1,F1=!0,gu=!1,uI=!1,gI=!1,Kf=!1,W1=!1,B1=!1,WW=!0,BW=!1;const CJ="user-content-";let fI=!0,ib=!1,Gf={},Zf=null;const HW=Mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let VW=null;const zW=Mt({},["audio","video","img","source","image","track"]);let pI=null;const UW=Mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),H1="http://www.w3.org/1998/Math/MathML",V1="http://www.w3.org/2000/svg",dc="http://www.w3.org/1999/xhtml";let Yf=dc,mI=!1,_I=null;const vJ=Mt({},[H1,V1,dc],wE);let z1=Mt({},["mi","mo","mn","ms","mtext"]),U1=Mt({},["annotation-xml"]);const wJ=Mt({},["title","style","font","a","script"]);let nb=null;const SJ=["application/xhtml+xml","text/html"],yJ="text/html";let ds=null,Xf=null;const LJ=t.createElement("form"),$W=function(G){return G instanceof RegExp||G instanceof Function},bI=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Xf&&Xf===G)){if((!G||typeof G!="object")&&(G={}),G=Ic(G),nb=SJ.indexOf(G.PARSER_MEDIA_TYPE)===-1?yJ:G.PARSER_MEDIA_TYPE,ds=nb==="application/xhtml+xml"?wE:B0,We=ka(G,"ALLOWED_TAGS")?Mt({},G.ALLOWED_TAGS,ds):st,Ye=ka(G,"ALLOWED_ATTR")?Mt({},G.ALLOWED_ATTR,ds):Ft,_I=ka(G,"ALLOWED_NAMESPACES")?Mt({},G.ALLOWED_NAMESPACES,wE):vJ,pI=ka(G,"ADD_URI_SAFE_ATTR")?Mt(Ic(UW),G.ADD_URI_SAFE_ATTR,ds):UW,VW=ka(G,"ADD_DATA_URI_TAGS")?Mt(Ic(zW),G.ADD_DATA_URI_TAGS,ds):zW,Zf=ka(G,"FORBID_CONTENTS")?Mt({},G.FORBID_CONTENTS,ds):HW,nn=ka(G,"FORBID_TAGS")?Mt({},G.FORBID_TAGS,ds):Ic({}),Pi=ka(G,"FORBID_ATTR")?Mt({},G.FORBID_ATTR,ds):Ic({}),Gf=ka(G,"USE_PROFILES")?G.USE_PROFILES:!1,xs=G.ALLOW_ARIA_ATTR!==!1,tb=G.ALLOW_DATA_ATTR!==!1,O1=G.ALLOW_UNKNOWN_PROTOCOLS||!1,FW=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qf=G.SAFE_FOR_TEMPLATES||!1,F1=G.SAFE_FOR_XML!==!1,gu=G.WHOLE_DOCUMENT||!1,Kf=G.RETURN_DOM||!1,W1=G.RETURN_DOM_FRAGMENT||!1,B1=G.RETURN_TRUSTED_TYPE||!1,gI=G.FORCE_BODY||!1,WW=G.SANITIZE_DOM!==!1,BW=G.SANITIZE_NAMED_PROPS||!1,fI=G.KEEP_CONTENT!==!1,ib=G.IN_PLACE||!1,De=G.ALLOWED_URI_REGEXP||gK,Yf=G.NAMESPACE||dc,z1=G.MATHML_TEXT_INTEGRATION_POINTS||z1,U1=G.HTML_INTEGRATION_POINTS||U1,yt=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&$W(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(yt.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&$W(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(yt.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(yt.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),qf&&(tb=!1),W1&&(Kf=!0),Gf&&(We=Mt({},t8),Ye=[],Gf.html===!0&&(Mt(We,e8),Mt(Ye,i8)),Gf.svg===!0&&(Mt(We,yE),Mt(Ye,DE),Mt(Ye,SS)),Gf.svgFilters===!0&&(Mt(We,LE),Mt(Ye,DE),Mt(Ye,SS)),Gf.mathMl===!0&&(Mt(We,xE),Mt(Ye,n8),Mt(Ye,SS))),G.ADD_TAGS&&(We===st&&(We=Ic(We)),Mt(We,G.ADD_TAGS,ds)),G.ADD_ATTR&&(Ye===Ft&&(Ye=Ic(Ye)),Mt(Ye,G.ADD_ATTR,ds)),G.ADD_URI_SAFE_ATTR&&Mt(pI,G.ADD_URI_SAFE_ATTR,ds),G.FORBID_CONTENTS&&(Zf===HW&&(Zf=Ic(Zf)),Mt(Zf,G.FORBID_CONTENTS,ds)),fI&&(We["#text"]=!0),gu&&Mt(We,["html","head","body"]),We.table&&(Mt(We,["tbody"]),delete nn.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=G.TRUSTED_TYPES_POLICY,S=v.createHTML("")}else v===void 0&&(v=pme(g,n)),v!==null&&typeof S=="string"&&(S=v.createHTML(""));To&&To(G),Xf=G}},jW=Mt({},[...yE,...LE,...sme]),qW=Mt({},[...xE,...ome]),xJ=function(G){let Le=w(G);(!Le||!Le.tagName)&&(Le={namespaceURI:Yf,tagName:"template"});const qe=B0(G.tagName),Gi=B0(Le.tagName);return _I[G.namespaceURI]?G.namespaceURI===V1?Le.namespaceURI===dc?qe==="svg":Le.namespaceURI===H1?qe==="svg"&&(Gi==="annotation-xml"||z1[Gi]):!!jW[qe]:G.namespaceURI===H1?Le.namespaceURI===dc?qe==="math":Le.namespaceURI===V1?qe==="math"&&U1[Gi]:!!qW[qe]:G.namespaceURI===dc?Le.namespaceURI===V1&&!U1[Gi]||Le.namespaceURI===H1&&!z1[Gi]?!1:!qW[qe]&&(wJ[qe]||!jW[qe]):!!(nb==="application/xhtml+xml"&&_I[G.namespaceURI]):!1},ll=function(G){_b(e.removed,{element:G});try{w(G).removeChild(G)}catch{_(G)}},fu=function(G,Le){try{_b(e.removed,{attribute:Le.getAttributeNode(G),from:Le})}catch{_b(e.removed,{attribute:null,from:Le})}if(Le.removeAttribute(G),G==="is")if(Kf||W1)try{ll(Le)}catch{}else try{Le.setAttribute(G,"")}catch{}},KW=function(G){let Le=null,qe=null;if(gI)G=""+G;else{const On=SE(G,/^[\r\n\t ]+/);qe=On&&On[0]}nb==="application/xhtml+xml"&&Yf===dc&&(G=''+G+"");const Gi=v?v.createHTML(G):G;if(Yf===dc)try{Le=new u().parseFromString(Gi,nb)}catch{}if(!Le||!Le.documentElement){Le=L.createDocument(Yf,"template",null);try{Le.documentElement.innerHTML=mI?S:Gi}catch{}}const qs=Le.body||Le.documentElement;return G&&qe&&qs.insertBefore(t.createTextNode(qe),qs.childNodes[0]||null),Yf===dc?I.call(Le,gu?"html":"body")[0]:gu?Le.documentElement:qs},GW=function(G){return x.call(G.ownerDocument||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},CI=function(G){return G instanceof h&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof d)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},ZW=function(G){return typeof a=="function"&&G instanceof a};function hc(Qe,G,Le){wS(Qe,qe=>{qe.call(e,G,Le,Xf)})}const YW=function(G){let Le=null;if(hc(A.beforeSanitizeElements,G,null),CI(G))return ll(G),!0;const qe=ds(G.nodeName);if(hc(A.uponSanitizeElement,G,{tagName:qe,allowedTags:We}),F1&&G.hasChildNodes()&&!ZW(G.firstElementChild)&&fo(/<[/\w!]/g,G.innerHTML)&&fo(/<[/\w!]/g,G.textContent)||G.nodeType===wb.progressingInstruction||F1&&G.nodeType===wb.comment&&fo(/<[/\w]/g,G.data))return ll(G),!0;if(!We[qe]||nn[qe]){if(!nn[qe]&&QW(qe)&&(yt.tagNameCheck instanceof RegExp&&fo(yt.tagNameCheck,qe)||yt.tagNameCheck instanceof Function&&yt.tagNameCheck(qe)))return!1;if(fI&&!Zf[qe]){const Gi=w(G)||G.parentNode,qs=C(G)||G.childNodes;if(qs&&Gi){const On=qs.length;for(let Fo=On-1;Fo>=0;--Fo){const uc=p(qs[Fo],!0);uc.__removalCount=(G.__removalCount||0)+1,Gi.insertBefore(uc,b(G))}}}return ll(G),!0}return G instanceof l&&!xJ(G)||(qe==="noscript"||qe==="noembed"||qe==="noframes")&&fo(/<\/no(script|embed|frames)/i,G.innerHTML)?(ll(G),!0):(qf&&G.nodeType===wb.text&&(Le=G.textContent,wS([O,W,U],Gi=>{Le=bb(Le,Gi," ")}),G.textContent!==Le&&(_b(e.removed,{element:G.cloneNode()}),G.textContent=Le)),hc(A.afterSanitizeElements,G,null),!1)},XW=function(G,Le,qe){if(WW&&(Le==="id"||Le==="name")&&(qe in t||qe in LJ))return!1;if(!(tb&&!Pi[Le]&&fo(q,Le))){if(!(xs&&fo(ie,Le))){if(!Ye[Le]||Pi[Le]){if(!(QW(G)&&(yt.tagNameCheck instanceof RegExp&&fo(yt.tagNameCheck,G)||yt.tagNameCheck instanceof Function&&yt.tagNameCheck(G))&&(yt.attributeNameCheck instanceof RegExp&&fo(yt.attributeNameCheck,Le)||yt.attributeNameCheck instanceof Function&&yt.attributeNameCheck(Le,G))||Le==="is"&&yt.allowCustomizedBuiltInElements&&(yt.tagNameCheck instanceof RegExp&&fo(yt.tagNameCheck,qe)||yt.tagNameCheck instanceof Function&&yt.tagNameCheck(qe))))return!1}else if(!pI[Le]){if(!fo(De,bb(qe,ne,""))){if(!((Le==="src"||Le==="xlink:href"||Le==="href")&&G!=="script"&&eme(qe,"data:")===0&&VW[G])){if(!(O1&&!fo(Q,bb(qe,ne,"")))){if(qe)return!1}}}}}}return!0},QW=function(G){return G!=="annotation-xml"&&SE(G,ce)},JW=function(G){hc(A.beforeSanitizeAttributes,G,null);const{attributes:Le}=G;if(!Le||CI(G))return;const qe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ye,forceKeepAttr:void 0};let Gi=Le.length;for(;Gi--;){const qs=Le[Gi],{name:On,namespaceURI:Fo,value:uc}=qs,Qf=ds(On),vI=uc;let Ds=On==="value"?vI:tme(vI);if(qe.attrName=Qf,qe.attrValue=Ds,qe.keepAttr=!0,qe.forceKeepAttr=void 0,hc(A.uponSanitizeAttribute,G,qe),Ds=qe.attrValue,BW&&(Qf==="id"||Qf==="name")&&(fu(On,G),Ds=CJ+Ds),F1&&fo(/((--!?|])>)|<\/(style|title|textarea)/i,Ds)){fu(On,G);continue}if(Qf==="attributename"&&SE(Ds,"href")){fu(On,G);continue}if(qe.forceKeepAttr)continue;if(!qe.keepAttr){fu(On,G);continue}if(!FW&&fo(/\/>/i,Ds)){fu(On,G);continue}qf&&wS([O,W,U],t7=>{Ds=bb(Ds,t7," ")});const e7=ds(G.nodeName);if(!XW(e7,Qf,Ds)){fu(On,G);continue}if(v&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Fo)switch(g.getAttributeType(e7,Qf)){case"TrustedHTML":{Ds=v.createHTML(Ds);break}case"TrustedScriptURL":{Ds=v.createScriptURL(Ds);break}}if(Ds!==vI)try{Fo?G.setAttributeNS(Fo,On,Ds):G.setAttribute(On,Ds),CI(G)?ll(G):JB(e.removed)}catch{fu(On,G)}}hc(A.afterSanitizeAttributes,G,null)},DJ=function Qe(G){let Le=null;const qe=GW(G);for(hc(A.beforeSanitizeShadowDOM,G,null);Le=qe.nextNode();)hc(A.uponSanitizeShadowNode,Le,null),YW(Le),JW(Le),Le.content instanceof s&&Qe(Le.content);hc(A.afterSanitizeShadowDOM,G,null)};return e.sanitize=function(Qe){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Le=null,qe=null,Gi=null,qs=null;if(mI=!Qe,mI&&(Qe=""),typeof Qe!="string"&&!ZW(Qe))if(typeof Qe.toString=="function"){if(Qe=Qe.toString(),typeof Qe!="string")throw Cb("dirty is not a string, aborting")}else throw Cb("toString is not a function");if(!e.isSupported)return Qe;if(uI||bI(G),e.removed=[],typeof Qe=="string"&&(ib=!1),ib){if(Qe.nodeName){const uc=ds(Qe.nodeName);if(!We[uc]||nn[uc])throw Cb("root node is forbidden and cannot be sanitized in-place")}}else if(Qe instanceof a)Le=KW(""),qe=Le.ownerDocument.importNode(Qe,!0),qe.nodeType===wb.element&&qe.nodeName==="BODY"||qe.nodeName==="HTML"?Le=qe:Le.appendChild(qe);else{if(!Kf&&!qf&&!gu&&Qe.indexOf("<")===-1)return v&&B1?v.createHTML(Qe):Qe;if(Le=KW(Qe),!Le)return Kf?null:B1?S:""}Le&&gI&&ll(Le.firstChild);const On=GW(ib?Qe:Le);for(;Gi=On.nextNode();)YW(Gi),JW(Gi),Gi.content instanceof s&&DJ(Gi.content);if(ib)return Qe;if(Kf){if(W1)for(qs=k.call(Le.ownerDocument);Le.firstChild;)qs.appendChild(Le.firstChild);else qs=Le;return(Ye.shadowroot||Ye.shadowrootmode)&&(qs=T.call(i,qs,!0)),qs}let Fo=gu?Le.outerHTML:Le.innerHTML;return gu&&We["!doctype"]&&Le.ownerDocument&&Le.ownerDocument.doctype&&Le.ownerDocument.doctype.name&&fo(fK,Le.ownerDocument.doctype.name)&&(Fo=" -`+Fo),qf&&wS([O,W,U],uc=>{Fo=bb(Fo,uc," ")}),v&&B1?v.createHTML(Fo):Fo},e.setConfig=function(){let Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bI(Qe),uI=!0},e.clearConfig=function(){Xf=null,uI=!1},e.isValidAttribute=function(Qe,G,Le){Xf||bI({});const qe=ds(Qe),Gi=ds(G);return XW(qe,Gi,Le)},e.addHook=function(Qe,G){typeof G=="function"&&_b(A[Qe],G)},e.removeHook=function(Qe,G){if(G!==void 0){const Le=Qpe(A[Qe],G);return Le===-1?void 0:Jpe(A[Qe],Le,1)[0]}return JB(A[Qe])},e.removeHooks=function(Qe){A[Qe]=[]},e.removeAllHooks=function(){A=o8()},e}var Lp=pK();const mK=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),_K=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),kE="vscode-relative-path";function r8(o,e){if(e.override==="*")return!0;try{const t=new URL(o,kE+"://");return!!(e.override.includes(t.protocol.replace(/:$/,""))||e.allowRelativePaths&&t.protocol===kE+":"&&!o.trim().toLowerCase().startsWith(kE))}catch{return!1}}function mme(o,e){Lp.addHook("afterSanitizeAttributes",t=>{for(const i of["href","src"])if(t.hasAttribute(i)){const n=t.getAttribute(i);i==="href"?!n.startsWith("#")&&!r8(n,o)&&t.removeAttribute(i):r8(n,e)||t.removeAttribute(i)}})}const _me=Object.freeze({ALLOWED_TAGS:[...mK],ALLOWED_ATTR:[..._K],ALLOW_UNKNOWN_PROTOCOLS:!0});function bme(o,e){return bK(o,e,"trusted")}function bK(o,e,t){try{const i={..._me};e?.allowedTags&&(e.allowedTags.override&&(i.ALLOWED_TAGS=[...e.allowedTags.override]),e.allowedTags.augment&&(i.ALLOWED_TAGS=[...i.ALLOWED_TAGS??[],...e.allowedTags.augment]));let n=[..._K];e?.allowedAttributes&&(e.allowedAttributes.override&&(n=[...e.allowedAttributes.override]),e.allowedAttributes.augment&&(n=[...n,...e.allowedAttributes.augment])),n=n.map(a=>typeof a=="string"?a.toLowerCase():{attributeName:a.attributeName.toLowerCase(),shouldKeep:a.shouldKeep});const s=new Set(n.map(a=>typeof a=="string"?a:a.attributeName)),r=new Map;for(const a of n)typeof a=="string"?r.delete(a):r.set(a.attributeName,a);return i.ALLOWED_ATTR=Array.from(s),mme({override:e?.allowedLinkProtocols?.override??[Ie.http,Ie.https],allowRelativePaths:e?.allowRelativeLinkPaths??!1},{override:e?.allowedMediaProtocols?.override??[Ie.http,Ie.https],allowRelativePaths:e?.allowRelativeMediaPaths??!1}),e?.replaceWithPlaintext&&Lp.addHook("uponSanitizeElement",vme),r.size&&Lp.addHook("uponSanitizeAttribute",(a,l)=>{const c=r.get(l.attrName);if(c){const d=c.shouldKeep(a,l);typeof d=="string"?(l.keepAttr=!0,l.attrValue=d):l.keepAttr=d}else l.keepAttr=s.has(l.attrName)}),t==="dom"?Lp.sanitize(o,{...i,RETURN_DOM_FRAGMENT:!0}):Lp.sanitize(o,{...i,RETURN_TRUSTED_TYPE:!0})}finally{Lp.removeAllHooks()}}const Cme=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],vme=(o,e,t)=>{if(!e.allowedTags[e.tagName]&&e.tagName!=="body"){const i=CK(o);i&&(o.nodeType===Node.COMMENT_NODE?o.parentElement?.insertBefore(i,o):o.parentElement?.replaceChild(i,o))}};function CK(o){if(!o.ownerDocument)return;let e,t;if(o.nodeType===Node.COMMENT_NODE)e=``;else if(o instanceof Element){const r=o.tagName.toLowerCase(),a=Cme.includes(r),l=o.attributes.length?" "+Array.from(o.attributes).map(c=>`${c.name}="${c.value}"`).join(" "):"";e=`<${r}${l}>`,a||(t=``)}else return;const i=document.createDocumentFragment(),n=o.ownerDocument.createTextNode(e);for(i.appendChild(n);o.firstChild;)i.appendChild(o.firstChild);const s=t?o.ownerDocument.createTextNode(t):void 0;return s&&i.appendChild(s),i}function vK(o,e,t){const i=bK(e,t,"dom");gn(o,i)}const wme=new RegExp(`(\\\\)?\\$\\((${ye.iconNameExpression}(?:${ye.iconModifierExpression})?)\\)`,"g");function Mh(o){const e=new Array;let t,i=0,n=0;for(;(t=wme.exec(o))!==null;){n=t.index||0,i{let i=[],n=[];return o&&({href:o,dimensions:i}=gpe(o),n.push(`src="${CS(o)}"`)),t&&n.push(`alt="${CS(t)}"`),e&&n.push(`title="${CS(e)}"`),i.length&&(n=n.concat(i)),""},paragraph({tokens:o}){return`

${this.parser.parseInline(o)}

`},link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof o!="string"?"":(o===i&&(i=vE(i)),e=typeof e=="string"?CS(vE(e)):"",o=vE(o),o=o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${i}`)}});function Sme(o){return function(e){const{tokens:t}=e,i=t[0];if(i?.type!=="paragraph")return o.call(this,e);const n=i.tokens;if(!n||n.length===0)return o.call(this,e);const s=n[0];if(s?.type!=="text")return o.call(this,e);const r=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=s.raw.match(r);if(!a)return o.call(this,e);s.raw=s.raw.replace(r,""),s.text=s.text.replace(r,"");const l={note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"},c=a[1],d=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase(),h=c.toLowerCase(),u=tl({id:l[h]}).outerHTML,g=this.parser.parse(t);return`

${u}${d}${g.substring(3)}

-`}}function u1(o,e={},t){const i=new z;let n=!1;const s=new dK(...e.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=Lme(s,e,o),c=xme(o);let d;if(e.fillInIncompleteTokens){const f={...s.defaults,...e.markedOptions,renderer:r},p=s.lexer(c,f),_=Wme(p);d=s.parser(_,f)}else d=s.parse(c,{...e?.markedOptions,renderer:r,async:!1});o.supportThemeIcons&&(d=Mh(d).map(p=>typeof p=="string"?p:p.outerHTML).join(""));const h=document.createElement("div"),u=wK(o,e.sanitizerConfig??{});vK(h,d,u),yme(o,e,h);let g;if(t?(g=t,gn(t,...h.children)):g=h,a.length>0)Promise.all(a).then(f=>{if(n)return;const p=new Map(f),_=g.querySelectorAll("div[data-code]");for(const b of _){const C=p.get(b.dataset.code??"");C&&gn(b,C)}e.asyncRenderCallback?.()});else if(l.length>0){const f=new Map(l),p=g.querySelectorAll("div[data-code]");for(const _ of p){const b=f.get(_.dataset.code??"");b&&gn(_,b)}}if(e.asyncRenderCallback)for(const f of g.getElementsByTagName("img")){const p=i.add(B(f,"load",()=>{p.dispose(),e.asyncRenderCallback()}))}if(e.actionHandler){const f=p=>{const _=new qn(me(g),p);!_.leftButton&&!_.middleButton||a8(o,e,_)};i.add(B(g,"click",f)),i.add(B(g,"auxclick",f)),i.add(B(g,"keydown",p=>{const _=new Et(p);!_.equals(10)&&!_.equals(3)||a8(o,e,_)}))}for(const f of[...g.getElementsByTagName("input")])if(f.attributes.getNamedItem("type")?.value==="checkbox")f.setAttribute("disabled","");else if(e.sanitizerConfig?.replaceWithPlaintext){const p=CK(f);p?f.parentElement?.replaceChild(p,f):f.remove()}else f.remove();return{element:g,dispose:()=>{n=!0,i.dispose()}}}function yme(o,e,t){for(const i of t.querySelectorAll("img, audio, video, source")){const n=i.getAttribute("src");if(n){let s=n;try{o.baseUri&&(s=NR(be.from(o.baseUri),s))}catch{}if(i.setAttribute("src",l8(o,s,!0)),e.sanitizerConfig?.remoteImageIsAllowed){const r=be.parse(s);r.scheme!==Ie.file&&r.scheme!==Ie.data&&!e.sanitizerConfig.remoteImageIsAllowed(r)&&i.replaceWith(ee("",void 0,i.outerHTML))}}}for(const i of t.querySelectorAll("a")){const n=i.getAttribute("href");if(i.setAttribute("href",""),!n||/^data:|javascript:/i.test(n)||/^command:/i.test(n)&&!o.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(n))i.replaceWith(...i.childNodes);else{let s=l8(o,n,!1);o.baseUri&&(s=NR(be.from(o.baseUri),n)),i.dataset.href=s}}}function Lme(o,e,t){const i=new o.Renderer(e.markedOptions);i.image=IE.image,i.link=IE.link,i.paragraph=IE.paragraph,t.supportAlertSyntax&&(i.blockquote=Sme(i.blockquote));const n=[],s=[];return e.codeBlockRendererSync?i.code=({text:r,lang:a,raw:l})=>{const c=LR.nextId(),d=e.codeBlockRendererSync(c8(a),r,l);return s.push([c,d]),`
${ha(r)}
`}:e.codeBlockRenderer&&(i.code=({text:r,lang:a})=>{const l=LR.nextId(),c=e.codeBlockRenderer(c8(a),r);return n.push(c.then(d=>[l,d])),`
${ha(r)}
`}),t.supportHtml||(i.html=({text:r})=>e.sanitizerConfig?.replaceWithPlaintext?ha(r):(t.isTrusted?r.match(/^(]+>)|(<\/\s*span>)$/):void 0)?r:""),{renderer:i,codeBlocks:n,syncCodeBlocks:s}}function xme(o){let e=o.value;return e.length>1e5&&(e=`${e.substr(0,1e5)}…`),o.supportThemeIcons&&(e=lpe(e)),e}function a8(o,e,t){const i=t.target.closest("a[data-href]");if(Si(i))try{let n=i.dataset.href;n&&(o.baseUri&&(n=NR(be.from(o.baseUri),n)),e.actionHandler?.(n,o))}catch(n){Te(n)}finally{t.preventDefault()}}function Dme(o,e){let t;try{t=DR(decodeURIComponent(e))}catch{}return t?(t=y$(t,i=>{if(o.uris&&o.uris[i])return be.revive(o.uris[i])}),encodeURIComponent(JSON.stringify(t))):e}function l8(o,e,t){const i=o.uris&&o.uris[e];let n=be.revive(i);return t?e.startsWith(Ie.data+":")?e:(n||(n=be.parse(e)),PU.uriToBrowserUri(n).toString(!0)):!n||be.parse(e).toString()===n.toString()?e:(n.query&&(n=n.with({query:Dme(o,n.query)})),n.toString())}function c8(o){if(!o)return"";const e=o.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:o}function NR(o,e){return/^\w[\w\d+.-]*:/.test(e)?e:o.path.endsWith("/")?U7(o,e).toString():U7(CD(o),e).toString()}function kme(o,e,t={}){const i=wK(e,t);return bme(o,i)}const Ime=Object.freeze([...mK,"input"]),Eme=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(o,e)=>o.tagName==="SPAN"&&e.attrName==="style"?/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(e.attrValue):!1},{attributeName:"class",shouldKeep:(o,e)=>o.tagName==="SPAN"&&e.attrName==="class"?/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue):!1}]);function wK(o,e){const t=o.isTrusted??!1,i=[Ie.http,Ie.https,Ie.mailto,Ie.file,Ie.vscodeFileResource,Ie.vscodeRemote,Ie.vscodeRemoteResource,Ie.vscodeNotebookCell];return t&&i.push(Ie.command),e.allowedLinkSchemes?.augment&&i.push(...e.allowedLinkSchemes.augment),{allowedTags:{override:e.allowedTags?.override??Ime},allowedAttributes:{override:e.allowedAttributes?.override??Eme},allowedLinkProtocols:{override:i},allowRelativeLinkPaths:!!o.baseUri,allowedMediaProtocols:{override:[Ie.http,Ie.https,Ie.data,Ie.file,Ie.vscodeFileResource,Ie.vscodeRemote,Ie.vscodeRemoteResource]},allowRelativeMediaPaths:!!o.baseUri,replaceWithPlaintext:e.replaceWithPlaintext}}function Nme(o,e){if(typeof o=="string")return o;let t=o.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=qpe(t,{async:!1,renderer:Rme.value});return kme(i,{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,n=>Tme.get(n)??n).trim()}const Tme=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function SK(){const o=new qv;return o.code=({text:e})=>ha(e),o.blockquote=({text:e})=>e+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:i}){const n=this.parser.parseInline(i),s=_9(e);if(s===null)return n;e=s;let r='",r}image({href:e,title:t,text:i}){const n=_9(e);if(n===null)return i;e=n;let s=`${i}{const a=s[r].flat(1/0);i=i.concat(this.walkTokens(a,t))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{const n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=t.renderers[s.name];r?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[s.level];r?r.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),i.renderer){const s=this.defaults.renderer||new lv(this.defaults);for(const r in i.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=i.renderer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h||""}}n.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new my(this.defaults);for(const r in i.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=i.tokenizer[a],c=s[a];s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}n.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new $S;for(const r in i.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,l=i.hooks[a],c=s[a];$S.passThroughHooks.has(r)?s[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(s,d)).then(u=>c.call(s,u));const h=l.call(s,d);return c.call(s,h)}:s[a]=(...d)=>{let h=l.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}n.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens,r=i.walkTokens;n.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Cl.lex(e,t??this.defaults)}parser(e,t){return vl.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,s)=>{const r={...s},a={...this.defaults,...r},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let c=e(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=t(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const n="

An error occurred:

"+rr(i.message+"",!0)+"
";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}}const Fg=new Lj;function wi(o,e){return Fg.parse(o,e)}wi.options=wi.setOptions=function(o){return Fg.setOptions(o),wi.defaults=Fg.defaults,pj(wi.defaults),wi};wi.getDefaults=W4;wi.defaults=hf;wi.use=function(...o){return Fg.use(...o),wi.defaults=Fg.defaults,pj(wi.defaults),wi};wi.walkTokens=function(o,e){return Fg.walkTokens(o,e)};wi.parseInline=Fg.parseInline;wi.Parser=vl;wi.parser=vl.parse;wi.Renderer=lv;wi.TextRenderer=$4;wi.Lexer=Cl;wi.lexer=Cl.lex;wi.Tokenizer=my;wi.Hooks=$S;wi.parse=wi;wi.options;wi.setOptions;wi.use;wi.walkTokens;wi.parseInline;const Yge=wi;vl.parse;const cv=Cl.lex;function Xge(o){return JSON.stringify(o,Qge)}function mT(o){let e=JSON.parse(o);return e=_T(e),e}function Qge(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function _T(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return _e.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof lh||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t{for(const i of["href","src"])if(t.hasAttribute(i)){const n=t.getAttribute(i);i==="href"?!n.startsWith("#")&&!w9(n,o)&&t.removeAttribute(i):w9(n,e)||t.removeAttribute(i)}})}const efe=Object.freeze({ALLOWED_TAGS:[...kj],ALLOWED_ATTR:[...Dj],ALLOW_UNKNOWN_PROTOCOLS:!0});function tfe(o,e){return Ij(o,e,"trusted")}function Ij(o,e,t){try{const i={...efe};e?.allowedTags&&(e.allowedTags.override&&(i.ALLOWED_TAGS=[...e.allowedTags.override]),e.allowedTags.augment&&(i.ALLOWED_TAGS=[...i.ALLOWED_TAGS??[],...e.allowedTags.augment]));let n=[...Dj];e?.allowedAttributes&&(e.allowedAttributes.override&&(n=[...e.allowedAttributes.override]),e.allowedAttributes.augment&&(n=[...n,...e.allowedAttributes.augment])),n=n.map(a=>typeof a=="string"?a.toLowerCase():{attributeName:a.attributeName.toLowerCase(),shouldKeep:a.shouldKeep});const s=new Set(n.map(a=>typeof a=="string"?a:a.attributeName)),r=new Map;for(const a of n)typeof a=="string"?r.delete(a):r.set(a.attributeName,a);return i.ALLOWED_ATTR=Array.from(s),Jge({override:e?.allowedLinkProtocols?.override??[Le.http,Le.https],allowRelativePaths:e?.allowRelativeLinkPaths??!1},{override:e?.allowedMediaProtocols?.override??[Le.http,Le.https],allowRelativePaths:e?.allowRelativeMediaPaths??!1}),e?.replaceWithPlaintext&&Gf.addHook("uponSanitizeElement",nfe),r.size&&Gf.addHook("uponSanitizeAttribute",(a,l)=>{const c=r.get(l.attrName);if(c){const d=c.shouldKeep(a,l);typeof d=="string"?(l.keepAttr=!0,l.attrValue=d):l.keepAttr=d}else l.keepAttr=s.has(l.attrName)}),t==="dom"?Gf.sanitize(o,{...i,RETURN_DOM_FRAGMENT:!0}):Gf.sanitize(o,{...i,RETURN_TRUSTED_TYPE:!0})}finally{Gf.removeAllHooks()}}const ife=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],nfe=(o,e,t)=>{if(!e.allowedTags[e.tagName]&&e.tagName!=="body"){const i=Ej(o);i&&(o.nodeType===Node.COMMENT_NODE?o.parentElement?.insertBefore(i,o):o.parentElement?.replaceChild(i,o))}};function Ej(o){if(!o.ownerDocument)return;let e,t;if(o.nodeType===Node.COMMENT_NODE)e=``;else if(o instanceof Element){const r=o.tagName.toLowerCase(),a=ife.includes(r),l=o.attributes.length?" "+Array.from(o.attributes).map(c=>`${c.name}="${c.value}"`).join(" "):"";e=`<${r}${l}>`,a||(t=``)}else return;const i=document.createDocumentFragment(),n=o.ownerDocument.createTextNode(e);for(i.appendChild(n);o.firstChild;)i.appendChild(o.firstChild);const s=t?o.ownerDocument.createTextNode(t):void 0;return s&&i.appendChild(s),i}function Nj(o,e,t){const i=Ij(e,t,"dom");on(o,i)}const sfe=new RegExp(`(\\\\)?\\$\\((${Se.iconNameExpression}(?:${Se.iconModifierExpression})?)\\)`,"g");function uh(o){const e=new Array;let t,i=0,n=0;for(;(t=sfe.exec(o))!==null;){n=t.index||0,i{let i=[],n=[];return o&&({href:o,dimensions:i}=_ge(o),n.push(`src="${D1(o)}"`)),t&&n.push(`alt="${D1(t)}"`),e&&n.push(`title="${D1(e)}"`),i.length&&(n=n.concat(i)),""},paragraph({tokens:o}){return`

${this.parser.parseInline(o)}

`},link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof o!="string"?"":(o===i&&(i=mI(i)),e=typeof e=="string"?D1(mI(e)):"",o=mI(o),o=o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${i}`)}});function ofe(o){return function(e){const{tokens:t}=e,i=t[0];if(i?.type!=="paragraph")return o.call(this,e);const n=i.tokens;if(!n||n.length===0)return o.call(this,e);const s=n[0];if(s?.type!=="text")return o.call(this,e);const r=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=s.raw.match(r);if(!a)return o.call(this,e);s.raw=s.raw.replace(r,""),s.text=s.text.replace(r,"");const l={note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"},c=a[1],d=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase(),h=c.toLowerCase(),u=Ba({id:l[h]}).outerHTML,g=this.parser.parse(t);return`

${u}${d}${g.substring(3)}

+`}}function Iw(o,e={},t){const i=new z;let n=!1;const s=new Lj(...e.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=afe(s,e,o),c=lfe(o);let d;if(e.fillInIncompleteTokens){const f={...s.defaults,...e.markedOptions,renderer:r},p=s.lexer(c,f),_=wfe(p);d=s.parser(_,f)}else d=s.parse(c,{...e?.markedOptions,renderer:r,async:!1});o.supportThemeIcons&&(d=uh(d).map(p=>typeof p=="string"?p:p.outerHTML).join(""));const h=document.createElement("div"),u=Tj(o,e.sanitizerConfig??{});Nj(h,d,u),rfe(o,e,h);let g;if(t?(g=t,on(t,...h.children)):g=h,a.length>0)Promise.all(a).then(f=>{if(n)return;const p=new Map(f),_=g.querySelectorAll("div[data-code]");for(const b of _){const C=p.get(b.dataset.code??"");C&&on(b,C)}e.asyncRenderCallback?.()});else if(l.length>0){const f=new Map(l),p=g.querySelectorAll("div[data-code]");for(const _ of p){const b=f.get(_.dataset.code??"");b&&on(_,b)}}if(e.asyncRenderCallback)for(const f of g.getElementsByTagName("img")){const p=i.add(W(f,"load",()=>{p.dispose(),e.asyncRenderCallback()}))}if(e.actionHandler){const f=p=>{const _=new Wn(pe(g),p);!_.leftButton&&!_.middleButton||S9(o,e,_)};i.add(W(g,"click",f)),i.add(W(g,"auxclick",f)),i.add(W(g,"keydown",p=>{const _=new yt(p);!_.equals(10)&&!_.equals(3)||S9(o,e,_)}))}for(const f of[...g.getElementsByTagName("input")])if(f.attributes.getNamedItem("type")?.value==="checkbox")f.setAttribute("disabled","");else if(e.sanitizerConfig?.replaceWithPlaintext){const p=Ej(f);p?f.parentElement?.replaceChild(p,f):f.remove()}else f.remove();return{element:g,dispose:()=>{n=!0,i.dispose()}}}function rfe(o,e,t){for(const i of t.querySelectorAll("img, audio, video, source")){const n=i.getAttribute("src");if(n){let s=n;try{o.baseUri&&(s=bT(_e.from(o.baseUri),s))}catch{}if(i.setAttribute("src",y9(o,s,!0)),e.sanitizerConfig?.remoteImageIsAllowed){const r=_e.parse(s);r.scheme!==Le.file&&r.scheme!==Le.data&&!e.sanitizerConfig.remoteImageIsAllowed(r)&&i.replaceWith(J("",void 0,i.outerHTML))}}}for(const i of t.querySelectorAll("a")){const n=i.getAttribute("href");if(i.setAttribute("href",""),!n||/^data:|javascript:/i.test(n)||/^command:/i.test(n)&&!o.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(n))i.replaceWith(...i.childNodes);else{let s=y9(o,n,!1);o.baseUri&&(s=bT(_e.from(o.baseUri),n)),i.dataset.href=s}}}function afe(o,e,t){const i=new o.Renderer(e.markedOptions);i.image=bI.image,i.link=bI.link,i.paragraph=bI.paragraph,t.supportAlertSyntax&&(i.blockquote=ofe(i.blockquote));const n=[],s=[];return e.codeBlockRendererSync?i.code=({text:r,lang:a,raw:l})=>{const c=fT.nextId(),d=e.codeBlockRendererSync(x9(a),r,l);return s.push([c,d]),`
${Xr(r)}
`}:e.codeBlockRenderer&&(i.code=({text:r,lang:a})=>{const l=fT.nextId(),c=e.codeBlockRenderer(x9(a),r);return n.push(c.then(d=>[l,d])),`
${Xr(r)}
`}),t.supportHtml||(i.html=({text:r})=>e.sanitizerConfig?.replaceWithPlaintext?Xr(r):(t.isTrusted?r.match(/^(]+>)|(<\/\s*span>)$/):void 0)?r:""),{renderer:i,codeBlocks:n,syncCodeBlocks:s}}function lfe(o){let e=o.value;return e.length>1e5&&(e=`${e.substr(0,1e5)}…`),o.supportThemeIcons&&(e=uge(e)),e}function S9(o,e,t){const i=t.target.closest("a[data-href]");if(mi(i))try{let n=i.dataset.href;n&&(o.baseUri&&(n=bT(_e.from(o.baseUri),n)),e.actionHandler?.(n,o))}catch(n){Ee(n)}finally{t.preventDefault()}}function cfe(o,e){let t;try{t=mT(decodeURIComponent(e))}catch{}return t?(t=Wz(t,i=>{if(o.uris&&o.uris[i])return _e.revive(o.uris[i])}),encodeURIComponent(JSON.stringify(t))):e}function y9(o,e,t){const i=o.uris&&o.uris[e];let n=_e.revive(i);return t?e.startsWith(Le.data+":")?e:(n||(n=_e.parse(e)),ZV.uriToBrowserUri(n).toString(!0)):!n||_e.parse(e).toString()===n.toString()?e:(n.query&&(n=n.with({query:cfe(o,n.query)})),n.toString())}function x9(o){if(!o)return"";const e=o.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:o}function bT(o,e){return/^\w[\w\d+.-]*:/.test(e)?e:o.path.endsWith("/")?u7(o,e).toString():u7(xL(o),e).toString()}function dfe(o,e,t={}){const i=Tj(e,t);return tfe(o,i)}const hfe=Object.freeze([...kj,"input"]),ufe=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(o,e)=>o.tagName==="SPAN"&&e.attrName==="style"?/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(e.attrValue):!1},{attributeName:"class",shouldKeep:(o,e)=>o.tagName==="SPAN"&&e.attrName==="class"?/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue):!1}]);function Tj(o,e){const t=o.isTrusted??!1,i=[Le.http,Le.https,Le.mailto,Le.file,Le.vscodeFileResource,Le.vscodeRemote,Le.vscodeRemoteResource,Le.vscodeNotebookCell];return t&&i.push(Le.command),e.allowedLinkSchemes?.augment&&i.push(...e.allowedLinkSchemes.augment),{allowedTags:{override:e.allowedTags?.override??hfe},allowedAttributes:{override:e.allowedAttributes?.override??ufe},allowedLinkProtocols:{override:i},allowRelativeLinkPaths:!!o.baseUri,allowedMediaProtocols:{override:[Le.http,Le.https,Le.data,Le.file,Le.vscodeFileResource,Le.vscodeRemote,Le.vscodeRemoteResource]},allowRelativeMediaPaths:!!o.baseUri,replaceWithPlaintext:e.replaceWithPlaintext}}function gfe(o,e){if(typeof o=="string")return o;let t=o.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Yge(t,{async:!1,renderer:pfe.value});return dfe(i,{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,n=>ffe.get(n)??n).trim()}const ffe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function Rj(){const o=new lv;return o.code=({text:e})=>Xr(e),o.blockquote=({text:e})=>e+` `,o.html=e=>"",o.heading=function({tokens:e}){return this.parser.parseInline(e)+` `},o.hr=()=>"",o.list=function({items:e}){return e.map(t=>this.listitem(t)).join(` `)+` @@ -328,26 +327,26 @@ Please report this to https://github.com/markedjs/marked.`,e){const n="

An err `},o.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+` `+t.map(i=>i.map(n=>this.tablecell(n)).join(" ")).join(` `)+` -`},o.tablerow=({text:e})=>e,o.tablecell=function({tokens:e}){return this.parser.parseInline(e)},o.strong=({text:e})=>e,o.em=({text:e})=>e,o.codespan=({text:e})=>ha(e),o.br=e=>` -`,o.del=({text:e})=>e,o.image=e=>"",o.text=({text:e})=>e,o.link=({text:e})=>e,o}const Rme=new $n(SK);new $n(()=>{const o=SK();return o.code=({text:e})=>` +`},o.tablerow=({text:e})=>e,o.tablecell=function({tokens:e}){return this.parser.parseInline(e)},o.strong=({text:e})=>e,o.em=({text:e})=>e,o.codespan=({text:e})=>Xr(e),o.br=e=>` +`,o.del=({text:e})=>e,o.image=e=>"",o.text=({text:e})=>e,o.link=({text:e})=>e,o}const pfe=new On(Rj);new On(()=>{const o=Rj();return o.code=({text:e})=>` \`\`\` -${ha(e)} +${Xr(e)} \`\`\` -`,o});function Gv(o){let e="";return o.forEach(t=>{e+=t.raw}),e}function yK(o){if(o.tokens)for(let e=o.tokens.length-1;e>=0;e--){const t=o.tokens[e];if(t.type==="text"){const i=t.raw.split(` -`),n=i[i.length-1];if(n.includes("`"))return Hme(o);if(n.includes("**"))return qme(o);if(n.match(/\*\w/))return Vme(o);if(n.match(/(^|\s)__\w/))return Kme(o);if(n.match(/(^|\s)_\w/))return zme(o);if(Mme(n)||Pme(n)&&o.tokens.slice(0,e).some(s=>s.type==="text"&&s.raw.match(/\[[^\]]*$/))){const s=o.tokens.slice(e+1);return s[0]?.type==="link"&&s[1]?.type==="text"&&s[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?$me(o):Ume(o)}else if(n.match(/(^|\s)\[\w*[^\]]*$/))return jme(o)}}}function Mme(o){return!!o.match(/(^|\s)\[.*\]\(\w*/)}function Pme(o){return!!o.match(/^[^\[]*\]\([^\)]*$/)}function Ame(o){const e=o.items[o.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0,i=c=>{const h=c.items.at(-1)?.tokens.at(-1);return h?.type==="heading"||h?.type==="list"&&i(h)};let n;if(t?.type==="text"&&!("inRawBlock"in e))n=yK(t);else if(i(o)){const c=Kv(o.raw.trim()+"  ")[0];return c.type!=="list"?void 0:c}if(!n||n.type!=="paragraph")return;const s=Gv(o.items.slice(0,-1)),r=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!r)return;const a=r+Gv(e.tokens.slice(0,-1))+n.raw,l=Kv(s+a)[0];if(l.type==="list")return l}function Ome(o,e){if(o.raw.match(/-\s*$/))return Kv(e+"  ")}const Fme=3;function Wme(o){for(let e=0;e{e+=t.raw}),e}function Mj(o){if(o.tokens)for(let e=o.tokens.length-1;e>=0;e--){const t=o.tokens[e];if(t.type==="text"){const i=t.raw.split(` +`),n=i[i.length-1];if(n.includes("`"))return yfe(o);if(n.includes("**"))return Efe(o);if(n.match(/\*\w/))return xfe(o);if(n.match(/(^|\s)__\w/))return Nfe(o);if(n.match(/(^|\s)_\w/))return Lfe(o);if(mfe(n)||_fe(n)&&o.tokens.slice(0,e).some(s=>s.type==="text"&&s.raw.match(/\[[^\]]*$/))){const s=o.tokens.slice(e+1);return s[0]?.type==="link"&&s[1]?.type==="text"&&s[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?Dfe(o):kfe(o)}else if(n.match(/(^|\s)\[\w*[^\]]*$/))return Ife(o)}}}function mfe(o){return!!o.match(/(^|\s)\[.*\]\(\w*/)}function _fe(o){return!!o.match(/^[^\[]*\]\([^\)]*$/)}function bfe(o){const e=o.items[o.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0,i=c=>{const h=c.items.at(-1)?.tokens.at(-1);return h?.type==="heading"||h?.type==="list"&&i(h)};let n;if(t?.type==="text"&&!("inRawBlock"in e))n=Mj(t);else if(i(o)){const c=cv(o.raw.trim()+"  ")[0];return c.type!=="list"?void 0:c}if(!n||n.type!=="paragraph")return;const s=dv(o.items.slice(0,-1)),r=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!r)return;const a=r+dv(e.tokens.slice(0,-1))+n.raw,l=cv(s+a)[0];if(l.type==="list")return l}function Cfe(o,e){if(o.raw.match(/-\s*$/))return cv(e+"  ")}const vfe=3;function wfe(o){for(let e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(` `):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+` -|${" --- |".repeat(i)}`;return Kv(a)}}let LK={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>F.None,setupDelayedHoverAtMouse:()=>F.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Zme(o){LK=o}function va(){return LK}class Yme{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function Ts(o,e,t){return Math.min(Math.max(o,e),t)}class xK{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class Xme{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n=r.end||r.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}o.intersect=e;function t(s){return s.end-s.start<=0}o.isEmpty=t;function i(s,r){return!t(e(s,r))}o.intersects=i;function n(s,r){const a=[],l={start:s.start,end:Math.min(r.start,s.end)},c={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}o.relativeComplement=n})(Xn||(Xn={}));function d8(o,e){const t=[];for(const i of e){if(o.start>=i.range.end)continue;if(o.ende.concat(t),[]))}class e_e{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=d8({start:0,end:e},this.groups),r=d8({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:TR(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Jme(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}function i_e(o,e,t,i=[]){if(!o.dataTransfer)return;const n=ee(".monaco-drag-image");n.textContent=t,n.classList.add(...i),(a=>{for(;a&&!a.classList.contains("monaco-workbench");)a=a.parentElement;return a||e.ownerDocument.body})(e).appendChild(n),o.dataTransfer.setDragImage(n,-10,-10),setTimeout(()=>n.remove(),0)}var Rd=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const Su={CurrentDragAndDropData:void 0},hl={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(o){return[o]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class g1{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class n_e{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class s_e{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;tn,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class wa{static{this.InstanceCount=0}get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:MI(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=hl){if(this.virtualDelegate=t,this.domId=`list_id_${++wa.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Fr(50),this.splicing=!1,this.dragOverAnimationStopDisposable=F.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=F.None,this.onDragLeaveTimeout=F.None,this.currentSelectionDisposable=F.None,this.disposables=new z,this._onDidChangeContentHeight=new P,this._onDidChangeContentWidth=new P,this.onDidChangeContentHeight=se.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);if(this.cache=this.disposables.add(new t_e(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=n.horizontalScrolling??hl.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new r_e(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??hl.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(ni.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new z_({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>ro(me(this.domNode),r)})),this.scrollableElement=this.disposables.add(new zD(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??hl.alwaysConsumeMouseWheel,horizontal:1,vertical:n.verticalScrollMode??hl.verticalScrollMode,useShadows:n.useShadows??hl.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(B(this.rowsContainer,Bt.Change,r=>this.onTouchChange(r))),this.disposables.add(B(this.scrollableElement.getDomNode(),"scroll",r=>{const a=r.target,l=a.scrollTop;a.scrollTop=0,n.scrollToActiveElement&&this.setScrollTop(this.scrollTop+l)})),this.disposables.add(B(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(B(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(B(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(B(this.domNode,"dragend",r=>this.onDragEnd(r))),n.userSelection){if(n.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(B(this.domNode,"mousedown",r=>this.onPotentialSelectionStart(r)))}this.setRowLineHeight=n.setRowLineHeight??hl.setRowLineHeight,this.setRowHeight=n.setRowHeight??hl.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??hl.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(hl.dnd),this.layout(n.initialSize?.height,n.initialSize?.width),n.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(B(e,"focus",()=>{const t=Ji();this.activeElement!==t&&t!==null&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),s=e.getBoundingClientRect().top-i.top;s<0&&this.setScrollTop(this.scrollTop+s)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new e_e(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},r=Xn.intersect(n,s),a=new Map;for(let S=r.end-1;S>=r.start;S--){const L=this.items[S];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let x=a.get(L.templateId);x||(x=[],a.set(L.templateId,x));const k=this.renderers.get(L.templateId);k&&k.disposeElement&&k.disposeElement(L.element,S,L.row.templateData,{height:L.size}),x.unshift(L.row)}L.row=null,L.stale=!0}const l={start:e+t,end:this.items.length},c=Xn.intersect(l,n),d=Xn.relativeComplement(l,n),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:F.None,checkedDisposable:F.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=wy(this.items,e,t,h));const g=i.length-t,f=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=TR(c,g),_=Xn.intersect(f,p);for(let S=_.start;S<_.end;S++)this.updateItemInDOM(this.items[S],S);const b=Xn.relativeComplement(p,f);for(const S of b)for(let L=S.start;LTR(S,g)),v=[{start:e,end:e+i.length},...C].map(S=>Xn.intersect(f,S)).reverse();for(const S of v)for(let L=S.end-1;L>=S.start;L--){const x=this.items[L],I=a.get(x.templateId)?.pop();this.insertItemInDOM(L,I)}for(const S of a.values())for(const L of S)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=ro(me(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:Yte(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:MI(this.domNode)})}render(e,t,i,n,s,r=!1,a=!1){const l=this.getRenderRange(t,i),c=Xn.relativeComplement(l,e).reverse(),d=Xn.relativeComplement(e,l);if(r){const h=Xn.intersect(e,l);for(let u=h.start;u{for(const h of d)for(let u=h.start;u=h.start;u--)this.insertItemInDOM(u)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&s!==void 0&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);const s=this.accessibilityProvider.isChecked(i.element),r=c=>c==="mixed"?"mixed":String(!!c);if(typeof s=="boolean"||s==="mixed")i.row.domNode.setAttribute("aria-checked",r(s));else if(s){const c=d=>i.row.domNode.setAttribute("aria-checked",r(d));c(s.value),i.checkedDisposable=s.onDidChange(()=>c(s.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const a=this.renderers.get(i.templateId);if(!a)throw new Error(`No renderer found for template id ${i.templateId}`);a?.renderElement(i.element,e,i.row.templateData,{height:i.size});const l=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!l,l&&(i.dragStartDisposable=B(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,l,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=MI(e.row.domNode);const t=me(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const n=this.renderers.get(i.templateId);n&&n.disposeElement&&n.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return se.map(this.disposables.add(new wt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return se.map(this.disposables.add(new wt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return se.filter(se.map(this.disposables.add(new wt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return se.map(this.disposables.add(new wt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return se.map(this.disposables.add(new wt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return se.map(this.disposables.add(new wt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return se.any(se.map(this.disposables.add(new wt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),se.map(this.disposables.add(new wt(this.domNode,Bt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return se.map(this.disposables.add(new wt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return se.map(this.disposables.add(new wt(this.rowsContainer,Bt.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,s=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(of.TEXT,t);let s;this.dnd.getDragLabel&&(s=this.dnd.getDragLabel(n,i)),typeof s>"u"&&(s=String(n.length)),i_e(i,this.domNode,s,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new g1(n),Su.CurrentDragAndDropData=new n_e(n),this.dnd.onDragStart?.(this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=Vte(this.domNode),i=this.currentSelectionDisposable=new z,n=i.add(new z);n.add(B(this.domNode,"selectstart",()=>{n.add(B(t,"mousemove",s=>{t.getSelection()?.isCollapsed===!1&&this.setupDragAndDropScrollTopAnimation(s)})),i.add(ge(()=>{const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(s,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(B(t,"selectionchange",()=>{const s=t.getSelection();if(!s||s.isCollapsed){n.isDisposed&&i.dispose();return}let r=this.getIndexOfListElement(s.anchorNode),a=this.getIndexOfListElement(s.focusNode);r!==void 0&&a!==void 0&&(a{n.dispose(),this.teardownDragAndDropScrollTopAnimation(),t.getSelection()?.isCollapsed!==!1&&i.dispose()}))}getIndexOfListElement(e){if(!(!e||!this.domNode.contains(e)))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Su.CurrentDragAndDropData&&Su.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Su.CurrentDragAndDropData)this.currentDragData=Su.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new s_e}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=bd(i).filter(s=>s>=-1&&ss-r),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(o_e(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===n)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=ge(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&n!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");n==="drop-target-after"&&i[0]{for(const s of i){const r=this.items[s];r.dropTarget=!1,r.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=pd(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Su.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Su.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=F.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=YU(this.domNode).top;this.dragOverAnimationDisposable=rie(me(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=pd(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,n=Math.floor(i/.25);return Ts(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Si(i)||e$(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const s=Number(n);if(!isNaN(s))return s}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const n=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,n),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),n)}return i}_rerender(e,t,i){const n=this.getRenderRange(e,t);let s,r;e===this.elementTop(n.start)?(s=n.start,r=0):n.end-n.start>1&&(s=n.start+1,r=this.elementTop(s)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=u.start;g--)this.insertItemInDOM(g);for(let u=l.start;u=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class a_e{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(s=>s.templateData===i);if(n>=0){const s=this.renderedElements[n];this.trait.unrender(i),s.index=t}else{const s={index:t,templateData:i};this.renderedElements.push(s)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const s of this.renderedElements)s.index=e+t&&n.push({index:s.index+i-t,templateData:s.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let gL=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new a_e(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new P}splice(e,t,i){const n=i.length-t,s=e+t,r=[];let a=0;for(;a=s;)r.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(u8),t)}_set(e,t,i){const n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=RR(s,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return vy(this.sortedIndexes,e,u8)>=0}dispose(){vt(this._onChange)}};lu([Ii],gL.prototype,"renderer",null);class l_e extends gL{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class EE{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=new Set(n),r=i.map(a=>s.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function f1(o,e){return o.classList.contains(e)?!0:o.classList.contains("monaco-list")||!o.parentElement?!1:f1(o.parentElement,e)}function qb(o){return f1(o,"monaco-editor")}function c_e(o){return f1(o,"monaco-custom-toggle")}function d_e(o){return f1(o,"action-item")}function EC(o){return f1(o,"monaco-tree-sticky-row")}function Zv(o){return o.classList.contains("monaco-tree-sticky-container")}function DK(o){return o.tagName==="A"&&o.classList.contains("monaco-button")||o.tagName==="DIV"&&o.classList.contains("monaco-button-dropdown")?!0:o.classList.contains("monaco-list")||!o.parentElement?!1:DK(o.parentElement)}class kK{get onKeyDown(){return se.chain(this.disposables.add(new wt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!$a(t.target)).map(t=>new Et(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new z,this.multipleSelectionDisposables=new z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(n=>{switch(n.keyCode){case 3:return this.onEnter(n);case 16:return this.onUpArrow(n);case 18:return this.onDownArrow(n);case 11:return this.onPageUpArrow(n);case 12:return this.onPageDownArrow(n);case 9:return this.onEscape(n);case 31:this.multipleSelectionSupport&&(je?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Ns(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}lu([Ii],kK.prototype,"onKeyDown",null);var Rl;(function(o){o[o.Automatic=0]="Automatic",o[o.Trigger=1]="Trigger"})(Rl||(Rl={}));var $p;(function(o){o[o.Idle=0]="Idle",o[o.Typing=1]="Typing"})($p||($p={}));const h_e=new class{mightProducePrintableCharacter(o){return o.ctrlKey||o.metaKey||o.altKey?!1:o.keyCode>=31&&o.keyCode<=56||o.keyCode>=21&&o.keyCode<=30||o.keyCode>=98&&o.keyCode<=107||o.keyCode>=85&&o.keyCode<=95}};class u_e{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=$p.Idle,this.mode=Rl.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new z,this.disposables=new z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Rl.Automatic}enable(){if(this.enabled)return;let e=!1;const t=se.chain(this.enabledDisposables.add(new wt(this.view.domNode,"keydown")).event,s=>s.filter(r=>!$a(r.target)).filter(()=>this.mode===Rl.Automatic||this.triggered).map(r=>new Et(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>ct.stop(r,!0)).map(r=>r.browserEvent.key)),i=se.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);se.reduce(se.any(t,i),(s,r)=>r===null?null:(s||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?Ws(t):t&&Ws(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=$p.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===$p.Idle?1:0;this.state=$p.Typing;for(let s=0;s1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||jv(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class g_e{constructor(e,t){this.list=e,this.view=t,this.disposables=new z;const i=se.chain(this.disposables.add(new wt(t.domNode,"keydown")).event,s=>s.filter(r=>!$a(r.target)).map(r=>new Et(r)));se.chain(i,s=>s.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!Si(n)||n.tabIndex===-1)return;const s=me(n).getComputedStyle(n);s.visibility==="hidden"||s.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function IK(o){return je?o.browserEvent.metaKey:o.browserEvent.ctrlKey}function EK(o){return o.browserEvent.shiftKey}function f_e(o){return k4(o)&&o.button===2}const h8={isSelectionSingleChangeEvent:IK,isSelectionRangeChangeEvent:EK};class NK{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new z,this._onPointer=this.disposables.add(new P),e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||h8),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(ni.addTarget(e.getHTMLElement()))),se.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||h8))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){qb(e.browserEvent.target)||Ji()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if($a(e.browserEvent.target)||qb(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||$a(e.browserEvent.target)||qb(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),f_e(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if($a(e.browserEvent.target)||qb(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const n=Math.min(i,t),s=Math.max(i,t),r=Ns(n,s+1),a=this.list.getSelection(),l=b_e(RR(a,[i]),i);if(l.length===0)return;const c=RR(r,C_e(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),s=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===s.length?this.list.setSelection([...s,t],e.browserEvent):this.list.setSelection(s,e.browserEvent)}}dispose(){this.disposables.dispose()}}class p_e{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` +|${" --- |".repeat(i)}`;return cv(a)}}let Pj={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>A.None,setupDelayedHoverAtMouse:()=>A.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Rfe(o){Pj=o}function oa(){return Pj}class Mfe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function ws(o,e,t){return Math.min(Math.max(o,e),t)}class Aj{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class Pfe{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n=r.end||r.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}o.intersect=e;function t(s){return s.end-s.start<=0}o.isEmpty=t;function i(s,r){return!t(e(s,r))}o.intersects=i;function n(s,r){const a=[],l={start:s.start,end:Math.min(r.start,s.end)},c={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}o.relativeComplement=n})(Un||(Un={}));function L9(o,e){const t=[];for(const i of e){if(o.start>=i.range.end)continue;if(o.ende.concat(t),[]))}class Ffe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=L9({start:0,end:e},this.groups),r=L9({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:CT(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Ofe(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}function Bfe(o,e,t,i=[]){if(!o.dataTransfer)return;const n=J(".monaco-drag-image");n.textContent=t,n.classList.add(...i),(a=>{for(;a&&!a.classList.contains("monaco-workbench");)a=a.parentElement;return a||e.ownerDocument.body})(e).appendChild(n),o.dataTransfer.setDragImage(n,-10,-10),setTimeout(()=>n.remove(),0)}var hd=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const Jh={CurrentDragAndDropData:void 0},Ga={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(o){return[o]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Ew{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Hfe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Vfe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;tn,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class ra{static{this.InstanceCount=0}get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:ED(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=Ga){if(this.virtualDelegate=t,this.domId=`list_id_${++ra.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new yr(50),this.splicing=!1,this.dragOverAnimationStopDisposable=A.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=A.None,this.onDragLeaveTimeout=A.None,this.currentSelectionDisposable=A.None,this.disposables=new z,this._onDidChangeContentHeight=new P,this._onDidChangeContentWidth=new P,this.onDidChangeContentHeight=te.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);if(this.cache=this.disposables.add(new Wfe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=n.horizontalScrolling??Ga.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new Ufe(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??Ga.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Xt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new u_({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>Zs(pe(this.domNode),r)})),this.scrollableElement=this.disposables.add(new KL(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??Ga.alwaysConsumeMouseWheel,horizontal:1,vertical:n.verticalScrollMode??Ga.verticalScrollMode,useShadows:n.useShadows??Ga.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(W(this.rowsContainer,Rt.Change,r=>this.onTouchChange(r))),this.disposables.add(W(this.scrollableElement.getDomNode(),"scroll",r=>{const a=r.target,l=a.scrollTop;a.scrollTop=0,n.scrollToActiveElement&&this.setScrollTop(this.scrollTop+l)})),this.disposables.add(W(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(W(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(W(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(W(this.domNode,"dragend",r=>this.onDragEnd(r))),n.userSelection){if(n.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(W(this.domNode,"mousedown",r=>this.onPotentialSelectionStart(r)))}this.setRowLineHeight=n.setRowLineHeight??Ga.setRowLineHeight,this.setRowHeight=n.setRowHeight??Ga.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??Ga.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(Ga.dnd),this.layout(n.initialSize?.height,n.initialSize?.width),n.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(W(e,"focus",()=>{const t=ji();this.activeElement!==t&&t!==null&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),s=e.getBoundingClientRect().top-i.top;s<0&&this.setScrollTop(this.scrollTop+s)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new Ffe(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},r=Un.intersect(n,s),a=new Map;for(let S=r.end-1;S>=r.start;S--){const x=this.items[S];if(x.dragStartDisposable.dispose(),x.checkedDisposable.dispose(),x.row){let k=a.get(x.templateId);k||(k=[],a.set(x.templateId,k));const D=this.renderers.get(x.templateId);D&&D.disposeElement&&D.disposeElement(x.element,S,x.row.templateData,{height:x.size}),k.unshift(x.row)}x.row=null,x.stale=!0}const l={start:e+t,end:this.items.length},c=Un.intersect(l,n),d=Un.relativeComplement(l,n),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:A.None,checkedDisposable:A.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=k0(this.items,e,t,h));const g=i.length-t,f=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=CT(c,g),_=Un.intersect(f,p);for(let S=_.start;S<_.end;S++)this.updateItemInDOM(this.items[S],S);const b=Un.relativeComplement(p,f);for(const S of b)for(let x=S.start;xCT(S,g)),v=[{start:e,end:e+i.length},...C].map(S=>Un.intersect(f,S)).reverse();for(const S of v)for(let x=S.end-1;x>=S.start;x--){const k=this.items[x],I=a.get(k.templateId)?.pop();this.insertItemInDOM(x,I)}for(const S of a.values())for(const x of S)this.cache.release(x);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Zs(pe(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:eee(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:ED(this.domNode)})}render(e,t,i,n,s,r=!1,a=!1){const l=this.getRenderRange(t,i),c=Un.relativeComplement(l,e).reverse(),d=Un.relativeComplement(e,l);if(r){const h=Un.intersect(e,l);for(let u=h.start;u{for(const h of d)for(let u=h.start;u=h.start;u--)this.insertItemInDOM(u)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&s!==void 0&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const c=this.cache.alloc(i.templateId);i.row=c.row,i.stale||=c.isReusingConnectedDomNode}const n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);const s=this.accessibilityProvider.isChecked(i.element),r=c=>c==="mixed"?"mixed":String(!!c);if(typeof s=="boolean"||s==="mixed")i.row.domNode.setAttribute("aria-checked",r(s));else if(s){const c=d=>i.row.domNode.setAttribute("aria-checked",r(d));c(s.value),i.checkedDisposable=s.onDidChange(()=>c(s.value))}if(i.stale||!i.row.domNode.parentElement){const c=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==c)&&this.rowsContainer.insertBefore(i.row.domNode,c),i.stale=!1}this.updateItemInDOM(i,e);const a=this.renderers.get(i.templateId);if(!a)throw new Error(`No renderer found for template id ${i.templateId}`);a?.renderElement(i.element,e,i.row.templateData,{height:i.size});const l=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!l,l&&(i.dragStartDisposable=W(i.row.domNode,"dragstart",c=>this.onDragStart(i.element,l,c))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=ED(e.row.domNode);const t=pe(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const n=this.renderers.get(i.templateId);n&&n.disposeElement&&n.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return te.map(this.disposables.add(new mt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return te.map(this.disposables.add(new mt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return te.filter(te.map(this.disposables.add(new mt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return te.map(this.disposables.add(new mt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return te.map(this.disposables.add(new mt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return te.map(this.disposables.add(new mt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return te.any(te.map(this.disposables.add(new mt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),te.map(this.disposables.add(new mt(this.domNode,Rt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return te.map(this.disposables.add(new mt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return te.map(this.disposables.add(new mt(this.rowsContainer,Rt.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,s=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(Ag.TEXT,t);let s;this.dnd.getDragLabel&&(s=this.dnd.getDragLabel(n,i)),typeof s>"u"&&(s=String(n.length)),Bfe(i,this.domNode,s,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new Ew(n),Jh.CurrentDragAndDropData=new Hfe(n),this.dnd.onDragStart?.(this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=jJ(this.domNode),i=this.currentSelectionDisposable=new z,n=i.add(new z);n.add(W(this.domNode,"selectstart",()=>{n.add(W(t,"mousemove",s=>{t.getSelection()?.isCollapsed===!1&&this.setupDragAndDropScrollTopAnimation(s)})),i.add(ue(()=>{const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(s,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(W(t,"selectionchange",()=>{const s=t.getSelection();if(!s||s.isCollapsed){n.isDisposed&&i.dispose();return}let r=this.getIndexOfListElement(s.anchorNode),a=this.getIndexOfListElement(s.focusNode);r!==void 0&&a!==void 0&&(a{n.dispose(),this.teardownDragAndDropScrollTopAnimation(),t.getSelection()?.isCollapsed!==!1&&i.dispose()}))}getIndexOfListElement(e){if(!(!e||!this.domNode.contains(e)))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Jh.CurrentDragAndDropData&&Jh.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Jh.CurrentDragAndDropData)this.currentDragData=Jh.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Vfe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Xc(i).filter(s=>s>=-1&&ss-r),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(zfe(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===n)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=ue(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&n!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");n==="drop-target-after"&&i[0]{for(const s of i){const r=this.items[s];r.dropTarget=!1,r.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Gc(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Jh.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Jh.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=A.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=hz(this.domNode).top;this.dragOverAnimationDisposable=dee(pe(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Gc(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,n=Math.floor(i/.25);return ws(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(mi(i)||pz(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const s=Number(n);if(!isNaN(s))return s}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const n=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,n),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),n)}return i}_rerender(e,t,i){const n=this.getRenderRange(e,t);let s,r;e===this.elementTop(n.start)?(s=n.start,r=0):n.end-n.start>1&&(s=n.start+1,r=this.elementTop(s)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=u.start;g--)this.insertItemInDOM(g);for(let u=l.start;u=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class $fe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(s=>s.templateData===i);if(n>=0){const s=this.renderedElements[n];this.trait.unrender(i),s.index=t}else{const s={index:t,templateData:i};this.renderedElements.push(s)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const s of this.renderedElements)s.index=e+t&&n.push({index:s.index+i-t,templateData:s.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let by=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new $fe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new P}splice(e,t,i){const n=i.length-t,s=e+t,r=[];let a=0;for(;a=s;)r.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(D9),t)}_set(e,t,i){const n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=vT(s,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return L0(this.sortedIndexes,e,D9)>=0}dispose(){pt(this._onChange)}};Vh([Si],by.prototype,"renderer",null);class jfe extends by{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class CI{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=new Set(n),r=i.map(a=>s.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function Nw(o,e){return o.classList.contains(e)?!0:o.classList.contains("monaco-list")||!o.parentElement?!1:Nw(o.parentElement,e)}function lb(o){return Nw(o,"monaco-editor")}function qfe(o){return Nw(o,"monaco-custom-toggle")}function Kfe(o){return Nw(o,"action-item")}function jb(o){return Nw(o,"monaco-tree-sticky-row")}function hv(o){return o.classList.contains("monaco-tree-sticky-container")}function Oj(o){return o.tagName==="A"&&o.classList.contains("monaco-button")||o.tagName==="DIV"&&o.classList.contains("monaco-button-dropdown")?!0:o.classList.contains("monaco-list")||!o.parentElement?!1:Oj(o.parentElement)}class Fj{get onKeyDown(){return te.chain(this.disposables.add(new mt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Ia(t.target)).map(t=>new yt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new z,this.multipleSelectionDisposables=new z,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(n=>{switch(n.keyCode){case 3:return this.onEnter(n);case 16:return this.onUpArrow(n);case 18:return this.onDownArrow(n);case 11:return this.onPageUpArrow(n);case 12:return this.onPageDownArrow(n);case 9:return this.onEscape(n);case 31:this.multipleSelectionSupport&&(ze?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(vs(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Vh([Si],Fj.prototype,"onKeyDown",null);var pl;(function(o){o[o.Automatic=0]="Automatic",o[o.Trigger=1]="Trigger"})(pl||(pl={}));var fp;(function(o){o[o.Idle=0]="Idle",o[o.Typing=1]="Typing"})(fp||(fp={}));const Gfe=new class{mightProducePrintableCharacter(o){return o.ctrlKey||o.metaKey||o.altKey?!1:o.keyCode>=31&&o.keyCode<=56||o.keyCode>=21&&o.keyCode<=30||o.keyCode>=98&&o.keyCode<=107||o.keyCode>=85&&o.keyCode<=95}};class Zfe{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=fp.Idle,this.mode=pl.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new z,this.disposables=new z,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??pl.Automatic}enable(){if(this.enabled)return;let e=!1;const t=te.chain(this.enabledDisposables.add(new mt(this.view.domNode,"keydown")).event,s=>s.filter(r=>!Ia(r.target)).filter(()=>this.mode===pl.Automatic||this.triggered).map(r=>new yt(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>nt.stop(r,!0)).map(r=>r.browserEvent.key)),i=te.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);te.reduce(te.any(t,i),(s,r)=>r===null?null:(s||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?Is(t):t&&Is(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=fp.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===fp.Idle?1:0;this.state=fp.Typing;for(let s=0;s1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||av(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Yfe{constructor(e,t){this.list=e,this.view=t,this.disposables=new z;const i=te.chain(this.disposables.add(new mt(t.domNode,"keydown")).event,s=>s.filter(r=>!Ia(r.target)).map(r=>new yt(r)));te.chain(i,s=>s.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!mi(n)||n.tabIndex===-1)return;const s=pe(n).getComputedStyle(n);s.visibility==="hidden"||s.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function Wj(o){return ze?o.browserEvent.metaKey:o.browserEvent.ctrlKey}function Bj(o){return o.browserEvent.shiftKey}function Xfe(o){return pO(o)&&o.button===2}const k9={isSelectionSingleChangeEvent:Wj,isSelectionRangeChangeEvent:Bj};class Hj{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new z,this._onPointer=this.disposables.add(new P),e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||k9),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Xt.addTarget(e.getHTMLElement()))),te.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||k9))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){lb(e.browserEvent.target)||ji()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Ia(e.browserEvent.target)||lb(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Ia(e.browserEvent.target)||lb(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Xfe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Ia(e.browserEvent.target)||lb(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const n=Math.min(i,t),s=Math.max(i,t),r=vs(n,s+1),a=this.list.getSelection(),l=tpe(vT(a,[i]),i);if(l.length===0)return;const c=vT(r,ipe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),s=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===s.length?this.list.setSelection([...s,t],e.browserEvent):this.list.setSelection(s,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Qfe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` .monaco-drag-image${t}, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` .monaco-drag-image${t}, .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=ad(e.listFocusAndSelectionOutline,ad(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` + `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=Hc(e.listFocusAndSelectionOutline,Hc(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` .monaco-drag-image${t}, .monaco-list${t}:focus .monaco-list-row.focused, .context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const s=ad(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` + `);const s=Hc(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` .monaco-list${t}.drop-target, .monaco-list${t} .monaco-list-rows.drop-target, .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } @@ -380,97 +379,97 @@ ${ha(e)} background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const m_e={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:V.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:V.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:V.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},__e={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function b_e(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]o-e;class v_e{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class w_e{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new z}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:Ot(n);i.disposables.add(ke(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class S_e{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class ur{get onDidChangeFocus(){return se.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return se.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=se.chain(this.disposables.add(new wt(this.view.domNode,"keydown")).event,s=>s.map(r=>new Et(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>ct.stop(r,!0)).filter(()=>!1)),i=se.chain(this.disposables.add(new wt(this.view.domNode,"keyup")).event,s=>s.forEach(()=>e=!1).map(r=>new Et(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>ct.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),n=se.chain(this.view.onContextMenu,s=>s.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new qn(me(this.view.domNode),l),browserEvent:l})));return se.any(t,i,n)}get onKeyDown(){return this.disposables.add(new wt(this.view.domNode,"keydown")).event}get onDidFocus(){return se.signal(this.disposables.add(new wt(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return se.signal(this.disposables.add(new wt(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,s=__e){this.user=e,this._options=s,this.focus=new gL("focused"),this.anchor=new gL("anchor"),this.eventBufferer=new Kw,this._ariaLabel="",this.disposables=new z,this._onDidDispose=new P,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new l_e(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(a.push(new w_e(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(c=>new v_e(c.templateId,[...a,c]));const l={...s,dnd:s.dnd&&new S_e(this,s.dnd)};if(this.view=this.createListView(t,i,n,l),this.view.domNode.setAttribute("role",r),s.styleController)this.styleController=s.styleController(this.view.domId);else{const c=zr(this.view.domNode);this.styleController=new p_e(c,this.view.domId)}if(this.spliceable=new Yme([new EE(this.focus,this.view,s.identityProvider),new EE(this.selection,this.view,s.identityProvider),new EE(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new g_e(this,this.view)),(typeof s.keyboardSupport!="boolean"||s.keyboardSupport)&&(this.keyboardController=new kK(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const c=s.keyboardNavigationDelegate||h_e;this.typeNavigationController=new u_e(this,this.view,s.keyboardNavigationLabelProvider,s.keyboardNavigationEventFilter??(()=>!0),c),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const c=this.accessibilityProvider.getWidgetAriaLabel(),d=c&&typeof c!="string"?c:Ot(c);this.disposables.add(ke(h=>{this.ariaLabel=h.readObservable(d)}))}this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new wa(e,t,i,n)}createMouseController(e){return new NK(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new wu(this.user,`Invalid start index: ${e}`);if(t<0)throw new wu(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new wu(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new wu(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new wu(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const s=this.focus.get(),r=this.findNextIndex(s.length>0?s[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const s=this.focus.get(),r=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let r=s+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==s&&(this.setFocus([]),await ql(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const s=i(),r=this.view.getScrollTop()+s;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const l=this.findNextIndex(n,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([n],e)}else{const l=r;this.view.setScrollTop(r-this.view.renderHeight-s),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await ql(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new wu(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if(gd(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Ts(t,0,1)+s-i)}else{const a=s+r,l=n+this.view.renderHeight;s=l||(s=l&&r>=this.view.renderHeight?this.view.setScrollTop(s-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new wu(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=s-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}lu([Ii],ur.prototype,"onDidChangeFocus",null);lu([Ii],ur.prototype,"onDidChangeSelection",null);lu([Ii],ur.prototype,"onContextMenu",null);lu([Ii],ur.prototype,"onKeyDown",null);lu([Ii],ur.prototype,"onDidFocus",null);lu([Ii],ur.prototype,"onDidBlur",null);const bg=ee,TK="selectOption.entry.template";class y_e{get templateId(){return TK}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Y(e,bg(".option-text")),t.detail=Y(e,bg(".option-detail")),t.decoratorRight=Y(e,bg(".option-decorator-right")),t}renderElement(e,t,i){const n=i,s=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;n.text.textContent=s,n.detail.textContent=r||"",n.decoratorRight.textContent=a||"",l?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Xu extends F{static{this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32}static{this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2}static{this.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3}constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new z),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Xu.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new P,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(va().setupManagedHover(oc("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return TK}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ee(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Y(this.selectDropDownContainer,bg(".select-box-details-pane"));const t=Y(this.selectDropDownContainer,bg(".select-box-dropdown-container-width-control")),i=Y(t,bg(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Y(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=zr(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(B(this.selectDropDownContainer,te.DRAG_START,n=>{ct.stop(n,!0)}))}registerListeners(){this._register(Ti(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(B(this.selectElement,te.CLICK,t=>{ct.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(B(this.selectElement,te.MOUSE_DOWN,t=>{ct.stop(t)}));let e;this._register(B(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(B(this.selectElement,"touchend",t=>{ct.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(B(this.selectElement,te.KEY_DOWN,t=>{const i=new Et(t);let n=!1;je?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(n=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(n=!0),n&&(this.showSelectDropDown(),ct.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Qt(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=ad(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=me(this.selectElement),i=wi(this.selectElement),n=me(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Xu.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,f=Math.floor((r-s-u)/this.getHeight()),p=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=f*this.getHeight())}else g>a&&(h=p*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((s,r)=>{const a=s.detail?s.detail.length:0,l=s.decoratorRight?s.decoratorRight.length:0,c=s.text.length+a+l;c>n&&(i=r,n=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=_o(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Y(e,bg(".select-box-dropdown-list-container")),this.listRenderer=new y_e,this.selectList=this._register(new ur("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let s=n.text;return n.detail&&(s+=`. ${n.detail}`),n.decoratorRight&&(s+=`. ${n.decoratorRight}`),n.description&&(s+=`. ${n.description}`),s},getWidgetAriaLabel:()=>m(16,"Select Box"),getRole:()=>je?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new wt(this.selectDropDownListContainer,"keydown")),i=se.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(s=>new Et(s)));this._register(se.chain(i,n=>n.filter(s=>s.keyCode===3))(this.onEnter,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===2))(this.onEnter,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===9))(this.onEscape,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===16))(this.onUpArrow,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===18))(this.onDownArrow,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===12))(this.onPageDown,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===11))(this.onPageUp,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===14))(this.onHome,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode===13))(this.onEnd,this)),this._register(se.chain(i,n=>n.filter(s=>s.keyCode>=21&&s.keyCode<=56||s.keyCode>=85&&s.keyCode<=113))(this.onCharacter,this)),this._register(B(this.selectList.getHTMLElement(),te.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(B(this.selectDropDownContainer,te.FOCUS_OUT,n=>{!this._isVisible||un(n.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;ct.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(ct.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){ct.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){ct.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){ct.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Vc.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(B(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ti(this.selectElement,"click",e=>{ct.stop(e,!0)})),this._register(Ti(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ti(this.selectElement,"keydown",e=>{let t=!1;je?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Qt(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(n)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Zg)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(ni.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,so&&this._register(B(e,te.DRAG_START,n=>n.dataTransfer?.setData(of.TEXT,this._action.label)))),this._register(B(t,Bt.Tap,n=>this.onClick(n,!0))),this._register(B(t,te.MOUSE_DOWN,n=>{i||ct.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),je&&this._register(B(t,te.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(B(t,te.CLICK,n=>{ct.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(B(t,te.DBLCLICK,n=>{ct.stop(n,!0)})),[te.MOUSE_UP,te.MOUSE_OUT].forEach(n=>{this._register(B(t,n,s=>{ct.stop(s),t.classList.remove("active")}))})}onClick(e,t=!1){ct.stop(e,!0);const i=Sr(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),!this.customHover&&e!==""){const t=this.options.hoverDelegate??oc("element");this.customHover=this._store.add(va().setupManagedHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class r_ extends Wa{constructor(e,t,i){i={...i,icon:i.icon!==void 0?i.icon:!1,label:i.label!==void 0?i.label:!0},super(e,t,i),this.options=i,this.cssClass=""}render(e){super.render(e),rt(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===$i.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=m(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class D_e extends Wa{constructor(e,t,i,n,s,r,a){super(e,t),this.selectBox=new x_e(i,n,s,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}class no extends F{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new z),this.viewItemDisposables=this._register(new iD),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new P),this._onDidCancel=this._register(new P({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new P),this._onWillRun=this._register(new P),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(Hq()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Zg,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(s=>this._onDidRun.fire(s))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(s=>this._onWillRun.fire(s))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,n;switch(this._orientation){case 0:i=[15],n=[17];break;case 1:i=[16],n=[18],this.domNode.className+=" vertical";break}this._register(B(this.domNode,te.KEY_DOWN,s=>{const r=new Et(s);let a=!0;const l=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():n&&(r.equals(n[0])||r.equals(n[1]))?a=this.focusNext():r.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(14)?a=this.focusFirst():r.equals(13)?a=this.focusLast():r.equals(2)&&l instanceof Wa&&l.trapsArrowNavigation?a=this.focusNext(void 0,!0):this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(B(this.domNode,te.KEY_UP,s=>{const r=new Et(s);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(2)||r.equals(1026)||r.equals(16)||r.equals(18)||r.equals(15)||r.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(Wr(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Ji()===this.domNode||!un(Ji(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Wa&&i.isEnabled());t instanceof Wa&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Wa&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(Si(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(s,l)),a||(a=new r_(this.context,s,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,B(r,te.CONTEXT_MENU,c=>{ct.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),this.focusable){let s=!1;for(const r of this.viewItems){if(!(r instanceof Wa))continue;let a;s||r.action.id===$i.ID||!r.isEnabled()&&this.options.focusOnlyEnabledItems?a=!1:a=!0,a?(r.setFocusable(!0),s=!0):r.setFocusable(!1)}}typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e"u"){const n=this.viewItems.findIndex(s=>s.isEnabled());this.focusedItem=n===-1?void 0:n,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===$i.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===$i.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const n=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(n){let s=!0;$g(n.focus)||(s=!1),this.options.focusOnlyEnabledItems&&$g(n.isEnabled)&&!n.isEnabled()&&(s=!1),n.action.id===$i.ID&&(s=!1),s?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),s&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Wa){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=vt(this.viewItems),this.getContainer().remove(),super.dispose()}}function k_e(o,e,t,i){if(o.length===0)return e;if(e.length===0)return o;const n=[];let s=0,r=0;for(;sd?(n.push(l),r++):(n.push(i(a,l)),s++,r++)}for(;s`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function jp(o,e){return o.appendChild(e),ge(()=>{e.remove()})}function I_e(o,e){return o.prepend(e),ge(()=>{e.remove()})}class RK extends F{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new V$(e,t)),this._width=Ee(this,this.elementSizeObserver.getWidth()),this._height=Ee(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>At(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function g8(o,e,t){let i=e.get(),n=i,s=i;const r=Ee("animatedValue",i);let a=-1;const l=300;let c;t.add(N_({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(o.cancelAnimationFrame(c),c=void 0),n=s,i=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;s=Math.floor(E_e(h,n,i-n,l)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class s5{static{this._counter=0}constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${s5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function Zh(o,e){return ke(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),o.style[i]=n})}function pL(o,e,t,i){const n=new z,s=[];return n.add(os((r,a)=>{const l=e.read(r),c=new Map,d=new Map;t&&t(!0),o.changeViewZones(h=>{for(const u of s)h.removeZone(u),i?.delete(u);s.length=0;for(const u of l){const g=h.addZone(u);u.setZoneId&&u.setZoneId(g),s.push(g),i?.add(g),c.set(u,g)}}),t&&t(!1),a.add(N_({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const g=d.get(h.changedObservable);return g!==void 0&&u.zoneIds.push(g),!0}}},(h,u)=>{for(const g of l)g.onChange&&(d.set(g.onChange,c.get(g)),g.onChange.read(h));t&&t(!0),o.changeViewZones(g=>{for(const f of u.zoneIds)g.layoutZone(f)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),o.changeViewZones(r=>{for(const a of s)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class N_e extends Jt{dispose(){super.dispose(!0)}}function f8(o,e){const t=Iv(e,n=>n.original.startLineNumber<=o.lineNumber);if(!t)return D.fromPositions(o);if(t.original.endLineNumberExclusive<=o.lineNumber){const n=o.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return D.fromPositions(new R(n,o.column))}if(!t.innerChanges)return D.fromPositions(new R(t.modified.startLineNumber,1));const i=Iv(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(o));if(!i){const n=o.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return D.fromPositions(new R(n,o.column))}if(i.originalRange.containsPosition(o))return i.modifiedRange;{const n=T_e(i.originalRange.getEndPosition(),o);return D.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function T_e(o,e){return o.lineNumber===e.lineNumber?new di(0,e.column-o.column):new di(e.lineNumber-o.lineNumber,e.column-1)}function R_e(o,e){let t;return o.filter(i=>{const n=e(i,t);return t=i,n})}class mL{static create(e,t=void 0){return new p8(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new z;return n.add(t),n.add(e),new p8(e,n,i)}}class p8 extends mL{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new M_e(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class M_e extends mL{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}class _s{static inverse(e,t,i){const n=[];let s=1,r=1;for(const l of e){const c=new _s(new Ce(s,l.original.startLineNumber),new Ce(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new _s(new Ce(s,t+1),new Ce(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const s of e){const r=s.original.intersect(t),a=s.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new _s(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new _s(this.modified,this.original)}join(e){return new _s(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new Ms(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new ve("not a valid diff");return new Ms(new D(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new D(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ms(new D(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new D(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(m8(this.original.endLineNumberExclusive,e)&&m8(this.modified.endLineNumberExclusive,t))return new Ms(new D(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new D(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Ms(D.fromPositions(new R(this.original.startLineNumber,1),rp(new R(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),D.fromPositions(new R(this.modified.startLineNumber,1),rp(new R(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Ms(D.fromPositions(rp(new R(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),rp(new R(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),D.fromPositions(rp(new R(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),rp(new R(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new ve}}function rp(o,e){if(o.lineNumber<1)return new R(1,1);if(o.lineNumber>e.length)return new R(e.length,e[e.length-1].length+1);const t=e[o.lineNumber-1];return o.column>t.length+1?new R(o.lineNumber,t.length+1):o}function m8(o,e){return o>=1&&o<=e.length}class ar extends _s{static fromRangeMappings(e){const t=Ce.join(e.map(n=>Ce.fromRangeInclusive(n.originalRange))),i=Ce.join(e.map(n=>Ce.fromRangeInclusive(n.modifiedRange)));return new ar(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new ar(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new ar(this.original,this.modified,[this.toRangeMapping()])}}class Ms{static fromEdit(e){const t=e.getNewRanges();return e.replacements.map((n,s)=>new Ms(n.range,t[s]))}static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new Ms(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new Fi(this.originalRange,t)}}function _L(o,e,t,i=!1){const n=[];for(const s of _4(o.map(r=>P_e(r,e,t)),(r,a)=>r.original.intersectsOrTouches(a.original)||r.modified.intersectsOrTouches(a.modified))){const r=s[0],a=s[s.length-1];n.push(new ar(r.original.join(a.original),r.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return Wh(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length.lineCount-n[n.length-1].modified.endLineNumberExclusive!==e.length.lineCount-n[n.length-1].original.endLineNumberExclusive)?!1:$w(n,(s,r)=>r.original.startLineNumber-s.original.endLineNumberExclusive===r.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=t.getLineLength(o.modifiedRange.startLineNumber)&&o.originalRange.startColumn-1>=e.getLineLength(o.originalRange.startLineNumber)&&o.originalRange.startLineNumber<=o.originalRange.endLineNumber+n&&o.modifiedRange.startLineNumber<=o.modifiedRange.endLineNumber+n&&(i=1);const s=new Ce(o.originalRange.startLineNumber+i,o.originalRange.endLineNumber+1+n),r=new Ce(o.modifiedRange.startLineNumber+i,o.modifiedRange.endLineNumber+1+n);return new ar(s,r,[o])}const A_e={IconContribution:"base.contributions.icons"};var _8;(function(o){function e(t,i){let n=t.defaults;for(;ye.isThemeIcon(n);){const s=Af.getIcon(n.id);if(!s)return;n=s.defaults}return n}o.getDefinition=e})(_8||(_8={}));var b8;(function(o){function e(i){return{weight:i.weight,style:i.style,src:i.src.map(n=>({format:n.format,location:n.location.toString()}))}}o.toJSONObject=e;function t(i){const n=s=>hn(s)?s:void 0;if(i&&Array.isArray(i.src)&&i.src.every(s=>hn(s.format)&&hn(s.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(s=>({format:s.format,location:be.parse(s.location)}))}}o.fromJSONObject=t})(b8||(b8={}));const O_e=/^([\w_-]+)$/,F_e=m(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class W_e extends F{constructor(){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:O_e.source,patternErrorMessage:F_e},fontCharacter:{type:"string",description:m(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${ye.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return s}const r={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(s,r)=>s.id.localeCompare(r.id),t=s=>{for(;ye.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(const s of n.filter(r=>!!r.description).sort(e))i.push(`||${s.id}|${ye.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter(r=>!ye.isThemeIcon(r.defaults)).sort(e))i.push(`||${s.id}|`);return i.join(` -`)}}const Af=new W_e;fi.add(A_e.IconContribution,Af);function Kt(o,e,t,i){return Af.registerIcon(o,e,t,i)}function MK(){return Af}function B_e(){const o=r$();for(const e in o){const t="\\"+o[e].toString(16);Af.registerIcon(e,{fontCharacter:t})}}B_e();const PK="vscode://schemas/icons",AK=fi.as(DD.JSONContribution);AK.registerSchema(PK,Af.getIconSchema());const C8=new It(()=>AK.notifySchemaChanged(PK),200);Af.onDidChange(()=>{C8.isScheduled()||C8.schedule()});const OK=Kt("widget-close",Z.close,m(2027,"Icon for the close action in widgets."));Kt("goto-previous-location",Z.arrowUp,m(2028,"Icon for goto previous editor location."));Kt("goto-next-location",Z.arrowDown,m(2029,"Icon for goto next editor location."));ye.modify(Z.sync,"spin");ye.modify(Z.loading,"spin");var o5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r5=function(o,e){return function(t,i){e(t,i,o)}};const H_e=Kt("diff-review-insert",Z.add,m(97,"Icon for 'Insert' in accessible diff viewer.")),V_e=Kt("diff-review-remove",Z.remove,m(98,"Icon for 'Remove' in accessible diff viewer.")),z_e=Kt("diff-review-close",Z.close,m(99,"Icon for 'Close' in accessible diff viewer."));let Cg=class extends F{static{this._ttPolicy=sc("diffReview",{createHTML:e=>e})}constructor(e,t,i,n,s,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=$(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(MR,this._diffs,this._models,this._setVisible,this._canClose)),g=d.store.add(this._instantiationService.createInstance(PR,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){At(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){At(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){At(e=>{this._setVisible(!1,e)})}};Cg=o5([r5(8,pe)],Cg);let MR=class extends F{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=Ee(this,[]),this._currentGroupIdx=Ee(this,0),this._currentElementIdx=Ee(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(ke(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=U_e(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());At(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===Ps.Deleted?this._accessibilitySignalService.playSignal(tt.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===Ps.Added&&this._accessibilitySignalService.playSignal(tt.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ke(r=>{const a=this.currentElement.read(r);if(a&&a.type!==Ps.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(D.fromPositions(new R(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Um(t,n=>{this._currentGroupIdx.set(fe.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||At(i=>{this._currentElementIdx.set(fe.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&At(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Ps.Deleted?this._models.originalReveal(D.fromPositions(new R(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Ps.Header?D.fromPositions(new R(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};MR=o5([r5(4,Td)],MR);const Sb=3;function U_e(o,e,t){const i=[];for(const n of _4(o,(s,r)=>r.modified.startLineNumber-s.modified.endLineNumberExclusive<2*Sb)){const s=[];s.push(new j_e);const r=new Ce(Math.max(1,n[0].original.startLineNumber-Sb),Math.min(n[n.length-1].original.endLineNumberExclusive+Sb,e+1)),a=new Ce(Math.max(1,n[0].modified.startLineNumber-Sb),Math.min(n[n.length-1].modified.endLineNumberExclusive+Sb,t+1));AU(n,(d,h)=>{const u=new Ce(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),g=new Ce(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(f=>{s.push(new G_e(f,g.startLineNumber+(f-u.startLineNumber)))}),h&&(h.original.forEach(f=>{s.push(new q_e(h,f))}),h.modified.forEach(f=>{s.push(new K_e(h,f))}))});const l=n[0].modified.join(n[n.length-1].modified),c=n[0].original.join(n[n.length-1].original);i.push(new $_e(new _s(l,c),s))}return i}var Ps;(function(o){o[o.Header=0]="Header",o[o.Unchanged=1]="Unchanged",o[o.Deleted=2]="Deleted",o[o.Added=3]="Added"})(Ps||(Ps={}));class $_e{constructor(e,t){this.range=e,this.lines=t}}class j_e{constructor(){this.type=Ps.Header}}class q_e{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Ps.Deleted,this.modifiedLineNumber=void 0}}class K_e{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Ps.Added,this.originalLineNumber=void 0}}class G_e{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Ps.Unchanged}}let PR=class extends F{constructor(e,t,i,n,s,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=s,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new no(a)),this._register(ke(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(kg({id:"diffreview.close",label:m(100,"Close"),class:"close-diff-review "+ye.asClassName(z_e),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new o1(this._content,{})),gn(this.domNode,this._scrollbar.getDomNode(),a),this._register(ke(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(ge(()=>{gn(this.domNode)})),this._register(Zh(this.domNode,{width:this._width,height:this._height})),this._register(Zh(this._content,{width:this._width,height:this._height})),this._register(os((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Ti(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",m(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),wn(n,i.get(59)),gn(this._content,n);const s=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!s||!r)return;const a=s.getOptions(),l=r.getOptions(),c=i.get(75),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===Ps.Header){const f=document.createElement("div");f.className="diff-review-row",f.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,C=L=>L===0?m(102,"no lines changed"):L===1?m(103,"1 line changed"):m(104,"{0} lines changed",L),w=C(p.original.length),v=C(p.modified.length);f.setAttribute("aria-label",m(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,b,p.original.startLineNumber,w,p.modified.startLineNumber,v));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),f.appendChild(S),u=f}else u=this._createRow(h,c,this._width.get(),t,s,a,i,r,l);n.appendChild(u);const g=$(f=>this._model.currentElement.read(f)===h);e.add(ke(f=>{const p=g.read(f);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(B(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,r,a,l,c){const d=n.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),g=10+u.glyphMarginWidth+u.lineNumbersWidth;let f="diff-review-row",p="";const _="diff-review-spacer";let b=null;switch(e.type){case Ps.Added:f="diff-review-row line-insert",p=" char-insert",b=H_e;break;case Ps.Deleted:f="diff-review-row line-delete",p=" char-delete",b=V_e;break}const C=document.createElement("div");C.style.minWidth=i+"px",C.className=f,C.setAttribute("role","listitem"),C.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,C.appendChild(w);const v=document.createElement("span");v.style.width=h+"px",v.style.minWidth=h+"px",v.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",w.appendChild(v);const S=document.createElement("span");S.style.width=g+"px",S.style.minWidth=g+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const L=document.createElement("span");if(L.className=_,b){const I=document.createElement("span");I.className=ye.asClassName(b),I.innerText="  ",L.appendChild(I)}else L.innerText="  ";w.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let I=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Cg._ttPolicy&&(I=Cg._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),x=l.getLineContent(e.modifiedLineNumber)}else{let I=this._getLineHtml(s,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Cg._ttPolicy&&(I=Cg._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),x=s.getLineContent(e.originalLineNumber)}x.length===0&&(x=m(106,"blank"));let k="";switch(e.type){case Ps.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=m(107,"{0} unchanged line {1}",x,e.originalLineNumber):k=m(108,"{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case Ps.Added:k=m(109,"+ {0} modified line {1}",x,e.modifiedLineNumber);break;case Ps.Deleted:k=m(110,"- {0} original line {1}",x,e.originalLineNumber);break}return C.setAttribute("aria-label",k),C}_getLineHtml(e,t,i,n,s){const r=e.getLineContent(n),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=Xt.createEmpty(r,s),d=cr.isBasicASCII(r,e.mightContainNonBasicASCII()),h=cr.containsRTL(r,d,e.mightContainRTL());return HD(new Nd(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,r,!1,d,h,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==Dr.OFF,null,null,l)).html}};PR=o5([r5(5,yi)],PR);class Z_e{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}E("diffEditor.move.border","#8b8b8b9c",m(137,"The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border","#FFA500",m(138,"The active border color for text that got moved in the diff editor."));E("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},m(139,"The color of the shadow around unchanged region widgets."));const Y_e=Kt("diff-insert",Z.add,m(140,"Line decoration for inserts in the diff editor.")),FK=Kt("diff-remove",Z.remove,m(141,"Line decoration for removals in the diff editor.")),v8=Me.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+ye.asClassName(Y_e),marginClassName:"gutter-insert"}),w8=Me.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+ye.asClassName(FK),marginClassName:"gutter-delete"}),S8=Me.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),y8=Me.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),L8=Me.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),X_e=Me.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),Q_e=Me.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),AR=Me.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),J_e=Me.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),ebe=Me.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),uo=Ve("editorWorkerService");var WK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},OR=function(o,e){return function(t,i){e(t,i,o)}},Ou;const BK=Ve("diffProviderFactoryService");let FR=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(WR,e)}};FR=WK([OR(0,pe)],FR);Ge(BK,FR,1);let WR=class{static{Ou=this}static{this.diffCache=new Map}constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new P,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new ar(new Ce(1,2),new Ce(1,t.getLineCount()+1),[new Ms(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const s=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=Ou.diffCache.get(s);if(a&&a.context===r)return a.result;const l=fn.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:c?.quitEarly??!0,detectedMoves:i.computeMoves?c?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return Ou.diffCache.size>10&&Ou.diffCache.delete(Ou.diffCache.keys().next().value),Ou.diffCache.set(s,{result:c,context:r}),c}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}};WR=Ou=WK([OR(1,uo),OR(2,cs)],WR);class cd{static trivial(e,t){return new cd([new an(fe.ofLength(e.length),fe.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new cd([new an(fe.ofLength(e.length),fe.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class an{static invert(e,t){const i=[];return AU(e,(n,s)=>{i.push(an.fromOffsetPairs(n?n.getEndExclusives():Va.zero,s?s.getStarts():new Va(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new an(new fe(e.offset1,t.offset1),new fe(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new ve("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new an(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new an(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new an(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new an(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new an(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new an(t,i)}getStarts(){return new Va(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Va(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Va{static{this.zero=new Va(0,0)}static{this.max=new Va(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Va(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}class p1{static{this.instance=new p1}isValid(){return!0}}class tbe{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new ve("timeout must be positive")}isValid(){return!(Date.now()-this.startTimen!=null),new Promise((n,s)=>{let r=!0,a=!1;const l=o.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=ke(d=>{const{isFinished:h,error:u,state:g}=l.read(d);(h||u)&&(r?a=!0:c.dispose(),u?s(u===!0?g:u):n(g))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),s(new Ar)});if(i.isCancellationRequested){c.dispose(),d.dispose(),s(new Ar);return}}r=!1,a&&c.dispose()})}function vo(o,e,t=en.ofCaller()){return new ibe(typeof o=="string"?o:new Zn(o,void 0,void 0),e,t)}class ibe extends E_{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{At(n=>{for(const s of this._observers)n.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}var nbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sbe=function(o,e){return function(t,i){e(t,i,o)}};let HR=class extends F{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Ee(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ee(this,void 0),this.diff=this._diff,this._unchangedRegions=Ee(this,void 0),this.unchangedRegions=$(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(At(l=>{for(const c of this._unchangedRegions.read(void 0)?.regions||[])c.collapseAll(l)}),[])),this.movedTextToCompare=Ee(this,void 0),this._activeMovedText=Ee(this,void 0),this._hoveredMovedText=Ee(this,void 0),this.activeMovedText=$(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new Jt,this._diffProvider=$(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=vo("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(ge(()=>this._cancellationTokenSource.cancel()));const n=Er("contentChangedSignal"),s=this._register(new It(()=>n.trigger(void 0),200));this._register(ke(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(f=>f.isDragged.read(a)))return;const c=l.originalDecorationIds.map(f=>e.original.getDecorationRange(f)).map(f=>f?Ce.fromRangeInclusive(f):void 0),d=l.modifiedDecorationIds.map(f=>e.modified.getDecorationRange(f)).map(f=>f?Ce.fromRangeInclusive(f):void 0),h=l.regions.map((f,p)=>!c[p]||!d[p]?void 0:new Sh(c[p].startLineNumber,d[p].startLineNumber,c[p].length,f.visibleLineCountTop.read(a),f.visibleLineCountBottom.read(a))).filter(Cn),u=[];let g=!1;for(const f of _4(h,(p,_)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===_.getHiddenModifiedRange(a).startLineNumber))if(f.length>1){g=!0;const p=f.reduce((b,C)=>b+C.lineCount,0),_=new Sh(f[0].originalLineNumber,f[0].modifiedLineNumber,p,f[0].visibleLineCountTop.read(void 0),f[f.length-1].visibleLineCountBottom.read(void 0));u.push(_)}else u.push(f[0]);if(g){const f=e.original.deltaDecorations(l.originalDecorationIds,u.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));At(_=>{this._unchangedRegions.set({regions:u,originalDecorationIds:f,modifiedDecorationIds:p},_)})}}));const r=(a,l,c)=>{const d=Sh.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const _=u.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).map(v=>v?Ce.fromRangeInclusive(v):void 0),b=u.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).map(v=>v?Ce.fromRangeInclusive(v):void 0);let w=R_e(u.regions.map((v,S)=>{if(!_[S]||!b[S])return;const L=_[S].length;return new Sh(_[S].startLineNumber,b[S].startLineNumber,L,Math.min(v.visibleLineCountTop.get(),L),Math.min(v.visibleLineCountBottom.get(),L-v.visibleLineCountTop.get()))}).filter(Cn),(v,S)=>!S||v.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&v.originalLineNumber>=S.originalLineNumber+S.lineCount).map(v=>new _s(v.getHiddenOriginalRange(c),v.getHiddenModifiedRange(c)));w=_s.clip(w,Ce.ofLength(1,e.original.getLineCount()),Ce.ofLength(1,e.modified.getLineCount())),h=_s.inverse(w,e.original.getLineCount(),e.modified.getLineCount())}const g=[];if(h)for(const _ of d){const b=h.filter(C=>C.original.intersectsStrict(_.originalUnchangedRange)&&C.modified.intersectsStrict(_.modifiedUnchangedRange));g.push(..._.setVisibleRanges(b,l))}else g.push(...d);const f=e.original.deltaDecorations(u?.originalDecorationIds||[],g.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],g.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:g,originalDecorationIds:f,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Qc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Qc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(os(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),s.cancel(),n.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(g=>{const f=Qc.fromModelContentChanges(g.changes);d=rL(d,f)}));let h=[];l.add(e.modified.onDidChangeContent(g=>{const f=Qc.fromModelContentChanges(g.changes);h=rL(h,f)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=obe(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,At(g=>{r(u,g),this._lastDiff=u;const f=a5.fromDiffResult(u);this._diff.set(f,g),this._isDiffUpToDate.set(!0,g);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,g)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const s of n)if(s.getHiddenModifiedRange(void 0).contains(e)){s.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const s of n)if(s.getHiddenOriginalRange(void 0).contains(e)){s.showOriginalLine(e,t,i);return}}async waitForDiff(){await HK(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(n=>Ce.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||At(n=>{for(const s of i.regions)for(const r of t)if(s.modifiedUnchangedRange.intersect(r)){s.setHiddenModifiedRange(r,n);break}})}};HR=nbe([sbe(2,BK)],HR);function obe(o,e,t){return{changes:o.changes.map(i=>new ar(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>rbe(n,e,t)):void 0)),moves:o.moves,identical:o.identical,quitEarly:o.quitEarly}}function rbe(o,e,t){let i=o.originalRange,n=o.modifiedRange;return i.startColumn===1&&n.startColumn===1&&(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew VK(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class VK{constructor(e){this.lineRangeMapping=e}}class Sh{static fromDiffs(e,t,i,n,s){const r=ar.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,g=c+h===t+1&&d+h===i+1;(u||g)&&h>=s+n?(u&&!g&&(h-=s),g&&!u&&(c+=s,d+=s,h-=s),a.push(new Sh(c,d,h,0,0))):h>=s*2+n&&(c+=s,d+=s,h-=s*2,a.push(new Sh(c,d,h,0,0)))}return a}get originalUnchangedRange(){return Ce.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ce.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Ee(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ee(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=$(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Ee(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(s,this.lineCount-n),0);n7(n===r),n7(s===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Ir(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of n.ranges){const d=l===n.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-r,u=new Sh(s,r,h,0,0);u.setHiddenModifiedRange(c,t),i.push(u),s=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ce.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ce.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&n{a.preventDefault();const l=e.ownerDocument.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0);if(!c||c.collapsed)return;const d=c.startContainer.nodeType===Node.TEXT_NODE?c.startContainer.parentElement:c.startContainer,h=c.endContainer.nodeType===Node.TEXT_NODE?c.endContainer.parentElement:c.endContainer;if(!d||!h)return;const u=t.getModelPositionAt(d,c.startOffset),g=t.getModelPositionAt(h,c.endOffset);if(!u||!g)return;const f=u.delta(i.original.startLineNumber-1),p=g.delta(i.original.startLineNumber-1),_=p.isBefore(f)?D.fromPositions(p,f):D.fromPositions(f,p),b=n.getValueInRange(_);s.writeText(b)})),r}class lbe extends F{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=n,this._diff=s,this._editor=r,this._renderLinesResult=a,this._originalTextModel=l,this._contextMenuService=c,this._clipboardService=d,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=ye.asClassName(Z.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${h}px`,this._diffActions.style.lineHeight=`${h}px`,this._marginDomNode.appendChild(this._diffActions);let u=0;const g=n.getOption(144)&&!Or,f=(p,_,b)=>{this._contextMenuService.showContextMenu({domForShadowRoot:g?n.getDomNode()??void 0:void 0,getAnchor:()=>p,onHide:b,getActions:()=>{const C=[],w=s.modified.isEmpty;return C.push(new nr("diff.clipboard.copyDeletedContent",w?s.original.length>1?m(112,"Copy deleted lines"):m(113,"Copy deleted line"):s.original.length>1?m(114,"Copy changed lines"):m(115,"Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(S)})),s.original.length>1&&C.push(new nr("diff.clipboard.copyDeletedLineContent",w?m(116,"Copy deleted line ({0})",s.original.startLineNumber+u):m(117,"Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(s.original.startLineNumber+u);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` +`)}}const Jfe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:V.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:V.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:V.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},epe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function tpe(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]o-e;class npe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class spe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new z}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:Nt(n);i.disposables.add(xe(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class ope{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class Qo{get onDidChangeFocus(){return te.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return te.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=te.chain(this.disposables.add(new mt(this.view.domNode,"keydown")).event,s=>s.map(r=>new yt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>nt.stop(r,!0)).filter(()=>!1)),i=te.chain(this.disposables.add(new mt(this.view.domNode,"keyup")).event,s=>s.forEach(()=>e=!1).map(r=>new yt(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>nt.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),n=te.chain(this.view.onContextMenu,s=>s.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new Wn(pe(this.view.domNode),l),browserEvent:l})));return te.any(t,i,n)}get onKeyDown(){return this.disposables.add(new mt(this.view.domNode,"keydown")).event}get onDidFocus(){return te.signal(this.disposables.add(new mt(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return te.signal(this.disposables.add(new mt(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,s=epe){this.user=e,this._options=s,this.focus=new by("focused"),this.anchor=new by("anchor"),this.eventBufferer=new cw,this._ariaLabel="",this.disposables=new z,this._onDidDispose=new P,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new jfe(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(a.push(new spe(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(c=>new npe(c.templateId,[...a,c]));const l={...s,dnd:s.dnd&&new ope(this,s.dnd)};if(this.view=this.createListView(t,i,n,l),this.view.domNode.setAttribute("role",r),s.styleController)this.styleController=s.styleController(this.view.domId);else{const c=Ir(this.view.domNode);this.styleController=new Qfe(c,this.view.domId)}if(this.spliceable=new Mfe([new CI(this.focus,this.view,s.identityProvider),new CI(this.selection,this.view,s.identityProvider),new CI(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new Yfe(this,this.view)),(typeof s.keyboardSupport!="boolean"||s.keyboardSupport)&&(this.keyboardController=new Fj(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const c=s.keyboardNavigationDelegate||Gfe;this.typeNavigationController=new Zfe(this,this.view,s.keyboardNavigationLabelProvider,s.keyboardNavigationEventFilter??(()=>!0),c),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const c=this.accessibilityProvider.getWidgetAriaLabel(),d=c&&typeof c!="string"?c:Nt(c);this.disposables.add(xe(h=>{this.ariaLabel=h.readObservable(d)}))}this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new ra(e,t,i,n)}createMouseController(e){return new Hj(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new Qh(this.user,`Invalid start index: ${e}`);if(t<0)throw new Qh(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new Qh(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new Qh(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new Qh(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const s=this.focus.get(),r=this.findNextIndex(s.length>0?s[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const s=this.focus.get(),r=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let r=s+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==s&&(this.setFocus([]),await El(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const s=i(),r=this.view.getScrollTop()+s;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const l=this.findNextIndex(n,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([n],e)}else{const l=r;this.view.setScrollTop(r-this.view.renderHeight-s),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await El(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new Qh(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if(qc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*ws(t,0,1)+s-i)}else{const a=s+r,l=n+this.view.renderHeight;s=l||(s=l&&r>=this.view.renderHeight?this.view.setScrollTop(s-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new Qh(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=s-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Vh([Si],Qo.prototype,"onDidChangeFocus",null);Vh([Si],Qo.prototype,"onDidChangeSelection",null);Vh([Si],Qo.prototype,"onContextMenu",null);Vh([Si],Qo.prototype,"onKeyDown",null);Vh([Si],Qo.prototype,"onDidFocus",null);Vh([Si],Qo.prototype,"onDidBlur",null);const Zu=J,Vj="selectOption.entry.template";class rpe{get templateId(){return Vj}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Z(e,Zu(".option-text")),t.detail=Z(e,Zu(".option-detail")),t.decoratorRight=Z(e,Zu(".option-decorator-right")),t}renderElement(e,t,i){const n=i,s=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;n.text.textContent=s,n.detail.textContent=r||"",n.decoratorRight.textContent=a||"",l?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Iu extends A{static{this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32}static{this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2}static{this.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3}constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new z),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Iu.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new P,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(oa().setupManagedHover(zl("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Vj}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=J(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Z(this.selectDropDownContainer,Zu(".select-box-details-pane"));const t=Z(this.selectDropDownContainer,Zu(".select-box-dropdown-container-width-control")),i=Z(t,Zu(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Z(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Ir(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(W(this.selectDropDownContainer,ee.DRAG_START,n=>{nt.stop(n,!0)}))}registerListeners(){this._register(Li(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(W(this.selectElement,ee.CLICK,t=>{nt.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(W(this.selectElement,ee.MOUSE_DOWN,t=>{nt.stop(t)}));let e;this._register(W(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(W(this.selectElement,"touchend",t=>{nt.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(W(this.selectElement,ee.KEY_DOWN,t=>{const i=new yt(t);let n=!1;ze?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(n=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(n=!0),n&&(this.showSelectDropDown(),nt.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){jt(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=Hc(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=pe(this.selectElement),i=pi(this.selectElement),n=pe(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Iu.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,f=Math.floor((r-s-u)/this.getHeight()),p=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=f*this.getHeight())}else g>a&&(h=p*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((s,r)=>{const a=s.detail?s.detail.length:0,l=s.decoratorRight?s.decoratorRight.length:0,c=s.text.length+a+l;c>n&&(i=r,n=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=so(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Z(e,Zu(".select-box-dropdown-list-container")),this.listRenderer=new rpe,this.selectList=this._register(new Qo("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let s=n.text;return n.detail&&(s+=`. ${n.detail}`),n.decoratorRight&&(s+=`. ${n.decoratorRight}`),n.description&&(s+=`. ${n.description}`),s},getWidgetAriaLabel:()=>m(16,"Select Box"),getRole:()=>ze?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new mt(this.selectDropDownListContainer,"keydown")),i=te.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(s=>new yt(s)));this._register(te.chain(i,n=>n.filter(s=>s.keyCode===3))(this.onEnter,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===2))(this.onEnter,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===9))(this.onEscape,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===16))(this.onUpArrow,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===18))(this.onDownArrow,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===12))(this.onPageDown,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===11))(this.onPageUp,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===14))(this.onHome,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode===13))(this.onEnd,this)),this._register(te.chain(i,n=>n.filter(s=>s.keyCode>=21&&s.keyCode<=56||s.keyCode>=85&&s.keyCode<=113))(this.onCharacter,this)),this._register(W(this.selectList.getHTMLElement(),ee.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(W(this.selectDropDownContainer,ee.FOCUS_OUT,n=>{!this._isVisible||sn(n.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;nt.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(nt.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){nt.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){nt.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){nt.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=vc.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(W(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Li(this.selectElement,"click",e=>{nt.stop(e,!0)})),this._register(Li(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Li(this.selectElement,"keydown",e=>{let t=!1;ze?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!jt(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(n)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new kg)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Xt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Ks&&this._register(W(e,ee.DRAG_START,n=>n.dataTransfer?.setData(Ag.TEXT,this._action.label)))),this._register(W(t,Rt.Tap,n=>this.onClick(n,!0))),this._register(W(t,ee.MOUSE_DOWN,n=>{i||nt.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),ze&&this._register(W(t,ee.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(W(t,ee.CLICK,n=>{nt.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(W(t,ee.DBLCLICK,n=>{nt.stop(n,!0)})),[ee.MOUSE_UP,ee.MOUSE_OUT].forEach(n=>{this._register(W(t,n,s=>{nt.stop(s),t.classList.remove("active")}))})}onClick(e,t=!1){nt.stop(e,!0);const i=lr(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),!this.customHover&&e!==""){const t=this.options.hoverDelegate??zl("element");this.customHover=this._store.add(oa().setupManagedHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class Nm extends Sa{constructor(e,t,i){i={...i,icon:i.icon!==void 0?i.icon:!1,label:i.label!==void 0?i.label:!0},super(e,t,i),this.options=i,this.cssClass=""}render(e){super.render(e),Je(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Fi.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=m(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class cpe extends Sa{constructor(e,t,i,n,s,r,a){super(e,t),this.selectBox=new lpe(i,n,s,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}class qs extends A{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new z),this.viewItemDisposables=this._register(new aL),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new P),this._onDidCancel=this._register(new P({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new P),this._onWillRun=this._register(new P),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(tj()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new kg,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(s=>this._onDidRun.fire(s))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(s=>this._onWillRun.fire(s))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,n;switch(this._orientation){case 0:i=[15],n=[17];break;case 1:i=[16],n=[18],this.domNode.className+=" vertical";break}this._register(W(this.domNode,ee.KEY_DOWN,s=>{const r=new yt(s);let a=!0;const l=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(r.equals(i[0])||r.equals(i[1]))?a=this.focusPrevious():n&&(r.equals(n[0])||r.equals(n[1]))?a=this.focusNext():r.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(14)?a=this.focusFirst():r.equals(13)?a=this.focusLast():r.equals(2)&&l instanceof Sa&&l.trapsArrowNavigation?a=this.focusNext(void 0,!0):this.isTriggerKeyEvent(r)?this._triggerKeys.keyDown?this.doTrigger(r):this.triggerKeyDown=!0:a=!1,a&&(r.preventDefault(),r.stopPropagation())})),this._register(W(this.domNode,ee.KEY_UP,s=>{const r=new yt(s);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(2)||r.equals(1026)||r.equals(16)||r.equals(18)||r.equals(15)||r.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(xr(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(ji()===this.domNode||!sn(ji(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Sa&&i.isEnabled());t instanceof Sa&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Sa&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){if(typeof e=="number")return this.viewItems[e]?.action;if(mi(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(s,l)),a||(a=new Nm(this.context,s,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,W(r,ee.CONTEXT_MENU,c=>{nt.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),this.focusable){let s=!1;for(const r of this.viewItems){if(!(r instanceof Sa))continue;let a;s||r.action.id===Fi.ID||!r.isEnabled()&&this.options.focusOnlyEnabledItems?a=!1:a=!0,a?(r.setFocusable(!0),s=!0):r.setFocusable(!1)}}typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e"u"){const n=this.viewItems.findIndex(s=>s.isEnabled());this.focusedItem=n===-1?void 0:n,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===Fi.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Fi.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const n=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(n){let s=!0;wg(n.focus)||(s=!1),this.options.focusOnlyEnabledItems&&wg(n.isEnabled)&&!n.isEnabled()&&(s=!1),n.action.id===Fi.ID&&(s=!1),s?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),s&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Sa){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=pt(this.viewItems),this.getContainer().remove(),super.dispose()}}function dpe(o,e,t,i){if(o.length===0)return e;if(e.length===0)return o;const n=[];let s=0,r=0;for(;sd?(n.push(l),r++):(n.push(i(a,l)),s++,r++)}for(;s`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function pp(o,e){return o.appendChild(e),ue(()=>{e.remove()})}function hpe(o,e){return o.prepend(e),ue(()=>{e.remove()})}class zj extends A{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new iU(e,t)),this._width=De(this,this.elementSizeObserver.getWidth()),this._height=De(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Et(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function I9(o,e,t){let i=e.get(),n=i,s=i;const r=De("animatedValue",i);let a=-1;const l=300;let c;t.add(e_({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(o.cancelAnimationFrame(c),c=void 0),n=s,i=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;s=Math.floor(upe(h,n,i-n,l)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class q4{static{this._counter=0}constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${q4._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function Ih(o,e){return xe(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),o.style[i]=n})}function vy(o,e,t,i){const n=new z,s=[];return n.add(Xn((r,a)=>{const l=e.read(r),c=new Map,d=new Map;t&&t(!0),o.changeViewZones(h=>{for(const u of s)h.removeZone(u),i?.delete(u);s.length=0;for(const u of l){const g=h.addZone(u);u.setZoneId&&u.setZoneId(g),s.push(g),i?.add(g),c.set(u,g)}}),t&&t(!1),a.add(e_({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const g=d.get(h.changedObservable);return g!==void 0&&u.zoneIds.push(g),!0}}},(h,u)=>{for(const g of l)g.onChange&&(d.set(g.onChange,c.get(g)),g.onChange.read(h));t&&t(!0),o.changeViewZones(g=>{for(const f of u.zoneIds)g.layoutZone(f)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),o.changeViewZones(r=>{for(const a of s)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class gpe extends qt{dispose(){super.dispose(!0)}}function E9(o,e){const t=$C(e,n=>n.original.startLineNumber<=o.lineNumber);if(!t)return L.fromPositions(o);if(t.original.endLineNumberExclusive<=o.lineNumber){const n=o.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return L.fromPositions(new R(n,o.column))}if(!t.innerChanges)return L.fromPositions(new R(t.modified.startLineNumber,1));const i=$C(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(o));if(!i){const n=o.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return L.fromPositions(new R(n,o.column))}if(i.originalRange.containsPosition(o))return i.modifiedRange;{const n=fpe(i.originalRange.getEndPosition(),o);return L.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function fpe(o,e){return o.lineNumber===e.lineNumber?new si(0,e.column-o.column):new si(e.lineNumber-o.lineNumber,e.column-1)}function ppe(o,e){let t;return o.filter(i=>{const n=e(i,t);return t=i,n})}class wy{static create(e,t=void 0){return new N9(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new z;return n.add(t),n.add(e),new N9(e,n,i)}}class N9 extends wy{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new mpe(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class mpe extends wy{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}class ls{static inverse(e,t,i){const n=[];let s=1,r=1;for(const l of e){const c=new ls(new be(s,l.original.startLineNumber),new be(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new ls(new be(s,t+1),new be(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const s of e){const r=s.original.intersect(t),a=s.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new ls(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new ls(this.modified,this.original)}join(e){return new ls(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new ys(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ce("not a valid diff");return new ys(new L(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new ys(new L(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new L(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(T9(this.original.endLineNumberExclusive,e)&&T9(this.modified.endLineNumberExclusive,t))return new ys(new L(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new ys(L.fromPositions(new R(this.original.startLineNumber,1),Nf(new R(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L.fromPositions(new R(this.modified.startLineNumber,1),Nf(new R(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new ys(L.fromPositions(Nf(new R(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Nf(new R(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L.fromPositions(Nf(new R(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),Nf(new R(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ce}}function Nf(o,e){if(o.lineNumber<1)return new R(1,1);if(o.lineNumber>e.length)return new R(e.length,e[e.length-1].length+1);const t=e[o.lineNumber-1];return o.column>t.length+1?new R(o.lineNumber,t.length+1):o}function T9(o,e){return o>=1&&o<=e.length}class Ko extends ls{static fromRangeMappings(e){const t=be.join(e.map(n=>be.fromRangeInclusive(n.originalRange))),i=be.join(e.map(n=>be.fromRangeInclusive(n.modifiedRange)));return new Ko(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new Ko(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Ko(this.original,this.modified,[this.toRangeMapping()])}}class ys{static fromEdit(e){const t=e.getNewRanges();return e.replacements.map((n,s)=>new ys(n.range,t[s]))}static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new ys(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new Ni(this.originalRange,t)}}function Sy(o,e,t,i=!1){const n=[];for(const s of oO(o.map(r=>_pe(r,e,t)),(r,a)=>r.original.intersectsOrTouches(a.original)||r.modified.intersectsOrTouches(a.modified))){const r=s[0],a=s[s.length-1];n.push(new Ko(r.original.join(a.original),r.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return _h(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length.lineCount-n[n.length-1].modified.endLineNumberExclusive!==e.length.lineCount-n[n.length-1].original.endLineNumberExclusive)?!1:rw(n,(s,r)=>r.original.startLineNumber-s.original.endLineNumberExclusive===r.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=t.getLineLength(o.modifiedRange.startLineNumber)&&o.originalRange.startColumn-1>=e.getLineLength(o.originalRange.startLineNumber)&&o.originalRange.startLineNumber<=o.originalRange.endLineNumber+n&&o.modifiedRange.startLineNumber<=o.modifiedRange.endLineNumber+n&&(i=1);const s=new be(o.originalRange.startLineNumber+i,o.originalRange.endLineNumber+1+n),r=new be(o.modifiedRange.startLineNumber+i,o.modifiedRange.endLineNumber+1+n);return new Ko(s,r,[o])}const bpe={IconContribution:"base.contributions.icons"};var R9;(function(o){function e(t,i){let n=t.defaults;for(;Se.isThemeIcon(n);){const s=uf.getIcon(n.id);if(!s)return;n=s.defaults}return n}o.getDefinition=e})(R9||(R9={}));var M9;(function(o){function e(i){return{weight:i.weight,style:i.style,src:i.src.map(n=>({format:n.format,location:n.location.toString()}))}}o.toJSONObject=e;function t(i){const n=s=>nn(s)?s:void 0;if(i&&Array.isArray(i.src)&&i.src.every(s=>nn(s.format)&&nn(s.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(s=>({format:s.format,location:_e.parse(s.location)}))}}o.fromJSONObject=t})(M9||(M9={}));const Cpe=/^([\w_-]+)$/,vpe=m(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class wpe extends A{constructor(){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:Cpe.source,patternErrorMessage:vpe},fontCharacter:{type:"string",description:m(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Se.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return s}const r={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(s,r)=>s.id.localeCompare(r.id),t=s=>{for(;Se.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(const s of n.filter(r=>!!r.description).sort(e))i.push(`||${s.id}|${Se.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter(r=>!Se.isThemeIcon(r.defaults)).sort(e))i.push(`||${s.id}|`);return i.join(` +`)}}const uf=new wpe;li.add(bpe.IconContribution,uf);function Ht(o,e,t,i){return uf.registerIcon(o,e,t,i)}function Uj(){return uf}function Spe(){const o=wz();for(const e in o){const t="\\"+o[e].toString(16);uf.registerIcon(e,{fontCharacter:t})}}Spe();const $j="vscode://schemas/icons",jj=li.as(TL.JSONContribution);jj.registerSchema($j,uf.getIconSchema());const P9=new St(()=>jj.notifySchemaChanged($j),200);uf.onDidChange(()=>{P9.isScheduled()||P9.schedule()});const qj=Ht("widget-close",G.close,m(2027,"Icon for the close action in widgets."));Ht("goto-previous-location",G.arrowUp,m(2028,"Icon for goto previous editor location."));Ht("goto-next-location",G.arrowDown,m(2029,"Icon for goto next editor location."));Se.modify(G.sync,"spin");Se.modify(G.loading,"spin");var K4=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G4=function(o,e){return function(t,i){e(t,i,o)}};const ype=Ht("diff-review-insert",G.add,m(97,"Icon for 'Insert' in accessible diff viewer.")),xpe=Ht("diff-review-remove",G.remove,m(98,"Icon for 'Remove' in accessible diff viewer.")),Lpe=Ht("diff-review-close",G.close,m(99,"Icon for 'Close' in accessible diff viewer."));let Yu=class extends A{static{this._ttPolicy=Vl("diffReview",{createHTML:e=>e})}constructor(e,t,i,n,s,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=$(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(wT,this._diffs,this._models,this._setVisible,this._canClose)),g=d.store.add(this._instantiationService.createInstance(ST,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Et(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Et(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Et(e=>{this._setVisible(!1,e)})}};Yu=K4([G4(8,fe)],Yu);let wT=class extends A{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=De(this,[]),this._currentGroupIdx=De(this,0),this._currentElementIdx=De(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>this.currentGroup.read(a)?.lines[r]),this._register(xe(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=kpe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Et(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===xs.Deleted?this._accessibilitySignalService.playSignal(Ze.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===xs.Added&&this._accessibilitySignalService.playSignal(Ze.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(xe(r=>{const a=this.currentElement.read(r);if(a&&a.type!==xs.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(L.fromPositions(new R(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||gm(t,n=>{this._currentGroupIdx.set(ge.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Et(i=>{this._currentElementIdx.set(ge.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Et(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===xs.Deleted?this._models.originalReveal(L.fromPositions(new R(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==xs.Header?L.fromPositions(new R(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};wT=K4([G4(4,dd)],wT);const W_=3;function kpe(o,e,t){const i=[];for(const n of oO(o,(s,r)=>r.modified.startLineNumber-s.modified.endLineNumberExclusive<2*W_)){const s=[];s.push(new Ipe);const r=new be(Math.max(1,n[0].original.startLineNumber-W_),Math.min(n[n.length-1].original.endLineNumberExclusive+W_,e+1)),a=new be(Math.max(1,n[0].modified.startLineNumber-W_),Math.min(n[n.length-1].modified.endLineNumberExclusive+W_,t+1));YV(n,(d,h)=>{const u=new be(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),g=new be(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(f=>{s.push(new Tpe(f,g.startLineNumber+(f-u.startLineNumber)))}),h&&(h.original.forEach(f=>{s.push(new Epe(h,f))}),h.modified.forEach(f=>{s.push(new Npe(h,f))}))});const l=n[0].modified.join(n[n.length-1].modified),c=n[0].original.join(n[n.length-1].original);i.push(new Dpe(new ls(l,c),s))}return i}var xs;(function(o){o[o.Header=0]="Header",o[o.Unchanged=1]="Unchanged",o[o.Deleted=2]="Deleted",o[o.Added=3]="Added"})(xs||(xs={}));class Dpe{constructor(e,t){this.range=e,this.lines=t}}class Ipe{constructor(){this.type=xs.Header}}class Epe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=xs.Deleted,this.modifiedLineNumber=void 0}}class Npe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=xs.Added,this.originalLineNumber=void 0}}class Tpe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=xs.Unchanged}}let ST=class extends A{constructor(e,t,i,n,s,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=s,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new qs(a)),this._register(xe(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(sg({id:"diffreview.close",label:m(100,"Close"),class:"close-diff-review "+Se.asClassName(Lpe),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new ww(this._content,{})),on(this.domNode,this._scrollbar.getDomNode(),a),this._register(xe(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(ue(()=>{on(this.domNode)})),this._register(Ih(this.domNode,{width:this._width,height:this._height})),this._register(Ih(this._content,{width:this._width,height:this._height})),this._register(Xn((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Li(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",m(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),gn(n,i.get(59)),on(this._content,n);const s=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!s||!r)return;const a=s.getOptions(),l=r.getOptions(),c=i.get(75),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===xs.Header){const f=document.createElement("div");f.className="diff-review-row",f.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,C=x=>x===0?m(102,"no lines changed"):x===1?m(103,"1 line changed"):m(104,"{0} lines changed",x),w=C(p.original.length),v=C(p.modified.length);f.setAttribute("aria-label",m(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,b,p.original.startLineNumber,w,p.modified.startLineNumber,v));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),f.appendChild(S),u=f}else u=this._createRow(h,c,this._width.get(),t,s,a,i,r,l);n.appendChild(u);const g=$(f=>this._model.currentElement.read(f)===h);e.add(xe(f=>{const p=g.read(f);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(W(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,r,a,l,c){const d=n.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),g=10+u.glyphMarginWidth+u.lineNumbersWidth;let f="diff-review-row",p="";const _="diff-review-spacer";let b=null;switch(e.type){case xs.Added:f="diff-review-row line-insert",p=" char-insert",b=ype;break;case xs.Deleted:f="diff-review-row line-delete",p=" char-delete",b=xpe;break}const C=document.createElement("div");C.style.minWidth=i+"px",C.className=f,C.setAttribute("role","listitem"),C.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,C.appendChild(w);const v=document.createElement("span");v.style.width=h+"px",v.style.minWidth=h+"px",v.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",w.appendChild(v);const S=document.createElement("span");S.style.width=g+"px",S.style.minWidth=g+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const x=document.createElement("span");if(x.className=_,b){const I=document.createElement("span");I.className=Se.asClassName(b),I.innerText="  ",x.appendChild(I)}else x.innerText="  ";w.appendChild(x);let k;if(e.modifiedLineNumber!==void 0){let I=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Yu._ttPolicy&&(I=Yu._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),k=l.getLineContent(e.modifiedLineNumber)}else{let I=this._getLineHtml(s,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Yu._ttPolicy&&(I=Yu._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),k=s.getLineContent(e.originalLineNumber)}k.length===0&&(k=m(106,"blank"));let D="";switch(e.type){case xs.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=m(107,"{0} unchanged line {1}",k,e.originalLineNumber):D=m(108,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case xs.Added:D=m(109,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case xs.Deleted:D=m(110,"- {0} original line {1}",k,e.originalLineNumber);break}return C.setAttribute("aria-label",D),C}_getLineHtml(e,t,i,n,s){const r=e.getLineContent(n),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=$t.createEmpty(r,s),d=Zo.isBasicASCII(r,e.mightContainNonBasicASCII()),h=Zo.containsRTL(r,d,e.mightContainRTL());return jL(new cd(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,r,!1,d,h,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==ur.OFF,null,null,l)).html}};ST=K4([G4(5,_i)],ST);class Rpe{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}E("diffEditor.move.border","#8b8b8b9c",m(137,"The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border","#FFA500",m(138,"The active border color for text that got moved in the diff editor."));E("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},m(139,"The color of the shadow around unchanged region widgets."));const Mpe=Ht("diff-insert",G.add,m(140,"Line decoration for inserts in the diff editor.")),Kj=Ht("diff-remove",G.remove,m(141,"Line decoration for removals in the diff editor.")),A9=Te.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Se.asClassName(Mpe),marginClassName:"gutter-insert"}),O9=Te.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Se.asClassName(Kj),marginClassName:"gutter-delete"}),F9=Te.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),W9=Te.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),B9=Te.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),Ppe=Te.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),Ape=Te.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),yT=Te.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),Ope=Te.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),Fpe=Te.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),eo=We("editorWorkerService");var Gj=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xT=function(o,e){return function(t,i){e(t,i,o)}},gu;const Zj=We("diffProviderFactoryService");let LT=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(kT,e)}};LT=Gj([xT(0,fe)],LT);$e(Zj,LT,1);let kT=class{static{gu=this}static{this.diffCache=new Map}constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new P,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Ko(new be(1,2),new be(1,t.getLineCount()+1),[new ys(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const s=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=gu.diffCache.get(s);if(a&&a.context===r)return a.result;const l=rn.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:c?.quitEarly??!0,detectedMoves:i.computeMoves?c?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return gu.diffCache.size>10&&gu.diffCache.delete(gu.diffCache.keys().next().value),gu.diffCache.set(s,{result:c,context:r}),c}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}};kT=gu=Gj([xT(1,eo),xT(2,ts)],kT);class zc{static trivial(e,t){return new zc([new Qi(ge.ofLength(e.length),ge.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new zc([new Qi(ge.ofLength(e.length),ge.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class Qi{static invert(e,t){const i=[];return YV(e,(n,s)=>{i.push(Qi.fromOffsetPairs(n?n.getEndExclusives():La.zero,s?s.getStarts():new La(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Qi(new ge(e.offset1,t.offset1),new ge(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ce("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Qi(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Qi(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Qi(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Qi(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Qi(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new Qi(t,i)}getStarts(){return new La(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new La(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class La{static{this.zero=new La(0,0)}static{this.max=new La(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new La(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}class Tw{static{this.instance=new Tw}isValid(){return!0}}class Wpe{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ce("timeout must be positive")}isValid(){return!(Date.now()-this.startTimen!=null),new Promise((n,s)=>{let r=!0,a=!1;const l=o.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=xe(d=>{const{isFinished:h,error:u,state:g}=l.read(d);(h||u)&&(r?a=!0:c.dispose(),u?s(u===!0?g:u):n(g))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),s(new wr)});if(i.isCancellationRequested){c.dispose(),d.dispose(),s(new wr);return}}r=!1,a&&c.dispose()})}function ao(o,e,t=qi.ofCaller()){return new Bpe(typeof o=="string"?o:new Vn(o,void 0,void 0),e,t)}class Bpe extends Jm{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{Et(n=>{for(const s of this._observers)n.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}var Hpe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Vpe=function(o,e){return function(t,i){e(t,i,o)}};let IT=class extends A{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=De(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=De(this,void 0),this.diff=this._diff,this._unchangedRegions=De(this,void 0),this.unchangedRegions=$(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(Et(l=>{for(const c of this._unchangedRegions.read(void 0)?.regions||[])c.collapseAll(l)}),[])),this.movedTextToCompare=De(this,void 0),this._activeMovedText=De(this,void 0),this._hoveredMovedText=De(this,void 0),this.activeMovedText=$(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new qt,this._diffProvider=$(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=ao("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(ue(()=>this._cancellationTokenSource.cancel()));const n=pr("contentChangedSignal"),s=this._register(new St(()=>n.trigger(void 0),200));this._register(xe(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(f=>f.isDragged.read(a)))return;const c=l.originalDecorationIds.map(f=>e.original.getDecorationRange(f)).map(f=>f?be.fromRangeInclusive(f):void 0),d=l.modifiedDecorationIds.map(f=>e.modified.getDecorationRange(f)).map(f=>f?be.fromRangeInclusive(f):void 0),h=l.regions.map((f,p)=>!c[p]||!d[p]?void 0:new th(c[p].startLineNumber,d[p].startLineNumber,c[p].length,f.visibleLineCountTop.read(a),f.visibleLineCountBottom.read(a))).filter(hn),u=[];let g=!1;for(const f of oO(h,(p,_)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===_.getHiddenModifiedRange(a).startLineNumber))if(f.length>1){g=!0;const p=f.reduce((b,C)=>b+C.lineCount,0),_=new th(f[0].originalLineNumber,f[0].modifiedLineNumber,p,f[0].visibleLineCountTop.read(void 0),f[f.length-1].visibleLineCountBottom.read(void 0));u.push(_)}else u.push(f[0]);if(g){const f=e.original.deltaDecorations(l.originalDecorationIds,u.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Et(_=>{this._unchangedRegions.set({regions:u,originalDecorationIds:f,modifiedDecorationIds:p},_)})}}));const r=(a,l,c)=>{const d=th.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const _=u.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).map(v=>v?be.fromRangeInclusive(v):void 0),b=u.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).map(v=>v?be.fromRangeInclusive(v):void 0);let w=ppe(u.regions.map((v,S)=>{if(!_[S]||!b[S])return;const x=_[S].length;return new th(_[S].startLineNumber,b[S].startLineNumber,x,Math.min(v.visibleLineCountTop.get(),x),Math.min(v.visibleLineCountBottom.get(),x-v.visibleLineCountTop.get()))}).filter(hn),(v,S)=>!S||v.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&v.originalLineNumber>=S.originalLineNumber+S.lineCount).map(v=>new ls(v.getHiddenOriginalRange(c),v.getHiddenModifiedRange(c)));w=ls.clip(w,be.ofLength(1,e.original.getLineCount()),be.ofLength(1,e.modified.getLineCount())),h=ls.inverse(w,e.original.getLineCount(),e.modified.getLineCount())}const g=[];if(h)for(const _ of d){const b=h.filter(C=>C.original.intersectsStrict(_.originalUnchangedRange)&&C.modified.intersectsStrict(_.modifiedUnchangedRange));g.push(..._.setVisibleRanges(b,l))}else g.push(...d);const f=e.original.deltaDecorations(u?.originalDecorationIds||[],g.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],g.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:g,originalDecorationIds:f,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Tc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Tc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(Xn(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),s.cancel(),n.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(g=>{const f=Tc.fromModelContentChanges(g.changes);d=hy(d,f)}));let h=[];l.add(e.modified.onDidChangeContent(g=>{const f=Tc.fromModelContentChanges(g.changes);h=hy(h,f)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=zpe(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,Et(g=>{r(u,g),this._lastDiff=u;const f=Z4.fromDiffResult(u);this._diff.set(f,g),this._isDiffUpToDate.set(!0,g);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(_=>_.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,g)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const s of n)if(s.getHiddenModifiedRange(void 0).contains(e)){s.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length===0)return;const n=this._unchangedRegions.get()?.regions||[];for(const s of n)if(s.getHiddenOriginalRange(void 0).contains(e)){s.showOriginalLine(e,t,i);return}}async waitForDiff(){await Yj(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(n=>be.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||Et(n=>{for(const s of i.regions)for(const r of t)if(s.modifiedUnchangedRange.intersect(r)){s.setHiddenModifiedRange(r,n);break}})}};IT=Hpe([Vpe(2,Zj)],IT);function zpe(o,e,t){return{changes:o.changes.map(i=>new Ko(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>Upe(n,e,t)):void 0)),moves:o.moves,identical:o.identical,quitEarly:o.quitEarly}}function Upe(o,e,t){let i=o.originalRange,n=o.modifiedRange;return i.startColumn===1&&n.startColumn===1&&(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew Xj(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class Xj{constructor(e){this.lineRangeMapping=e}}class th{static fromDiffs(e,t,i,n,s){const r=Ko.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,g=c+h===t+1&&d+h===i+1;(u||g)&&h>=s+n?(u&&!g&&(h-=s),g&&!u&&(c+=s,d+=s,h-=s),a.push(new th(c,d,h,0,0))):h>=s*2+n&&(c+=s,d+=s,h-=s*2,a.push(new th(c,d,h,0,0)))}return a}get originalUnchangedRange(){return be.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return be.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=De(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=De(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=$(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=De(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(s,this.lineCount-n),0);k3(n===r),k3(s===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new fr(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of n.ranges){const d=l===n.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-r,u=new th(s,r,h,0,0);u.setHiddenModifiedRange(c,t),i.push(u),s=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return be.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return be.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&n{a.preventDefault();const l=e.ownerDocument.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0);if(!c||c.collapsed)return;const d=c.startContainer.nodeType===Node.TEXT_NODE?c.startContainer.parentElement:c.startContainer,h=c.endContainer.nodeType===Node.TEXT_NODE?c.endContainer.parentElement:c.endContainer;if(!d||!h)return;const u=t.getModelPositionAt(d,c.startOffset),g=t.getModelPositionAt(h,c.endOffset);if(!u||!g)return;const f=u.delta(i.original.startLineNumber-1),p=g.delta(i.original.startLineNumber-1),_=p.isBefore(f)?L.fromPositions(p,f):L.fromPositions(f,p),b=n.getValueInRange(_);s.writeText(b)})),r}class jpe extends A{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=n,this._diff=s,this._editor=r,this._renderLinesResult=a,this._originalTextModel=l,this._contextMenuService=c,this._clipboardService=d,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Se.asClassName(G.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${h}px`,this._diffActions.style.lineHeight=`${h}px`,this._marginDomNode.appendChild(this._diffActions);let u=0;const g=n.getOption(144)&&!Sr,f=(p,_,b)=>{this._contextMenuService.showContextMenu({domForShadowRoot:g?n.getDomNode()??void 0:void 0,getAnchor:()=>p,onHide:b,getActions:()=>{const C=[],w=s.modified.isEmpty;return C.push(new Uo("diff.clipboard.copyDeletedContent",w?s.original.length>1?m(112,"Copy deleted lines"):m(113,"Copy deleted line"):s.original.length>1?m(114,"Copy changed lines"):m(115,"Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(S)})),s.original.length>1&&C.push(new Uo("diff.clipboard.copyDeletedLineContent",w?m(116,"Copy deleted line ({0})",s.original.startLineNumber+u):m(117,"Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(s.original.startLineNumber+u);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),await this._clipboardService.writeText(S)})),n.getOption(104)||C.push(new nr("diff.inline.revertChange",m(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),C},autoSelectFirstItem:!0})};this._register(Ti(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:_,height:b}=wi(this._diffActions),C=Math.floor(h/3);p.preventDefault(),f({x:p.posx,y:_+b+C})})),this._register(n.onMouseMove(p=>{(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,h),this.visibility=!0):this.visibility=!1})),this._register(abe({domNode:this._deletedCodeDomNode,diffEntry:s,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:d}))}_updateLightBulbPosition(e,t,i){const{top:n}=wi(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._renderLinesResult.viewLineCounts){let l=0;for(let c=0;co});function m1(o,e,t,i,n=!1){wn(i,e.fontInfo);const s=t.length>0,r=new su(1e4);let a=0,l=0;const c=[],d=[];for(let f=0;fnull),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class dd{static fromEditor(e){const t=e.getOptions(),i=t.get(59),n=t.get(165);return new dd(e.getModel()?.getOptions().tabSize||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),n.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=g}withSetWidth(e){return new dd(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new dd(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class cbe{constructor(e,t,i,n,s){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=n,this._source=s}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;const n=i.parentElement;if(!n)return;const s=n.querySelectorAll(".view-line");let r=-1;for(let h=0;h=this._renderOutputs.length)return;let a=1,l=r;for(let h=0;hthis._source.lineTokens.length)return;const c=this._renderOutputs[r];if(!c)return;const d=Ym(c.characterMapping,e,t)+c.offset;return new R(a,d)}}class D8 extends Ky{constructor(e,t,i){super(e,t),this.offset=i}}function k8(o,e,t,i,n,s,r,a,l){a.appendString('

'):a.appendString('px;">');const c=e.getLineContent(),d=cr.isBasicASCII(c,n),h=cr.containsRTL(c,d,s),u=V_(new Nd(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Dr.OFF,null,null,r.verticalScrollbarSize),a);a.appendString("
");const g=u.characterMapping.getHorizontalOffset(u.characterMapping.length);return{output:u,maxCharWidth:g}}const Mo=Ve("clipboardService"),Md=Ve("contextViewService"),gr=Ve("contextMenuService");var dbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},I8=function(o,e){return function(t,i){e(t,i,o)}};let VR=class extends F{constructor(e,t,i,n,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Ee(this,0),this._originalScrollOffset=Ee(this,0),this._originalScrollOffsetAnimated=g8(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Ee(this,0),this._modifiedScrollOffset=Ee(this,0),this._modifiedScrollOffsetAnimated=g8(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Ee("invalidateAlignmentsState",0),u=this._register(new It(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()}));const g=this._diffModel.map(w=>w?pt(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,v)=>w?.read(v)),f=$(w=>{const v=this._diffModel.read(w),S=v?.diff.read(w);if(!v||!S)return null;h.read(w);const x=this._options.renderSideBySide.read(w);return E8(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,x)}),p=$(w=>{const v=this._diffModel.read(w)?.movedTextToCompare.read(w);if(!v)return null;h.read(w);const S=v.changes.map(L=>new VK(L));return E8(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const b=this._register(new z);this.viewZones=$(this,w=>{b.clear();const v=f.read(w)||[],S=[],L=[],x=this._modifiedTopPadding.read(w);x>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:x,showInHiddenAreas:!0,suppressMouseDown:!0});const k=this._originalTopPadding.read(w);k>0&&S.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:k,showInHiddenAreas:!0,suppressMouseDown:!0});const I=this._options.renderSideBySide.read(w),T=I?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(T){const ne=this._editors.original.getModel();for(const ce of v)if(ce.diff)for(let De=ce.originalRange.startLineNumber;Dene.getLineCount())return{orig:S,mod:L};T?.addRequest(ne.getLineContent(De),null,null)}}const A=T?.finalize()??[];let O=0;const W=this._editors.modified.getOption(75),U=this._diffModel.read(w)?.movedTextToCompare.read(w),q=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,ie=this._editors.original.getModel()?.mightContainRTL()??!1,Q=dd.fromEditor(this._editors.modified);for(const ne of v)if(ne.diff&&!I&&(!this._options.useTrueInlineDiffRendering.read(w)||!l5(ne.diff))){if(!ne.originalRange.isEmpty){g.read(w);const De=document.createElement("div");De.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const We=this._editors.original.getModel();if(ne.originalRange.endLineNumberExclusive-1>We.getLineCount())return{orig:S,mod:L};const st=new _1(ne.originalRange.mapToLineArray(Pi=>We.tokenization.getLineTokens(Pi)),ne.originalRange.mapToLineArray(Pi=>A[O++]),q,ie),Ye=[];for(const Pi of ne.diff.innerChanges||[])Ye.push(new Ag(Pi.originalRange.delta(-(ne.diff.original.startLineNumber-1)),AR.className,0));const Ft=m1(st,Q,Ye,De),yt=document.createElement("div");if(yt.className="inline-deleted-margin-view-zone",wn(yt,Q.fontInfo),this._options.renderIndicators.read(w))for(let Pi=0;Pidh(nn),yt,De,this._editors.modified,ne.diff,this._diffEditorWidget,Ft,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Pi=0;Pi1&&S.push({afterLineNumber:ne.originalRange.startLineNumber+Pi,domNode:_(),heightInPx:(xs-1)*W,showInHiddenAreas:!0,suppressMouseDown:!0})}L.push({afterLineNumber:ne.modifiedRange.startLineNumber-1,domNode:De,heightInPx:Ft.heightInLines*W,minWidthInPx:Ft.minWidthInPx,marginDomNode:yt,setZoneId(Pi){nn=Pi},showInHiddenAreas:!0,suppressMouseDown:!1})}const ce=document.createElement("div");ce.className="gutter-delete",S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ne.modifiedHeightInPx,marginDomNode:ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ce=ne.modifiedHeightInPx-ne.originalHeightInPx;if(ce>0){if(U?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ne.originalRange.endLineNumberExclusive-1))continue;S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let De=function(){const st=document.createElement("div");return st.className="arrow-revert-change "+ye.asClassName(Z.arrowRight),w.store.add(B(st,"mousedown",Ye=>Ye.stopPropagation())),w.store.add(B(st,"click",Ye=>{Ye.stopPropagation(),s.revert(ne.diff)})),ee("div",{},st)};if(U?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ne.modifiedRange.endLineNumberExclusive-1))continue;let We;ne.diff&&ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(We=De()),L.push({afterLineNumber:ne.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ce,marginDomNode:We,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ne of p.read(w)??[]){if(!U?.lineRangeMapping.original.intersect(ne.originalRange)||!U?.lineRangeMapping.modified.intersect(ne.modifiedRange))continue;const ce=ne.modifiedHeightInPx-ne.originalHeightInPx;ce>0?S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0}):L.push({afterLineNumber:ne.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ce,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:S,mod:L}});let C=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.modified.setScrollLeft(w.scrollLeft),C=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.original.setScrollLeft(w.scrollLeft),C=!1)})),this._originalScrollTop=pt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=pt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ke(w=>{const v=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(w));v!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(v,1)})),this._register(ke(w=>{const v=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(w));v!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(v,1)})),this._register(ke(w=>{const v=this._diffModel.read(w)?.movedTextToCompare.read(w);let S=0;if(v){const L=this._editors.original.getTopForLineNumber(v.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);S=this._editors.modified.getTopForLineNumber(v.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-L}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+S,void 0,!0)}))}};VR=dbe([I8(8,Mo),I8(9,gr)],VR);function E8(o,e,t,i,n,s){const r=new Cd(N8(o,i)),a=new Cd(N8(e,n)),l=o.getOption(75),c=e.getOption(75),d=[];let h=0,u=0;function g(f,p){for(;;){let _=r.peek(),b=a.peek();if(_&&_.lineNumber>=f&&(_=void 0),b&&b.lineNumber>=p&&(b=void 0),!_&&!b)break;const C=_?_.lineNumber-h:Number.MAX_VALUE,w=b?b.lineNumber-u:Number.MAX_VALUE;Cw?(a.dequeue(),_={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ce.ofLength(_.lineNumber,1),modifiedRange:Ce.ofLength(b.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+b.heightInPx,diff:void 0})}}for(const f of t){let w=function(v,S,L=!1){if(vA.lineNumberA+O.heightInPx,0)??0,T=a.takeWhile(A=>A.lineNumberA+O.heightInPx,0)??0;d.push({originalRange:x,modifiedRange:k,originalHeightInPx:x.length*l+I,modifiedHeightInPx:k.length*c+T,diff:f.lineRangeMapping}),C=v,b=S};const p=f.lineRangeMapping;g(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,b=p.modified.startLineNumber,C=p.original.startLineNumber;if(s)for(const v of p.innerChanges||[]){v.originalRange.startColumn>1&&v.modifiedRange.startColumn>1&&w(v.originalRange.startLineNumber,v.modifiedRange.startLineNumber);const S=o.getModel(),L=v.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(v.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;v.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of o.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new R(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return k_e(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function l5(o){return o.innerChanges?o.innerChanges.every(e=>bL(e.modifiedRange)&&bL(e.originalRange)||e.originalRange.equalsRange(new D(1,1,1,1))):!1}function bL(o){return o.startLineNumber===o.endLineNumber}class Og extends F{static{this.movedCodeBlockPadding=4}constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=pt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=pt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=vo("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ee(this,0),this._modifiedViewZonesChangedSignal=vo("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=vo("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=$(this,d=>{this._element.replaceChildren();const h=this._diffModel.read(d),u=h?.diff.read(d)?.movedTexts;if(!u||u.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const g=this._originalEditorLayoutInfo.read(d),f=this._modifiedEditorLayoutInfo.read(d);if(!g||!f){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const p=u.map(L=>{function x(ie,Q){const ne=Q.getTopForLineNumber(ie.startLineNumber,!0),ce=Q.getTopForLineNumber(ie.endLineNumberExclusive,!0);return(ne+ce)/2}const k=x(L.lineRangeMapping.original,this._editors.original),I=this._originalScrollTop.read(d),T=x(L.lineRangeMapping.modified,this._editors.modified),A=this._modifiedScrollTop.read(d),O=k-I,W=T-A,U=Math.min(k,T),q=Math.max(k,T);return{range:new fe(U,q),from:O,to:W,fromWithoutScroll:k,toWithoutScroll:T,move:L}});p.sort(Cte(Kn(L=>L.fromWithoutScroll>L.toWithoutScroll,WU),Kn(L=>L.fromWithoutScroll>L.toWithoutScroll?L.fromWithoutScroll:-L.toWithoutScroll,Lo)));const _=c5.compute(p.map(L=>L.range)),b=10,C=g.verticalScrollbarWidth,w=(_.getTrackCount()-1)*10+b*2,v=C+w+(f.contentLeft-Og.movedCodeBlockPadding);let S=0;for(const L of p){const x=_.getTrack(S),k=C+b+x*10,I=15,T=15,A=v,O=f.glyphMarginWidth+f.lineNumbersWidth,W=18,U=document.createElementNS("http://www.w3.org/2000/svg","rect");U.classList.add("arrow-rectangle"),U.setAttribute("x",`${A-O}`),U.setAttribute("y",`${L.to-W/2}`),U.setAttribute("width",`${O}`),U.setAttribute("height",`${W}`),this._element.appendChild(U);const q=document.createElementNS("http://www.w3.org/2000/svg","g"),ie=document.createElementNS("http://www.w3.org/2000/svg","path");ie.setAttribute("d",`M 0 ${L.from} L ${k} ${L.from} L ${k} ${L.to} L ${A-T} ${L.to}`),ie.setAttribute("fill","none"),q.appendChild(ie);const Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");Q.classList.add("arrow"),d.store.add(ke(ne=>{ie.classList.toggle("currentMove",L.move===h.activeMovedText.read(ne)),Q.classList.toggle("currentMove",L.move===h.activeMovedText.read(ne))})),Q.setAttribute("points",`${A-T},${L.to-I/2} ${A},${L.to} ${A-T},${L.to+I/2}`),q.appendChild(Q),this._element.appendChild(q),S++}this.width.set(w,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(ge(()=>this._element.remove())),this._register(ke(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Og.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register($m(this._state));const r=$(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(g=>({move:g,original:new qp(Ot(g.lineRangeMapping.original.startLineNumber-1),18),modified:new qp(Ot(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(pL(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(pL(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(os((d,h)=>{const u=r.read(d);for(const g of u)h.add(new T8(this._editors.original,g.original,g.move,"original",this._diffModel.get())),h.add(new T8(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=vo("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=vo("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(N_({changeTracker:{createChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)}},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let g;if(u&&c==="original"){const f=this._editors.originalCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(f.lineNumber)))}if(u&&c==="modified"){const f=this._editors.modifiedCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber)))}g!==h.movedTextToCompare.read(void 0)&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(g)}))}}class c5{static compute(e){const t=[],i=[];for(const n of e){let s=t.findIndex(r=>!r.intersectsStrict(n));s===-1&&(t.length>=6?s=Tce(t,Kn(a=>a.intersectWithRangeLength(n),Lo)):(s=t.length,t.push(new F4))),t[s].addRange(n),i.push(s)}return new c5(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class T8 extends n5{constructor(e,t,i,n,s){const r=ot("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=ot("div.diff-moved-code-block",{style:{marginRight:"4px"}},[ot("div.text-content@textContent"),ot("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=pt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Zh(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new no(this._nodes.actionBar,{highlightToggledItems:!0})),d=new nr("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new nr("","Compare",ye.asClassName(Z.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ke(u=>{const g=this._diffModel.movedTextToCompare.read(u)===i;h.checked=g})),c.push(h,{icon:!1,label:!0})}}class hbe extends F{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=$(this,s=>{const r=this._diffModel.read(s),a=r?.diff.read(s);if(!a)return null;const l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),d=this._options.showEmptyDecorations.read(s),h=[],u=[];if(!l)for(const f of a.mappings)if(f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?w8:y8}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?v8:S8}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:J_e}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:X_e});else{const p=this._options.useTrueInlineDiffRendering.read(s)&&l5(f.lineRangeMapping);for(const _ of f.lineRangeMapping.innerChanges||[])if(f.lineRangeMapping.original.contains(_.originalRange.startLineNumber)&&h.push({range:_.originalRange,options:_.originalRange.isEmpty()&&d?ebe:AR}),f.lineRangeMapping.modified.contains(_.modifiedRange.startLineNumber)&&u.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()&&d&&!p?Q_e:L8}),p){const b=r.model.original.getValueInRange(_.originalRange);u.push({range:_.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const f of l.changes){const p=f.original.toInclusiveRange();p&&h.push({range:p,options:c?w8:y8});const _=f.modified.toInclusiveRange();_&&u.push({range:_,options:c?v8:S8});for(const b of f.innerChanges||[])h.push({range:b.originalRange,options:AR}),u.push({range:b.modifiedRange,options:L8})}const g=this._diffModel.read(s).activeMovedText.read(s);for(const f of a.movedTexts)h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===g?" currentMove":""),blockPadding:[Og.movedCodeBlockPadding,0,Og.movedCodeBlockPadding,Og.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(fL(this._editors.original,this._decorations.map(s=>s?.originalDecorations||[]))),this._register(fL(this._editors.modified,this._decorations.map(s=>s?.modifiedDecorations||[])))}}class dn{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new dn(this.x+e.x,this.y+e.y)}deltaX(e){return new dn(this.x+e,this.y)}deltaY(e){return new dn(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new dn(this.x-e.x,this.y-e.y)}scale(e){return new dn(this.x*e,this.y*e)}mapComponents(e){return new dn(e(this.x),e(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function oi(o){return Qu.get(o)}class Qu extends F{static{this._map=new Map}static get(e){let t=Qu._map.get(e);if(!t){t=new Qu(e),Qu._map.set(e,t);const i=e.onDidDispose(()=>{const n=Qu._map.get(e);n&&(Qu._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new T_(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Ee(this,this.editor.getModel()),this.model=this._model,this.isReadonly=pt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=SC({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=SC({owner:this,equalsFn:dg(lv(le.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Un({owner:this,equalsFn:dg(lv(R.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=pt(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=pt(this,t=>{const i=this.editor.onDidFocusEditorText(t),n=this.editor.onDidBlurEditorText(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=pt(this,t=>{const i=this.editor.onDidCompositionStart(()=>{t(void 0)}),n=this.editor.onDidCompositionEnd(()=>{t(void 0)});return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.inComposition),this.value=S4(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=$(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Un({owner:this,equalsFn:dg(le.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Un({owner:this,equalsFn:R.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.cursorLineNumber=$(this,t=>this.cursorPosition.read(t)?.lineNumber??null),this.onDidType=Er(this),this.onDidPaste=Er(this),this.scrollTop=pt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=pt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=pt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(t=>t.width),this.layoutInfoHeight=this.layoutInfo.map(t=>t.height),this.layoutInfoMinimap=this.layoutInfo.map(t=>t.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(t=>t.verticalScrollbarWidth),this.contentWidth=pt(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=pt(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Ee(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=$(t=>(this.model.read(t),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=en.ofCaller()){return pt(this,i=>this.editor.onDidChangeConfiguration(n=>{n.hasChanged(e)&&i(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new z,i=this.editor.createDecorationsCollection();return t.add(rD({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=ke(s=>{e.position.read(s),e.minContentWidthInPx.read(s),this.editor.layoutOverlayWidget(i)});return ge(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const n=ke(s=>{e.position.read(s),this.editor.layoutContentWidget(i)});return ge(()=>{n.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){const i=this.observePosition(e.map(s=>new R(s.startLineNumber,1)),t),n=this.observePosition(e.map(s=>new R(s.endLineNumberExclusive+1,1)),t);return $(s=>{i.read(s),n.read(s);const r=e.read(s),a=this.model.read(s)?.getLineCount(),l=(typeof a<"u"&&r.startLineNumber>a?this.editor.getBottomForLineNumber(a):this.editor.getTopForLineNumber(r.startLineNumber))-this.scrollTop.read(s),c=r.isEmpty?l:this.editor.getBottomForLineNumber(r.endLineNumberExclusive-1)-this.scrollTop.read(s);return new fe(l,c)})}observePosition(e,t){let i=e.get();const n=SC({owner:this,debugName:()=>`topLeftOfPosition${i?.toString()}`,equalsFn:dg(dn.equals)},new dn(0,0)),s="observablePositionWidget"+this._widgetCounter++,r=document.createElement("div"),a={getDomNode:()=>r,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>s,allowEditorOverflow:!1,afterRender:(l,c)=>{const d=this._model.get();d&&i&&i.lineNumber>d.getLineCount()?n.set(new dn(0,this.editor.getBottomForLineNumber(d.getLineCount())-this.scrollTop.get()),void 0):n.set(c?new dn(c.left,c.top):null,void 0)}};return this.editor.addContentWidget(a),t.add(ke(l=>{i=e.read(l),this.editor.layoutContentWidget(a)})),t.add(ge(()=>{this.editor.removeContentWidget(a)})),n}isTargetHovered(e,t){const i=Ee("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(n=>{const s=e(n);i.set(s,void 0)})),t.add(this.editor.onMouseLeave(n=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return $(t=>{const i=e instanceof R?e:e.read(t);return i===null?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return typeof e=="number"?this.observeLineHeightForPosition(new R(e,1)):$(t=>{const i=e.read(t);return i===null?null:this.observeLineHeightForPosition(new R(i,1)).read(t)})}observeLineHeightsForLineRange(e){return $(t=>{const i=e instanceof Ce?e:e.read(t),n=[];for(let s=i.startLineNumber;s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gbe=function(o,e){return function(t,i){e(t,i,o)}},xa;let Xv=class extends F{static{xa=this}static{this.ONE_OVERVIEW_WIDTH=15}static{this.ENTIRE_DIFF_OVERVIEW_WIDTH=this.ONE_OVERVIEW_WIDTH*2}constructor(e,t,i,n,s,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=xa.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=pt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=$(u=>{const g=l.read(u),f=g.getColor(lre)||(g.getColor(fg)||NT).transparent(2),p=g.getColor(cre)||(g.getColor(mh)||TT).transparent(2);return{insertColor:f,removeColor:p}}),d=mt(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=ot("div.diffOverview",{style:{position:"absolute",top:"0px",width:xa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(jp(h,d.domNode)),this._register(Ti(h,te.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(B(h,te.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(jp(this._rootElement,h)),this._register(os((u,g)=>{const f=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(g.add(p),g.add(jp(h,p.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(g.add(_),g.add(jp(h,_.getDomNode()))),!p||!_)return;const b=vo("viewZoneChanged",this._editors.original.onDidChangeViewZones),C=vo("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=vo("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),v=vo("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add(ke(S=>{b.read(S),C.read(S),w.read(S),v.read(S);const L=c.read(S),x=f?.diff.read(S)?.mappings;function k(A,O,W){const U=W._getViewModel();return U?A.filter(q=>q.length>0).map(q=>{const ie=U.coordinatesConverter.convertModelPositionToViewPosition(new R(q.startLineNumber,1)),Q=U.coordinatesConverter.convertModelPositionToViewPosition(new R(q.endLineNumberExclusive,1)),ne=Q.lineNumber-ie.lineNumber;return new Xj(ie.lineNumber,Q.lineNumber,ne,O.toString())}):[]}const I=k((x||[]).map(A=>A.lineRangeMapping.original),L.removeColor,this._editors.original),T=k((x||[]).map(A=>A.lineRangeMapping.modified),L.insertColor,this._editors.modified);p?.setZones(I),_?.setZones(T)})),g.add(ke(S=>{const L=this._rootHeight.read(S),x=this._rootWidth.read(S),k=this._modifiedEditorLayoutInfo.read(S);if(k){const I=xa.ENTIRE_DIFF_OVERVIEW_WIDTH-2*xa.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:L,right:I+xa.ONE_OVERVIEW_WIDTH,width:xa.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:L,right:0,width:xa.ONE_OVERVIEW_WIDTH});const T=this._editors.modifiedScrollTop.read(S),A=this._editors.modifiedScrollHeight.read(S),O=this._editors.modified.getOption(117),W=new Jm(O.verticalHasArrows?O.arrowSize:0,O.verticalScrollbarSize,0,k.height,A,T);d.setTop(W.getSliderPosition()),d.setHeight(W.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=x-xa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(xa.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Xv=xa=ube([gbe(6,pi)],Xv);var fbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},TE=function(o,e){return function(t,i){e(t,i,o)}};let zR=class extends F{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,s,r,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=s,this._contextKeyService=r,this._instantiationService=a,this._keybindingService=l,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new P),this.modifiedScrollTop=pt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=pt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=oi(this.modified),this.originalObs=oi(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=pt(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Un({owner:this,equalsFn:R.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new R(1,1)),this.originalCursor=pt(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new R(1,1)),this.isOriginalFocused=oi(this.original).isFocused,this.isModifiedFocused=oi(this.modified).isFocused,this.isFocused=$(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(N_({changeTracker:{createChangeSummary:()=>({}),handleChange:(c,d)=>(c.didChange(i.editorOptions)&&Object.assign(d,c.change.changedOptions),!0)}},(c,d)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,d))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_constructInnerEditor(e,t,i,n){const s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Xv.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=ps.revealHorizontalRightPadding.defaultValue+Xv.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=m(111," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};zR=fbe([TE(5,Ne),TE(6,pe),TE(7,dt)],zR);var j_=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const pbe=!1;var CL;(function(o){o.North="north",o.South="south",o.East="east",o.West="west"})(CL||(CL={}));let mbe=4;const _be=new P;let bbe=300;const Cbe=new P;class d5{constructor(e){this.el=e,this.disposables=new z}get onPointerMove(){return this.disposables.add(new wt(me(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new wt(me(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}j_([Ii],d5.prototype,"onPointerMove",null);j_([Ii],d5.prototype,"onPointerUp",null);class h5{get onPointerMove(){return this.disposables.add(new wt(this.el,Bt.Change)).event}get onPointerUp(){return this.disposables.add(new wt(this.el,Bt.End)).event}constructor(e){this.el=e,this.disposables=new z}dispose(){this.disposables.dispose()}}j_([Ii],h5.prototype,"onPointerMove",null);j_([Ii],h5.prototype,"onPointerUp",null);class vL{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}j_([Ii],vL.prototype,"onPointerMove",null);j_([Ii],vL.prototype,"onPointerUp",null);const R8="pointer-events-disabled";class Qn extends F{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=Y(this.el,ee(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(ge(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(B(this._orthogonalStartDragHandle,"mouseenter",()=>Qn.onMouseEnter(e))),this.orthogonalStartDragHandleDisposables.add(B(this._orthogonalStartDragHandle,"mouseleave",()=>Qn.onMouseLeave(e))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=Y(this.el,ee(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(ge(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(B(this._orthogonalEndDragHandle,"mouseenter",()=>Qn.onMouseEnter(e))),this.orthogonalEndDragHandleDisposables.add(B(this._orthogonalEndDragHandle,"mouseleave",()=>Qn.onMouseLeave(e))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=bbe,this.hoverDelayer=this._register(new Fr(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new P),this._onDidStart=this._register(new P),this._onDidChange=this._register(new P),this._onDidReset=this._register(new P),this._onDidEnd=this._register(new P),this.orthogonalStartSashDisposables=this._register(new z),this.orthogonalStartDragHandleDisposables=this._register(new z),this.orthogonalEndSashDisposables=this._register(new z),this.orthogonalEndDragHandleDisposables=this._register(new z),this.linkedSash=void 0,this.el=Y(e,ee(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),je&&this.el.classList.add("mac"),this._register(B(this.el,"mousedown",s=>this.onPointerStart(s,new d5(e)))),this._register(B(this.el,"dblclick",s=>this.onPointerDoublePress(s))),this._register(B(this.el,"mouseenter",()=>Qn.onMouseEnter(this))),this._register(B(this.el,"mouseleave",()=>Qn.onMouseLeave(this))),this._register(ni.addTarget(this.el)),this._register(B(this.el,Bt.Start,s=>this.onPointerStart(s,new h5(this.el))));let n;this._register(B(this.el,Bt.Tap,s=>{if(n){clearTimeout(n),n=void 0,this.onPointerDoublePress(s);return}clearTimeout(n),n=setTimeout(()=>n=void 0,250)})),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=mbe,this._register(_be.event(s=>{this.size=s,this.layout()}))),this._register(Cbe.event(s=>this.hoverDelay=s)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",pbe),this.layout()}onPointerStart(e,t){ct.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const f=this.getOrthogonalSash(e);f&&(i=!0,e.__orthogonalSashEvent=!0,f.onPointerStart(e,new vL(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new vL(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const f of n)f.classList.add(R8);const s=e.pageX,r=e.pageY,a=e.altKey,l={startX:s,currentX:s,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=zr(this.el),d=()=>{let f="";i?f="all-scroll":this.orientation===1?this.state===1?f="s-resize":this.state===2?f="n-resize":f=je?"row-resize":"ns-resize":this.state===1?f="e-resize":this.state===2?f="w-resize":f=je?"col-resize":"ew-resize",c.textContent=`* { cursor: ${f} !important; }`},h=new z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=f=>{ct.stop(f,!1);const p={startX:s,currentX:f.pageX,startY:r,currentY:f.pageY,altKey:a};this._onDidChange.fire(p)},g=f=>{ct.stop(f,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const p of n)p.classList.remove(R8)};t.onPointerMove(u,null,h),t.onPointerUp(g,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Qn.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Qn.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Qn.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!Si(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}class vbe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=S4(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const s=this.dimensions.width.get();this._sashRatio.set(i/s,n)}),this._sashRatio=Ee(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:si-r?i-r:s}}class zK extends F{constructor(e,t,i,n,s,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=s,this._resetSash=r,this._sash=this._register(new Qn(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(ke(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(ke(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class u5 extends F{constructor(){super(...arguments),this._id=++u5.idCounter,this._onDidDispose=this._register(new P),this.onDidDispose=this._onDidDispose.event}static{this.idCounter=0}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}const Fn={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1};function wbe(o,e){return Ed(o,(t,i)=>i??e(t))}var Sbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ybe=function(o,e){return function(t,i){e(t,i,o)}};let UR=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Ee(this,0),this._screenReaderMode=pt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=$(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=$(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=$(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=$(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=$(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=$(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=$(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=$(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=$(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=$(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=$(this,n=>this._options.read(n).maxComputationTime),this.showMoves=$(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=$(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=$(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=$(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=$(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=$(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=$(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=$(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=$(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=$(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=$(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=$(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=$(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Ee(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>wbe(this,s=>{const r=n?.diff.read(s);return r?Lbe(r,this.trueInlineDiffRenderingEnabled.read(s)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...M8(e,Fn)};this._options=Ee(this,i)}updateOptions(e){const t=M8(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};UR=Sbe([ybe(1,Mn)],UR);function Lbe(o,e){return o.mappings.every(t=>xbe(t.lineRangeMapping)||Dbe(t.lineRangeMapping)||e&&l5(t.lineRangeMapping))}function xbe(o){return o.original.length===0}function Dbe(o){return o.modified.length===0}function M8(o,e){return{enableSplitViewResizing:_e(o.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Pse(o.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:_e(o.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:_e(o.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Fc(o.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Fc(o.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:_e(o.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:_e(o.renderIndicators,e.renderIndicators),originalEditable:_e(o.originalEditable,e.originalEditable),diffCodeLens:_e(o.diffCodeLens,e.diffCodeLens),renderOverviewRuler:_e(o.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ut(o.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ut(o.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:_e(o.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:_e(o.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:_e(o.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:_e(o.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:_e(o.hideUnchangedRegions?.enabled??o.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Fc(o.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Fc(o.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Fc(o.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:_e(o.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:_e(o.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Fc(o.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:_e(o.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:_e(o.renderGutterMenu,e.renderGutterMenu),compactMode:_e(o.compactMode,e.compactMode)}}class kbe extends Zg{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new P),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Y(e,ee(".monaco-dropdown")),this._label=Y(this._element,ee(".dropdown-label"));let i=t.labelRenderer;i||(i=s=>(s.textContent=t.label||"",null));for(const s of[te.CLICK,te.MOUSE_DOWN,Bt.Tap])this._register(B(this.element,s,r=>ct.stop(r,!0)));for(const s of[te.MOUSE_DOWN,Bt.Tap])this._register(B(this._label,s,r=>{k4(r)&&r.button!==0||(this.visible?this.hide():this.show())}));this._register(B(this._label,te.KEY_DOWN,s=>{const r=new Et(s);(r.equals(3)||r.equals(10))&&(ct.stop(s,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(ni.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class Ibe extends kbe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class wL extends Wa{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new P),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=s=>(this.element=Y(s,ee("a.action-label")),this.renderLabel(this.element)),i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Ibe(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(s=>{this.element?.setAttribute("aria-expanded",`${s}`),this._onDidChangeVisibility.fire(s)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const s=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return s.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return typeof this.options.classNames=="string"?t=this.options.classNames.split(/\s+/g).filter(i=>!!i):this.options.classNames&&(t=this.options.classNames),t.find(i=>i==="icon")||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(va().setupManagedHover(this.options.hoverDelegate??oc("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}const P8=24;class Ebe extends F{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new gee),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new z),i.hoverDelegate=i.hoverDelegate??this._register(Hq()),this.options=i,this.toggleMenuAction=this._register(new Qv(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new no(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,s)=>{if(n.id===Qv.ID)return this.toggleMenuActionViewItem=new wL(n,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ye.asClassNameArray(i.moreIcon??Z.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(n,s);if(r)return r}if(n instanceof jm){const r=new wL(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}})),this.options.responsive){this.element.classList.add("responsive");const n=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});n.observe(this.element),this._store.add(ge(()=>n.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>0&&this.options.trailingSeparator&&i.push(new $i),i.forEach(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}getItemsWidthResponsive(){return this.actionBar.length()*P8}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&this.hiddenActions.length===0)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){const i=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(i<0)break;const n=Math.min(P8,this.getItemWidth(i)),s=this.originalPrimaryActions[i];this.hiddenActions.unshift({action:s,size:n}),this.actionBar.pull(i),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const i=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+i.size>e){this.hiddenActions.unshift(i);break}this.actionBar.push(i.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(i.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const t=this.hiddenActions.map(i=>i.action);if(this.originalSecondaryActions.length>0||t.length>0){const i=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=$i.join(t,i)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Qv extends nr{static{this.ID="toolbar.toggle.more"}constructor(e,t){t=t||m(17,"More Actions..."),super(Qv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}class ak{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const n=[];for(let s=0,r=t.length;sthis.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Ju.Closed)return;let i=!1;Sr(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return Sr(i)?t:i}getBoolean(e,t){const i=this.get(e);return Sr(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Sr(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===Ju.Closed)return;if(Sr(t))return this.delete(e,i);const n=Xi(t)||Array.isArray(t)?Kpe(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Ju.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Ju.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===bm.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}}class RE{constructor(){this.onDidChangeItemsExternal=se.None,this.items=new Map}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}}const H0="__$__targetStorageMarker",Ls=Ve("storageService");var Ph;(function(o){o[o.NONE=0]="NONE",o[o.SHUTDOWN=1]="SHUTDOWN"})(Ph||(Ph={}));function Obe(o){const e=o.get(H0);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class f5 extends F{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(e={flushInterval:f5.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Kg),this._onDidChangeTarget=this._register(new Kg),this._onWillSaveState=this._register(new P),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new _t),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new It(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return se.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=r4(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===H0){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}store(e,t,i,n,s=!1){if(Sr(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){const s=this.getKeyTargets(t);typeof i=="number"?s[e]!==i&&(s[e]=i,this.getStorage(t)?.set(H0,JSON.stringify(s),n)):typeof s[e]=="number"&&(delete s[e],this.getStorage(t)?.set(H0,JSON.stringify(s),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Obe(t):Object.create(null)}async flush(e=Ph.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),n=this.getStorage(1);switch(e){case Ph.NONE:await rv.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case Ph.SHUTDOWN:await rv.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()]);break}}}class Fbe extends f5{constructor(){super(),this.applicationStorage=this._register(new NC(new RE,{hint:bm.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new NC(new RE,{hint:bm.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new NC(new RE,{hint:bm.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}function Wbe(o,e){const t={...e};for(const i in o){const n=o[i];t[i]=n!==void 0?J(n):void 0}return t}const UK={keybindingLabelBackground:J(jre),keybindingLabelForeground:J(qre),keybindingLabelBorder:J(Kre),keybindingLabelBottomBorder:J(Gre),keybindingLabelShadow:J(B_)},Bbe={buttonForeground:J(OD),buttonSeparator:J(Rre),buttonBackground:J(pg),buttonHoverBackground:J(Mre),buttonSecondaryForeground:J(aj),buttonSecondaryBackground:J(jy),buttonSecondaryHoverBackground:J(Are),buttonBorder:J(Pre)},Hbe={progressBarBackground:J(Goe)},SL={inputActiveOptionBorder:J(t1),inputActiveOptionForeground:J(i1),inputActiveOptionBackground:J(H_)};J(zb),J(Ore),J(Fre),J(Wre),J(Bre),J(Hre),J(Vre);const p5={checkboxBackground:J(nF),checkboxBorder:J(zre),checkboxForeground:J(sF),checkboxDisabledBackground:J(Ure),checkboxDisabledForeground:J($re)};J(tr),J(RD),J(B_),J(J4),J(gre),J(fre),J(pre),J(qoe);const yL={inputBackground:J(OT),inputForeground:J(oj),inputBorder:J(rj),inputValidationInfoBorder:J(Lre),inputValidationInfoBackground:J(Sre),inputValidationInfoForeground:J(yre),inputValidationWarningBorder:J(kre),inputValidationWarningBackground:J(xre),inputValidationWarningForeground:J(Dre),inputValidationErrorBorder:J(Nre),inputValidationErrorBackground:J(Ire),inputValidationErrorForeground:J(Ere)},Vbe={listFilterWidgetBackground:J(aae),listFilterWidgetOutline:J(lae),listFilterWidgetNoMatchesOutline:J(cae),listFilterWidgetShadow:J(dae),inputBoxStyles:yL,toggleStyles:SL},$K={badgeBackground:J(R0),badgeForeground:J(Koe),badgeBorder:J(et)};J(hre),J(dre),J(f9),J(f9),J(ure);const q_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:J(Zre),listFocusForeground:J(Yre),listFocusOutline:J(Xre),listActiveSelectionBackground:J(Qg),listActiveSelectionForeground:J(Lv),listActiveSelectionIconForeground:J(lj),listFocusAndSelectionOutline:J(Qre),listFocusAndSelectionBackground:J(Qg),listFocusAndSelectionForeground:J(Lv),listInactiveSelectionBackground:J(Jre),listInactiveSelectionIconForeground:J(tae),listInactiveSelectionForeground:J(eae),listInactiveFocusBackground:J(iae),listInactiveFocusOutline:J(nae),listHoverBackground:J(cj),listHoverForeground:J(dj),listDropOverBackground:J(sae),listDropBetweenBackground:J(oae),listSelectionOutline:J(ti),listHoverOutline:J(ti),treeIndentGuidesStroke:J(hj),treeInactiveIndentGuidesStroke:J(hae),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:J(TD),tableColumnsBorder:J(uae),tableOddRowsBackgroundColor:J(gae)};function Of(o){return Wbe(o,q_)}const zbe={selectBackground:J(AD),selectListBackground:J(Tre),selectForeground:J(tF),decoratorRightForeground:J(uj),selectBorder:J(iF),focusBorder:J(Kl),listFocusBackground:J(Dv),listInactiveSelectionIconForeground:J(oF),listFocusForeground:J(xv),listFocusOutline:G$(ti,V.transparent.toString()),listHoverBackground:J(cj),listHoverForeground:J(dj),listHoverOutline:J(ti),selectListBorder:J(G4),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Ube={shadowColor:J(B_),borderColor:J(pae),foregroundColor:J(mae),backgroundColor:J(_ae),selectionForegroundColor:J(bae),selectionBackgroundColor:J(Cae),selectionBorderColor:J(vae),separatorColor:J(wae),scrollbarShadow:J(TD),scrollbarSliderBackground:J(J$),scrollbarSliderHoverBackground:J(ej),scrollbarSliderActiveBackground:J(tj)};function $be(o,e){if(ic)return!1;const t=jbe(o,e),i=o.getValue("window");return i?.menuStyle==="native"?!(!je&&!t):i?.menuStyle==="custom"?!1:t}function jbe(o,e){return e||(e=jK(o)),e==="native"}function jK(o){if(ic)return"custom";const e=o.getValue("window");if(e){if(je&&e.nativeTabs===!0||je&&e.nativeFullScreen===!1)return"native";const n=e.titleBarStyle;if(n==="native"||n==="custom")return n}return"custom"}function qbe(o){if(ic||je||jK(o)==="native")return"native";const t=o.getValue("window")?.controlsStyle;return t==="custom"||t==="hidden"?t:"native"}var lk=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},As=function(o,e){return function(t,i){e(t,i,o)}};function Kbe(o,e){const t=[];return Gbe(o,t),t}function Gbe(o,e,t){const i=Zc.getInstance(),n=i.keyStatus.altKey||(Rn||oo)&&i.keyStatus.shiftKey;GK(o,e,n,s=>s==="navigation")}function qK(o,e,t,i){const n={primary:[],secondary:[]};return KK(o,n,e,t,i),n}function Zbe(o,e,t,i){const n=[];return KK(o,n,e,t,i),n}function KK(o,e,t,i,n){GK(o,e,!1,typeof t=="string"?r=>r===t:t,i,n)}function GK(o,e,t,i=r=>r==="navigation",n=()=>!1,s=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of o){let h;i(c)?(h=r,h.length>0&&s&&h.push(new $i)):(h=a,h.length>0&&h.push(new $i));for(let u of d){t&&(u=u instanceof sr&&u.alt?u.alt:u);const g=h.push(u);u instanceof jm&&l.add({group:c,action:u,index:g-1})}}for(const{group:c,action:d,index:h}of l){const u=i(c)?r:a,g=d.actions;n(d,c,u.length)&&u.splice(h,1,...g)}}let Yh=class extends r_{constructor(e,t,i,n,s,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate,keybindingNotRenderedWithLabel:t?.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new _t),this._altKey=Zc.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const n=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(B(e,"mouseleave",n=>{t=!1,i()})),this._register(B(e,"mouseenter",n=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?m(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),l=a?m(1645,"{0} ({1})",s,a):s;n=m(1646,`{0} -[{1}] {2}`,n,g5.modifierLabels[wo].altKey,l)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&Abe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(ye.isThemeIcon(n)){const s=ye.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=ge(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=Sd(this._themeService.getColorTheme().type)?Yl(n.dark):Yl(n.light),i.classList.add("icon"),this._itemClassDispose.value=da(ge(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Yh=lk([As(2,dt),As(3,Li),As(4,Ne),As(5,pi),As(6,gr),As(7,Mn)],Yh);class m5 extends Yh{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=m5._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=m(1647,"{1} to {0}",this._action.label,t):this.label.textContent=m(1648,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let $R=class extends wL{constructor(e,t,i,n,s){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(ye.isThemeIcon(e.item.icon)?ye.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),rt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ye.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Sd(this._themeService.getColorTheme().type)?Yl(i.dark):Yl(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};$R=lk([As(2,dt),As(3,gr),As(4,pi)],$R);let jR=class extends Wa{constructor(e,t,i,n,s,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._defaultActionDisposables=this._register(new z),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t?.togglePrimaryAction?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Yh,c,{keybinding:this._getDefaultActionKeybindingLabel(c)}));const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new Zg)};this._dropdown=this._register(new wL(e,e.actions,this._contextMenuService,h)),t?.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof sr&&this.update(u.action)}))}update(e){this._options?.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Yh,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends Zg{async runAction(t,i){await t.run(void 0)}}),this._container&&this._defaultAction.render(cD(this._container,ee(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=ee(".action-container");this._defaultAction.render(Y(this._container,t)),this._register(B(t,te.KEY_DOWN,n=>{const s=new Et(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=ee(".dropdown-action-container");this._dropdown.render(Y(this._container,i)),this._register(B(i,te.KEY_DOWN,n=>{const s=new Et(n);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};jR=lk([As(2,dt),As(3,Li),As(4,gr),As(5,Ur),As(6,pe),As(7,Ls)],jR);let qR=class extends D_e{constructor(e,t,i){super(null,e,e.actions.map(n=>({text:n.id===$i.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,zbe,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!$be(i)}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=J(iF)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};qR=lk([As(1,Md),As(2,Oe)],qR);function _5(o,e,t){return e instanceof sr?o.createInstance(Yh,e,t):e instanceof Ig?e.item.isSelection?o.createInstance(qR,e):e.item.isSplitButton?o.createInstance(jR,e,{...t,togglePrimaryAction:typeof e.item.isSplitButton!="boolean"?e.item.isSplitButton.togglePrimaryAction:!1}):o.createInstance($R,e,t):void 0}var ck=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zl=function(o,e){return function(t,i){e(t,i,o)}},xp,Kb;let KR=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new GR(i)}createMenu(e,t,i){return new LL(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new LL(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),s=n.getActions(i);return n.dispose(),s}resetHiddenStates(e){this._hiddenStates.reset(e)}};KR=ck([zl(0,Vt),zl(1,dt),zl(2,Ls)],KR);let GR=class{static{xp=this}static{this._key="menu.hiddenCommands"}constructor(e){this._storageService=e,this._disposables=new z,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(xp._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,xp._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(xp._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const s=this._data[e.id];if(i)s?s.indexOf(t)<0&&s.push(t):this._data[e.id]=[t];else if(s){const r=s.indexOf(t);r>=0&&pte(s,r),s.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(xp._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};GR=xp=ck([zl(0,Ls)],GR);class TC{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(vn.getMenuItems(this._id));let t;for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(TC._fillInKbExprKeys(e.when,this._structureContextKeys),sm(e)){if(e.command.precondition&&TC._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;TC._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(vn.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let ZR=Kb=class extends TC{constructor(e,t,i,n,s,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=s,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,s]=i;let r;for(const a of s)if(this._contextKeyService.contextMatchesRules(a.when)){const l=sm(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=Ybe(this._id,l?a.command:a,this._hiddenStates);if(l){const d=ZK(this._commandService,this._keybindingService,a.command.id,a.when);(r??=[]).push(new sr(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new Kb(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=$i.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new Ig(a,c,h))}}r&&r.length>0&&t.push([n,r])}return t}_sort(e){return e.sort(Kb._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const s=e.order||0,r=t.order||0;return sr?1:Kb._compareTitles(sm(e)?e.command.title:e.title,sm(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};ZR=Kb=ck([zl(3,Vt),zl(4,dt),zl(5,Ne)],ZR);let LL=class{constructor(e,t,i,n,s,r){this._disposables=new z,this._menuInfo=new ZR(e,t,i.emitEventsForSubmenuChanges,n,s,r);const a=new It(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(vn.onDidChangeMenu(h=>{for(const u of this._menuInfo.allMenuIds)if(h.has(u)){a.schedule();break}}));const l=this._disposables.add(new z),c=h=>{let u=!1,g=!1,f=!1;for(const p of h)if(u=u||p.isStructuralChange,g=g||p.isEnablementChange,f=f||p.isToggleChange,u&&g&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:g,isToggleChange:f}},d=()=>{l.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),g=h.affectsSome(this._menuInfo.preconditionContextKeys),f=h.affectsSome(this._menuInfo.toggledContextKeys);(u||g||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:g,isToggleChange:f})})),l.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new uU({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};LL=ck([zl(3,Vt),zl(4,dt),zl(5,Ne)],LL);function Ybe(o,e,t){const i=Rie(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,s=kg({id:`hide/${o.id}/${i}`,label:m(1651,"Hide '{0}'",n),run(){t.updateHidden(o,i,!0)}}),r=kg({id:`toggle/${o.id}/${i}`,label:n,get checked(){return!t.isHidden(o,i)},run(){t.updateHidden(o,i,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}function ZK(o,e,t,i=void 0,n=!0){return kg({id:`configureKeybinding/${t}`,label:m(1652,"Configure Keybinding"),enabled:n,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;o.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}const YK=Ve("IActionViewItemService");class Xbe{constructor(){this._providers=new Map,this._onDidChange=new P,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof M?t.id:t}`}}Ge(YK,Xbe,1);var XK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ko=function(o,e){return function(t,i){e(t,i,o)}};let xL=class extends Ebe{constructor(e,t,i,n,s,r,a,l){super(e,s,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new z);const c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),s=t.slice(),r=[];let a=0;const l=[];let c=!1;if(this._options?.hiddenItemStrategy!==-1)for(let d=0;dg?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let g=0;g=h&&(n[g]=void 0,l[g]=f))}}_7(n),_7(l),super.setActions(n,$i.join(l,s)),(r.length>0||n.length>0)&&this._sessionDisposables.add(B(this.getElement(),"contextmenu",d=>{const h=new qn(me(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const g=[];if(u instanceof sr&&u.menuKeybinding)g.push(u.menuKeybinding);else if(!(u instanceof Ig||u instanceof Qv)){const p=!!this._keybindingService.lookupKeybinding(u.id);g.push(ZK(this._commandService,this._keybindingService,u.id,void 0,p))}if(r.length>0){let p=!1;if(a===1&&this._options?.hiddenItemStrategy===0){p=!0;for(let _=0;_this._menuService.resetHiddenStates(i)}))),f.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>f,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};xL=XK([Ko(2,Ur),Ko(3,Ne),Ko(4,gr),Ko(5,dt),Ko(6,Vt),Ko(7,cs)],xL);let Jv=class extends xL{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,s,r,a,l,c,d,h){super(e,{resetMenu:t,...i,actionViewItemProvider:(f,p)=>{let _=d.lookUp(t,f instanceof Ig?f.item.submenu.id:f.id);_||(_=i?.actionViewItemProvider);const b=_?.(f,p,h,me(e).vscodeWindowId);return b||_5(h,f,p)}},n,s,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new P);const u=this._store.add(n.createMenu(t,s,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),g=()=>{const{primary:f,secondary:p}=qK(u.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",f.length===0&&p.length===0),super.setActions(f,p)};this._store.add(u.onDidChange(()=>{g(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(f=>{f===t&&g()})),g()}setActions(){throw new ve("This toolbar is populated from a menu.")}};Jv=XK([Ko(3,Ur),Ko(4,Ne),Ko(5,gr),Ko(6,dt),Ko(7,Vt),Ko(8,cs),Ko(9,YK),Ko(10,pe)],Jv);var Qbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},A8=function(o,e){return function(t,i){e(t,i,o)}};const Us=Ve("hoverService");let a_=class extends F{get delay(){return this.isInstantlyHovering()?0:this.hoverOptions?.dynamicDelay?e=>this.hoverOptions?.dynamicDelay?.(e)??this._delay:this._delay}constructor(e,t,i={},n,s){super(),this.placement=e,this.hoverOptions=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=Si(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ti(r,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const s=Si(e.content)?void 0:typeof e.content=="string"?e.content.toString():e.content.value;return this.hoverService.showInstantHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:s,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return!!this.hoverOptions?.instantHover&&Date.now()-this.lastHoverHideTimethis._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=pt(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=vo("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=vo("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Er("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(ot("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{At(r=>{this.domNodeSizeChanged.trigger(r)})});s.observe(this._domNode),this._register(ge(()=>s.disconnect())),this._register(ke(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(ke(r=>this.render(r)))}dispose(){super.dispose(),gn(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),s=fe.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(const r of i){const a=new Ce(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);At(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const _=Ee("item",d),b=this.itemProvider.createView(_,p);h=new tCe(_,b,p),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:d.range.startLineNumber>1?this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t:0,f=(d.range.endLineNumberExclusive===1?Math.max(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${f}px`,h.gutterItemView.layout(fe.ofStartAndLength(u,f),s)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class tCe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var JK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},V0=function(o,e){return function(t,i){e(t,i,o)}};const ME=[],yS=35;let YR=class extends F{constructor(e,t,i,n,s,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=s,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(M.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=pt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(h=>h.length>0),this._showSash=$(this,h=>this._options.renderSideBySide.read(h)&&this._hasActions.read(h)),this.width=$(this,h=>this._hasActions.read(h)?yS:0),this.elements=ot("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:yS+"px"}},[]),this._currentDiff=$(this,h=>{const u=this._diffModel.read(h);if(!u)return;const g=u.diff.read(h)?.mappings,f=this._editors.modifiedCursor.read(h);if(f)return g?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=$(this,h=>{const g=this._diffModel.read(h)?.diff.read(h);if(!g)return ME;const f=this._editors.modifiedSelections.read(h);if(f.every(C=>C.isEmpty()))return ME;const p=new Ir(f.map(C=>Ce.fromRangeInclusive(C))),b=g.mappings.filter(C=>C.lineRangeMapping.innerChanges&&p.intersects(C.lineRangeMapping.modified)).map(C=>({mapping:C,rangeMappings:C.lineRangeMapping.innerChanges.filter(w=>f.some(v=>D.areIntersecting(w.modifiedRange,v)))}));return b.length===0||b.every(C=>C.rangeMappings.length===0)?ME:b}),this._register(I_e(e,this.elements.root)),this._register(B(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Zh(this.elements.root,{display:this._hasActions.map(h=>h?"block":"none")})),br(this,h=>this._showSash.read(h)?new zK(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,S4(this,g=>this._sashLayout.sashLeft.read(g)-yS,(g,f)=>this._sashLayout.sashLeft.set(g+yS,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const d=$(this,h=>{const u=this._diffModel.read(h);if(!u)return[];const g=u.diff.read(h);if(!g)return[];const f=this._selectedDiffs.read(h);if(f.length>0){const _=ar.fromRangeMappings(f.flatMap(b=>b.rangeMappings));return[new O8(_,!0,M.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return g.mappings.map(_=>new O8(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===p?.lineRangeMapping,M.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))});this._register(new eCe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(h,u)=>d.read(u),createView:(h,u)=>this._instantiationService.createInstance(XR,h,u,this)})),this._register(B(this.elements.gutter,te.MOUSE_WHEEL,h=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new lf(this._editors.modifiedModel.get()),n=new lf(this._editors.original.getModel());return new yo(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};YR=JK([V0(6,pe),V0(7,Ne),V0(8,Ur)],YR);class O8{constructor(e,t,i,n,s,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=s,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let XR=class extends F{constructor(e,t,i,n){super(),this._item=e,this._elements=ot("div.gutterItem",{style:{height:"20px",width:"34px"}},[ot("div.background@background",{},[]),ot("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Ee(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const s=this._register(n.createInstance(a_,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(jp(t,this._elements.root)),this._register(ke(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(os((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(Jv,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:a.add(new QK(()=>{const c=this._item.read(void 0),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,s=i;let r=e.start+n;const a=fe.tryCreate(s,t.endExclusive-s-i),l=fe.tryCreate(e.start+s,e.endExclusive-i-s);l&&a&&l.start=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nCe=function(o,e){return function(t,i){e(t,i,o)}},QR;let DL=class extends F{static{QR=this}static{this._breadcrumbsSourceFactory=Ee(this,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}}))}static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=br(this,l=>{const c=this._editors.modifiedModel.read(l),d=QR._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();At(d=>{for(const h of this._editors.original.getSelections()||[])c?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();At(d=>{for(const h of this._editors.modified.getSelections()||[])c?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const s=this._diffModel.map((l,c)=>{const d=l?.unchangedRegions.read(c)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(c)?.getLineCount()?[]:d});this.viewZones=$(this,l=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const d=[],h=[],u=this._options.renderSideBySide.read(l),g=this._options.compactMode.read(l),f=s.read(l);for(let p=0;p_.getHiddenOriginalRange(w).startLineNumber-1),C=new qp(b,12);d.push(C),l.store.add(new F8(this._editors.original,C,_,!u))}{const b=$(this,w=>_.getHiddenModifiedRange(w).startLineNumber-1),C=new qp(b,12);h.push(C),l.store.add(new F8(this._editors.modified,C,_))}}else{{const b=$(this,w=>_.getHiddenOriginalRange(w).startLineNumber-1),C=new qp(b,24);d.push(C),l.store.add(new W8(this._editors.original,C,_,_.originalUnchangedRange,!u,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{const b=$(this,w=>_.getHiddenModifiedRange(w).startLineNumber-1),C=new qp(b,24);h.push(C),l.store.add(new W8(this._editors.modified,C,_,_.modifiedUnchangedRange,!1,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new ts(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ye.asClassName(Z.fold),zIndex:10001};this._register(fL(this._editors.original,$(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:D.fromPositions(new R(h.originalLineNumber,1)),options:a});return d}))),this._register(fL(this._editors.modified,$(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:Ce.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ke(l=>{const c=s.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Cn)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Cn))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};DL=QR=iCe([nCe(3,pe)],DL);class F8 extends n5{constructor(e,t,i,n=!1){const s=ot("div.diff-hidden-lines-widget");super(e,t,s.root),this._unchangedRegion=i,this._hide=n,this._nodes=ot("div.diff-hidden-lines-compact",[ot("div.line-left",[]),ot("div.text@text",[]),ot("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ke(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=m(125,"{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class W8 extends n5{constructor(e,t,i,n,s,r,a,l){const c=ot("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=s,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=ot("div.diff-hidden-lines",[ot("div.top@top",{title:m(126,"Click or drag to show more above")}),ot("div.center@content",{style:{display:"flex"}},[ot("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ee("a",{title:m(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Mh("$(unfold)"))]),ot("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),ot("div.bottom@bottom",{title:m(128,"Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?gn(this._nodes.first):this._register(Zh(this._nodes.first,{width:oi(this._editor).layoutInfoContentLeft})),this._register(ke(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const g=this._unchangedRegion.isDragged.read(h),f=this._editor.getDomNode();f&&(f.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(f.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),f.classList.toggle("canMoveBottom",!u)):g==="bottom"?(f.classList.toggle("canMoveTop",!u),f.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(f.classList.toggle("canMoveTop",!1),f.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(B(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=me(this._nodes.top),_=B(p,"mousemove",C=>{const v=C.clientY-u;g=g||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),L=Math.max(0,Math.min(f+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=B(p,"mouseup",C=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),_.dispose(),b.dispose()})})),this._register(B(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=me(this._nodes.bottom),_=B(p,"mousemove",C=>{const v=C.clientY-u;g=g||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),L=Math.max(0,Math.min(f-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(k-x))}),b=B(p,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const v=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(v-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),b.dispose()})})),this._register(ke(h=>{const u=[];if(!this._hide){const g=i.getHiddenModifiedRange(h).length,f=m(129,"{0} hidden lines",g),p=ee("span",{title:m(130,"Double click to unfold")},f);p.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const _=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(_,h);if(b.length>0){u.push(ee("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}gn(this._nodes.others,...u)}))}}const PE=[];class sCe extends F{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=$(this,s=>{const a=this._diffModel.read(s)?.diff.read(s);if(!a)return PE;const l=this._editors.modifiedSelections.read(s);if(l.every(u=>u.isEmpty()))return PE;const c=new Ir(l.map(u=>Ce.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(g=>l.some(f=>D.areIntersecting(g.modifiedRange,f)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?PE:h}),this._register(os((s,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;const a=this._diffModel.read(s),l=a?.diff.read(s);if(!a||!l||a.movedTextToCompare.read(s))return;const c=[],d=this._selectedDiffs.read(s),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(s),g=r.add(new kL(u[u.length-1].positionLineNumber,this._widget,d.flatMap(f=>f.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const g=r.add(new kL(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}r.add(ge(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}class kL extends F{static{this.counter=0}getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${kL.counter++}`,this._domNode=ot("div.revertButton",{title:this._revertSelection?m(135,"Revert Selected Changes"):m(136,"Revert Change")},[tl(Z.arrowRight)]).root,this._register(B(this._domNode,te.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register(B(this._domNode,te.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register(B(this._domNode,te.CLICK,s=>{this._diffs instanceof _s?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Xa.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}var oCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yb=function(o,e){return function(t,i){e(t,i,o)}};let Xl=class extends u5{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,s,r,a,l){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._codeEditorService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=ot("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[ot("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),ot("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),ot("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(x4(this,void 0)),this._diffModel=$(this,v=>this._diffModelSrc.read(v)?.object),this.onDidChangeModel=se.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new $_([Ne,this._contextKeyService]))),this._boundarySashes=Ee(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ee(this,!1),this._accessibleDiffViewerVisible=$(this,v=>this._options.onlyShowAccessibleDiffViewer.read(v)?!0:this._accessibleDiffViewerShouldBeVisible.read(v)),this._movedBlocksLinesPart=Ee(this,void 0),this._layoutInfo=$(this,v=>{const S=this._rootSizeObserver.width.read(v),L=this._rootSizeObserver.height.read(v);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const x=this._sash.read(v),k=this._gutter.read(v),I=k?.width.read(v)??0,T=this._overviewRulerPart.read(v)?.width??0;let A,O,W,U,q;if(!!x){const Q=x.sashLeft.read(v),ne=this._movedBlocksLinesPart.read(v)?.width.read(v)??0;A=0,O=Q-I-ne,q=Q-I,W=Q,U=S-W-T}else{q=0;const Q=this._options.inlineViewHideOriginalLineNumbers.read(v);A=I,Q?O=0:O=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(v)),W=I+O,U=S-W-T}return this.elements.original.style.left=A+"px",this.elements.original.style.width=O+"px",this._editors.original.layout({width:O,height:L},!0),k?.layout(q),this.elements.modified.style.left=W+"px",this.elements.modified.style.width=U+"px",this._editors.modified.layout({width:U,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((v,S)=>v?.diff.read(S)),this.onDidUpdateDiff=se.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(ge(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new RK(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(UR,t),this._register(ke(v=>{this._options.setWidth(this._rootSizeObserver.width.read(v))})),this._contextKeyService.createKey(N.isEmbeddedDiffEditor.key,!1),this._register(bl(N.isEmbeddedDiffEditor,this._contextKeyService,v=>this._options.isInEmbeddedEditor.read(v))),this._register(bl(N.comparingMovedCode,this._contextKeyService,v=>!!this._diffModel.read(v)?.movedTextToCompare.read(v))),this._register(bl(N.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,v=>this._options.couldShowInlineViewBecauseOfSize.read(v))),this._register(bl(N.diffEditorInlineMode,this._contextKeyService,v=>!this._options.renderSideBySide.read(v))),this._register(bl(N.hasChanges,this._contextKeyService,v=>(this._diffModel.read(v)?.diff.read(v)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(zR,this.elements.original,this.elements.modified,this._options,i,(v,S,L,x)=>this._createInnerEditor(v,S,L,x))),this._register(bl(N.diffEditorOriginalWritable,this._contextKeyService,v=>this._options.originalEditable.read(v))),this._register(bl(N.diffEditorModifiedWritable,this._contextKeyService,v=>!this._options.readOnly.read(v))),this._register(bl(N.diffEditorOriginalUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.original.uri.toString()??"")),this._register(bl(N.diffEditorModifiedUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.modified.uri.toString()??"")),this._overviewRulerPart=br(this,v=>this._options.renderOverviewRuler.read(v)?this._instantiationService.createInstance(kc(Xv),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((v,S)=>v-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new vbe(this._options,c),this._sash=br(this,v=>{const S=this._options.renderSideBySide.read(v);return this.elements.root.classList.toggle("side-by-side",S),S?new zK(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=br(this,v=>this._instantiationService.createInstance(kc(DL),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);br(this,v=>this._instantiationService.createInstance(kc(hbe),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let g=!1;const f=br(this,v=>this._instantiationService.createInstance(kc(VR),me(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.read(void 0).isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=$(this,v=>{const S=f.read(v).viewZones.read(v).orig,L=d.read(v).viewZones.read(v).origViewZones;return S.concat(L)}),_=$(this,v=>{const S=f.read(v).viewZones.read(v).mod,L=d.read(v).viewZones.read(v).modViewZones;return S.concat(L)});this._register(pL(this._editors.original,p,v=>{g=v},h));let b;this._register(pL(this._editors.modified,_,v=>{g=v,g?b=el.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=br(this,v=>this._instantiationService.createInstance(kc(Cg),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,L)=>this._accessibleDiffViewerShouldBeVisible.set(S,L),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,L)=>S?.diff.read(L)?.mappings.map(x=>x.lineRangeMapping)),new Z_e(this._editors))).recomputeInitiallyAndOnChange(this._store);const C=this._accessibleDiffViewerVisible.map(v=>v?"hidden":"visible");this._register(Zh(this.elements.modified,{visibility:C})),this._register(Zh(this.elements.original,{visibility:C})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(ge(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=br(this,v=>this._options.shouldRenderGutterMenu.read(v)?this._instantiationService.createInstance(kc(YR),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register($m(this._layoutInfo)),br(this,v=>new(kc(Og))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,v=>{this._movedBlocksLinesPart.set(v,void 0)}),this._register(se.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!0))),this._register(se.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!1)));const w=this._diffModel.map(this,(v,S)=>{if(v)return v.diff.read(S)===void 0&&!v.isDiffUpToDate.read(S)});this._register(os((v,S)=>{if(w.read(v)===!0){const L=this._editorProgressService.show(!0,1e3);S.add(ge(()=>L.done()))}})),this._register(os((v,S)=>{S.add(new(kc(sCe))(this._editors,this._diffModel,this._options,this))})),this._register(os((v,S)=>{const L=this._diffModel.read(v);if(L)for(const x of[L.model.original,L.model.modified])S.add(x.onWillDispose(k=>{Te(new ve("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ke(v=>{this._options.setModel(this._diffModel.read(v))}))}_createInnerEditor(e,t,i,n){return e.createInstance(sf,t,i,n)}_createDiffEditorContributions(){const e=om.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Te(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return l1.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(HR,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?mL.create(e).createNewRef(this):mL.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&Um(t,n=>{const s=e?.object;pt.batchEventsGlobally(n,()=>{this._editors.original.setModel(s?s.model.original:null),this._editors.modified.setModel(s?s.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?rCe(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const n=i.getPosition().lineNumber,s=i.getSelection(),r=Ce.fromRange(s||new D(n,0,n,0)),a=t.filter(l=>l.lineRangeMapping.modified.intersect(r));i.pushUndoStop(),i.executeEdits("diffEditor",a.map(l=>({range:l.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(l.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new R(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let n;e==="next"?this._editors.modified.getModel().getLineCount()===i?n=t[0]:n=t.find(r=>r.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Iv(t,s=>s.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const s=t.getSelection();if(s){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=f8(s.getStartPosition(),r),l=f8(s.getEndPosition(),r);n=D.plusRange(a,l)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&At(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&At(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===3){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(tt.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(tt.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(tt.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Xl=oCe([yb(3,Ne),yb(4,pe),yb(5,at),yb(6,Td),yb(7,yd)],Xl);function rCe(o){return o.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,s,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,r=0,a=void 0):(s=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,modifiedEndLineNumber:r,charChanges:a?.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}class aCe extends yn{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:H(85,"Toggle Collapse Unchanged Regions"),icon:Z.map,toggled:K.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:K.has("isInDiffEditor"),menu:{when:K.has("isInDiffEditor"),id:M.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Oe),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class eG extends yn{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:H(86,"Toggle Show Moved Code Blocks"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(Oe),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class tG extends yn{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:H(87,"Toggle Use Inline View When Space Is Limited"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(Oe),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const b1=H(88,"Diff Editor");class lCe extends Ca{constructor(){super({id:"diffEditor.switchSide",title:H(89,"Switch Side"),icon:Z.arrowSwap,precondition:K.has("isInDiffEditor"),f1:!0,category:b1})}runEditorCommand(e,t,i){const n=Ff(e);if(n instanceof Xl){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class cCe extends Ca{constructor(){super({id:"diffEditor.exitCompareMove",title:H(90,"Exit Compare Move"),icon:Z.close,precondition:N.comparingMovedCode,f1:!1,category:b1,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Ff(e);n instanceof Xl&&n.exitCompareMove()}}class dCe extends Ca{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:H(91,"Collapse All Unchanged Regions"),icon:Z.fold,precondition:K.has("isInDiffEditor"),f1:!0,category:b1})}runEditorCommand(e,t,...i){const n=Ff(e);n instanceof Xl&&n.collapseAllUnchangedRegions()}}class hCe extends Ca{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:H(92,"Show All Unchanged Regions"),icon:Z.unfold,precondition:K.has("isInDiffEditor"),f1:!0,category:b1})}runEditorCommand(e,t,...i){const n=Ff(e);n instanceof Xl&&n.showAllUnchangedRegions()}}class JR extends yn{constructor(){super({id:"diffEditor.revert",title:H(93,"Revert"),f1:!0,category:b1,precondition:K.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=Ff(e);t instanceof Xl&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=uCe(e,t.originalUri,t.modifiedUri);i instanceof Xl&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const iG=H(94,"Accessible Diff Viewer");class C1 extends yn{static{this.id="editor.action.accessibleDiffViewer.next"}constructor(){super({id:C1.id,title:H(95,"Go to Next Difference"),category:iG,precondition:K.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Ff(e)?.accessibleDiffViewerNext()}}class dk extends yn{static{this.id="editor.action.accessibleDiffViewer.prev"}constructor(){super({id:dk.id,title:H(96,"Go to Previous Difference"),category:iG,precondition:K.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Ff(e)?.accessibleDiffViewerPrev()}}function uCe(o,e,t){return o.get(at).listDiffEditors().find(s=>{const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Ff(o){const t=o.get(at).listDiffEditors(),i=Ji();if(i){for(const n of t)if(n.getContainerDomNode().contains(i))return n}return null}Lt(aCe);Lt(eG);Lt(tG);vn.appendMenuItem(M.EditorTitle,{command:{id:new tG().desc.id,title:m(119,"Use Inline View When Space Is Limited"),toggled:K.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:K.has("isInDiffEditor")},order:11,group:"1_diff",when:K.and(N.diffEditorRenderSideBySideInlineBreakpointReached,K.has("isInDiffEditor"))});vn.appendMenuItem(M.EditorTitle,{command:{id:new eG().desc.id,title:m(120,"Show Moved Code Blocks"),icon:Z.move,toggled:R_.create("config.diffEditor.experimental.showMoves",!0),precondition:K.has("isInDiffEditor")},order:10,group:"1_diff",when:K.has("isInDiffEditor")});Lt(JR);for(const o of[{icon:Z.arrowRight,key:N.diffEditorInlineMode.toNegated()},{icon:Z.discard,key:N.diffEditorInlineMode}])vn.appendMenuItem(M.DiffEditorHunkToolbar,{command:{id:new JR().desc.id,title:m(121,"Revert Block"),icon:o.icon},when:K.and(N.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),vn.appendMenuItem(M.DiffEditorSelectionToolbar,{command:{id:new JR().desc.id,title:m(122,"Revert Selection"),icon:o.icon},when:K.and(N.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Lt(lCe);Lt(cCe);Lt(dCe);Lt(hCe);vn.appendMenuItem(M.EditorTitle,{command:{id:C1.id,title:m(123,"Open Accessible Diff Viewer"),precondition:K.has("isInDiffEditor")},order:10,group:"2_diff",when:K.and(N.accessibleDiffViewerVisible.negate(),K.has("isInDiffEditor"))});it.registerCommandAlias("editor.action.diffReview.next",C1.id);Lt(C1);it.registerCommandAlias("editor.action.diffReview.prev",dk.id);Lt(dk);var gCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fCe=function(o,e){return function(t,i){e(t,i,o)}},eM;const hk=new re("selectionAnchorSet",!1);let Xh=class{static{eM=this}static{this.ID="editor.contrib.selectionAnchorController"}static get(e){return e.getContribution(eM.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=hk.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(le.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new ts().appendText(m(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ws(m(799,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(le.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Xh=eM=gCe([fCe(1,Ne)],Xh);class pCe extends de{constructor(){super({id:"editor.action.setSelectionAnchor",label:H(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2080),weight:100}})}async run(e,t){Xh.get(t)?.setSelectionAnchor()}}class mCe extends de{constructor(){super({id:"editor.action.goToSelectionAnchor",label:H(801,"Go to Selection Anchor"),precondition:hk})}async run(e,t){Xh.get(t)?.goToSelectionAnchor()}}class _Ce extends de{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:H(802,"Select from Anchor to Cursor"),precondition:hk,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2089),weight:100}})}async run(e,t){Xh.get(t)?.selectFromAnchorToCursor()}}class bCe extends de{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:H(803,"Cancel Selection Anchor"),precondition:hk,kbOpts:{kbExpr:N.editorTextFocus,primary:9,weight:100}})}async run(e,t){Xh.get(t)?.cancelSelectionAnchor()}}nt(Xh.ID,Xh,4);oe(pCe);oe(mCe);oe(_Ce);oe(bCe);const CCe=E("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m(804,"Overview ruler marker color for matching brackets."));class vCe extends de{constructor(){super({id:"editor.action.jumpToBracket",label:H(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:3165,weight:100}})}run(e,t){hd.get(t)?.jumpToBracket()}}class wCe extends de{constructor(){super({id:"editor.action.selectToBracket",label:H(807,"Select to Bracket"),precondition:void 0,metadata:{description:H(808,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),hd.get(t)?.selectToBracket(n)}}class SCe extends de{constructor(){super({id:"editor.action.removeBrackets",label:H(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){hd.get(t)?.removeBrackets(this.id)}}class yCe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class hd extends F{static{this.ID="editor.contrib.bracketMatchingController"}static get(e){return e.getContribution(hd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new It(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new le(r.lineNumber,r.column,r.lineNumber,r.column):new le(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const c=t.bracketPairs.findNextBracket(s);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(D.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new le(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Me.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:_i(CCe),position:or.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Me.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h1&&s.sort(R.compare);const a=[];let l=0,c=0;const d=n.length;for(let h=0,u=s.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}oe(kCe);const ICe=Ve("productService");function b5(o,e){return{id:e,asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function ECe(o,e,t,i){const n={id:Rf(),name:o,uri:e,data:t};return{id:i,asString:async()=>"",asFile:()=>n,value:void 0}}class sG{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Je.some(this,([i,n])=>n.asFile())&&t.push("files"),oG(IL(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return IL(e)}}function IL(o){return o.toLowerCase()}function B8(o,e){return oG(IL(o),e.map(IL))}function oG(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const uk=Object.freeze({create:o=>bd(o.map(e=>e.toString())).join(`\r +`),await this._clipboardService.writeText(S)})),n.getOption(104)||C.push(new Uo("diff.inline.revertChange",m(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),C},autoSelectFirstItem:!0})};this._register(Li(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:_,height:b}=pi(this._diffActions),C=Math.floor(h/3);p.preventDefault(),f({x:p.posx,y:_+b+C})})),this._register(n.onMouseMove(p=>{(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,h),this.visibility=!0):this.visibility=!1})),this._register($pe({domNode:this._deletedCodeDomNode,diffEntry:s,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:d}))}_updateLightBulbPosition(e,t,i){const{top:n}=pi(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._renderLinesResult.viewLineCounts){let l=0;for(let c=0;co});function Rw(o,e,t,i,n=!1){gn(i,e.fontInfo);const s=t.length>0,r=new Fh(1e4);let a=0,l=0;const c=[],d=[];for(let f=0;fnull),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class Uc{static fromEditor(e){const t=e.getOptions(),i=t.get(59),n=t.get(165);return new Uc(e.getModel()?.getOptions().tabSize||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),n.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=g}withSetWidth(e){return new Uc(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new Uc(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class qpe{constructor(e,t,i,n,s){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=n,this._source=s}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;const n=i.parentElement;if(!n)return;const s=n.querySelectorAll(".view-line");let r=-1;for(let h=0;h=this._renderOutputs.length)return;let a=1,l=r;for(let h=0;hthis._source.lineTokens.length)return;const c=this._renderOutputs[r];if(!c)return;const d=vm(c.characterMapping,e,t)+c.offset;return new R(a,d)}}class V9 extends Q0{constructor(e,t,i){super(e,t),this.offset=i}}function z9(o,e,t,i,n,s,r,a,l){a.appendString('
'):a.appendString('px;">');const c=e.getLineContent(),d=Zo.isBasicASCII(c,n),h=Zo.containsRTL(c,d,s),u=h_(new cd(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==ur.OFF,null,null,r.verticalScrollbarSize),a);a.appendString("
");const g=u.characterMapping.getHorizontalOffset(u.characterMapping.length);return{output:u,maxCharWidth:g}}const Co=We("clipboardService"),ud=We("contextViewService"),Jo=We("contextMenuService");var Kpe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U9=function(o,e){return function(t,i){e(t,i,o)}};let ET=class extends A{constructor(e,t,i,n,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=De(this,0),this._originalScrollOffset=De(this,0),this._originalScrollOffsetAnimated=I9(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=De(this,0),this._modifiedScrollOffset=De(this,0),this._modifiedScrollOffsetAnimated=I9(this._targetWindow,this._modifiedScrollOffset,this._store);const h=De("invalidateAlignmentsState",0),u=this._register(new St(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()}));const g=this._diffModel.map(w=>w?dt(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,v)=>w?.read(v)),f=$(w=>{const v=this._diffModel.read(w),S=v?.diff.read(w);if(!v||!S)return null;h.read(w);const k=this._options.renderSideBySide.read(w);return $9(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),p=$(w=>{const v=this._diffModel.read(w)?.movedTextToCompare.read(w);if(!v)return null;h.read(w);const S=v.changes.map(x=>new Xj(x));return $9(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const b=this._register(new z);this.viewZones=$(this,w=>{b.clear();const v=f.read(w)||[],S=[],x=[],k=this._modifiedTopPadding.read(w);k>0&&x.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:k,showInHiddenAreas:!0,suppressMouseDown:!0});const D=this._originalTopPadding.read(w);D>0&&S.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:D,showInHiddenAreas:!0,suppressMouseDown:!0});const I=this._options.renderSideBySide.read(w),T=I?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(T){const ne=this._editors.original.getModel();for(const ce of v)if(ce.diff)for(let ke=ce.originalRange.startLineNumber;kene.getLineCount())return{orig:S,mod:x};T?.addRequest(ne.getLineContent(ke),null,null)}}const F=T?.finalize()??[];let O=0;const B=this._editors.modified.getOption(75),U=this._diffModel.read(w)?.movedTextToCompare.read(w),K=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,ie=this._editors.original.getModel()?.mightContainRTL()??!1,X=Uc.fromEditor(this._editors.modified);for(const ne of v)if(ne.diff&&!I&&(!this._options.useTrueInlineDiffRendering.read(w)||!Y4(ne.diff))){if(!ne.originalRange.isEmpty){g.read(w);const ke=document.createElement("div");ke.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const it=this._editors.original.getModel();if(ne.originalRange.endLineNumberExclusive-1>it.getLineCount())return{orig:S,mod:x};const ot=new Mw(ne.originalRange.mapToLineArray(Gi=>it.tokenization.getLineTokens(Gi)),ne.originalRange.mapToLineArray(Gi=>F[O++]),K,ie),Lt=[];for(const Gi of ne.diff.innerChanges||[])Lt.push(new ug(Gi.originalRange.delta(-(ne.diff.original.startLineNumber-1)),yT.className,0));const Zt=Rw(ot,X,Lt,ke),mn=document.createElement("div");if(mn.className="inline-deleted-margin-view-zone",gn(mn,X.fontInfo),this._options.renderIndicators.read(w))for(let Gi=0;GiUd(ms),mn,ke,this._editors.modified,ne.diff,this._diffEditorWidget,Zt,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Gi=0;Gi1&&S.push({afterLineNumber:ne.originalRange.startLineNumber+Gi,domNode:_(),heightInPx:(yo-1)*B,showInHiddenAreas:!0,suppressMouseDown:!0})}x.push({afterLineNumber:ne.modifiedRange.startLineNumber-1,domNode:ke,heightInPx:Zt.heightInLines*B,minWidthInPx:Zt.minWidthInPx,marginDomNode:mn,setZoneId(Gi){ms=Gi},showInHiddenAreas:!0,suppressMouseDown:!1})}const ce=document.createElement("div");ce.className="gutter-delete",S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ne.modifiedHeightInPx,marginDomNode:ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ce=ne.modifiedHeightInPx-ne.originalHeightInPx;if(ce>0){if(U?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ne.originalRange.endLineNumberExclusive-1))continue;S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let ke=function(){const ot=document.createElement("div");return ot.className="arrow-revert-change "+Se.asClassName(G.arrowRight),w.store.add(W(ot,"mousedown",Lt=>Lt.stopPropagation())),w.store.add(W(ot,"click",Lt=>{Lt.stopPropagation(),s.revert(ne.diff)})),J("div",{},ot)};if(U?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ne.modifiedRange.endLineNumberExclusive-1))continue;let it;ne.diff&&ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(it=ke()),x.push({afterLineNumber:ne.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ce,marginDomNode:it,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ne of p.read(w)??[]){if(!U?.lineRangeMapping.original.intersect(ne.originalRange)||!U?.lineRangeMapping.modified.intersect(ne.modifiedRange))continue;const ce=ne.modifiedHeightInPx-ne.originalHeightInPx;ce>0?S.push({afterLineNumber:ne.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0}):x.push({afterLineNumber:ne.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ce,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:S,mod:x}});let C=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.modified.setScrollLeft(w.scrollLeft),C=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.original.setScrollLeft(w.scrollLeft),C=!1)})),this._originalScrollTop=dt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=dt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(xe(w=>{const v=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(w));v!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(v,1)})),this._register(xe(w=>{const v=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(w));v!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(v,1)})),this._register(xe(w=>{const v=this._diffModel.read(w)?.movedTextToCompare.read(w);let S=0;if(v){const x=this._editors.original.getTopForLineNumber(v.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);S=this._editors.modified.getTopForLineNumber(v.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-x}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+S,void 0,!0)}))}};ET=Kpe([U9(8,Co),U9(9,Jo)],ET);function $9(o,e,t,i,n,s){const r=new Qc(j9(o,i)),a=new Qc(j9(e,n)),l=o.getOption(75),c=e.getOption(75),d=[];let h=0,u=0;function g(f,p){for(;;){let _=r.peek(),b=a.peek();if(_&&_.lineNumber>=f&&(_=void 0),b&&b.lineNumber>=p&&(b=void 0),!_&&!b)break;const C=_?_.lineNumber-h:Number.MAX_VALUE,w=b?b.lineNumber-u:Number.MAX_VALUE;Cw?(a.dequeue(),_={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:be.ofLength(_.lineNumber,1),modifiedRange:be.ofLength(b.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+b.heightInPx,diff:void 0})}}for(const f of t){let w=function(v,S,x=!1){if(vF.lineNumberF+O.heightInPx,0)??0,T=a.takeWhile(F=>F.lineNumberF+O.heightInPx,0)??0;d.push({originalRange:k,modifiedRange:D,originalHeightInPx:k.length*l+I,modifiedHeightInPx:D.length*c+T,diff:f.lineRangeMapping}),C=v,b=S};const p=f.lineRangeMapping;g(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,b=p.modified.startLineNumber,C=p.original.startLineNumber;if(s)for(const v of p.innerChanges||[]){v.originalRange.startColumn>1&&v.modifiedRange.startColumn>1&&w(v.originalRange.startLineNumber,v.modifiedRange.startLineNumber);const S=o.getModel(),x=v.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(v.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;v.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of o.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new R(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return dpe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function Y4(o){return o.innerChanges?o.innerChanges.every(e=>yy(e.modifiedRange)&&yy(e.originalRange)||e.originalRange.equalsRange(new L(1,1,1,1))):!1}function yy(o){return o.startLineNumber===o.endLineNumber}class gg extends A{static{this.movedCodeBlockPadding=4}constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=dt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=dt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=ao("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=De(this,0),this._modifiedViewZonesChangedSignal=ao("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=ao("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=$(this,d=>{this._element.replaceChildren();const h=this._diffModel.read(d),u=h?.diff.read(d)?.movedTexts;if(!u||u.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const g=this._originalEditorLayoutInfo.read(d),f=this._modifiedEditorLayoutInfo.read(d);if(!g||!f){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const p=u.map(x=>{function k(ie,X){const ne=X.getTopForLineNumber(ie.startLineNumber,!0),ce=X.getTopForLineNumber(ie.endLineNumberExclusive,!0);return(ne+ce)/2}const D=k(x.lineRangeMapping.original,this._editors.original),I=this._originalScrollTop.read(d),T=k(x.lineRangeMapping.modified,this._editors.modified),F=this._modifiedScrollTop.read(d),O=D-I,B=T-F,U=Math.min(D,T),K=Math.max(D,T);return{range:new ge(U,K),from:O,to:B,fromWithoutScroll:D,toWithoutScroll:T,move:x}});p.sort(yJ(Bn(x=>x.fromWithoutScroll>x.toWithoutScroll,JV),Bn(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,uo)));const _=X4.compute(p.map(x=>x.range)),b=10,C=g.verticalScrollbarWidth,w=(_.getTrackCount()-1)*10+b*2,v=C+w+(f.contentLeft-gg.movedCodeBlockPadding);let S=0;for(const x of p){const k=_.getTrack(S),D=C+b+k*10,I=15,T=15,F=v,O=f.glyphMarginWidth+f.lineNumbersWidth,B=18,U=document.createElementNS("http://www.w3.org/2000/svg","rect");U.classList.add("arrow-rectangle"),U.setAttribute("x",`${F-O}`),U.setAttribute("y",`${x.to-B/2}`),U.setAttribute("width",`${O}`),U.setAttribute("height",`${B}`),this._element.appendChild(U);const K=document.createElementNS("http://www.w3.org/2000/svg","g"),ie=document.createElementNS("http://www.w3.org/2000/svg","path");ie.setAttribute("d",`M 0 ${x.from} L ${D} ${x.from} L ${D} ${x.to} L ${F-T} ${x.to}`),ie.setAttribute("fill","none"),K.appendChild(ie);const X=document.createElementNS("http://www.w3.org/2000/svg","polygon");X.classList.add("arrow"),d.store.add(xe(ne=>{ie.classList.toggle("currentMove",x.move===h.activeMovedText.read(ne)),X.classList.toggle("currentMove",x.move===h.activeMovedText.read(ne))})),X.setAttribute("points",`${F-T},${x.to-I/2} ${F},${x.to} ${F-T},${x.to+I/2}`),K.appendChild(X),this._element.appendChild(K),S++}this.width.set(w,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(ue(()=>this._element.remove())),this._register(xe(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-gg.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(fm(this._state));const r=$(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(g=>({move:g,original:new mp(Nt(g.lineRangeMapping.original.startLineNumber-1),18),modified:new mp(Nt(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(vy(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(vy(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(Xn((d,h)=>{const u=r.read(d);for(const g of u)h.add(new q9(this._editors.original,g.original,g.move,"original",this._diffModel.get())),h.add(new q9(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=ao("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=ao("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(e_({changeTracker:{createChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)}},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let g;if(u&&c==="original"){const f=this._editors.originalCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(f.lineNumber)))}if(u&&c==="modified"){const f=this._editors.modifiedCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber)))}g!==h.movedTextToCompare.read(void 0)&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(g)}))}}class X4{static compute(e){const t=[],i=[];for(const n of e){let s=t.findIndex(r=>!r.intersectsStrict(n));s===-1&&(t.length>=6?s=Aae(t,Bn(a=>a.intersectWithRangeLength(n),uo)):(s=t.length,t.push(new LO))),t[s].addRange(n),i.push(s)}return new X4(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class q9 extends j4{constructor(e,t,i,n,s){const r=Qe("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=Qe("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Qe("div.text-content@textContent"),Qe("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=dt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Ih(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new qs(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Uo("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new Uo("","Compare",Se.asClassName(G.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(xe(u=>{const g=this._diffModel.movedTextToCompare.read(u)===i;h.checked=g})),c.push(h,{icon:!1,label:!0})}}class Gpe extends A{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=$(this,s=>{const r=this._diffModel.read(s),a=r?.diff.read(s);if(!a)return null;const l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),d=this._options.showEmptyDecorations.read(s),h=[],u=[];if(!l)for(const f of a.mappings)if(f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?O9:W9}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?A9:F9}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:Ope}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:Ppe});else{const p=this._options.useTrueInlineDiffRendering.read(s)&&Y4(f.lineRangeMapping);for(const _ of f.lineRangeMapping.innerChanges||[])if(f.lineRangeMapping.original.contains(_.originalRange.startLineNumber)&&h.push({range:_.originalRange,options:_.originalRange.isEmpty()&&d?Fpe:yT}),f.lineRangeMapping.modified.contains(_.modifiedRange.startLineNumber)&&u.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()&&d&&!p?Ape:B9}),p){const b=r.model.original.getValueInRange(_.originalRange);u.push({range:_.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const f of l.changes){const p=f.original.toInclusiveRange();p&&h.push({range:p,options:c?O9:W9});const _=f.modified.toInclusiveRange();_&&u.push({range:_,options:c?A9:F9});for(const b of f.innerChanges||[])h.push({range:b.originalRange,options:yT}),u.push({range:b.modifiedRange,options:B9})}const g=this._diffModel.read(s).activeMovedText.read(s);for(const f of a.movedTexts)h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===g?" currentMove":""),blockPadding:[gg.movedCodeBlockPadding,0,gg.movedCodeBlockPadding,gg.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(Cy(this._editors.original,this._decorations.map(s=>s?.originalDecorations||[]))),this._register(Cy(this._editors.modified,this._decorations.map(s=>s?.modifiedDecorations||[])))}}class tn{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new tn(this.x+e.x,this.y+e.y)}deltaX(e){return new tn(this.x+e,this.y)}deltaY(e){return new tn(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new tn(this.x-e.x,this.y-e.y)}scale(e){return new tn(this.x*e,this.y*e)}mapComponents(e){return new tn(e(this.x),e(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function Jt(o){return Eu.get(o)}class Eu extends A{static{this._map=new Map}static get(e){let t=Eu._map.get(e);if(!t){t=new Eu(e),Eu._map.set(e,t);const i=e.onDidDispose(()=>{const n=Eu._map.get(e);n&&(Eu._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new t_(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=De(this,this.editor.getModel()),this.model=this._model,this.isReadonly=dt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=Wb({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=Wb({owner:this,equalsFn:Vu(xC(ae.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=An({owner:this,equalsFn:Vu(xC(R.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=dt(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=dt(this,t=>{const i=this.editor.onDidFocusEditorText(t),n=this.editor.onDidBlurEditorText(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=dt(this,t=>{const i=this.editor.onDidCompositionStart(()=>{t(void 0)}),n=this.editor.onDidCompositionEnd(()=>{t(void 0)});return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.inComposition),this.value=dO(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=$(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=An({owner:this,equalsFn:Vu(ae.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=An({owner:this,equalsFn:R.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.cursorLineNumber=$(this,t=>this.cursorPosition.read(t)?.lineNumber??null),this.onDidType=pr(this),this.onDidPaste=pr(this),this.scrollTop=dt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=dt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=dt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(t=>t.width),this.layoutInfoHeight=this.layoutInfo.map(t=>t.height),this.layoutInfoMinimap=this.layoutInfo.map(t=>t.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(t=>t.verticalScrollbarWidth),this.contentWidth=dt(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=dt(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=De(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=$(t=>(this.model.read(t),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=qi.ofCaller()){return dt(this,i=>this.editor.onDidChangeConfiguration(n=>{n.hasChanged(e)&&i(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new z,i=this.editor.createDecorationsCollection();return t.add(hL({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=xe(s=>{e.position.read(s),e.minContentWidthInPx.read(s),this.editor.layoutOverlayWidget(i)});return ue(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const n=xe(s=>{e.position.read(s),this.editor.layoutContentWidget(i)});return ue(()=>{n.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){const i=this.observePosition(e.map(s=>new R(s.startLineNumber,1)),t),n=this.observePosition(e.map(s=>new R(s.endLineNumberExclusive+1,1)),t);return $(s=>{i.read(s),n.read(s);const r=e.read(s),a=this.model.read(s)?.getLineCount(),l=(typeof a<"u"&&r.startLineNumber>a?this.editor.getBottomForLineNumber(a):this.editor.getTopForLineNumber(r.startLineNumber))-this.scrollTop.read(s),c=r.isEmpty?l:this.editor.getBottomForLineNumber(r.endLineNumberExclusive-1)-this.scrollTop.read(s);return new ge(l,c)})}observePosition(e,t){let i=e.get();const n=Wb({owner:this,debugName:()=>`topLeftOfPosition${i?.toString()}`,equalsFn:Vu(tn.equals)},new tn(0,0)),s="observablePositionWidget"+this._widgetCounter++,r=document.createElement("div"),a={getDomNode:()=>r,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>s,allowEditorOverflow:!1,afterRender:(l,c)=>{const d=this._model.get();d&&i&&i.lineNumber>d.getLineCount()?n.set(new tn(0,this.editor.getBottomForLineNumber(d.getLineCount())-this.scrollTop.get()),void 0):n.set(c?new tn(c.left,c.top):null,void 0)}};return this.editor.addContentWidget(a),t.add(xe(l=>{i=e.read(l),this.editor.layoutContentWidget(a)})),t.add(ue(()=>{this.editor.removeContentWidget(a)})),n}isTargetHovered(e,t){const i=De("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(n=>{const s=e(n);i.set(s,void 0)})),t.add(this.editor.onMouseLeave(n=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return $(t=>{const i=e instanceof R?e:e.read(t);return i===null?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return typeof e=="number"?this.observeLineHeightForPosition(new R(e,1)):$(t=>{const i=e.read(t);return i===null?null:this.observeLineHeightForPosition(new R(i,1)).read(t)})}observeLineHeightsForLineRange(e){return $(t=>{const i=e instanceof be?e:e.read(t),n=[];for(let s=i.startLineNumber;s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ype=function(o,e){return function(t,i){e(t,i,o)}},da;let gv=class extends A{static{da=this}static{this.ONE_OVERVIEW_WIDTH=15}static{this.ENTIRE_DIFF_OVERVIEW_WIDTH=this.ONE_OVERVIEW_WIDTH*2}constructor(e,t,i,n,s,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=da.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=dt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=$(u=>{const g=l.read(u),f=g.getColor(use)||(g.getColor(ju)||vN).transparent(2),p=g.getColor(gse)||(g.getColor(Zd)||wN).transparent(2);return{insertColor:f,removeColor:p}}),d=ht(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Qe("div.diffOverview",{style:{position:"absolute",top:"0px",width:da.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(pp(h,d.domNode)),this._register(Li(h,ee.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(W(h,ee.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(pp(this._rootElement,h)),this._register(Xn((u,g)=>{const f=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(g.add(p),g.add(pp(h,p.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(g.add(_),g.add(pp(h,_.getDomNode()))),!p||!_)return;const b=ao("viewZoneChanged",this._editors.original.onDidChangeViewZones),C=ao("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=ao("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),v=ao("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add(xe(S=>{b.read(S),C.read(S),w.read(S),v.read(S);const x=c.read(S),k=f?.diff.read(S)?.mappings;function D(F,O,B){const U=B._getViewModel();return U?F.filter(K=>K.length>0).map(K=>{const ie=U.coordinatesConverter.convertModelPositionToViewPosition(new R(K.startLineNumber,1)),X=U.coordinatesConverter.convertModelPositionToViewPosition(new R(K.endLineNumberExclusive,1)),ne=X.lineNumber-ie.lineNumber;return new u$(ie.lineNumber,X.lineNumber,ne,O.toString())}):[]}const I=D((k||[]).map(F=>F.lineRangeMapping.original),x.removeColor,this._editors.original),T=D((k||[]).map(F=>F.lineRangeMapping.modified),x.insertColor,this._editors.modified);p?.setZones(I),_?.setZones(T)})),g.add(xe(S=>{const x=this._rootHeight.read(S),k=this._rootWidth.read(S),D=this._modifiedEditorLayoutInfo.read(S);if(D){const I=da.ENTIRE_DIFF_OVERVIEW_WIDTH-2*da.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:x,right:I+da.ONE_OVERVIEW_WIDTH,width:da.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:x,right:0,width:da.ONE_OVERVIEW_WIDTH});const T=this._editors.modifiedScrollTop.read(S),F=this._editors.modifiedScrollHeight.read(S),O=this._editors.modified.getOption(117),B=new ym(O.verticalHasArrows?O.arrowSize:0,O.verticalScrollbarSize,0,D.height,F,T);d.setTop(B.getSliderPosition()),d.setHeight(B.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=x+"px",h.style.left=k-da.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(da.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};gv=da=Zpe([Ype(6,ci)],gv);var Xpe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wI=function(o,e){return function(t,i){e(t,i,o)}};let NT=class extends A{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,s,r,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=s,this._contextKeyService=r,this._instantiationService=a,this._keybindingService=l,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new P),this.modifiedScrollTop=dt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=dt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Jt(this.modified),this.originalObs=Jt(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=dt(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=An({owner:this,equalsFn:R.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new R(1,1)),this.originalCursor=dt(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new R(1,1)),this.isOriginalFocused=Jt(this.original).isFocused,this.isModifiedFocused=Jt(this.modified).isFocused,this.isFocused=$(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(e_({changeTracker:{createChangeSummary:()=>({}),handleChange:(c,d)=>(c.didChange(i.editorOptions)&&Object.assign(d,c.change.changedOptions),!0)}},(c,d)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,d))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_constructInnerEditor(e,t,i,n){const s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+gv.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=rs.revealHorizontalRightPadding.defaultValue+gv.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=m(111," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};NT=Xpe([wI(5,Ie),wI(6,fe),wI(7,st)],NT);var p_=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const Qpe=!1;var xy;(function(o){o.North="north",o.South="south",o.East="east",o.West="west"})(xy||(xy={}));let Jpe=4;const eme=new P;let tme=300;const ime=new P;class Q4{constructor(e){this.el=e,this.disposables=new z}get onPointerMove(){return this.disposables.add(new mt(pe(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new mt(pe(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}p_([Si],Q4.prototype,"onPointerMove",null);p_([Si],Q4.prototype,"onPointerUp",null);class J4{get onPointerMove(){return this.disposables.add(new mt(this.el,Rt.Change)).event}get onPointerUp(){return this.disposables.add(new mt(this.el,Rt.End)).event}constructor(e){this.el=e,this.disposables=new z}dispose(){this.disposables.dispose()}}p_([Si],J4.prototype,"onPointerMove",null);p_([Si],J4.prototype,"onPointerUp",null);class Ly{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}p_([Si],Ly.prototype,"onPointerMove",null);p_([Si],Ly.prototype,"onPointerUp",null);const K9="pointer-events-disabled";class $n extends A{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=Z(this.el,J(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(ue(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(W(this._orthogonalStartDragHandle,"mouseenter",()=>$n.onMouseEnter(e))),this.orthogonalStartDragHandleDisposables.add(W(this._orthogonalStartDragHandle,"mouseleave",()=>$n.onMouseLeave(e))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=Z(this.el,J(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(ue(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(W(this._orthogonalEndDragHandle,"mouseenter",()=>$n.onMouseEnter(e))),this.orthogonalEndDragHandleDisposables.add(W(this._orthogonalEndDragHandle,"mouseleave",()=>$n.onMouseLeave(e))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=tme,this.hoverDelayer=this._register(new yr(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new P),this._onDidStart=this._register(new P),this._onDidChange=this._register(new P),this._onDidReset=this._register(new P),this._onDidEnd=this._register(new P),this.orthogonalStartSashDisposables=this._register(new z),this.orthogonalStartDragHandleDisposables=this._register(new z),this.orthogonalEndSashDisposables=this._register(new z),this.orthogonalEndDragHandleDisposables=this._register(new z),this.linkedSash=void 0,this.el=Z(e,J(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),ze&&this.el.classList.add("mac"),this._register(W(this.el,"mousedown",s=>this.onPointerStart(s,new Q4(e)))),this._register(W(this.el,"dblclick",s=>this.onPointerDoublePress(s))),this._register(W(this.el,"mouseenter",()=>$n.onMouseEnter(this))),this._register(W(this.el,"mouseleave",()=>$n.onMouseLeave(this))),this._register(Xt.addTarget(this.el)),this._register(W(this.el,Rt.Start,s=>this.onPointerStart(s,new J4(this.el))));let n;this._register(W(this.el,Rt.Tap,s=>{if(n){clearTimeout(n),n=void 0,this.onPointerDoublePress(s);return}clearTimeout(n),n=setTimeout(()=>n=void 0,250)})),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Jpe,this._register(eme.event(s=>{this.size=s,this.layout()}))),this._register(ime.event(s=>this.hoverDelay=s)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",Qpe),this.layout()}onPointerStart(e,t){nt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const f=this.getOrthogonalSash(e);f&&(i=!0,e.__orthogonalSashEvent=!0,f.onPointerStart(e,new Ly(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new Ly(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const f of n)f.classList.add(K9);const s=e.pageX,r=e.pageY,a=e.altKey,l={startX:s,currentX:s,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Ir(this.el),d=()=>{let f="";i?f="all-scroll":this.orientation===1?this.state===1?f="s-resize":this.state===2?f="n-resize":f=ze?"row-resize":"ns-resize":this.state===1?f="e-resize":this.state===2?f="w-resize":f=ze?"col-resize":"ew-resize",c.textContent=`* { cursor: ${f} !important; }`},h=new z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=f=>{nt.stop(f,!1);const p={startX:s,currentX:f.pageX,startY:r,currentY:f.pageY,altKey:a};this._onDidChange.fire(p)},g=f=>{nt.stop(f,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const p of n)p.classList.remove(K9)};t.onPointerMove(u,null,h),t.onPointerUp(g,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&$n.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&$n.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){$n.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!mi(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}class nme{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=dO(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const s=this.dimensions.width.get();this._sashRatio.set(i/s,n)}),this._sashRatio=De(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:si-r?i-r:s}}class Qj extends A{constructor(e,t,i,n,s,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=s,this._resetSash=r,this._sash=this._register(new $n(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(xe(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(xe(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class eF extends A{constructor(){super(...arguments),this._id=++eF.idCounter,this._onDidDispose=this._register(new P),this.onDidDispose=this._onDidDispose.event}static{this.idCounter=0}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}const En={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1};function sme(o,e){return ld(o,(t,i)=>i??e(t))}var ome=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rme=function(o,e){return function(t,i){e(t,i,o)}};let TT=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=De(this,0),this._screenReaderMode=dt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=$(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=$(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=$(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=$(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=$(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=$(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=$(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=$(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=$(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=$(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=$(this,n=>this._options.read(n).maxComputationTime),this.showMoves=$(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=$(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=$(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=$(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=$(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=$(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=$(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=$(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=$(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=$(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=$(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=$(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=$(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=$(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=De(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>sme(this,s=>{const r=n?.diff.read(s);return r?ame(r,this.trueInlineDiffRenderingEnabled.read(s)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...G9(e,En)};this._options=De(this,i)}updateOptions(e){const t=G9(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};TT=ome([rme(1,kn)],TT);function ame(o,e){return o.mappings.every(t=>lme(t.lineRangeMapping)||cme(t.lineRangeMapping)||e&&Y4(t.lineRangeMapping))}function lme(o){return o.original.length===0}function cme(o){return o.modified.length===0}function G9(o,e){return{enableSplitViewResizing:me(o.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Wie(o.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:me(o.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:me(o.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:mc(o.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:mc(o.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:me(o.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:me(o.renderIndicators,e.renderIndicators),originalEditable:me(o.originalEditable,e.originalEditable),diffCodeLens:me(o.diffCodeLens,e.diffCodeLens),renderOverviewRuler:me(o.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ot(o.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ot(o.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:me(o.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:me(o.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:me(o.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:me(o.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:me(o.hideUnchangedRegions?.enabled??o.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:mc(o.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:mc(o.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:mc(o.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:me(o.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:me(o.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:mc(o.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:me(o.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:me(o.renderGutterMenu,e.renderGutterMenu),compactMode:me(o.compactMode,e.compactMode)}}class dme extends kg{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new P),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Z(e,J(".monaco-dropdown")),this._label=Z(this._element,J(".dropdown-label"));let i=t.labelRenderer;i||(i=s=>(s.textContent=t.label||"",null));for(const s of[ee.CLICK,ee.MOUSE_DOWN,Rt.Tap])this._register(W(this.element,s,r=>nt.stop(r,!0)));for(const s of[ee.MOUSE_DOWN,Rt.Tap])this._register(W(this._label,s,r=>{pO(r)&&r.button!==0||(this.visible?this.hide():this.show())}));this._register(W(this._label,ee.KEY_DOWN,s=>{const r=new yt(s);(r.equals(3)||r.equals(10))&&(nt.stop(s,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(Xt.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class hme extends dme{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class ky extends Sa{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new P),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=s=>(this.element=Z(s,J("a.action-label")),this.renderLabel(this.element)),i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new hme(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(s=>{this.element?.setAttribute("aria-expanded",`${s}`),this._onDidChangeVisibility.fire(s)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const s=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return s.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return typeof this.options.classNames=="string"?t=this.options.classNames.split(/\s+/g).filter(i=>!!i):this.options.classNames&&(t=this.options.classNames),t.find(i=>i==="icon")||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(oa().setupManagedHover(this.options.hoverDelegate??zl("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}const Z9=24;class ume extends A{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new _Q),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new z),i.hoverDelegate=i.hoverDelegate??this._register(tj()),this.options=i,this.toggleMenuAction=this._register(new fv(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new qs(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,s)=>{if(n.id===fv.ID)return this.toggleMenuActionViewItem=new ky(n,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Se.asClassNameArray(i.moreIcon??G.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(n,s);if(r)return r}if(n instanceof pm){const r=new ky(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}})),this.options.responsive){this.element.classList.add("responsive");const n=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});n.observe(this.element),this._store.add(ue(()=>n.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>0&&this.options.trailingSeparator&&i.push(new Fi),i.forEach(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}getItemsWidthResponsive(){return this.actionBar.length()*Z9}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&this.hiddenActions.length===0)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){const i=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(i<0)break;const n=Math.min(Z9,this.getItemWidth(i)),s=this.originalPrimaryActions[i];this.hiddenActions.unshift({action:s,size:n}),this.actionBar.pull(i),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const i=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+i.size>e){this.hiddenActions.unshift(i);break}this.actionBar.push(i.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(i.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const t=this.hiddenActions.map(i=>i.action);if(this.originalSecondaryActions.length>0||t.length>0){const i=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=Fi.join(t,i)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class fv extends Uo{static{this.ID="toolbar.toggle.more"}constructor(e,t){t=t||m(17,"More Actions..."),super(fv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}class uk{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const n=[];for(let s=0,r=t.length;sthis.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Nu.Closed)return;let i=!1;lr(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return lr(i)?t:i}getBoolean(e,t){const i=this.get(e);return lr(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return lr(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===Nu.Closed)return;if(lr(t))return this.delete(e,i);const n=Ui(t)||Array.isArray(t)?Xge(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Nu.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Nu.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===zp.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}}class SI{constructor(){this.onDidChangeItemsExternal=te.None,this.items=new Map}async updateItems(e){e.insert?.forEach((t,i)=>this.items.set(i,t)),e.delete?.forEach(t=>this.items.delete(t))}}const jS="__$__targetStorageMarker",ps=We("storageService");var gh;(function(o){o[o.NONE=0]="NONE",o[o.SHUTDOWN=1]="SHUTDOWN"})(gh||(gh={}));function Cme(o){const e=o.get(jS);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class iF extends A{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(e={flushInterval:iF.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new xg),this._onDidChangeTarget=this._register(new xg),this._onWillSaveState=this._register(new P),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new ut),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new St(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return te.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=GA(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===jS){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}store(e,t,i,n,s=!1){if(lr(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){const s=this.getKeyTargets(t);typeof i=="number"?s[e]!==i&&(s[e]=i,this.getStorage(t)?.set(jS,JSON.stringify(s),n)):typeof s[e]=="number"&&(delete s[e],this.getStorage(t)?.set(jS,JSON.stringify(s),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Cme(t):Object.create(null)}async flush(e=gh.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),n=this.getStorage(1);switch(e){case gh.NONE:await SC.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case gh.SHUTDOWN:await SC.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()]);break}}}class vme extends iF{constructor(){super(),this.applicationStorage=this._register(new qb(new SI,{hint:zp.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new qb(new SI,{hint:zp.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new qb(new SI,{hint:zp.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}function wme(o,e){const t={...e};for(const i in o){const n=o[i];t[i]=n!==void 0?Q(n):void 0}return t}const Jj={keybindingLabelBackground:Q(Zse),keybindingLabelForeground:Q(Yse),keybindingLabelBorder:Q(Xse),keybindingLabelBottomBorder:Q(Qse),keybindingLabelShadow:Q(c_)},Sme={buttonForeground:Q(VL),buttonSeparator:Q(Ose),buttonBackground:Q(qu),buttonHoverBackground:Q(Fse),buttonSecondaryForeground:Q(SU),buttonSecondaryBackground:Q(Y0),buttonSecondaryHoverBackground:Q(Bse),buttonBorder:Q(Wse)},yme={progressBarBackground:Q(Qne)},Dy={inputActiveOptionBorder:Q(_w),inputActiveOptionForeground:Q(bw),inputActiveOptionBackground:Q(d_)};Q(sb),Q(Hse),Q(Vse),Q(zse),Q(Use),Q($se),Q(jse);const nF={checkboxBackground:Q(jO),checkboxBorder:Q(qse),checkboxForeground:Q(qO),checkboxDisabledBackground:Q(Kse),checkboxDisabledForeground:Q(Gse)};Q(Vo),Q(FL),Q(c_),Q(VO),Q(_se),Q(bse),Q(Cse),Q(Yne);const Iy={inputBackground:Q(kN),inputForeground:Q(vU),inputBorder:Q(wU),inputValidationInfoBorder:Q(Ise),inputValidationInfoBackground:Q(kse),inputValidationInfoForeground:Q(Dse),inputValidationWarningBorder:Q(Tse),inputValidationWarningBackground:Q(Ese),inputValidationWarningForeground:Q(Nse),inputValidationErrorBorder:Q(Pse),inputValidationErrorBackground:Q(Rse),inputValidationErrorForeground:Q(Mse)},xme={listFilterWidgetBackground:Q(hoe),listFilterWidgetOutline:Q(uoe),listFilterWidgetNoMatchesOutline:Q(goe),listFilterWidgetShadow:Q(foe),inputBoxStyles:Iy,toggleStyles:Dy},eq={badgeBackground:Q(WS),badgeForeground:Q(Xne),badgeBorder:Q(Ge)};Q(pse),Q(fse),Q(F7),Q(F7),Q(mse);const m_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Q(Jse),listFocusForeground:Q(eoe),listFocusOutline:Q(toe),listActiveSelectionBackground:Q(Eg),listActiveSelectionForeground:Q(HC),listActiveSelectionIconForeground:Q(yU),listFocusAndSelectionOutline:Q(ioe),listFocusAndSelectionBackground:Q(Eg),listFocusAndSelectionForeground:Q(HC),listInactiveSelectionBackground:Q(noe),listInactiveSelectionIconForeground:Q(ooe),listInactiveSelectionForeground:Q(soe),listInactiveFocusBackground:Q(roe),listInactiveFocusOutline:Q(aoe),listHoverBackground:Q(xU),listHoverForeground:Q(LU),listDropOverBackground:Q(loe),listDropBetweenBackground:Q(coe),listSelectionOutline:Q(Gt),listHoverOutline:Q(Gt),treeIndentGuidesStroke:Q(kU),treeInactiveIndentGuidesStroke:Q(poe),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:Q(OL),tableColumnsBorder:Q(moe),tableOddRowsBackgroundColor:Q(_oe)};function gf(o){return wme(o,m_)}const Lme={selectBackground:Q(HL),selectListBackground:Q(Ase),selectForeground:Q(UO),decoratorRightForeground:Q(DU),selectBorder:Q($O),focusBorder:Q(Nl),listFocusBackground:Q(zC),listInactiveSelectionIconForeground:Q(KO),listFocusForeground:Q(VC),listFocusOutline:cU(Gt,V.transparent.toString()),listHoverBackground:Q(xU),listHoverForeground:Q(LU),listHoverOutline:Q(Gt),selectListBorder:Q(OO),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},kme={shadowColor:Q(c_),borderColor:Q(Coe),foregroundColor:Q(voe),backgroundColor:Q(woe),selectionForegroundColor:Q(Soe),selectionBackgroundColor:Q(yoe),selectionBorderColor:Q(xoe),separatorColor:Q(Loe),scrollbarShadow:Q(OL),scrollbarSliderBackground:Q(fU),scrollbarSliderHoverBackground:Q(pU),scrollbarSliderActiveBackground:Q(mU)};function Dme(o,e){if(Bl)return!1;const t=Ime(o,e),i=o.getValue("window");return i?.menuStyle==="native"?!(!ze&&!t):i?.menuStyle==="custom"?!1:t}function Ime(o,e){return e||(e=tq(o)),e==="native"}function tq(o){if(Bl)return"custom";const e=o.getValue("window");if(e){if(ze&&e.nativeTabs===!0||ze&&e.nativeFullScreen===!1)return"native";const n=e.titleBarStyle;if(n==="native"||n==="custom")return n}return"custom"}function Eme(o){if(Bl||ze||tq(o)==="native")return"native";const t=o.getValue("window")?.controlsStyle;return t==="custom"||t==="hidden"?t:"native"}var gk=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ls=function(o,e){return function(t,i){e(t,i,o)}};function Nme(o,e){const t=[];return Tme(o,t),t}function Tme(o,e,t){const i=Ic.getInstance(),n=i.keyStatus.altKey||(Ln||Gs)&&i.keyStatus.shiftKey;sq(o,e,n,s=>s==="navigation")}function iq(o,e,t,i){const n={primary:[],secondary:[]};return nq(o,n,e,t,i),n}function Rme(o,e,t,i){const n=[];return nq(o,n,e,t,i),n}function nq(o,e,t,i,n){sq(o,e,!1,typeof t=="string"?r=>r===t:t,i,n)}function sq(o,e,t,i=r=>r==="navigation",n=()=>!1,s=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of o){let h;i(c)?(h=r,h.length>0&&s&&h.push(new Fi)):(h=a,h.length>0&&h.push(new Fi));for(let u of d){t&&(u=u instanceof $o&&u.alt?u.alt:u);const g=h.push(u);u instanceof pm&&l.add({group:c,action:u,index:g-1})}}for(const{group:c,action:d,index:h}of l){const u=i(c)?r:a,g=d.actions;n(d,c,u.length)&&u.splice(h,1,...g)}}let Eh=class extends Nm{constructor(e,t,i,n,s,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate,keybindingNotRenderedWithLabel:t?.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new ut),this._altKey=Ic.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const n=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(W(e,"mouseleave",n=>{t=!1,i()})),this._register(W(e,"mouseenter",n=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?m(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),l=a?m(1645,"{0} ({1})",s,a):s;n=m(1646,`{0} +[{1}] {2}`,n,tF.modifierLabels[lo].altKey,l)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&bme(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(Se.isThemeIcon(n)){const s=Se.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=ue(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=td(this._themeService.getColorTheme().type)?Ml(n.dark):Ml(n.light),i.classList.add("icon"),this._itemClassDispose.value=Yr(ue(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Eh=gk([Ls(2,st),Ls(3,bi),Ls(4,Ie),Ls(5,ci),Ls(6,Jo),Ls(7,kn)],Eh);class sF extends Eh{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=sF._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=m(1647,"{1} to {0}",this._action.label,t):this.label.textContent=m(1648,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let RT=class extends ky{constructor(e,t,i,n,s){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(Se.isThemeIcon(e.item.icon)?Se.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),Je(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Se.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=td(this._themeService.getColorTheme().type)?Ml(i.dark):Ml(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};RT=gk([Ls(2,st),Ls(3,Jo),Ls(4,ci)],RT);let MT=class extends Sa{constructor(e,t,i,n,s,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._defaultActionDisposables=this._register(new z),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t?.togglePrimaryAction?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Eh,c,{keybinding:this._getDefaultActionKeybindingLabel(c)}));const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new kg)};this._dropdown=this._register(new ky(e,e.actions,this._contextMenuService,h)),t?.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof $o&&this.update(u.action)}))}update(e){this._options?.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(Eh,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends kg{async runAction(t,i){await t.run(void 0)}}),this._container&&this._defaultAction.render(fL(this._container,J(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=J(".action-container");this._defaultAction.render(Z(this._container,t)),this._register(W(t,ee.KEY_DOWN,n=>{const s=new yt(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=J(".dropdown-action-container");this._dropdown.render(Z(this._container,i)),this._register(W(i,ee.KEY_DOWN,n=>{const s=new yt(n);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),s.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};MT=gk([Ls(2,st),Ls(3,bi),Ls(4,Jo),Ls(5,Er),Ls(6,fe),Ls(7,ps)],MT);let PT=class extends cpe{constructor(e,t,i){super(null,e,e.actions.map(n=>({text:n.id===Fi.ID?"─────────":n.label,isDisabled:!n.enabled})),0,t,Lme,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!Dme(i)}),this.select(Math.max(0,e.actions.findIndex(n=>n.checked)))}render(e){super.render(e),e.style.borderColor=Q($O)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};PT=gk([Ls(1,ud),Ls(2,Pe)],PT);function oF(o,e,t){return e instanceof $o?o.createInstance(Eh,e,t):e instanceof og?e.item.isSelection?o.createInstance(PT,e):e.item.isSplitButton?o.createInstance(MT,e,{...t,togglePrimaryAction:typeof e.item.isSplitButton!="boolean"?e.item.isSplitButton.togglePrimaryAction:!1}):o.createInstance(RT,e,t):void 0}var fk=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ll=function(o,e){return function(t,i){e(t,i,o)}},Zf,cb;let AT=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new OT(i)}createMenu(e,t,i){return new Ey(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new Ey(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),s=n.getActions(i);return n.dispose(),s}resetHiddenStates(e){this._hiddenStates.reset(e)}};AT=fk([Ll(0,Pt),Ll(1,st),Ll(2,ps)],AT);let OT=class{static{Zf=this}static{this._key="menu.hiddenCommands"}constructor(e){this._storageService=e,this._disposables=new z,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Zf._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Zf._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Zf._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const s=this._data[e.id];if(i)s?s.indexOf(t)<0&&s.push(t):this._data[e.id]=[t];else if(s){const r=s.indexOf(t);r>=0&&CJ(s,r),s.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(Zf._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};OT=Zf=fk([Ll(0,ps)],OT);class Kb{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(un.getMenuItems(this._id));let t;for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(Kb._fillInKbExprKeys(e.when,this._structureContextKeys),Ip(e)){if(e.command.precondition&&Kb._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Kb._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(un.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let FT=cb=class extends Kb{constructor(e,t,i,n,s,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=s,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,s]=i;let r;for(const a of s)if(this._contextKeyService.contextMatchesRules(a.when)){const l=Ip(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=Mme(this._id,l?a.command:a,this._hiddenStates);if(l){const d=oq(this._commandService,this._keybindingService,a.command.id,a.when);(r??=[]).push(new $o(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new cb(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Fi.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new og(a,c,h))}}r&&r.length>0&&t.push([n,r])}return t}_sort(e){return e.sort(cb._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const s=e.order||0,r=t.order||0;return sr?1:cb._compareTitles(Ip(e)?e.command.title:e.title,Ip(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};FT=cb=fk([Ll(3,Pt),Ll(4,st),Ll(5,Ie)],FT);let Ey=class{constructor(e,t,i,n,s,r){this._disposables=new z,this._menuInfo=new FT(e,t,i.emitEventsForSubmenuChanges,n,s,r);const a=new St(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(un.onDidChangeMenu(h=>{for(const u of this._menuInfo.allMenuIds)if(h.has(u)){a.schedule();break}}));const l=this._disposables.add(new z),c=h=>{let u=!1,g=!1,f=!1;for(const p of h)if(u=u||p.isStructuralChange,g=g||p.isEnablementChange,f=f||p.isToggleChange,u&&g&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:g,isToggleChange:f}},d=()=>{l.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),g=h.affectsSome(this._menuInfo.preconditionContextKeys),f=h.affectsSome(this._menuInfo.toggledContextKeys);(u||g||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:g,isToggleChange:f})})),l.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new DV({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};Ey=fk([Ll(3,Pt),Ll(4,st),Ll(5,Ie)],Ey);function Mme(o,e,t){const i=Oee(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,s=sg({id:`hide/${o.id}/${i}`,label:m(1651,"Hide '{0}'",n),run(){t.updateHidden(o,i,!0)}}),r=sg({id:`toggle/${o.id}/${i}`,label:n,get checked(){return!t.isHidden(o,i)},run(){t.updateHidden(o,i,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}function oq(o,e,t,i=void 0,n=!0){return sg({id:`configureKeybinding/${t}`,label:m(1652,"Configure Keybinding"),enabled:n,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;o.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}const rq=We("IActionViewItemService");class Pme{constructor(){this._providers=new Map,this._onDidChange=new P,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof M?t.id:t}`}}$e(rq,Pme,1);var aq=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Mo=function(o,e){return function(t,i){e(t,i,o)}};let Ny=class extends ume{constructor(e,t,i,n,s,r,a,l){super(e,s,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new z);const c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),s=t.slice(),r=[];let a=0;const l=[];let c=!1;if(this._options?.hiddenItemStrategy!==-1)for(let d=0;dg?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let g=0;g=h&&(n[g]=void 0,l[g]=f))}}H3(n),H3(l),super.setActions(n,Fi.join(l,s)),(r.length>0||n.length>0)&&this._sessionDisposables.add(W(this.getElement(),"contextmenu",d=>{const h=new Wn(pe(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const g=[];if(u instanceof $o&&u.menuKeybinding)g.push(u.menuKeybinding);else if(!(u instanceof og||u instanceof fv)){const p=!!this._keybindingService.lookupKeybinding(u.id);g.push(oq(this._commandService,this._keybindingService,u.id,void 0,p))}if(r.length>0){let p=!1;if(a===1&&this._options?.hiddenItemStrategy===0){p=!0;for(let _=0;_this._menuService.resetHiddenStates(i)}))),f.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>f,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};Ny=aq([Mo(2,Er),Mo(3,Ie),Mo(4,Jo),Mo(5,st),Mo(6,Pt),Mo(7,ts)],Ny);let pv=class extends Ny{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,s,r,a,l,c,d,h){super(e,{resetMenu:t,...i,actionViewItemProvider:(f,p)=>{let _=d.lookUp(t,f instanceof og?f.item.submenu.id:f.id);_||(_=i?.actionViewItemProvider);const b=_?.(f,p,h,pe(e).vscodeWindowId);return b||oF(h,f,p)}},n,s,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new P);const u=this._store.add(n.createMenu(t,s,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),g=()=>{const{primary:f,secondary:p}=iq(u.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",f.length===0&&p.length===0),super.setActions(f,p)};this._store.add(u.onDidChange(()=>{g(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(f=>{f===t&&g()})),g()}setActions(){throw new Ce("This toolbar is populated from a menu.")}};pv=aq([Mo(3,Er),Mo(4,Ie),Mo(5,Jo),Mo(6,st),Mo(7,Pt),Mo(8,ts),Mo(9,rq),Mo(10,fe)],pv);var Ame=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Y9=function(o,e){return function(t,i){e(t,i,o)}};const Ms=We("hoverService");let Tm=class extends A{get delay(){return this.isInstantlyHovering()?0:this.hoverOptions?.dynamicDelay?e=>this.hoverOptions?.dynamicDelay?.(e)??this._delay:this._delay}constructor(e,t,i={},n,s){super(),this.placement=e,this.hoverOptions=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new z),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=mi(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Li(r,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const s=mi(e.content)?void 0:typeof e.content=="string"?e.content.toString():e.content.value;return this.hoverService.showInstantHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:s,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return!!this.hoverOptions?.instantHover&&Date.now()-this.lastHoverHideTimethis._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=dt(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=ao("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=ao("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=pr("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Qe("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{Et(r=>{this.domNodeSizeChanged.trigger(r)})});s.observe(this._domNode),this._register(ue(()=>s.disconnect())),this._register(xe(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(xe(r=>this.render(r)))}dispose(){super.dispose(),on(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),s=ge.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(const r of i){const a=new be(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);Et(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const _=De("item",d),b=this.itemProvider.createView(_,p);h=new Wme(_,b,p),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:d.range.startLineNumber>1?this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t:0,f=(d.range.endLineNumberExclusive===1?Math.max(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${f}px`,h.gutterItemView.layout(ge.ofStartAndLength(u,f),s)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class Wme{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var cq=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qS=function(o,e){return function(t,i){e(t,i,o)}};const yI=[],E1=35;let WT=class extends A{constructor(e,t,i,n,s,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=s,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(M.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=dt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(h=>h.length>0),this._showSash=$(this,h=>this._options.renderSideBySide.read(h)&&this._hasActions.read(h)),this.width=$(this,h=>this._hasActions.read(h)?E1:0),this.elements=Qe("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:E1+"px"}},[]),this._currentDiff=$(this,h=>{const u=this._diffModel.read(h);if(!u)return;const g=u.diff.read(h)?.mappings,f=this._editors.modifiedCursor.read(h);if(f)return g?.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber))}),this._selectedDiffs=$(this,h=>{const g=this._diffModel.read(h)?.diff.read(h);if(!g)return yI;const f=this._editors.modifiedSelections.read(h);if(f.every(C=>C.isEmpty()))return yI;const p=new fr(f.map(C=>be.fromRangeInclusive(C))),b=g.mappings.filter(C=>C.lineRangeMapping.innerChanges&&p.intersects(C.lineRangeMapping.modified)).map(C=>({mapping:C,rangeMappings:C.lineRangeMapping.innerChanges.filter(w=>f.some(v=>L.areIntersecting(w.modifiedRange,v)))}));return b.length===0||b.every(C=>C.rangeMappings.length===0)?yI:b}),this._register(hpe(e,this.elements.root)),this._register(W(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Ih(this.elements.root,{display:this._hasActions.map(h=>h?"block":"none")})),sr(this,h=>this._showSash.read(h)?new Qj(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,dO(this,g=>this._sashLayout.sashLeft.read(g)-E1,(g,f)=>this._sashLayout.sashLeft.set(g+E1,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const d=$(this,h=>{const u=this._diffModel.read(h);if(!u)return[];const g=u.diff.read(h);if(!g)return[];const f=this._selectedDiffs.read(h);if(f.length>0){const _=Ko.fromRangeMappings(f.flatMap(b=>b.rangeMappings));return[new X9(_,!0,M.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return g.mappings.map(_=>new X9(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===p?.lineRangeMapping,M.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))});this._register(new Fme(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(h,u)=>d.read(u),createView:(h,u)=>this._instantiationService.createInstance(BT,h,u,this)})),this._register(W(this.elements.gutter,ee.MOUSE_WHEEL,h=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new Wg(this._editors.modifiedModel.get()),n=new Wg(this._editors.original.getModel());return new ho(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};WT=cq([qS(6,fe),qS(7,Ie),qS(8,Er)],WT);class X9{constructor(e,t,i,n,s,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=s,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let BT=class extends A{constructor(e,t,i,n){super(),this._item=e,this._elements=Qe("div.gutterItem",{style:{height:"20px",width:"34px"}},[Qe("div.background@background",{},[]),Qe("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=De(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const s=this._register(n.createInstance(Tm,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(pp(t,this._elements.root)),this._register(xe(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Xn((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(pv,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:a.add(new lq(()=>{const c=this._item.read(void 0),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,s=i;let r=e.start+n;const a=ge.tryCreate(s,t.endExclusive-s-i),l=ge.tryCreate(e.start+s,e.endExclusive-i-s);l&&a&&l.start=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hme=function(o,e){return function(t,i){e(t,i,o)}},HT;let Ty=class extends A{static{HT=this}static{this._breadcrumbsSourceFactory=De(this,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}}))}static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=sr(this,l=>{const c=this._editors.modifiedModel.read(l),d=HT._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();Et(d=>{for(const h of this._editors.original.getSelections()||[])c?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();Et(d=>{for(const h of this._editors.modified.getSelections()||[])c?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const s=this._diffModel.map((l,c)=>{const d=l?.unchangedRegions.read(c)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(c)?.getLineCount()?[]:d});this.viewZones=$(this,l=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const d=[],h=[],u=this._options.renderSideBySide.read(l),g=this._options.compactMode.read(l),f=s.read(l);for(let p=0;p_.getHiddenOriginalRange(w).startLineNumber-1),C=new mp(b,12);d.push(C),l.store.add(new Q9(this._editors.original,C,_,!u))}{const b=$(this,w=>_.getHiddenModifiedRange(w).startLineNumber-1),C=new mp(b,12);h.push(C),l.store.add(new Q9(this._editors.modified,C,_))}}else{{const b=$(this,w=>_.getHiddenOriginalRange(w).startLineNumber-1),C=new mp(b,24);d.push(C),l.store.add(new J9(this._editors.original,C,_,_.originalUnchangedRange,!u,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{const b=$(this,w=>_.getHiddenModifiedRange(w).startLineNumber-1),C=new mp(b,24);h.push(C),l.store.add(new J9(this._editors.modified,C,_,_.modifiedUnchangedRange,!1,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Kn(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Se.asClassName(G.fold),zIndex:10001};this._register(Cy(this._editors.original,$(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:L.fromPositions(new R(h.originalLineNumber,1)),options:a});return d}))),this._register(Cy(this._editors.modified,$(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:be.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(xe(l=>{const c=s.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(hn)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(hn))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};Ty=HT=Bme([Hme(3,fe)],Ty);class Q9 extends j4{constructor(e,t,i,n=!1){const s=Qe("div.diff-hidden-lines-widget");super(e,t,s.root),this._unchangedRegion=i,this._hide=n,this._nodes=Qe("div.diff-hidden-lines-compact",[Qe("div.line-left",[]),Qe("div.text@text",[]),Qe("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(xe(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=m(125,"{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class J9 extends j4{constructor(e,t,i,n,s,r,a,l){const c=Qe("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=s,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Qe("div.diff-hidden-lines",[Qe("div.top@top",{title:m(126,"Click or drag to show more above")}),Qe("div.center@content",{style:{display:"flex"}},[Qe("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[J("a",{title:m(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...uh("$(unfold)"))]),Qe("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Qe("div.bottom@bottom",{title:m(128,"Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?on(this._nodes.first):this._register(Ih(this._nodes.first,{width:Jt(this._editor).layoutInfoContentLeft})),this._register(xe(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const g=this._unchangedRegion.isDragged.read(h),f=this._editor.getDomNode();f&&(f.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(f.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),f.classList.toggle("canMoveBottom",!u)):g==="bottom"?(f.classList.toggle("canMoveTop",!u),f.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(f.classList.toggle("canMoveTop",!1),f.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(W(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=pe(this._nodes.top),_=W(p,"mousemove",C=>{const v=C.clientY-u;g=g||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),x=Math.max(0,Math.min(f+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(x,void 0)}),b=W(p,"mouseup",C=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),_.dispose(),b.dispose()})})),this._register(W(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=pe(this._nodes.bottom),_=W(p,"mousemove",C=>{const v=C.clientY-u;g=g||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),x=Math.max(0,Math.min(f-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(x,void 0);const D=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(D-k))}),b=W(p,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const v=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(v-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),b.dispose()})})),this._register(xe(h=>{const u=[];if(!this._hide){const g=i.getHiddenModifiedRange(h).length,f=m(129,"{0} hidden lines",g),p=J("span",{title:m(130,"Double click to unfold")},f);p.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const _=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(_,h);if(b.length>0){u.push(J("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}on(this._nodes.others,...u)}))}}const xI=[];class Vme extends A{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=$(this,s=>{const a=this._diffModel.read(s)?.diff.read(s);if(!a)return xI;const l=this._editors.modifiedSelections.read(s);if(l.every(u=>u.isEmpty()))return xI;const c=new fr(l.map(u=>be.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(g=>l.some(f=>L.areIntersecting(g.modifiedRange,f)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?xI:h}),this._register(Xn((s,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;const a=this._diffModel.read(s),l=a?.diff.read(s);if(!a||!l||a.movedTextToCompare.read(s))return;const c=[],d=this._selectedDiffs.read(s),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(s),g=r.add(new Ry(u[u.length-1].positionLineNumber,this._widget,d.flatMap(f=>f.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const g=r.add(new Ry(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}r.add(ue(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}class Ry extends A{static{this.counter=0}getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${Ry.counter++}`,this._domNode=Qe("div.revertButton",{title:this._revertSelection?m(135,"Revert Selected Changes"):m(136,"Revert Change")},[Ba(G.arrowRight)]).root,this._register(W(this._domNode,ee.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register(W(this._domNode,ee.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register(W(this._domNode,ee.CLICK,s=>{this._diffs instanceof ls?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Aa.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}var zme=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},B_=function(o,e){return function(t,i){e(t,i,o)}};let Pl=class extends eF{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,s,r,a,l){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._codeEditorService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Qe("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Qe("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Qe("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Qe("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(gO(this,void 0)),this._diffModel=$(this,v=>this._diffModelSrc.read(v)?.object),this.onDidChangeModel=te.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new f_([Ie,this._contextKeyService]))),this._boundarySashes=De(this,void 0),this._accessibleDiffViewerShouldBeVisible=De(this,!1),this._accessibleDiffViewerVisible=$(this,v=>this._options.onlyShowAccessibleDiffViewer.read(v)?!0:this._accessibleDiffViewerShouldBeVisible.read(v)),this._movedBlocksLinesPart=De(this,void 0),this._layoutInfo=$(this,v=>{const S=this._rootSizeObserver.width.read(v),x=this._rootSizeObserver.height.read(v);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=x+"px";const k=this._sash.read(v),D=this._gutter.read(v),I=D?.width.read(v)??0,T=this._overviewRulerPart.read(v)?.width??0;let F,O,B,U,K;if(!!k){const X=k.sashLeft.read(v),ne=this._movedBlocksLinesPart.read(v)?.width.read(v)??0;F=0,O=X-I-ne,K=X-I,B=X,U=S-B-T}else{K=0;const X=this._options.inlineViewHideOriginalLineNumbers.read(v);F=I,X?O=0:O=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(v)),B=I+O,U=S-B-T}return this.elements.original.style.left=F+"px",this.elements.original.style.width=O+"px",this._editors.original.layout({width:O,height:x},!0),D?.layout(K),this.elements.modified.style.left=B+"px",this.elements.modified.style.width=U+"px",this._editors.modified.layout({width:U,height:x},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((v,S)=>v?.diff.read(S)),this.onDidUpdateDiff=te.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(ue(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new zj(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(TT,t),this._register(xe(v=>{this._options.setWidth(this._rootSizeObserver.width.read(v))})),this._contextKeyService.createKey(N.isEmbeddedDiffEditor.key,!1),this._register(tl(N.isEmbeddedDiffEditor,this._contextKeyService,v=>this._options.isInEmbeddedEditor.read(v))),this._register(tl(N.comparingMovedCode,this._contextKeyService,v=>!!this._diffModel.read(v)?.movedTextToCompare.read(v))),this._register(tl(N.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,v=>this._options.couldShowInlineViewBecauseOfSize.read(v))),this._register(tl(N.diffEditorInlineMode,this._contextKeyService,v=>!this._options.renderSideBySide.read(v))),this._register(tl(N.hasChanges,this._contextKeyService,v=>(this._diffModel.read(v)?.diff.read(v)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(NT,this.elements.original,this.elements.modified,this._options,i,(v,S,x,k)=>this._createInnerEditor(v,S,x,k))),this._register(tl(N.diffEditorOriginalWritable,this._contextKeyService,v=>this._options.originalEditable.read(v))),this._register(tl(N.diffEditorModifiedWritable,this._contextKeyService,v=>!this._options.readOnly.read(v))),this._register(tl(N.diffEditorOriginalUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.original.uri.toString()??"")),this._register(tl(N.diffEditorModifiedUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.modified.uri.toString()??"")),this._overviewRulerPart=sr(this,v=>this._options.renderOverviewRuler.read(v)?this._instantiationService.createInstance(ac(gv),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((v,S)=>v-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new nme(this._options,c),this._sash=sr(this,v=>{const S=this._options.renderSideBySide.read(v);return this.elements.root.classList.toggle("side-by-side",S),S?new Qj(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=sr(this,v=>this._instantiationService.createInstance(ac(Ty),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);sr(this,v=>this._instantiationService.createInstance(ac(Gpe),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let g=!1;const f=sr(this,v=>this._instantiationService.createInstance(ac(ET),pe(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.read(void 0).isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=$(this,v=>{const S=f.read(v).viewZones.read(v).orig,x=d.read(v).viewZones.read(v).origViewZones;return S.concat(x)}),_=$(this,v=>{const S=f.read(v).viewZones.read(v).mod,x=d.read(v).viewZones.read(v).modViewZones;return S.concat(x)});this._register(vy(this._editors.original,p,v=>{g=v},h));let b;this._register(vy(this._editors.modified,_,v=>{g=v,g?b=Wa.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=sr(this,v=>this._instantiationService.createInstance(ac(Yu),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,x)=>this._accessibleDiffViewerShouldBeVisible.set(S,x),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,x)=>S?.diff.read(x)?.mappings.map(k=>k.lineRangeMapping)),new Rpe(this._editors))).recomputeInitiallyAndOnChange(this._store);const C=this._accessibleDiffViewerVisible.map(v=>v?"hidden":"visible");this._register(Ih(this.elements.modified,{visibility:C})),this._register(Ih(this.elements.original,{visibility:C})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(ue(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=sr(this,v=>this._options.shouldRenderGutterMenu.read(v)?this._instantiationService.createInstance(ac(WT),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(fm(this._layoutInfo)),sr(this,v=>new(ac(gg))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,v=>{this._movedBlocksLinesPart.set(v,void 0)}),this._register(te.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!0))),this._register(te.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!1)));const w=this._diffModel.map(this,(v,S)=>{if(v)return v.diff.read(S)===void 0&&!v.isDiffUpToDate.read(S)});this._register(Xn((v,S)=>{if(w.read(v)===!0){const x=this._editorProgressService.show(!0,1e3);S.add(ue(()=>x.done()))}})),this._register(Xn((v,S)=>{S.add(new(ac(Vme))(this._editors,this._diffModel,this._options,this))})),this._register(Xn((v,S)=>{const x=this._diffModel.read(v);if(x)for(const k of[x.model.original,x.model.modified])S.add(k.onWillDispose(D=>{Ee(new Ce("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(xe(v=>{this._options.setModel(this._diffModel.read(v))}))}_createInnerEditor(e,t,i,n){return e.createInstance(Pg,t,i,n)}_createDiffEditorContributions(){const e=Ep.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Ee(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return xw.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(IT,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?wy.create(e).createNewRef(this):wy.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&gm(t,n=>{const s=e?.object;dt.batchEventsGlobally(n,()=>{this._editors.original.setModel(s?s.model.original:null),this._editors.modified.setModel(s?s.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?Ume(e):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(t=>t.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const n=i.getPosition().lineNumber,s=i.getSelection(),r=be.fromRange(s||new L(n,0,n,0)),a=t.filter(l=>l.lineRangeMapping.modified.intersect(r));i.pushUndoStop(),i.executeEdits("diffEditor",a.map(l=>({range:l.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(l.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new R(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let n;e==="next"?this._editors.modified.getModel().getLineCount()===i?n=t[0]:n=t.find(r=>r.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=$C(t,s=>s.lineRangeMapping.modified.startLineNumber{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const s=t.getSelection();if(s){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=E9(s.getStartPosition(),r),l=E9(s.getEndPosition(),r);n=L.plusRange(a,l)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Et(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Et(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===3){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ze.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ze.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Ze.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Pl=zme([B_(3,Ie),B_(4,fe),B_(5,et),B_(6,dd),B_(7,id)],Pl);function Ume(o){return o.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,s,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,r=0,a=void 0):(s=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,modifiedEndLineNumber:r,charChanges:a?.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}class $me extends pn{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:H(85,"Toggle Collapse Unchanged Regions"),icon:G.map,toggled:q.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:q.has("isInDiffEditor"),menu:{when:q.has("isInDiffEditor"),id:M.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Pe),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class dq extends pn{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:H(86,"Toggle Show Moved Code Blocks"),precondition:q.has("isInDiffEditor")})}run(e,...t){const i=e.get(Pe),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class hq extends pn{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:H(87,"Toggle Use Inline View When Space Is Limited"),precondition:q.has("isInDiffEditor")})}run(e,...t){const i=e.get(Pe),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const Pw=H(88,"Diff Editor");class jme extends sa{constructor(){super({id:"diffEditor.switchSide",title:H(89,"Switch Side"),icon:G.arrowSwap,precondition:q.has("isInDiffEditor"),f1:!0,category:Pw})}runEditorCommand(e,t,i){const n=ff(e);if(n instanceof Pl){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class qme extends sa{constructor(){super({id:"diffEditor.exitCompareMove",title:H(90,"Exit Compare Move"),icon:G.close,precondition:N.comparingMovedCode,f1:!1,category:Pw,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=ff(e);n instanceof Pl&&n.exitCompareMove()}}class Kme extends sa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:H(91,"Collapse All Unchanged Regions"),icon:G.fold,precondition:q.has("isInDiffEditor"),f1:!0,category:Pw})}runEditorCommand(e,t,...i){const n=ff(e);n instanceof Pl&&n.collapseAllUnchangedRegions()}}class Gme extends sa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:H(92,"Show All Unchanged Regions"),icon:G.unfold,precondition:q.has("isInDiffEditor"),f1:!0,category:Pw})}runEditorCommand(e,t,...i){const n=ff(e);n instanceof Pl&&n.showAllUnchangedRegions()}}class VT extends pn{constructor(){super({id:"diffEditor.revert",title:H(93,"Revert"),f1:!0,category:Pw,precondition:q.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=ff(e);t instanceof Pl&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=Zme(e,t.originalUri,t.modifiedUri);i instanceof Pl&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const uq=H(94,"Accessible Diff Viewer");class Aw extends pn{static{this.id="editor.action.accessibleDiffViewer.next"}constructor(){super({id:Aw.id,title:H(95,"Go to Next Difference"),category:uq,precondition:q.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){ff(e)?.accessibleDiffViewerNext()}}class pk extends pn{static{this.id="editor.action.accessibleDiffViewer.prev"}constructor(){super({id:pk.id,title:H(96,"Go to Previous Difference"),category:uq,precondition:q.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){ff(e)?.accessibleDiffViewerPrev()}}function Zme(o,e,t){return o.get(et).listDiffEditors().find(s=>{const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function ff(o){const t=o.get(et).listDiffEditors(),i=ji();if(i){for(const n of t)if(n.getContainerDomNode().contains(i))return n}return null}bt($me);bt(dq);bt(hq);un.appendMenuItem(M.EditorTitle,{command:{id:new hq().desc.id,title:m(119,"Use Inline View When Space Is Limited"),toggled:q.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:q.has("isInDiffEditor")},order:11,group:"1_diff",when:q.and(N.diffEditorRenderSideBySideInlineBreakpointReached,q.has("isInDiffEditor"))});un.appendMenuItem(M.EditorTitle,{command:{id:new dq().desc.id,title:m(120,"Show Moved Code Blocks"),icon:G.move,toggled:i_.create("config.diffEditor.experimental.showMoves",!0),precondition:q.has("isInDiffEditor")},order:10,group:"1_diff",when:q.has("isInDiffEditor")});bt(VT);for(const o of[{icon:G.arrowRight,key:N.diffEditorInlineMode.toNegated()},{icon:G.discard,key:N.diffEditorInlineMode}])un.appendMenuItem(M.DiffEditorHunkToolbar,{command:{id:new VT().desc.id,title:m(121,"Revert Block"),icon:o.icon},when:q.and(N.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),un.appendMenuItem(M.DiffEditorSelectionToolbar,{command:{id:new VT().desc.id,title:m(122,"Revert Selection"),icon:o.icon},when:q.and(N.diffEditorModifiedWritable,o.key),order:5,group:"primary"});bt(jme);bt(qme);bt(Kme);bt(Gme);un.appendMenuItem(M.EditorTitle,{command:{id:Aw.id,title:m(123,"Open Accessible Diff Viewer"),precondition:q.has("isInDiffEditor")},order:10,group:"2_diff",when:q.and(N.accessibleDiffViewerVisible.negate(),q.has("isInDiffEditor"))});Ye.registerCommandAlias("editor.action.diffReview.next",Aw.id);bt(Aw);Ye.registerCommandAlias("editor.action.diffReview.prev",pk.id);bt(pk);var Yme=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Xme=function(o,e){return function(t,i){e(t,i,o)}},zT;const mk=new oe("selectionAnchorSet",!1);let Nh=class{static{zT=this}static{this.ID="editor.contrib.selectionAnchorController"}static get(e){return e.getContribution(zT.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=mk.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(ae.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Kn().appendText(m(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Is(m(799,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(ae.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Nh=zT=Yme([Xme(1,Ie)],Nh);class Qme extends le{constructor(){super({id:"editor.action.setSelectionAnchor",label:H(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2080),weight:100}})}async run(e,t){Nh.get(t)?.setSelectionAnchor()}}class Jme extends le{constructor(){super({id:"editor.action.goToSelectionAnchor",label:H(801,"Go to Selection Anchor"),precondition:mk})}async run(e,t){Nh.get(t)?.goToSelectionAnchor()}}class e_e extends le{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:H(802,"Select from Anchor to Cursor"),precondition:mk,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2089),weight:100}})}async run(e,t){Nh.get(t)?.selectFromAnchorToCursor()}}class t_e extends le{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:H(803,"Cancel Selection Anchor"),precondition:mk,kbOpts:{kbExpr:N.editorTextFocus,primary:9,weight:100}})}async run(e,t){Nh.get(t)?.cancelSelectionAnchor()}}Xe(Nh.ID,Nh,4);se(Qme);se(Jme);se(e_e);se(t_e);const i_e=E("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m(804,"Overview ruler marker color for matching brackets."));class n_e extends le{constructor(){super({id:"editor.action.jumpToBracket",label:H(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:3165,weight:100}})}run(e,t){$c.get(t)?.jumpToBracket()}}class s_e extends le{constructor(){super({id:"editor.action.selectToBracket",label:H(807,"Select to Bracket"),precondition:void 0,metadata:{description:H(808,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),$c.get(t)?.selectToBracket(n)}}class o_e extends le{constructor(){super({id:"editor.action.removeBrackets",label:H(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){$c.get(t)?.removeBrackets(this.id)}}class r_e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class $c extends A{static{this.ID="editor.contrib.bracketMatchingController"}static get(e){return e.getContribution($c.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new St(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ae(r.lineNumber,r.column,r.lineNumber,r.column):new ae(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const c=t.bracketPairs.findNextBracket(s);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(L.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new ae(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Te.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:hi(i_e),position:jo.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Te.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h1&&s.sort(R.compare);const a=[];let l=0,c=0;const d=n.length;for(let h=0,u=s.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}se(d_e);const h_e=We("productService");function rF(o,e){return{id:e,asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function u_e(o,e,t,i){const n={id:cf(),name:o,uri:e,data:t};return{id:i,asString:async()=>"",asFile:()=>n,value:void 0}}class fq{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Ke.some(this,([i,n])=>n.asFile())&&t.push("files"),pq(My(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return My(e)}}function My(o){return o.toLowerCase()}function eB(o,e){return pq(My(o),e.map(My))}function pq(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const _k=Object.freeze({create:o=>Xc(o.map(e=>e.toString())).join(`\r `),split:o=>o.split(`\r -`),parse:o=>uk.split(o).filter(e=>!e.startsWith("#"))});class jt{static{this.sep="."}static{this.None=new jt("@@none@@")}static{this.Empty=new jt("")}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+jt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new jt((this.value?[this.value,...e]:e).join(jt.sep))}}const NCe={ctrlCmd:!1,alt:!1};var ew;(function(o){o[o.Blur=1]="Blur",o[o.Gesture=2]="Gesture",o[o.Other=3]="Other"})(ew||(ew={}));var Ma;(function(o){o[o.NONE=0]="NONE",o[o.FIRST=1]="FIRST",o[o.SECOND=2]="SECOND",o[o.LAST=3]="LAST"})(Ma||(Ma={}));var zt;(function(o){o[o.First=1]="First",o[o.Second=2]="Second",o[o.Last=3]="Last",o[o.Next=4]="Next",o[o.Previous=5]="Previous",o[o.NextPage=6]="NextPage",o[o.PreviousPage=7]="PreviousPage",o[o.NextSeparator=8]="NextSeparator",o[o.PreviousSeparator=9]="PreviousSeparator"})(zt||(zt={}));var EL;(function(o){o[o.Title=1]="Title",o[o.Inline=2]="Inline",o[o.Input=3]="Input"})(EL||(EL={}));const as=Ve("quickInputService"),H8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class TCe{}const RCe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};fi.add(RCe.DragAndDropContribution,new TCe);class NL{static{this.INSTANCE=new NL}constructor(){}static getInstance(){return NL.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}function rG(o){if(Za&&typeof globalThis.vscode?.webUtils?.getPathForFile=="function")return globalThis.vscode?.webUtils?.getPathForFile(o)}function aG(o){const e=new sG;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,b5(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,MCe(n))}}return e}function MCe(o){const e=rG(o),t=e?be.parse(e):void 0;return ECe(o.name,t,async()=>new Uint8Array(await o.arrayBuffer()))}const PCe=Object.freeze([H8.EDITORS,H8.FILES,of.RESOURCES,of.INTERNAL_URI_LIST]);function lG(o,e=!1){const t=aG(o),i=t.get(of.INTERNAL_URI_LIST);if(i)t.replace(Di.uriList,i);else if(e||!t.has(Di.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=rG(r);try{a?n.push(be.file(a).toString()):n.push(be.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Di.uriList,b5(uk.create(n)))}for(const n of PCe)t.delete(n);return t}const v1=Ve("IWorkspaceEditService");class C5{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ah.is(t))return Ah.lift(t);if(Cm.is(t))return Cm.lift(t);throw new Error("Unsupported edit")})}}class Ah extends C5{static is(e){return e instanceof Ah?!0:Xi(e)&&be.isUri(e.resource)&&Xi(e.textEdit)}static lift(e){return e instanceof Ah?e:new Ah(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class Cm extends C5{static is(e){return e instanceof Cm?!0:Xi(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Cm?e:new Cm(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const v5=Ve("IEditorCancelService"),cG=new re("cancellableOperation",!1,m(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Ge(v5,class{constructor(){this._tokens=new WeakMap}add(o,e){let t=this._tokens.get(o);t||(t=o.invokeWithinContext(n=>{const s=cG.bindTo(n.get(Ne)),r=new bs;return{key:s,tokens:r}}),this._tokens.set(o,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(o){const e=this._tokens.get(o);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class ACe extends Jt{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(v5).add(e,this))}dispose(){this._unregister(),super.dispose()}}ae(new class extends tn{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:cG})}runEditorCommand(o,e){o.get(v5).cancel(e)}});let dG=class tM{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?Gg("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof tM))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new tM(e,this.flags))}};class Ld extends ACe{constructor(e,t,i,n){super(e,n),this._listener=new z,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!D.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!D.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class w5 extends Jt{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}var OCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},FCe=function(o,e){return function(t,i){e(t,i,o)}};const WCe=Me.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:DU,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class S5 extends F{static{this.baseId="editor.widget.inlineProgressWidget"}constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ee(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ee("span.icon");this.domNode.append(t),t.classList.add(...ye.asClassNameArray(Z.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(75);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(61)||n.hasChanged(75))&&i()})),this._register(B(this.domNode,te.CLICK,n=>{this.delegate.cancel()}))}getId(){return S5.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}let TL=class extends F{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new _t),this._currentWidget=this._register(new _t),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=pd(()=>{const a=D.fromPositions(e);this._currentDecorations.set([{range:a,options:WCe}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(S5,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};TL=OCe([FCe(2,pe)],TL);const Pd=Ve("openerService");function BCe(o,e){return o.with({fragment:`${e.startLineNumber},${e.startColumn}${e.endLineNumber?`-${e.endLineNumber}${e.endColumn?`,${e.endColumn}`:""}`:""}`})}function HCe(o){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(o.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},o=o.with({fragment:""})),{selection:e,uri:o}}var VCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zCe=function(o,e){return function(t,i){e(t,i,o)}};const Sa=Ve("markdownRendererService");let iM=class{constructor(e){this._openerService=e}render(e,t,i){const n={...t};n.actionHandler||(n.actionHandler=(r,a)=>hG(this._openerService,r,a.isTrusted)),n.codeBlockRenderer||(n.codeBlockRenderer=(r,a)=>this._defaultCodeBlockRenderer?.renderCodeBlock(r,a,n??{})??Promise.resolve(document.createElement("span")));const s=u1(e,n,i);return s.element.classList.add("rendered-markdown"),s}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}};iM=VCe([zCe(0,Pd)],iM);async function hG(o,e,t,i){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:UCe(t),skipValidation:i})}catch(n){return Te(n),!1}}function UCe(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}Ge(Sa,iM,1);var $Ce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},V8=function(o,e){return function(t,i){e(t,i,o)}},z0;let Do=class{static{z0=this}static{this.ID="editor.contrib.messageController"}static{this.MESSAGE_VISIBLE=new re("messageVisible",!1,m(1287,"Whether the editor is currently showing an inline message"))}static get(e){return e.getContribution(z0.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new _t,this._messageListeners=new z,this._mouseOverMessage=!1,this._editor=e,this._visible=z0.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Ws(ld(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),ld(e)){const n=this._messageListeners.add(u1(e,{actionHandler:(s,r)=>{this.closeMessage(),hG(this._openerService,s,r.isTrusted)}}));this._messageWidget.value=new AE(this._editor,t,n.element)}else this._messageWidget.value=new AE(this._editor,t,e);this._messageListeners.add(se.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&un(Ji(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(B(this._messageWidget.value.getDomNode(),te.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(B(this._messageWidget.value.getDomNode(),te.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new D(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(AE.fadeOut(this._messageWidget.value))}};Do=z0=$Ce([V8(1,Ne),V8(2,Pd)],Do);const jCe=tn.bindToContribution(Do.get);ae(new jCe({id:"leaveEditorMessage",precondition:Do.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let AE=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};nt(Do.ID,Do,4);class qCe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new vm(new ZCe(e,t))}static forStrings(){return new vm(new qCe)}static forConfigKeys(){return new vm(new KCe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new LS,this._root.segment=i.value());const s=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new LS,n.left.segment=i.value()),s.push([-1,n]),n=n.left;else if(a<0)n.right||(n.right=new LS,n.right.segment=i.value()),s.push([1,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new LS,n.mid.segment=i.value()),s.push([0,n]),n=n.mid;else break}const r=yl.unwrap(n.value);n.value=yl.wrap(t),n.key=e;for(let a=s.length-1;a>=0;a--){const l=s[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=s[a][0],h=s[a+1][0];if(d===1&&h===1)s[a][1]=l.rotateLeft();else if(d===-1&&h===-1)s[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=s[a+1][1]=s[a+1][1].rotateRight(),s[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=s[a+1][1]=s[a+1][1].rotateLeft(),s[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(s[a-1][0]){case-1:s[a-1][1].left=s[a][1];break;case 1:s[a-1][1].right=s[a][1];break;case 0:s[a-1][1].mid=s[a][1];break}else this._root=s[0][1]}}return r}get(e){return yl.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let s=this._root;for(;s;){const r=i.cmp(s.segment);if(r>0)n.push([-1,s]),s=s.left;else if(r<0)n.push([1,s]),s=s.right;else if(i.hasNext())i.next(),n.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const r=[[1,s]],a=this._min(s.right,r);if(a.key){s.key=a.key,s.value=a.value,s.segment=a.segment;const l=a.right;if(r.length>1){const[d,h]=r[r.length-1];switch(d){case-1:h.left=l;break;case 0:nv(!1);case 1:nv(!1)}}else s.right=l;const c=this._balanceByStack(r);if(n.length>0){const[d,h]=n[n.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const r=s.left??s.right;if(n.length>0){const[a,l]=n[n.length-1];switch(a){case-1:l.left=r;break;case 0:l.mid=r;break;case 1:l.right=r;break}}else this._root=r}this._root=this._balanceByStack(n)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const n=i.balanceFactor();if(n>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):n<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),n=yl.unwrap(i.value)||n,i=i.mid;else break}return i&&yl.unwrap(i.value)||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const s=i.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?yl.unwrap(n.value):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,yl.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const xd=Ve("contextService");function nM(o){const e=o;return typeof e?.id=="string"&&be.isUri(e.uri)}function YCe(o){return typeof o?.id=="string"&&!nM(o)&&!JCe(o)}const XCe={id:"empty-window"};function QCe(o,e){if(typeof o=="string"||typeof o>"u")return typeof o=="string"?{id:sd(o)}:XCe;const t=o;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function JCe(o){const e=o;return typeof e?.id=="string"&&be.isUri(e.configPath)}class eve{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const sM="code-workspace";m(2050,"Code Workspace");const uG="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function tve(o){return o.id===uG}var y5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tw=function(o,e){return function(t,i){e(t,i,o)}};class L5{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}class cf extends L5{static{this.id="text"}constructor(){super(jt.Empty.append("text","plain")),this.id=cf.id,this.dropMimeTypes=[Di.text],this.pasteMimeTypes=[Di.text]}async getEdit(e,t){const i=e.get(Di.text);if(!i||e.has(Di.uriList))return;const n=await i.asString();return{handledMimeType:Di.text,title:m(926,"Insert Plain Text"),insertText:n,kind:this.kind}}}class gG extends L5{constructor(){super(jt.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Di.uriList],this.pasteMimeTypes=[Di.uriList]}async getEdit(e,t){const i=await fG(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===Ie.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?m(927,"Insert Uris"):m(928,"Insert Uri"):r=i.length>1?m(929,"Insert Paths"):m(930,"Insert Path"),{handledMimeType:Di.uriList,insertText:s,title:r,kind:this.kind}}}let RL=class extends L5{constructor(e){super(jt.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Di.uriList],this.pasteMimeTypes=[Di.uriList]}async getEdit(e,t){const i=await fG(e);if(!i.length||t.isCancellationRequested)return;const n=ol(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?jie(r.uri,s):void 0}));if(n.length)return{handledMimeType:Di.uriList,insertText:n.join(" "),title:i.length>1?m(931,"Insert Relative Paths"):m(932,"Insert Relative Path"),kind:this.kind}}};RL=y5([tw(0,xd)],RL);class ive{constructor(){this.kind=new jt("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Di.text}]}async provideDocumentPasteEdits(e,t,i,n,s){if(n.triggerKind!==Rv.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:m(933,"Insert HTML"),kind:this.kind}]}}}async function fG(o){const e=o.get(Di.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of uk.parse(t))try{i.push({uri:be.parse(n),originalText:n})}catch{}return i}const vg={scheme:"*",hasAccessToAllModels:!0};let oM=class extends F{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(vg,new cf)),this._register(e.documentDropEditProvider.register(vg,new gG)),this._register(e.documentDropEditProvider.register(vg,new RL(t)))}};oM=y5([tw(0,ue),tw(1,xd)],oM);let rM=class extends F{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(vg,new cf)),this._register(e.documentPasteEditProvider.register(vg,new gG)),this._register(e.documentPasteEditProvider.register(vg,new RL(t))),this._register(e.documentPasteEditProvider.register(vg,new ive))}};rM=y5([tw(0,ue),tw(1,xd)],rM);class Ia{constructor(){this.value="",this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Ia._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Ia.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ia.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Ia.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Ia.isVariableCharacter(i)||Ia.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ia._table[i]>"u"&&!Ia.isDigitCharacter(i)&&!Ia.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}class K_{constructor(){this._children=[]}appendChild(e){return e instanceof Os&&this._children[this._children.length-1]instanceof Os?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,l){for(const c of a)c.parent=l,r(c.children,c)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof w1)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Os extends K_{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Os(this.value)}}class pG extends K_{}class wr extends pG{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof G_?this._children[0]:void 0}clone(){const e=new wr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class G_ extends K_{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Os&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new G_;return this.options.forEach(e.appendChild,e),e}}class x5 extends K_{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Pa&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Pa){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new x5;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Pa extends K_{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Pa(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class iw extends pG{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Os(t)],!0):!1}clone(){const e=new iw(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function z8(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class w1 extends K_{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof wr&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return z8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof wr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof iw&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new w1;return this._children=this.children.map(t=>t.clone()),e}walk(e){z8(this.children,e)}}class df{constructor(){this._scanner=new Ia,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new w1;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(l=>(l instanceof wr&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):s.push(l)),!0));const r=(l,c)=>{const d=n.get(l.index);if(!d)return;const h=new wr(l.index);h.transform=l.transform;for(const u of d){const g=u.clone();h.appendChild(g),g instanceof wr&&n.has(g.index)&&!c.has(g.index)&&(c.add(g.index),r(g,c),c.delete(g.index))}t.replace(l,[h])},a=new Set;for(const l of s)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new wr(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Os(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new wr(Number(t)):new iw(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new wr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Os("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new G_;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Os(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new iw(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new Os("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new x5;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new Os(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Pa(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Pa(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Pa(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Pa(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Pa(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new Pa(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Pa(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Os(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function mG(o,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new Ah(o,{range:i,text:typeof t.insertText=="string"?df.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function _G(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const l of o)if(l!==r&&e(a,l)){let c=t.get(r);c||(c=[],t.set(r,c)),c.push(l)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let l=[];const c=t.get(a);return c&&(n.push(a),l=s(c),n.pop()),i.add(a),[...l,a,...s(r.slice(1))]}return s(Array.from(o))}V.white.toString(),V.white.toString();const nve=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class ML extends F{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new P),this._onDidEscape=this._register(new P),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(ni.addTarget(this._element)),[te.CLICK,Bt.Tap].forEach(s=>{this._register(B(this._element,s,r=>{if(!this.enabled){ct.stop(r);return}this._onDidClick.fire(r)}))}),this._register(B(this._element,te.KEY_DOWN,s=>{const r=new Et(s);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(s),a=!0):r.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&ct.stop(r,!0)})),this._register(B(this._element,te.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(B(this._element,te.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(Wr(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Mh(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||ld(this._label)&&ld(e)&&dpe(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ld(e)){const n=u1(e,void 0,document.createElement("span"));n.dispose();const s=n.element.querySelector("p")?.innerHTML;s?vK(t,s,nve):gn(t)}else this.options.supportIcons?gn(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=Nme(e)),this.setTitle(i),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):typeof this.options.title=="string"&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter(i=>i.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...ye.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(va().setupManagedHover(this.options.hoverDelegate??oc("element"),this._element,e)):this._hover&&this._hover.update(e)}}function OE(o,e){return e&&(o.stack||o.stacktrace)?m(29,"{0}: {1}",$8(o),U8(o.stack)||U8(o.stacktrace)):$8(o)}function U8(o){return Array.isArray(o)?o.join(` -`):o}function $8(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m(30,"A system error occurred ({0})",o.message):o.message||m(31,"An unknown error occurred. Please consult the log for more details.")}function PL(o=null,e=!1){if(!o)return m(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=ol(o),i=PL(t[0],e);return t.length>1?m(33,"{0} ({1} errors in total)",i,t.length):i}if(hn(o))return o;if(o.detail){const t=o.detail;if(t.error)return OE(t.error,e);if(t.exception)return OE(t.exception,e)}return o.stack?OE(o,e):o.message?o.message:m(34,"An unknown error occurred. Please consult the log for more details.")}const xS=ee,sve={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class Z_ extends F{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=Y(e,xS(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(va().setupManagedHover(oc("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(e,t){this.didEverRender&&this.keybinding===e&&Z_.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let i=1;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U0=function(o,e){return function(t,i){e(t,i,o)}};const CG="acceptSelectedCodeAction",vG="previewSelectedCodeAction";class ove{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}}class rve{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let aM=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");n.className="description",e.append(n);const s=new Z_(e,wo);return{container:e,icon:t,text:i,description:n,keybinding:s}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=ye.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=J(e.group.icon.color.id))):(i.icon.className=ye.asClassName(Z.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;oie(!e.hideIcon,i.icon),i.text.textContent=AL(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=AL(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const n=this._keybindingService.lookupKeybinding(CG)?.getLabel(),s=this._keybindingService.lookupKeybinding(vG)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:n&&s?this._supportsPreview&&e.canPreview?i.container.title=m(1653,"{0} to Apply, {1} to Preview",n,s):i.container.title=m(1654,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};aM=bG([U0(1,dt)],aM);class ave extends UIEvent{constructor(){super("acceptSelectedAction")}}class j8 extends UIEvent{constructor(){super("previewSelectedAction")}}function lve(o){if(o.kind==="action")return o.label}let lM=class extends F{constructor(e,t,i,n,s,r,a,l){super(),this._delegate=n,this._contextViewService=r,this._keybindingService=a,this._layoutService=l,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new Jt),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const c={getHeight:d=>{switch(d.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:d=>d.kind};this._list=this._register(new ur(e,this.domNode,c,[new aM(t,this._keybindingService),new ove,new rve],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:lve},accessibilityProvider:{getAriaLabel:d=>{if(d.kind==="action"){let h=d.label?AL(d?.label):"";return d.description&&(h=h+", "+AL(d.description)),d.disabled&&(h=m(1655,"{0}, Disabled Reason: {1}",h,d.disabled)),h}return null},getWidgetAriaLabel:()=>m(1656,"Action Widget"),getRole:d=>{switch(d.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...s}})),this._list.style(q_),this._register(this._list.onMouseClick(d=>this.onListClick(d))),this._register(this._list.onMouseOver(d=>this.onListHover(d))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(d=>this.onListSelection(d))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(d=>d.kind==="header").length,i=this._allMenuItems.filter(d=>d.kind==="separator").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(r);let a=e;if(this._allMenuItems.length>=50)a=380;else{const d=this._allMenuItems.map((h,u)=>{const g=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(g){g.style.width="auto";const f=g.getBoundingClientRect().width;return g.style.width="",f}return 0});a=Math.max(...d,e)}const c=Math.min(r,this._layoutService.getContainer(me(this.domNode)).clientHeight*.7);return this._list.layout(c,a),this.domNode.style.height=`${c}px`,this._list.domFocus(),a}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new j8:new ave;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof j8):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};lM=bG([U0(5,Md),U0(6,dt),U0(7,rc)],lM);function AL(o){return o.replace(/\r\n|\r|\n/g," ")}var cve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},FE=function(o,e){return function(t,i){e(t,i,o)}};E("actionBar.toggledBackground",H_,m(1657,"Background color for toggled action items in action bar."));const hf={Visible:new re("codeActionMenuVisible",!1,m(1658,"Whether the action widget list is visible"))},cu=Ve("actionWidgetService");let uf=class extends F{get isVisible(){return hf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new _t)}show(e,t,i,n,s,r,a,l){const c=hf.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(lM,e,t,i,n,l);this._contextViewService.showContextView({getAnchor:()=>s,render:h=>(c.set(!0),this._renderWidget(h,d,a??[])),onHide:h=>{c.reset(),this._onWidgetClosed(h)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),s.add(B(a,te.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),s.add(B(c,te.POINTER_MOVE,()=>c.remove())),s.add(B(c,te.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(n.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=s.add(Wr(e));return s.add(u.onDidBlur(()=>this.hide(!0))),s}_createActionBar(e,t){if(!t.length)return;const i=ee(e),n=new no(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};uf=cve([FE(0,Md),FE(1,Ne),FE(2,pe)],uf);Ge(cu,uf,1);const S1=1100;Lt(class extends yn{constructor(){super({id:"hideCodeActionWidget",title:H(1659,"Hide action widget"),precondition:hf.Visible,keybinding:{weight:S1,primary:9,secondary:[1033]}})}run(o){o.get(cu).hide(!0)}});Lt(class extends yn{constructor(){super({id:"selectPrevCodeAction",title:H(1660,"Select previous action"),precondition:hf.Visible,keybinding:{weight:S1,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(cu);e instanceof uf&&e.focusPrevious()}});Lt(class extends yn{constructor(){super({id:"selectNextCodeAction",title:H(1661,"Select next action"),precondition:hf.Visible,keybinding:{weight:S1,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(cu);e instanceof uf&&e.focusNext()}});Lt(class extends yn{constructor(){super({id:CG,title:H(1662,"Accept selected action"),precondition:hf.Visible,keybinding:{weight:S1,primary:3,secondary:[2137]}})}run(o){const e=o.get(cu);e instanceof uf&&e.acceptSelected()}});Lt(class extends yn{constructor(){super({id:vG,title:H(1663,"Preview selected action"),precondition:hf.Visible,keybinding:{weight:S1,primary:2051}})}run(o){const e=o.get(cu);e instanceof uf&&e.acceptSelected(!0)}});var wG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wm=function(o,e){return function(t,i){e(t,i,o)}},cM;let dM=class extends F{static{cM=this}static{this.baseId="editor.widget.postEditWidget"}constructor(e,t,i,n,s,r,a,l,c,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this.additionalActions=l,this._keybindingService=d,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(ge(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ge((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(u=>{this.dispose()})),this._register(se.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ee(".post-edit-widget"),this.button=this._register(new ML(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(B(this.domNode,te.CLICK,()=>this.showSelector()))}getId(){return cM.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=wi(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,n)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:ye.fromId(n===this.edits.activeEditIndex?Z.check.id:Z.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);const n=this.edits.allEdits.findIndex(s=>s===i);if(n!==this.edits.activeEditIndex)return this.onSelectNewEdit(n)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};dM=cM=wG([wm(8,Ne),wm(9,dt),wm(10,cu)],dM);let OL=class extends F{constructor(e,t,i,n,s,r,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._getAdditionalActions=s,this._instantiationService=r,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new _t),this._register(se.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){if(!e.length||!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async b=>{const C=this._editor.getModel();C&&(await C.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:b,allEdits:t.allEdits},i,n,s))},c=(b,C)=>{hr(b)||(this._notificationService.error(C),i&&this.show(e[0],t,l))},d=new Ld(this._editor,3,void 0,s);let h;try{h=await fee(n(a,d.token),d.token)}catch(b){return c(b,m(937,`Error resolving edit '{0}': -{1}`,a.title,PL(b)))}finally{d.dispose()}if(s.isCancellationRequested)return;const u=mG(r.uri,e,h),g=e[0],f=r.deltaDecorations([],[{range:g,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let p,_;try{p=await this._bulkEditService.apply(u,{editor:this._editor,token:s}),_=r.getDecorationRange(f[0])}catch(b){return c(b,m(938,`Error applying edit '{0}': -{1}`,a.title,PL(b)))}finally{r.deltaDecorations(f,[])}s.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(_??g,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dM,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};OL=wG([wm(5,pe),wm(6,v1),wm(7,Li)],OL);var dve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bc=function(o,e){return function(t,i){e(t,i,o)}},Xr;const SG="editor.changePasteType",hve="editor.pasteAs.preferences",D5=new re("pasteWidgetVisible",!1,m(917,"Whether the paste widget is showing")),WE="application/vnd.code.copymetadata";let Dd=class extends F{static{Xr=this}static{this.ID="editor.contrib.copyPasteActionController"}static get(e){return e.getContribution(Xr.ID)}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=s,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=c,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(B(h,"copy",u=>this.handleCopy(u))),this._register(B(h,"cut",u=>this.handleCopy(u))),this._register(B(h,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new TL("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(OL,"pasteIntoEditor",e,D5,{id:SG,label:m(918,"Show paste options...")},()=>Xr._configureDefaultAction?[Xr._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){let t=null;if(e.clipboardData){const[_,b]=Ng.getTextData(e.clipboardData);t=(b||Bl.INSTANCE.get(_))?.id||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",_.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled()))return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length)return;const s=this._editor.getOption(45);let r=n;const a=n.length===1&&n[0].isEmpty();if(a){if(!s)return;r=[new D(r[0].startLineNumber,1,r[0].startLineNumber,1+i.getLineLength(r[0].startLineNumber))]}const l=this._editor._getViewModel()?.getPlainTextToCopy(n,s,Rn),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const u=aG(e.clipboardData),g=h.flatMap(_=>_.copyMimeTypes??[]),f=t??Rf();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:g,defaultPastePayload:d});const p=h.map(_=>({providerMimeTypes:_.copyMimeTypes,operation:Qi(b=>_.prepareDocumentPaste(i,r,u,b).catch(C=>{console.error(C)}))}));Xr._currentCopyOperation?.operations.forEach(_=>_.operation.cancel()),Xr._currentCopyOperation={handle:f,operations:p}}async handlePaste(e){if(e.clipboardData){const[c,d]=Ng.getTextData(e.clipboardData),h=d||Bl.INSTANCE.get(c);this._logService.trace("CopyPasteController#handlePaste for id : ",h?.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;Do.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",n?.id," and text.length : ",e.clipboardData.getData("text/plain").length);const s=lG(e.clipboardData);s.delete(WE);const r=Array.from(e.clipboardData.files).map(c=>c.type),a=[...e.clipboardData.types,...r,...n?.providerCopyMimeTypes??[],Di.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const d=this._pasteAsActionContext?.preferred;return d&&!this.providerMatchesPreference(c,d)?!1:c.pasteMimeTypes?.some(h=>B8(h,a))});if(!l.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation());return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,l,i,s,n):this.doPasteInline(l,i,s,n,e)}showPasteAsNoEditMessage(e,t){const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(n=>n.value).join(", "):m(919,"empty"):t.providerId;Do.get(this._editor)?.showMessage(m(920,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,n,s){this._logService.trace("CopyPasteController#doPasteInline");const r=this._editor;if(!r.hasModel())return;const a=new Ld(r,3,void 0),l=Qi(async c=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new z,g=u.add(new Jt(c));u.add(a.token.onCancellationRequested(()=>g.cancel()));const f=g.token;try{if(await this.mergeInDataFromCopy(e,i,n,f),f.isCancellationRequested)return;const p=e.filter(C=>this.isSupportedPasteProvider(C,i));if(!p.length||p.length===1&&p[0]instanceof cf)return this.applyDefaultPasteHandler(i,n,f,s);const _={triggerKind:Rv.Automatic},b=await this.getPasteEdits(p,i,h,t,_,f);if(u.add(b),f.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof cf)return this.applyDefaultPasteHandler(i,n,f,s);if(b.edits.length){const C=d.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,b.edits),allEdits:b.edits},C,async(w,v)=>{if(!w.provider.resolveDocumentPasteEdit)return w;const S=w.provider.resolveDocumentPasteEdit(w,v),L=new xf,x=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(921,"Resolving paste edit for '{0}'. Click to cancel",w.title),Vm(Promise.race([L.p,S]),v),{cancel:()=>L.cancel()},0);return x&&(w.insertText=x.insertText,w.additionalEdit=x.additionalEdit),w},f)}await this.applyDefaultPasteHandler(i,n,f,s)}finally{u.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(922,"Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{l.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,n,a.token,s)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,n,s){this._logService.trace("CopyPasteController#showPasteAsPick");const r=Qi(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new z,h=d.add(new Ld(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,n,s,h.token),h.token.isCancellationRequested)return;let u=t.filter(b=>this.isSupportedPasteProvider(b,n,e));e&&(u=u.filter(b=>this.providerMatchesPreference(b,e)));const g={triggerKind:Rv.PasteAs,only:e&&"only"in e?e.only:void 0};let f=d.add(await this.getPasteEdits(u,n,c,i,g,h.token));if(h.token.isCancellationRequested)return;if(e&&(f={edits:f.edits.filter(b=>"only"in e?e.only.contains(b.kind):"preferences"in e?e.preferences.some(C=>C.contains(b.kind)):e.providerId===b.provider.id),dispose:f.dispose}),!f.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let p;if(e)p=f.edits.at(0);else{const b={id:"editor.pasteAs.default",label:m(923,"Configure default paste action"),edit:void 0},C=await this._quickInputService.pick([...f.edits.map(w=>({label:w.title,description:w.kind?.value,edit:w})),...Xr._configureDefaultAction?[{type:"separator"},{label:Xr._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:m(924,"Select Paste Action")});if(C===b){Xr._configureDefaultAction?.run();return}p=C?.edit}if(!p)return;const _=mG(c.uri,i,p);await this._bulkEditService.apply(_,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:m(925,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(WE,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(WE);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=Ng.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i,n){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&Xr._currentCopyOperation?.handle===i.id){const s=Xr._currentCopyOperation.operations.filter(a=>e.some(l=>l.pasteMimeTypes.some(c=>B8(c,a.providerMimeTypes)))).map(a=>a.operation),r=await Promise.all(s);if(n.isCancellationRequested)return;for(const a of r.reverse())if(a)for(const[l,c]of a)t.replace(l,c)}if(!t.has(Di.uriList)){const s=await this._clipboardService.readResources();if(n.isCancellationRequested)return;s.length&&t.append(Di.uriList,b5(uk.create(s)))}}async getPasteEdits(e,t,i,n,s,r){const a=new z,l=await Vm(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,s,r);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){hr(h)||console.error(h);return}})),r),c=ol(l??[]).flat().filter(d=>!s.only||s.only.contains(d.kind));return{edits:_G(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(Di.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t?.id),this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?t.preferences.some(i=>t.preferences.some(n=>n.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(hve,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new jt(n),r=t.findIndex(a=>s.contains(a.kind));if(r>=0)return r}return 0}};Dd=Xr=dve([bc(1,pe),bc(2,Ht),bc(3,v1),bc(4,Mo),bc(5,Vt),bc(6,Oe),bc(7,ue),bc(8,as),bc(9,Bq)],Dd);const gf="9_cutcopypaste",uve=Za||document.queryCommandSupported("cut"),yG=Za||document.queryCommandSupported("copy"),gve=typeof navigator.clipboard>"u"||so?document.queryCommandSupported("paste"):!0;function k5(o){return o.register(),o}const fve=uve?k5(new M_({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Za?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(813,"Cu&&t"),order:1},{menuId:M.EditorContext,group:gf,title:m(814,"Cut"),when:N.writable,order:1},{menuId:M.CommandPalette,group:"",title:m(815,"Cut"),order:1},{menuId:M.SimpleEditorContext,group:gf,title:m(816,"Cut"),when:N.writable,order:1}]})):void 0,pve=yG?k5(new M_({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Za?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(817,"&&Copy"),order:2},{menuId:M.EditorContext,group:gf,title:m(818,"Copy"),order:2},{menuId:M.CommandPalette,group:"",title:m(819,"Copy"),order:1},{menuId:M.SimpleEditorContext,group:gf,title:m(820,"Copy"),order:2}]})):void 0;vn.appendMenuItem(M.MenubarEditMenu,{submenu:M.MenubarCopy,title:H(825,"Copy As"),group:"2_ccp",order:3});vn.appendMenuItem(M.EditorContext,{submenu:M.EditorContextCopy,title:H(826,"Copy As"),group:gf,order:3});vn.appendMenuItem(M.EditorContext,{submenu:M.EditorContextShare,title:H(827,"Share"),group:"11_share",order:-1,when:K.and(K.notEquals("resourceScheme","output"),N.editorTextFocus)});vn.appendMenuItem(M.ExplorerContext,{submenu:M.ExplorerContextShare,title:H(828,"Share"),group:"11_share",order:-1});const BE=gve?k5(new M_({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Za?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(821,"&&Paste"),order:4},{menuId:M.EditorContext,group:gf,title:m(822,"Paste"),when:N.writable,order:4},{menuId:M.CommandPalette,group:"",title:m(823,"Paste"),order:1},{menuId:M.SimpleEditorContext,group:gf,title:m(824,"Paste"),when:N.writable,order:4}]})):void 0;class mve extends de{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:H(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(Ht);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(WT.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),WT.forceCopyWithSyntaxHighlighting=!1)}}function LG(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Ht);n.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");const s=t.get(at).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const r=s.getOption(45),a=s.getSelection();return a&&a.isEmpty()&&!r||(s.getOption(170)&&e==="cut"?(q8(s),n.trace("registerExecCommandImpl (before execCommand copy)"),s.getContainerDomNode().ownerDocument.execCommand("copy"),s.trigger(void 0,"cut",void 0),n.trace("registerExecCommandImpl (after execCommand copy)")):(q8(s),n.trace("registerExecCommandImpl (before execCommand "+e+")"),s.getContainerDomNode().ownerDocument.execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Ht);return n.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),n.trace("registerExecCommandImpl (before execCommand "+e+")"),Qw().execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function q8(o){if(o.getOption(170)){const t=vF.get(o.getId());t&&t.onWillCopy()}}LG(fve,"cut");LG(pve,"copy");BE&&(BE.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Ht);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const i=o.get(at),n=o.get(Mo),s=o.get(cs),r=o.get(ICe),a=i.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const h=vF.get(a.getId());h&&h.onWillPaste()}const c=fn.create(!0);t.trace("registerExecCommandImpl (before triggerPaste)");const d=n.triggerPaste(St().vscodeWindowId);return d?(t.trace("registerExecCommandImpl (triggerPaste defined)"),d.then(async()=>{if(t.trace("registerExecCommandImpl (after triggerPaste)"),r.quality!=="stable"){const h=c.elapsed();s.publicLog2("editorAsyncPaste",{duration:h})}return Dd.get(a)?.finishedPaste()??Promise.resolve()})):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),ic?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const h=await n.readText();if(h!==""){const u=Bl.INSTANCE.get(h);let g=!1,f=null,p=null;u&&(g=a.getOption(45)&&!!u.isFromEmptySelection,f=typeof u.multicursorText<"u"?u.multicursorText:null,p=u.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",h.length," id : ",u?.id,")"),a.trigger("keyboard","paste",{text:h,pasteOnNewLine:g,multicursorText:f,mode:p})}})()):!0)}return!1}),BE.addImplementation(0,"generic-dom",(o,e)=>(o.get(Ht).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),o.get(Mo).triggerPaste(St().vscodeWindowId)??!1)));yG&&oe(mve);const gk=Object.freeze({id:"editor",order:5,type:"object",title:m(147,"Editor"),scope:6}),FL={...gk,properties:{"editor.tabSize":{type:"number",default:zn.tabSize,minimum:1,maximum:100,markdownDescription:m(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:zn.insertSpaces,markdownDescription:m(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:zn.detectIndentation,markdownDescription:m(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:zn.trimAutoWhitespace,description:m(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:zn.largeFileOptimizations,description:m(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m(154,"Turn off Word Based Suggestions."),m(155,"Only suggest words from the active document."),m(156,"Suggest words from all open documents of the same language."),m(157,"Suggest words from all open documents.")],description:m(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m(159,"Semantic highlighting enabled for all color themes."),m(160,"Semantic highlighting disabled for all color themes."),m(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:m(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:m(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:m(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:m(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:m(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:m(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:m(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m(174,"The opening bracket character or string sequence.")},{type:"string",description:m(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m(177,"The opening bracket character or string sequence.")},{type:"string",description:m(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Fn.maxComputationTime,description:m(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Fn.maxFileSize,description:m(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Fn.renderSideBySide,description:m(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Fn.renderSideBySideInlineBreakpoint,description:m(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Fn.useInlineViewWhenSpaceIsLimited,description:m(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Fn.renderMarginRevertIcon,description:m(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Fn.renderGutterMenu,description:m(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Fn.ignoreTrimWhitespace,description:m(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Fn.renderIndicators,description:m(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Fn.diffCodeLens,description:m(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Fn.diffWordWrap,markdownEnumDescriptions:[m(189,"Lines will never wrap."),m(190,"Lines will wrap at the viewport width."),m(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Fn.diffAlgorithm,markdownEnumDescriptions:[m(192,"Uses the legacy diffing algorithm."),m(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Fn.hideUnchangedRegions.enabled,markdownDescription:m(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Fn.hideUnchangedRegions.revealLineCount,markdownDescription:m(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Fn.hideUnchangedRegions.minimumLineCount,markdownDescription:m(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Fn.hideUnchangedRegions.contextLineCount,markdownDescription:m(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Fn.experimental.showMoves,markdownDescription:m(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Fn.experimental.showEmptyDecorations,description:m(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Fn.experimental.useTrueInlineView,description:m(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function _ve(o){return typeof o.type<"u"||typeof o.anyOf<"u"}for(const o of Fp){const e=o.schema;if(typeof e<"u")if(_ve(e))FL.properties[`editor.${o.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(FL.properties[t]=e[t])}let DS=null;function xG(){return DS===null&&(DS=Object.create(null),Object.keys(FL.properties).forEach(o=>{DS[o]=!0})),DS}function bve(o){return xG()[`editor.${o}`]||!1}function Cve(o){return xG()[`diffEditor.${o}`]||!1}const vve=fi.as(rl.Configuration);vve.registerConfiguration(FL);const Yt=new class{constructor(){this.QuickFix=new jt("quickfix"),this.Refactor=new jt("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new jt("notebook"),this.Source=new jt("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var Po;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(Po||(Po={}));function wve(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>DG(e,t,o.include))||!o.includeSourceActions&&Yt.Source.contains(e))}function Sve(o,e){const t=e.kind?new jt(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>DG(t,i,o.include))||!o.includeSourceActions&&t&&Yt.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function DG(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class Ml{static fromUser(e,t){return!e||typeof e!="object"?new Ml(t.kind,t.apply,!1):new Ml(Ml.getKindFromUser(e,t.kind),Ml.getApplyFromUser(e,t.apply),Ml.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new jt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class yve{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){Bi(i)}t&&(this.action.edit=t.edit)}return this}}const kG="editor.action.codeAction",I5="editor.action.quickFix",IG="editor.action.autoFix",EG="editor.action.refactor",NG="editor.action.sourceAction",hM="editor.action.organizeImports",uM="editor.action.fixAll",Lve=1e3;class RC extends F{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:ws(e.diagnostics)?ws(t.diagnostics)?RC.codeActionsPreferredComparator(e,t):-1:ws(t.diagnostics)?1:RC.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(RC.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Yt.QuickFix.contains(new jt(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const K8={actions:[],documentation:void 0};async function Kp(o,e,t,i,n,s){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],Yt.Notebook]},l={only:r.include?.value,trigger:i.type},c=new w5(e,s),d=i.type===2,h=xve(o,e,d?a:r),u=new z,g=h.map(async p=>{const _=setTimeout(()=>n.report(p),1250);try{const b=await p.provideCodeActions(e,t,l,c.token);if(c.token.isCancellationRequested)return b?.dispose(),K8;b&&u.add(b);const C=(b?.actions||[]).filter(v=>v&&Sve(r,v)),w=kve(p,C,r.include);return{actions:C.map(v=>new yve(v,p)),documentation:w}}catch(b){if(hr(b))throw b;return Bi(b),K8}finally{clearTimeout(_)}}),f=o.onDidChange(()=>{const p=o.all(e);Qt(p,h)||c.cancel()});try{const p=await Promise.all(g),_=p.map(w=>w.actions).flat(),b=[...ol(p.map(w=>w.documentation)),...Dve(o,e,i,_)],C=new RC(_,b,u);return u.add(C),C}catch(p){throw u.dispose(),p}finally{f.dispose(),c.dispose()}}function xve(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>wve(t,new jt(n))):!0)}function*Dve(o,e,t,i){if(e&&i.length)for(const n of o.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(s=>s.action)))}function kve(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new jt(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new jt(n.kind)))return s.command}}var yh;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions",o.FromAILightbulb="fromAILightbulb",o.FromProblemsHover="fromProblemsHover"})(yh||(yh={}));async function Ive(o,e,t,i,n=$e.None){const s=o.get(v1),r=o.get(Vt),a=o.get(cs),l=o.get(Li),c=o.get(Td);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),c.playSignal(tt.codeActionTriggered),await e.resolve(n),!n.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await s.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==yh.OnSave,showPreview:i?.preview,reason:Jn.codeAction({kind:e.action.kind,providerId:ZD.fromExtensionId(e.provider?.extensionId)})})).isApplied)){if(e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const h=Eve(d);l.error(typeof h=="string"?h:m(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>c.playSignal(tt.codeActionApplied),Lve)}}function Eve(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}it.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof be))throw Rr();const{codeActionProvider:s}=o.get(ue),r=o.get(ri).getModel(e);if(!r)throw Rr();const a=le.isISelection(t)?le.liftSelection(t):D.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Rr();const l=typeof i=="string"?new jt(i):void 0,c=await Kp(s,r,a,{type:1,triggerAction:Po.Default,filter:{includeSourceActions:!0,include:l}},Jc.None,$e.None),d=[],h=Math.min(c.validActions.length,typeof n=="number"?n:0);for(let u=0;uu.action)}finally{setTimeout(()=>c.dispose(),100)}});var ui;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(ui||(ui={}));(function(o){function e(l,c){return c-l}o.compare=e;const t=Object.create(null);t[o.Error]=m(1732,"Error"),t[o.Warning]=m(1733,"Warning"),t[o.Info]=m(1734,"Info");function i(l){return t[l]||""}o.toString=i;const n=Object.create(null);n[o.Error]=m(1735,"Errors"),n[o.Warning]=m(1736,"Warnings"),n[o.Info]=m(1737,"Infos");function s(l){return n[l]||""}o.toStringPlural=s;function r(l){switch(l){case ci.Error:return o.Error;case ci.Warning:return o.Warning;case ci.Info:return o.Info;case ci.Ignore:return o.Hint}}o.fromSeverity=r;function a(l){switch(l){case o.Error:return ci.Error;case o.Warning:return ci.Warning;case o.Info:return ci.Info;case o.Hint:return ci.Ignore}}o.toSeverity=a})(ui||(ui={}));var WL;(function(o){function t(n){return i(n,!0)}o.makeKey=t;function i(n,s){const r=[""];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(""),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(""),n.severity!==void 0&&n.severity!==null?r.push(ui.toString(n.severity)):r.push(""),n.message&&s?r.push(n.message.replace("¦","\\¦")):r.push(""),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(""),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(""),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(""),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(""),r.push(""),r.join("¦")}o.makeKeyOptionalMessage=i})(WL||(WL={}));const ac=Ve("markerService");var Nve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tve=function(o,e){return function(t,i){e(t,i,o)}},gM;let fM=class{static{gM=this}static{this.codeActionCommands=[EG,kG,NG,hM,uM]}constructor(e){this.keybindingService=e}getResolver(){const e=new $n(()=>this.keybindingService.getKeybindings().filter(t=>gM.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===hM?i={kind:Yt.SourceOrganizeImports.value}:t.command===uM&&(i={kind:Yt.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Ml.fromUser(i,{kind:jt.None,apply:"never"})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new jt(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};fM=gM=Nve([Tve(0,dt)],fM);E("symbolIcon.arrayForeground",Ke,m(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",Ke,m(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",Ke,m(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",Ke,m(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",Ke,m(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",Ke,m(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",Ke,m(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",Ke,m(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",Ke,m(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",Ke,m(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",Ke,m(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",Ke,m(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",Ke,m(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",Ke,m(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",Ke,m(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",Ke,m(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",Ke,m(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",Ke,m(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",Ke,m(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",Ke,m(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",Ke,m(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",Ke,m(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",Ke,m(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const TG=Object.freeze({kind:jt.Empty,title:m(866,"More Actions...")}),Rve=Object.freeze([{kind:Yt.QuickFix,title:m(867,"Quick Fix")},{kind:Yt.RefactorExtract,title:m(868,"Extract"),icon:Z.wrench},{kind:Yt.RefactorInline,title:m(869,"Inline"),icon:Z.wrench},{kind:Yt.RefactorRewrite,title:m(870,"Rewrite"),icon:Z.wrench},{kind:Yt.RefactorMove,title:m(871,"Move"),icon:Z.wrench},{kind:Yt.SurroundWith,title:m(872,"Surround With"),icon:Z.surroundWith},{kind:Yt.Source,title:m(873,"Source Action"),icon:Z.symbolFile},TG]);function Mve(o,e,t){if(!e)return o.map(s=>({kind:"action",item:s,group:TG,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!s.action.edit?.edits.length}));const i=Rve.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new jt(s.action.kind):jt.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:Z.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}const RG=new re("supportedCodeAction",""),G8="_typescript.applyFixAllCodeAction";class Pve extends F{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Io),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>zh(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Po.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(73).enabled;if(i!==ia.Off){{if(i===ia.On)return t;if(i===ia.OnCode){if(!t.isEmpty())return t;const s=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=s.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===s.getLineMaxColumn(r)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var eg;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(hr(r))return pM;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(eg||(eg={}));const pM=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Ave extends F{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new _t),this._state=eg.Empty,this._onDidChangeState=this._register(new P),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new _t),this._disposed=!1,this._supportedCodeActions=RG.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(eg.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(eg.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Pve(this._editor,this._markerService,i=>{if(!i){this.setState(eg.Empty);return}const n=i.selection.getStartPosition(),s=Qi(async l=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Po.QuickFix||i.trigger.filter?.include?.contains(Yt.QuickFix))){const d=await Kp(this._registry,e,i.selection,i.trigger,Jc.None,l);this.codeActionsDisposable.value=d;const h=[...d.allActions];if(l.isCancellationRequested)return d.dispose(),pM;const u=d.validActions?.some(f=>f.action.kind&&Yt.QuickFix.contains(new jt(f.action.kind))&&!f.action.isAI),g=this._markerService.read({resource:e.uri});if(u){for(const f of d.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(G8))&&(f.action.diagnostics=[...g.filter(p=>p.relatedInformation)]);return{validActions:d.validActions,allActions:h,documentation:d.documentation,hasAutoFix:d.hasAutoFix,hasAIFix:d.hasAIFix,allAIFixes:d.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=d}}}else if(!u&&g.length>0){const f=i.selection.getPosition();let p=f,_=Number.MAX_VALUE;const b=[...d.validActions];for(const w of g){const v=w.endColumn,S=w.endLineNumber,L=w.startLineNumber;if(S===f.lineNumber||L===f.lineNumber){p=new R(S,v);const x={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:Yt.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new le(p.lineNumber,p.column,p.lineNumber,p.column),I=await Kp(this._registry,e,k,x,Jc.None,l);if(l.isCancellationRequested)return I.dispose(),pM;if(I.validActions.length!==0){for(const T of I.validActions)T.action.command?.arguments?.some(A=>typeof A=="string"&&A.includes(G8))&&(T.action.diagnostics=[...g.filter(A=>A.relatedInformation)]);d.allActions.length===0&&h.push(...I.allActions),Math.abs(f.column-v)<_?b.unshift(...I.validActions):b.push(...I.validActions)}_=Math.abs(f.column-v)}}const C=b.filter((w,v,S)=>S.findIndex(L=>L.action.title===w.action.title)===v);return C.sort((w,v)=>w.action.isPreferred&&!v.action.isPreferred?-1:!w.action.isPreferred&&v.action.isPreferred||w.action.isAI&&!v.action.isAI?1:!w.action.isAI&&v.action.isAI?-1:0),{validActions:C,allActions:h,documentation:d.documentation,hasAutoFix:d.hasAutoFix,hasAIFix:d.hasAIFix,allAIFixes:d.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=d}}}}if(i.trigger.type===1){const d=await Kp(this._registry,e,i.selection,i.trigger,Jc.None,l);return this.codeActionsDisposable.value=d,d}const c=await Kp(this._registry,e,i.selection,i.trigger,Jc.None,l);return this.codeActionsDisposable.value=c,c});i.trigger.type===1&&this._progressService?.showWhile(s,250);const r=new eg.Triggered(i.trigger,n,s);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&r.type===1&&r.trigger.type===2&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Po.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Ove=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fve=function(o,e){return function(t,i){e(t,i,o)}},Dp;const Z8=Kt("gutter-lightbulb",Z.lightBulb,m(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),Y8=Kt("gutter-lightbulb-auto-fix",Z.lightbulbAutofix,m(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),X8=Kt("gutter-lightbulb-sparkle",Z.lightbulbSparkle,m(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),Q8=Kt("gutter-lightbulb-aifix-auto-fix",Z.lightbulbSparkleAutofix,m(877,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),J8=Kt("gutter-lightbulb-sparkle-filled",Z.sparkleFilled,m(878,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var Ea;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(Ea||(Ea={}));let nw=class extends F{static{Dp=this}static{this.GUTTER_DECORATION=Me.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:ye.asClassName(Z.lightBulb),glyphMargin:{position:Xa.Left},stickiness:1})}static{this.ID="editor.contrib.lightbulbWidget"}static{this._posPref=[0]}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new P),this.onClick=this._onClick.event,this._state=Ea.Hidden,this._gutterState=Ea.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+Z8.id,"codicon-"+Q8.id,"codicon-"+Y8.id,"codicon-"+X8.id,"codicon-"+J8.id],this.gutterDecoration=Dp.GUTTER_DECORATION,this._domNode=ee("div.lightBulbWidget"),this._domNode.role="listbox",this._register(ni.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==1||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(Kte(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:n,height:s}=wi(this._domNode),r=this._editor.getOption(75);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(se.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(IG)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(I5)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:n,height:s}=wi(i.target.element),r=this._editor.getOption(75);let a=Math.floor(r/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,f=S=>S>2&&this._editor.getTopForLineNumber(S)===this._editor.getTopForLineNumber(S-1),p=this._editor.getLineDecorations(a);let _=!1;if(p)for(const S of p){const L=S.options.glyphMarginClassName;if(L&&!this.lightbulbClasses.some(x=>L.includes(x))){_=!0;break}}let b=a,C=1;if(!g){const S=L=>{const x=r.getLineContent(L);return/^\s*$|^\s+/.test(x)||x.length<=C};if(a>1&&!f(a-1)){const L=r.getLineCount(),x=a===L,k=a>1&&S(a-1),I=!x&&S(a+1),T=S(a),A=!I&&!k;if(!I&&!k&&!_)return this.gutterState=new Ea.Showing(e,t,i,{position:{lineNumber:b,column:C},preference:Dp._posPref}),this.renderGutterLightbub(),this.hide();k||x||k&&!T?b-=1:(I||A&&T)&&(b+=1)}else if(a===1&&(a===r.getLineCount()||!S(a+1)&&!S(a)))if(this.gutterState=new Ea.Showing(e,t,i,{position:{lineNumber:b,column:C},preference:Dp._posPref}),_)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a{this._gutterDecorationID=t.addDecoration(new D(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new D(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=m(879,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=m(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=m(881,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=m(882,"Show Code Actions")))}set title(e){this._domNode.title=e}};nw=Dp=Ove([Fve(1,dt)],nw);var Wve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ul=function(o,e){return function(t,i){e(t,i,o)}},kp;const Bve="quickfix-edit-highlight";let ff=class extends F{static{kp=this}static{this.ID="editor.contrib.codeActionController"}static get(e){return e.getContribution(kp.ID)}constructor(e,t,i,n,s,r,a,l,c,d,h){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._progressService=h,this._activeCodeActions=this._register(new _t),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Ave(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new $n(()=>{const u=this._editor.getContribution(nw.ID);return u&&this._register(u.onClick(g=>this.showCodeActionsFromLightbulb(g.actions,g))),u}),this._resolver=n.createInstance(fM),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,yh.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){if(!this._editor.hasModel())return;Do.get(this._editor)?.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,n){const s=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(Ive,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Po.QuickFix,filter:{}}),s.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(n){Te(n);return}if(!(this._disposed||this._editor.getSelection()?.startLineNumber!==e.position.lineNumber))if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===1){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this.hideLightBulbWidget(),await this.applyCodeAction(s,!1,!1,yh.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const r=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(r&&r.action.disabled){Do.get(this._editor)?.showMessage(r.action.disabled,e.trigger.context.position),t.dispose();return}}}const n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){Do.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}static{this.DECORATION=Me.register({description:"quickfix-highlight",className:Bve})}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=R.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,d)=>{this.applyCodeAction(c,!0,!!d,i.fromLightbulb?yh.FromAILightbulb:yh.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:c=>{this._editor?.focus(),n.clear()},onHover:async(c,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=c.action.kind;if(u){const g=new jt(u);h=[Yt.RefactorExtract,Yt.RefactorInline,Yt.RefactorRewrite,Yt.RefactorMove,Yt.Source].some(p=>p.contains(g))}return{canPreview:h||!!c.action.edit?.edits.length}},onFocus:c=>{if(c&&c.action){const d=c.action.ranges,h=c.action.diagnostics;if(n.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(g=>({range:g,options:kp.DECORATION})):d.map(g=>({range:g,options:kp.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(f=>({range:f,options:kp.DECORATION}));n.set(u);const g=h[0];if(g.startLineNumber&&g.startColumn){const f=this._editor.getModel()?.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn})?.word;Ya(m(863,"Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Mve(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=wi(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>({id:s.id,label:s.title,tooltip:s.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(s.id,...s.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:m(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};ff=kp=Wve([ul(1,ac),ul(2,Ne),ul(3,pe),ul(4,ue),ul(5,yd),ul(6,Vt),ul(7,Oe),ul(8,cu),ul(9,pe),ul(10,yd)],ff);jr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Yc));const i=o.getColor(ph);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${qa(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function y1(o){return K.regex(RG.keys()[0],new RegExp("(\\s|^)"+Eo(o.value)+"\\b"))}const E5={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:m(831,"Kind of the code action to run.")},apply:{type:"string",description:m(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[m(833,"Always apply the first returned code action."),m(834,"Apply the first returned code action if it is the only one."),m(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:m(836,"Controls if only preferred code actions should be returned.")}}};function Wf(o,e,t,i,n=Po.Default){o.hasModel()&&ff.get(o)?.manualTriggerAtCurrentPosition(e,n,t,i)}class Hve extends de{constructor(){super({id:I5,label:H(853,"Quick Fix..."),precondition:K.and(N.writable,N.hasCodeActionsProvider),kbOpts:{kbExpr:N.textInputFocus,primary:2137,weight:100}})}run(e,t){return Wf(t,m(837,"No code actions available"),void 0,void 0,Po.QuickFix)}}class Vve extends tn{constructor(){super({id:kG,precondition:K.and(N.writable,N.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:E5}]}})}runEditorCommand(e,t,i){const n=Ml.fromUser(i,{kind:jt.Empty,apply:"ifSingle"});return Wf(t,typeof i?.kind=="string"?n.preferred?m(838,"No preferred code actions for '{0}' available",i.kind):m(839,"No code actions for '{0}' available",i.kind):n.preferred?m(840,"No preferred code actions available"):m(841,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class zve extends de{constructor(){super({id:EG,label:H(854,"Refactor..."),precondition:K.and(N.writable,N.hasCodeActionsProvider),kbOpts:{kbExpr:N.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:K.and(N.writable,y1(Yt.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:E5}]}})}run(e,t,i){const n=Ml.fromUser(i,{kind:Yt.Refactor,apply:"never"});return Wf(t,typeof i?.kind=="string"?n.preferred?m(842,"No preferred refactorings for '{0}' available",i.kind):m(843,"No refactorings for '{0}' available",i.kind):n.preferred?m(844,"No preferred refactorings available"):m(845,"No refactorings available"),{include:Yt.Refactor.contains(n.kind)?n.kind:jt.None,onlyIncludePreferredActions:n.preferred},n.apply,Po.Refactor)}}class Uve extends de{constructor(){super({id:NG,label:H(855,"Source Action..."),precondition:K.and(N.writable,N.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:K.and(N.writable,y1(Yt.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:E5}]}})}run(e,t,i){const n=Ml.fromUser(i,{kind:Yt.Source,apply:"never"});return Wf(t,typeof i?.kind=="string"?n.preferred?m(846,"No preferred source actions for '{0}' available",i.kind):m(847,"No source actions for '{0}' available",i.kind):n.preferred?m(848,"No preferred source actions available"):m(849,"No source actions available"),{include:Yt.Source.contains(n.kind)?n.kind:jt.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,Po.SourceAction)}}class $ve extends de{constructor(){super({id:hM,label:H(856,"Organize Imports"),precondition:K.and(N.writable,y1(Yt.SourceOrganizeImports)),kbOpts:{kbExpr:N.textInputFocus,primary:1581,weight:100},metadata:{description:H(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return Wf(t,m(850,"No organize imports action available"),{include:Yt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Po.OrganizeImports)}}class jve extends de{constructor(){super({id:uM,label:H(858,"Fix All"),precondition:K.and(N.writable,y1(Yt.SourceFixAll))})}run(e,t){return Wf(t,m(851,"No fix all action available"),{include:Yt.SourceFixAll,includeSourceActions:!0},"ifSingle",Po.FixAll)}}class qve extends de{constructor(){super({id:IG,label:H(859,"Auto Fix..."),precondition:K.and(N.writable,y1(Yt.QuickFix)),kbOpts:{kbExpr:N.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Wf(t,m(852,"No auto fixes available"),{include:Yt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Po.AutoFix)}}nt(ff.ID,ff,3);nt(nw.ID,nw,4);oe(Hve);oe(zve);oe(Uve);oe($ve);oe(qve);oe(jve);ae(new Vve);fi.as(rl.Configuration).registerConfiguration({...gk,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:m(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});fi.as(rl.Configuration).registerConfiguration({...gk,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:m(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});fi.as(rl.Configuration).registerConfiguration({...gk,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:m(862,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class l_{constructor(){this.lenses=[]}static{this.Empty=new l_}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Lf(e)&&(this._store??=new z,this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function MG(o,e,t){const i=o.ordered(e),n=new Map,s=new l_,r=i.map(async(a,l)=>{n.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&s.add(c,a)}catch(c){Bi(c)}});return await Promise.all(r),t.isCancellationRequested?(s.dispose(),l_.Empty):(s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s)}it.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;rt(be.isUri(t)),rt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(ue),s=o.get(ri).getModel(t);if(!s)throw Rr();const r=[],a=new z;return MG(n,s,$e.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(s,d.symbol,$e.None)).then(h=>r.push(h||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Kve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gve=function(o,e){return function(t,i){e(t,i,o)}};const PG=Ve("ICodeLensCache");class eH{constructor(e,t){this.lineCount=e,this.data=t}}let mM=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new ba(20,.75);const t="codelens/cache";Hb(kt,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n);const s=se.filter(e.onWillSaveState,r=>r.reason===Ph.SHUTDOWN);se.once(s)(r=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new l_;n.add({lenses:i},this._fakeProvider);const s=new eH(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new D(a,1,a,11)});const r=new l_;r.add({lenses:s},this._fakeProvider),this._cache.set(i,new eH(n.lineCount,r))}}catch{}}};mM=Kve([Gve(0,Ls)],mM);Ge(PG,mM,1);class Zve{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class BL{static{this._idPool=0}constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${BL._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:tH},h=>this._decorationIds[d]=h),a?a=D.plusRange(a,c.symbol.range):a=D.lift(c.symbol.range)}),this._viewZone=new Zve(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new BL(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&D.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:tH},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nH=function(o,e){return function(t,i){e(t,i,o)}};const qr=Ve("ILanguageFeatureDebounceService");var HL;(function(o){const e=new WeakMap;let t=0;function i(n){let s=e.get(n);return s===void 0&&(s=++t,e.set(n,s)),s}o.of=i})(HL||(HL={}));class Xve{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Qve{constructor(e,t,i,n,s,r){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=r,this._cache=new ba(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>sD(HL.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Ts(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new Xme(6),this._cache.set(i,n));const s=Ts(n.update(t),this._min,this._max);return nD(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new xK;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Ts(e,this._min,this._max)}}let _M=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,s=i?.max??n**2,r=i?.key??void 0,a=`${HL.of(e)},${n}${r?","+r:""}`;let l=this._data.get(a);return l||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),l=new Xve(n*1.5)):l=new Qve(this._logService,t,e,this._overallAverage()|0||n*1.5,n,s),this._data.set(a,l)),l}_overallAverage(){const e=new xK;for(const t of this._data.values())e.update(t.default());return e.value}};_M=Yve([nH(0,Ht),nH(1,N5)],_M);Ge(qr,_M,1);var Jve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lb=function(o,e){return function(t,i){e(t,i,o)}};let sw=class{static{this.ID="css.editor.codeLens"}constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new z,this._localToDispose=new z,this._lenses=[],this._oldCodeLensModels=new z,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new It(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),n=this._editor.getOption(59),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",io.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&pd(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new It(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Qi(s=>MG(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const r=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=r,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},Te)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(ge(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(s=>{const r=[];let a=-1;this._lenses.forEach(c=>{!c.isValid()||a===c.getLineNumber()?r.push(c):(c.update(s),a=c.getLineNumber())});const l=new HE;r.forEach(c=>{c.dispose(l,s),this._lenses.splice(this._lenses.indexOf(c),1)}),l.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(ge(()=>{if(this._editor.getModel()){const n=el.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new HE;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=el.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new HE;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;c.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}const n=Date.now(),s=Qi(r=>{const a=t.map((l,c)=>{const d=new Array(l.length),h=l.map((u,g)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(f=>{d[g]=f},Bi):(d[g]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[c].isDisposed()&&i[c].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{Te(r),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};sw=Jve([Lb(1,ue),Lb(2,qr),Lb(3,Vt),Lb(4,Li),Lb(5,PG)],sw);nt(sw.ID,sw,1);oe(class extends de{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:N.hasCodeLensProvider,label:H(884,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(as),n=e.get(Vt),s=e.get(Li),r=t.getSelection().positionLineNumber,a=t.getContribution(sw.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&c.push({label:u.symbol.command.title,command:u.symbol.command});if(c.length===0)return;const d=await i.pick(c,{canPickMany:!1,placeHolder:m(883,"Select a command")});if(!d)return;let h=d.command;if(l.isDisposed){const g=(await a.getModel())?.lenses.find(f=>f.symbol.range.startLineNumber===r&&f.symbol.command?.title===h.title);if(!g||!g.symbol.command)return;h=g.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}}});const AG=[];function Y_(o){AG.push(o)}function ewe(){return AG.slice(0)}class VE{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class Gb{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class pf{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(const e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}}const Bf=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var OG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bM=function(o,e){return function(t,i){e(t,i,o)}};let ow=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new V(new j(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGBA(a):V.Format.CSS.formatRGB(a),c=r?V.Format.CSS.formatHSLA(a):V.Format.CSS.formatHSL(a),d=r?V.Format.CSS.formatHexA(a):V.Format.CSS.formatHex(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:c,textEdit:{range:n,text:c}}),h.push({label:d,textEdit:{range:n,text:d}}),h}};ow=OG([bM(0,uo)],ow);let CM=class extends F{constructor(e,t){super(),this._register(e.colorProvider.register("*",new ow(t)))}};CM=OG([bM(0,ue),bM(1,uo)],CM);async function FG(o,e,t,i="auto"){return T5(new twe,o,e,t,i)}function WG(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class twe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class iwe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class nwe{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,$e.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function T5(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(n!=="always"&&d instanceof ow)r=d;else try{await o.compute(d,t,i,a)&&(s=!0)}catch(h){Bi(h)}}return s?a:r&&n!=="never"?(await o.compute(r,t,i,a),a):[]}function BG(o,e){const{colorProvider:t}=o.get(ue),i=o.get(ri).getModel(e);if(!i)throw Rr();const n=o.get(Oe).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,defaultColorDecoratorsEnablement:n}}var swe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zE=function(o,e){return function(t,i){e(t,i,o)}},vM;const HG=Object.create({});let c_=class extends F{static{vM=this}static{this.ID="editor.contrib.colorDetector"}static{this.RECOMPUTE_TIME=1e3}constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new z),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new owe),this._colorDecorationClassRefs=this._register(new z),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new BD(this._editor)),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:vM.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(27),l=s.hasChanged(167);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Io,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Qi(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new fn(!1),n=await FG(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Te(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Me.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let s=0;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};c_=vM=swe([zE(1,Oe),zE(2,ue),zE(3,qr)],c_);class owe extends F{constructor(){super(...arguments),this._onDidChange=this._register(new P),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}const VG="editor.action.showHover",rwe="editor.action.showDefinitionPreviewHover",awe="editor.action.hideHover",lwe="editor.action.scrollUpHover",cwe="editor.action.scrollDownHover",dwe="editor.action.scrollLeftHover",hwe="editor.action.scrollRightHover",uwe="editor.action.pageUpHover",gwe="editor.action.pageDownHover",fwe="editor.action.goToTopHover",pwe="editor.action.goToBottomHover",fk="editor.action.increaseHoverVerbosityLevel",mwe=m(1102,"Increase Hover Verbosity Level"),pk="editor.action.decreaseHoverVerbosityLevel",_we=m(1103,"Decrease Hover Verbosity Level"),rw="editor.action.inlineSuggest.commit",zG="editor.action.inlineSuggest.showPrevious",UG="editor.action.inlineSuggest.showNext",bwe="editor.action.inlineSuggest.jump",$G="editor.action.inlineSuggest.hide",wM="editor.action.inlineSuggest.toggleShowCollapsed";var R5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ra=function(o,e){return function(t,i){e(t,i,o)}},$0;let SM=class extends F{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=pt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=$(this,n=>{const s=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const r=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const a=new R(s.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(os((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=$(c=>{const d=c.store.add(this.instantiationService.createInstance(d_.hot.read(c),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(d),c.store.add(ge(()=>e.removeContentWidget(d))),c.store.add(ke(h=>{this.position.read(h)&&r.lastTriggerKind.read(h)!==Zs.Explicit&&r.triggerExplicitly()})),d}),l=Ed(this,(c,d)=>!!this.position.read(c)||!!d);s.add(ke(c=>{l.read(c)&&a.read(c)}))}))}};SM=R5([ra(2,pe)],SM);const Cwe=Kt("inline-suggestion-hints-next",Z.chevronRight,m(1207,"Icon for show next parameter hint.")),vwe=Kt("inline-suggestion-hints-previous",Z.chevronLeft,m(1208,"Icon for show previous parameter hint."));let d_=class extends F{static{$0=this}static{this.hot=nk(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,i){const n=new nr(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=m(1209,"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._warning=a,this._relayout=l,this._commandService=c,this.keybindingService=h,this._contextKeyService=u,this._menuService=g,this.id=`InlineSuggestionHintsContentWidget${$0.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=$(f=>{const p=this._warning.read(f);return p?typeof p.message=="string"?p.message:f.store.add(u1(p.message)).element:void 0}),this._warningMessageNode=Fe.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:$(f=>this._warning.read(f)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=ot("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,ot("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(zG,m(1210,"Previous"),ye.asClassName(vwe))),this.availableSuggestionCountAction=this._register(new nr("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(UG,m(1211,"Next"),ye.asClassName(Cwe))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(M.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new It(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new It(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(ke(f=>{this._warningMessageContentNode.read(f),this._warningMessageNode.readEffect(f),this._relayout()})),this.toolBar=this._register(d.createInstance(yM,this.nodes.toolBar,M.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,p)=>{if(f instanceof sr)return d.createInstance(Swe,f,void 0);if(f===this.availableSuggestionCountAction){const _=new wwe(void 0,f,{label:!0,icon:!1});return _.setClass("availableSuggestionCount"),_}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{$0._dropDownVisible=f})),this._register(ke(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(ke(f=>{const p=this._suggestionCount.read(f),_=this._currentSuggestionIdx.read(f);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${_+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ke(f=>{const _=this._extraCommands.read(f).map(b=>({class:void 0,id:b.command.id,enabled:!0,tooltip:b.command.tooltip||"",label:b.command.title,run:C=>this._commandService.executeCommand(b.command.id)}));for(const[b,C]of this.inlineCompletionsActionsMenus.getActions())for(const w of C)w instanceof sr&&_.push(w);_.length>0&&_.unshift(new $i),this.toolBar.setAdditionalSecondaryActions(_)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};d_=$0=R5([ra(8,Vt),ra(9,pe),ra(10,dt),ra(11,Ne),ra(12,Ur)],d_);class wwe extends r_{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class Swe extends Yh{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=ot("div.keybinding").root;this._register(new Z_(t,wo,{disableTitle:!0,...sve})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let yM=class extends xL{constructor(e,t,i,n,s,r,a,l,c){super(e,{resetMenu:t,...i},n,s,r,a,l,c),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const{primary:e,secondary:t}=qK(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Qt(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Qt(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};yM=R5([ra(3,Ur),ra(4,Ne),ra(5,gr),ra(6,dt),ra(7,Vt),ra(8,cs)],yM);function mk(o,e,t){const i=wi(o);return!(ei.left+i.width||ti.top+i.height)}class ywe{constructor(e,t,i,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=n}}class jG extends F{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new P),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new UE(i=>this._triggerAsyncComputation(i),0)),this._syncComputationScheduler=this._register(new UE(i=>this._triggerSyncComputation(i),0)),this._loadingMessageScheduler=this._register(new UE(i=>this._triggerLoadingMessage(i),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=vee(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(t){Te(t)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;const t=this._state===0,i=this._state===4;this._onResult.fire(new ywe(this._result.slice(0),t,i,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class UE extends F{constructor(e,t){super(),this._scheduler=this._register(new It(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}class M5{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new P,this._onDidResize=new P,this._sashListener=new z,this._size=new ut(0,0),this._minSize=new ut(0,0),this._maxSize=new ut(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Qn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Qn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Qn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:CL.North}),this._southSash=new Qn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:CL.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(se.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(se.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(se.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(se.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new ut(t,e);ut.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const Lwe=30,xwe=24;class Dwe extends F{constructor(e,t=new ut(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new M5),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ut.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new ut(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?R.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:wi(t).top+i.top-Lwe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=wi(t),s=Hh(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-xwe}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),s=Math.min(Math.max(n,i),e),r=Math.min(e,s);let a;return this._editor.getOption(69).above?a=r<=n?1:2:a=r<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}const kS=ee;let P5=class extends F{constructor(e){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!e),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new o1(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class _k extends F{static render(e,t,i){return new _k(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Y(e,kS("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Y(this.actionContainer,kS("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Y(this.action,kS("span.icon")).classList.add(...t.iconClass.split(" ")),this.actionRenderedLabel=i?`${t.label} (${i})`:t.label;const n=Y(this.action,kS("span"));n.textContent=this.actionRenderedLabel,this._store.add(new KG(this.actionContainer,t.run)),this._store.add(new GG(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function qG(o,e){return o&&e?m(7,"Inspect this in the accessible view with {0}.",e):o?m(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class KG extends F{constructor(e,t){super(),this._register(B(e,te.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class GG extends F{constructor(e,t,i){super(),this._register(B(e,te.KEY_DOWN,n=>{const s=new Et(n);i.some(r=>s.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var kwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},IS=function(o,e){return function(t,i){e(t,i,o)}},Qr;const sH=30;let LM=class extends Dwe{static{Qr=this}static{this.ID="editor.contrib.resizableContentHoverWidget"}static{this._lastDimensions=new ut(0,0)}get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,s){const r=e.getOption(75)+8,a=150,l=new ut(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new P5(!0)),this._onDidResize=this._register(new P),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new P),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new P),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=l,this._hoverVisibleKey=N.hoverVisible.bindTo(t),this._hoverFocusedKey=N.hoverFocused.bindTo(t),Y(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(59)&&this._updateFont()}));const c=this._register(Wr(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(d=>{this._onDidScroll.fire(d)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return Qr.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Qr._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Qr._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return Qr._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Qr._applyMaxDimensions(this._hover.contentsDomNode,e,t),Qr._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),Qr._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new ut(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){Qr._lastDimensions=new ut(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let i=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{i+=n.clientHeight}),Math.min(e,i)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Qr._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,Qr._lastDimensions.width);this._resizableNode.maxSize=new ut(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=Gc(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const s=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&qG(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");s&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+s)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new ut(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new ut(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new ut(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=Gc(e),i=_o(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Gc(e),i=_o(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=Gc(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-sH})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+sH})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};LM=Qr=kwe([IS(1,Ne),IS(2,Oe),IS(3,Mn),IS(4,dt)],LM);function oH(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),c=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+c*c)}class VL{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return on.EMPTY;const n=VL._getLineDecorations(this._editor,i);return on.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(i,n,e.source,t):on.EMPTY))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=VL._getLineDecorations(this._editor,t);let n=[];for(const s of this._participants)n=n.concat(s.computeSync(t,i,e.source));return ol(n)}}class ZG{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Iwe(this,t,this.isComplete,this.options)}}class Iwe extends ZG{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}var Ewe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rH=function(o,e){return function(t,i){e(t,i,o)}};const aH=ee;let zL=class extends F{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=aH("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=Y(this.hoverElement,aH("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(_k.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(oc("element"),n.actionContainer,n.actionRenderedLabel)),this.actions.push(n),n}append(e){const t=Y(this.actionsElement,e);return this._hasContent=!0,t}};zL=Ewe([rH(0,dt),rH(1,Us)],zL);const YG={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class Ad extends Oo{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new P),this._onKeyDown=this._register(new P),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...ye.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(va().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(this.enabled){if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)}})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...ye.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...ye.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}class xM extends Oo{static{this.CLASS_NAME="monaco-checkbox"}constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new P),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}}class XG extends xM{constructor(e,t,i){const n=new Ad({title:e,isChecked:t,icon:Z.check,actionClassName:xM.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...YG});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(Z.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class QG extends xM{constructor(e,t,i){let n;switch(t){case!0:n=Z.check;break;case"mixed":n=Z.dash;break;case!1:n=void 0;break}const s=new Ad({title:e,isChecked:t===!0,icon:n,actionClassName:XG.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...YG});super(s,s.domNode,i),this._state=t,this._register(s),this._register(this.checkbox.onChange(r=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(r)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=e===!0,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(Z.check);break;case"mixed":this.checkbox.setIcon(Z.dash);break;case!1:this.checkbox.setIcon(void 0);break}super.applyStyles(e)}}class Jr{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,Jr._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,Jr._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new D(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,Jr._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=Jr._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=Jr._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let g=1,f=e.length;g=p.startLineNumber?p.endLineNumber>u&&(u=p.endLineNumber):(s.push({range:new D(h,1,u,1),options:Jr._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=p.startLineNumber,u=p.endLineNumber)}s.push({range:new D(h,1,u,1),options:Jr._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Jr._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return s;if(!(s.startColumn0){const i=[];for(let r=0;rD.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function lH(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function cH(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=JG([n[a]],r)+t}),s.slice(0,-1)}class dH{constructor(e){this.staticValue=e,this.kind=0}}class Twe{constructor(e){this.pieces=e,this.kind=1}}class h_{static fromStaticValue(e){return new h_([Fg.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new dH(""):e.length===1&&e[0].staticValue!==null?this._state=new dH(e[0].staticValue):this._state=new Twe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?JG(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const l=[],c=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=c){l.push(a.slice(h));break}switch(r.caseOps[d]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),d++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),d++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,vt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},Pwe)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new D(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,Lh);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=Ev(n.map(l=>l.range),l=>D.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===1?(i===1?i=s.getLineCount():i--,n=s.getLineMaxColumn(i)):n--,new R(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===s.getLineMaxColumn(i)?(i===s.getLineCount()?i=1:i++,n=1):n++,new R(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()MC._getSearchRange(this._editor.getModel(),s));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Lh?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Mu(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const n=this._editor.getModel(),s=n.getValue(1),r=n.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=s.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=s.replace(i,a.buildReplaceString(null,c));const d=new M4(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let r=0,a=i.length;rr.range),n);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(s=>new le(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn));const n=this._editor.getSelection();for(let s=0,r=i.length;s=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function nZ(o,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const s=document.createElement("a");t.disposables.add(Ti(s,"click",r=>{t.callback(String(e.index),r)})),n=s}else e.type===8?n=document.createElement("br"):e.type===1&&(n=o);n&&o!==n&&o.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(s=>{nZ(n,s,t,i)})}function Vwe(o,e){const t={type:1,children:[]};let i=0,n=t;const s=[],r=new Hwe(o);for(;!r.eos();){let a=r.next();const l=a==="\\"&&DM(r.peek())!==0;if(l&&(a=r.next()),!l&&zwe(a)&&a===r.peek()){r.advance(),n.type===2&&(n=s.pop());const c=DM(a);if(n.type===c||n.type===5&&c===6)n=s.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),n.children.push(d),s.push(n),n=d}}else if(a===` -`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function zwe(o,e){return DM(o)!==0}function DM(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class Uwe{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class $we{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new Uwe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const ap=ee;let jwe=class extends Oo{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new _t),this._onDidChange=this._register(new P),this._onDidHeightChange=this._register(new P),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Y(e,ap(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",s=Y(this.element,ap(".ibwrapper"));if(this.input=Y(s,ap(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Y(s,ap("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Sj(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Y(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const r=this._register(new wt(e.ownerDocument,"selectionchange")),a=se.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===s);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new no(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(va().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Gc(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return lD(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&xo(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${ad(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=_o(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{if(!this.message)return null;e=Y(n,ap(".monaco-inputbox-container")),t();const s=ap("span.monaco-inputbox-message");this.message.formatContent?Bwe(this.message.content,void 0,s):Wwe(this.message.content,void 0,s),s.classList.add(this.classForType(this.message.type));const r=this.stylesForType(this.message.type);return s.style.backgroundColor=r.background??"",s.style.color=r.foreground??"",s.style.border=r.border?`1px solid ${r.border}`:"",Y(e,s),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m(9,"Error: {0}",this.message.content):this.message.type===2?i=m(10,"Warning: {0}",this.message.content):i=m(11,"Info: {0}",this.message.content),Ws(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${ad(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Gc(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,s=t.value;i!==null&&n!==null&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}};class sZ extends jwe{constructor(e,t,i){const n=m(12," or {0} for history","⇅"),s=m(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new P),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new P),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new $we(i.history,100));const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:s,l=this.placeholder+a;i.showPlaceholderOnFocus&&!lD(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(s)||a(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Ya(this.value?this.value:m(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Ya(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const qwe=m(1,"input");class oZ extends Oo{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new _t),this.additionalToggles=[],this._onDidOptionChange=this._register(new P),this._onKeyDown=this._register(new P),this._onMouseDown=this._register(new P),this._onInput=this._register(new P),this._onKeyUp=this._register(new P),this._onCaseSensitiveKeyDown=this._register(new P),this._onRegexKeyDown=this._register(new P),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||qwe,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=!!i.flexibleHeight,l=!!i.flexibleWidth,c=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new sZ(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){const d=i?.hoverLifecycleOptions||{groupId:"find-input"};this.regex=this._register(new iZ({appendTitle:r,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.regex.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(u=>{this._onRegexKeyDown.fire(u)})),this.wholeWords=this._register(new tZ({appendTitle:s,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.wholeWords.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new eZ({appendTitle:n,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(u=>{this._onCaseSensitiveKeyDown.fire(u)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const g=h.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let f=-1;u.equals(17)?f=(g+1)%h.length:u.equals(15)&&(g===0?f=h.length-1:f=g-1),u.equals(9)?(h[g].blur(),this.inputBox.focus()):f>=0&&h[f].focus(),ct.stop(u,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(B(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(B(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const Kwe=m(5,"input"),Gwe=m(6,"Preserve Case");class Zwe extends Ad{constructor(e){super({icon:Z.preserveCase,title:Gwe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Ywe extends Oo{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onPreserveCaseKeyDown(){return this._onPreserveCaseKeyDown.event}constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new P),this._onKeyDown=this._register(new P),this._onMouseDown=this._register(new P),this._onInput=this._register(new P),this._onKeyUp=this._register(new P),this._onPreserveCaseKeyDown=this._register(new P),this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||Kwe;const s=n.appendPreserveCaseLabel||"",r=n.history||new Set([]),a=!!n.flexibleHeight,l=!!n.flexibleWidth,c=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new sZ(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new Zwe({appendTitle:s,isChecked:!1,hoverLifecycleOptions:n.hoverLifecycleOptions,...n.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const g=d.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let f=-1;u.equals(17)?f=(g+1)%d.length:u.equals(15)&&(g===0?f=d.length-1:f=g-1),u.equals(9)?(d[g].blur(),this.inputBox.focus()):f>=0&&d[f].focus(),ct.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox?.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var rZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aZ=function(o,e){return function(t,i){e(t,i,o)}};const O5=new re("suggestWidgetVisible",!1,m(1698,"Whether suggestion are visible")),F5="historyNavigationWidgetFocus",lZ="historyNavigationForwardsEnabled",cZ="historyNavigationBackwardsEnabled";let PC;const PS=[];function dZ(o,e){if(PS.includes(e))throw new Error("Cannot register the same widget multiple times");PS.push(e);const t=new z,i=new re(F5,!1).bindTo(o),n=new re(lZ,!0).bindTo(o),s=new re(cZ,!0).bindTo(o),r=()=>{i.set(!0),PC=e},a=()=>{i.set(!1),PC===e&&(PC=void 0)};return lD(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(ge(()=>{PS.splice(PS.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:s,dispose(){t.dispose()}}}let kM=class extends oZ{constructor(e,t,i,n){super(e,t,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(dZ(s,this.inputBox))}};kM=rZ([aZ(3,Ne)],kM);let IM=class extends Ywe{constructor(e,t,i,n,s=!1){super(e,t,s,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(dZ(r,this.inputBox))}};IM=rZ([aZ(3,Ne)],IM);Sn.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:K.and(K.has(F5),K.equals(cZ,!0),K.not("isComposing"),O5.isEqualTo(!1)),primary:16,secondary:[528],handler:o=>{PC?.showPreviousValue()}});Sn.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:K.and(K.has(F5),K.equals(lZ,!0),K.not("isComposing"),O5.isEqualTo(!1)),primary:18,secondary:[530],handler:o=>{PC?.showNextValue()}});function hH(o){return o.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&o.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const uH=Kt("find-collapsed",Z.chevronRight,m(956,"Icon to indicate that the editor find widget is collapsed.")),gH=Kt("find-expanded",Z.chevronDown,m(957,"Icon to indicate that the editor find widget is expanded.")),Xwe=Kt("find-selection",Z.selection,m(958,"Icon for 'Find in Selection' in the editor find widget.")),Qwe=Kt("find-replace",Z.replace,m(959,"Icon for 'Replace' in the editor find widget.")),Jwe=Kt("find-replace-all",Z.replaceAll,m(960,"Icon for 'Replace All' in the editor find widget.")),e1e=Kt("find-previous-match",Z.arrowUp,m(961,"Icon for 'Find Previous' in the editor find widget.")),t1e=Kt("find-next-match",Z.arrowDown,m(962,"Icon for 'Find Next' in the editor find widget.")),i1e=m(963,"Find / Replace"),n1e=m(964,"Find"),s1e=m(965,"Find"),o1e=m(966,"Previous Match"),r1e=m(967,"Next Match"),a1e=m(968,"Find in Selection"),l1e=m(969,"Close"),c1e=m(970,"Replace"),d1e=m(971,"Replace"),h1e=m(972,"Replace"),u1e=m(973,"Replace All"),g1e=m(974,"Toggle Replace"),f1e=m(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",Lh),p1e=m(976,"{0} of {1}"),fH=m(977,"No results"),gl=419,m1e=275,_1e=m1e-54;let xb=69;const b1e=33,pH=je?256:2048;class $E{constructor(e){this.afterLineNumber=e,this.heightInPx=b1e,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function mH(o,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){o.stopPropagation();return}}function _H(o,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(165)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(50)){const h=this._codeEditor.getOption(50).loop;this._state.change({loop:h},!1);const u=this._codeEditor.getOption(50).addExtraSpaceOnTop;u&&!this._viewZone&&(this._viewZone=new $E(0),this._showViewZone()),!u&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const d=await this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}})),this._findInputFocused=bk.bindTo(r),this._findFocusTracker=this._register(Wr(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=A5.bindTo(r),this._replaceFocusTracker=this._register(Wr(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new $E(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return W5.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(104)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=_o(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Te)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=xb+"px",this._state.matchesCount>=Lh?this._matchesCount.title=f1e:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Lh&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Gg(p1e,i,t)}else e=fH;this._matchesCount.appendChild(document.createTextNode(e)),Ws(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),xb=Math.max(xb,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===fH)return i===""?m(978,"{0} found",e):m(979,"{0} found for '{1}'",e,i);if(t){const n=m(980,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();return s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1?`${s.getLineContent(t.startLineNumber)}, ${n}`:n}return m(981,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=wi(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(s?s.left:0),a=s?s.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=YU(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new $E(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const s=this._getHeight();if(s===i.heightInPx)return;const r=s-i.heightInPx;i.heightInPx=s,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let s=this._getHeight();if(s-=this._codeEditor.getOption(96).top,s<=0)return;i.heightInPx=s,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,n=e.minimap.minimapWidth;let s=!1,r=!1,a=!1;if(this._resized&&_o(this._domNode)>gl){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=_o(this._findInput.domNode);return}if(gl+28+n>=i&&(r=!0),gl+28+n-xb>=i&&(a=!0),gl+28+n-xb>=i+50&&(s=!0),this._domNode.classList.toggle("collapsed-find-widget",s),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!s&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:s,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=_o(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!D.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(pH|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return mH(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return _H(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(pH|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return mH(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return _H(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const i=this._codeEditor.getOption(50).history,n=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new kM(null,this._contextViewProvider,{width:_1e,label:n1e,placeholder:s1e,appendCaseSensitiveLabel:this._keybindingLabelFor(Wt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Wt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Wt.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>hH(this._keybindingService),inputBoxStyles:yL,toggleStyles:SL,history:i==="workspace"?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(h=>{h.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(h)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),oo&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const s={groupId:"find-widget"};this._prevBtn=this._register(new Fu({label:o1e+this._keybindingLabelFor(Wt.PreviousMatchFindAction),icon:e1e,hoverLifecycleOptions:s,onTrigger:()=>{dh(this._codeEditor.getAction(Wt.PreviousMatchFindAction)).run().then(void 0,Te)}},this._hoverService)),this._nextBtn=this._register(new Fu({label:r1e+this._keybindingLabelFor(Wt.NextMatchFindAction),icon:t1e,hoverLifecycleOptions:s,onTrigger:()=>{dh(this._codeEditor.getAction(Wt.NextMatchFindAction)).run().then(void 0,Te)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const a=document.createElement("div");a.className="find-actions",r.appendChild(a),a.appendChild(this._matchesCount),a.appendChild(this._prevBtn.domNode),a.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Ad({icon:Xwe,title:a1e+this._keybindingLabelFor(Wt.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:s,inputActiveOptionBackground:J(H_),inputActiveOptionBorder:J(t1),inputActiveOptionForeground:J(i1)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),a.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Fu({label:l1e+this._keybindingLabelFor(Wt.CloseFindWidgetCommand),icon:OK,hoverLifecycleOptions:s,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new IM(null,void 0,{label:c1e,placeholder:d1e,appendPreserveCaseLabel:this._keybindingLabelFor(Wt.TogglePreserveCaseCommand),history:n==="workspace"?this._replaceWidgetHistory:new Set([]),flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>hH(this._keybindingService),inputBoxStyles:yL,toggleStyles:SL,hoverLifecycleOptions:s},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),h.preventDefault())})),this._replaceBtn=this._register(new Fu({label:h1e+this._keybindingLabelFor(Wt.ReplaceOneAction),icon:Qwe,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new Fu({label:u1e+this._keybindingLabelFor(Wt.ReplaceAllAction),icon:Jwe,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const l=document.createElement("div");l.className="replace-part",l.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",l.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Fu({label:g1e,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=_o(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=i1e,this._domNode.role="dialog",this._domNode.style.width=`${gl}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(l),this._resizeSash=this._register(new Qn(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=gl;this._register(this._resizeSash.onDidStart(()=>{d=_o(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const u=d+h.startX-h.currentX;if(ug||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=_o(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=_o(this._domNode);if(hthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}}class Fu extends Oo{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+ye.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},e.hoverLifecycleOptions)),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}this._opts.onKeyDown?.(n)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...ye.asClassNameArray(uH)),this._domNode.classList.add(...ye.asClassNameArray(gH))):(this._domNode.classList.remove(...ye.asClassNameArray(gH)),this._domNode.classList.add(...ye.asClassNameArray(uH)))}}jr((o,e)=>{const t=o.getColor(ph);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${qa(o.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=o.getColor(ire);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${qa(o.type)?"dashed":"solid"} ${i}; }`);const n=o.getColor(et);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const s=o.getColor(ere);s&&e.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const r=o.getColor(tre);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var C1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bH=function(o,e){return function(t,i){e(t,i,o)}};let EM=class extends F{constructor(e,t,i,n){super(),this._container=e,this._getContent=t,this._clipboardService=i,this._hoverService=n,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new Fu({label:m(1128,"Copy"),icon:Z.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const e=this._getContent();e&&(await this._clipboardService.writeText(e),Ya(m(1129,"Copied to clipboard")))}};EM=C1e([bH(2,Mo),bH(3,Us)],EM);class v1e{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function w1e(o,e,t,i,n){const s=await Promise.resolve(o.provideHover(t,i,n)).catch(Bi);if(!(!s||!S1e(s)))return new v1e(o,s,e)}function B5(o,e,t,i,n=!1){const r=o.ordered(e,n).map((a,l)=>w1e(a,l,e,t,i));return on.fromPromisesResolveOrder(r).coalesce()}async function hZ(o,e,t,i,n=!1){const s=[];for await(const r of B5(o,e,t,i,n))s.push(r.hover);return s}ho("_executeHoverProvider",(o,e,t)=>{const i=o.get(ue);return hZ(i.hoverProvider,e,t,$e.None)});ho("_executeHoverProvider_recursive",(o,e,t)=>{const i=o.get(ue);return hZ(i.hoverProvider,e,t,$e.None,!0)});function S1e(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var y1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lp=function(o,e){return function(t,i){e(t,i,o)}};const wg=ee,L1e=Kt("hover-increase-verbosity",Z.add,m(1130,"Icon for increaseing hover verbosity.")),x1e=Kt("hover-decrease-verbosity",Z.remove,m(1131,"Icon for decreasing hover verbosity."));class la{constructor(e,t,i,n,s,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s,this.source=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class uZ{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case bo.Increase:return this.hover.canIncreaseVerbosity??!1;case bo.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let aw=class{constructor(e,t,i,n,s,r,a){this._editor=e,this._markdownRendererService=t,this._configurationService=i,this._languageFeaturesService=n,this._keybindingService=s,this._hoverService=r,this._commandService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new la(this,e.range,[new ts().appendText(m(1132,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let u=!1;d>=0&&l>d&&e.range.startColumn>=d&&(u=!0,r.push(new la(this,e.range,[{value:m(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new la(this,e.range,[{value:m(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const f of t){const p=f.range.startLineNumber===n?f.range.startColumn:1,_=f.range.endLineNumber===n?f.range.endColumn:s,b=f.options.hoverMessage;if(!b||o_(b))continue;f.options.beforeContentClassName&&(g=!0);const C=new D(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new la(this,C,b4(b),g,a++))}return r}computeAsync(e,t,i,n){if(!this._editor.hasModel()||e.type!==1)return on.EMPTY;const s=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(s)?this._getMarkdownHovers(r,s,e,n):on.EMPTY}async*_getMarkdownHovers(e,t,i,n){const s=i.range.getStartPosition(),r=B5(e,t,s,n);for await(const a of r)if(!o_(a.hover.contents)){const l=a.hover.range?D.lift(a.hover.range):i.range,c=new uZ(a.hover,a.provider,s);yield new la(this,l,a.hover.contents,!1,a.ordinal,c)}}renderHoverParts(e,t){return this._renderedHoverParts=new D1e(t,e.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){this._renderedHoverParts?.handleScroll(e)}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}updateMarkdownHoverVerbosityLevel(e,t){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t))}};aw=y1e([lp(1,Sa),lp(2,Oe),lp(3,ue),lp(4,dt),lp(5,Us),lp(6,Vt)],aw);class AS{constructor(e,t,i,n){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=n}dispose(){this.disposables.dispose()}}class D1e{constructor(e,t,i,n,s,r,a,l,c,d){this._hoverParticipant=i,this._editor=n,this._commandService=s,this._keybindingService=r,this._hoverService=a,this._configurationService=l,this._markdownRendererService=c,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new z,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(ge(()=>{this.renderedHoverParts.forEach(h=>{h.dispose()}),this._ongoingHoverOperations.forEach(h=>{h.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(Kn(n=>n.ordinal,Lo)),e.map(n=>{const s=this._renderHoverPart(n,i);return t.appendChild(s.hoverElement),s})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,s=e.source,r=new z;if(r.add(i),!s)return new AS(e,n,r);const a=s.supportsVerbosityAction(bo.Increase),l=s.supportsVerbosityAction(bo.Decrease);if(!a&&!l)return new AS(e,n,r);const c=wg("div.verbosity-actions");n.prepend(c);const d=wg("div.verbosity-actions-inner");return c.append(d),r.add(this._renderHoverExpansionAction(d,bo.Increase,a)),r.add(this._renderHoverExpansionAction(d,bo.Decrease,l)),new AS(e,n,r,d)}_renderMarkdownHover(e,t){return gZ(this._editor,e,this._markdownRendererService,t)}_renderHoverExpansionAction(e,t,i){const n=new z,s=t===bo.Increase,r=Y(e,wg(ye.asCSSSelector(s?L1e:x1e)));r.tabIndex=0;const a=new a_("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,r,I1e(this._keybindingService,t))),!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===bo.Increase?fk:pk,{focus:!0});return n.add(new KG(r,l)),n.add(new GG(r,l,[3,10])),n}handleScroll(e){this.renderedHoverParts.forEach(t=>{const i=t.actionsContainer;if(!i)return;const n=t.hoverElement,r=e.scrollTop+e.height,a=n.offsetTop,l=n.clientHeight,c=a+l,d=22;let h;c<=r||a>=r?h=l-d:h=r-a-d,i.style.top=`${h}px`})}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const n=this._getRenderedHoverPartAtIndex(t),s=n?.hoverPart.source;if(!n||!s?.supportsVerbosityAction(e))return;const r=await this._fetchHover(s,i,e);if(!r)return;const a=new uZ(r,s.hoverProvider,s.hoverPosition),l=n.hoverPart,c=new la(this._hoverParticipant,l.range,r.contents,l.isBeforeContent,l.ordinal,a),d=this._updateRenderedHoverPart(t,c);if(d)return{hoverPart:c,hoverElement:d.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(e,t,i){let n=i===bo.Increase?1:-1;const s=e.hoverProvider,r=this._ongoingHoverOperations.get(s);r&&(r.tokenSource.cancel(),n+=r.verbosityDelta);const a=new Jt;this._ongoingHoverOperations.set(s,{verbosityDelta:n,tokenSource:a});const l={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let c;try{c=await Promise.resolve(s.provideHover(t,e.hoverPosition,a.token,l))}catch(d){Bi(d)}return a.dispose(),this._ongoingHoverOperations.delete(s),c}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),n=this.renderedHoverParts[e],s=n.hoverElement,r=i.hoverElement,a=Array.from(r.children);s.replaceChildren(...a);const l=new AS(t,s,i.disposables,i.actionsContainer);return n.dispose(),this.renderedHoverParts[e]=l,l}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function k1e(o,e,t,i){e.sort(Kn(s=>s.ordinal,Lo));const n=[];for(const s of e){const r=gZ(t,s,i,o.onContentsChanged);o.fragment.appendChild(r.hoverElement),n.push(r)}return new pf(n)}function gZ(o,e,t,i){const n=new z,s=wg("div.hover-row"),r=wg("div.hover-row-contents");s.appendChild(r);const a=e.contents;for(const c of a){if(o_(c))continue;const d=wg("div.markdown-hover"),h=Y(d,wg("div.hover-contents")),u=n.add(t.render(c,{context:o,asyncRenderCallback:()=>{h.className="hover-contents code-hover-contents",i()}}));h.appendChild(u.element),r.appendChild(d)}return{hoverPart:e,hoverElement:s,dispose(){n.dispose()}}}function I1e(o,e){switch(e){case bo.Increase:{const t=o.lookupKeybinding(fk);return t?m(1135,"Increase Hover Verbosity ({0})",t.getLabel()):m(1136,"Increase Hover Verbosity")}case bo.Decrease:{const t=o.lookupKeybinding(pk);return t?m(1137,"Decrease Hover Verbosity ({0})",t.getLabel()):m(1138,"Decrease Hover Verbosity")}}}const CH=ee;class E1e extends F{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,this._domNode=CH(".saturation-wrap"),Y(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Y(this._domNode,this._canvas),this.selection=CH(".saturation-selection"),Y(this._domNode,this.selection),this.layout(),this._register(B(this._domNode,te.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new W_);const t=wi(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=B(e.target.ownerDocument,te.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new Al(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=V.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class N1e extends F{constructor(e){super(),this._onClicked=this._register(new P),this.onClicked=this._onClicked.event,this._button=Y(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(B(this._button,te.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const Db=ee;class fZ extends F{constructor(e,t,i){super(),this.model=t,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,i==="standalone"?(this.domNode=Y(e,Db(".standalone-strip")),this.overlay=Y(this.domNode,Db(".standalone-overlay"))):(this.domNode=Y(e,Db(".strip")),this.overlay=Y(this.domNode,Db(".overlay"))),this.slider=Y(this.domNode,Db(".slider")),this.slider.style.top="0px",this._register(B(this.domNode,te.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new W_),i=wi(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=B(e.target.ownerDocument,te.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class T1e extends fZ{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new V(new j(t,i,n,1)),r=new V(new j(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class R1e extends fZ{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}const M1e=ee;class P1e extends F{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=M1e(".colorpicker-body"),Y(e,this._domNode),this._saturationBox=new E1e(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new T1e(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new R1e(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n==="standalone"&&(this._insertButton=this._register(new N1e(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new V(new Al(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new Al(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new V(new Al(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const A1e=ee;class O1e extends F{constructor(e){super(),this._onClicked=this._register(new P),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Y(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Y(this._button,t),Y(t,A1e(".button"+ye.asCSSSelector(Kt("color-picker-close",Z.close,m(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(B(this._button,te.CLICK,()=>{this._onClicked.fire()}))}}const OS=ee;class F1e extends F{constructor(e,t,i,n){super(),this.model=t,this.type=n,this._closeButton=null,this._domNode=OS(".colorpicker-header"),Y(e,this._domNode),this._pickedColorNode=Y(this._domNode,OS(".picked-color")),Y(this._pickedColorNode,OS("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Y(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=m(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=Y(this._domNode,OS(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor($y)||V.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor($y)||V.white})),this._register(B(this._pickedColorNode,te.CLICK,()=>this.model.selectNextColorPresentation())),this._register(B(this._originalColorNode,te.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=V.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.type==="standalone"&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new O1e(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const W1e=ee;class pZ extends Oo{constructor(e,t,i,n,s){super(),this.model=t,this.pixelRatio=i,this._register(vv.getInstance(me(e)).onDidChange(()=>this.layout())),this._domNode=W1e(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new F1e(this._domNode,this.model,n,s)),this.body=this._register(new P1e(this._domNode,this.model,this.pixelRatio,s))}layout(){this.body.layout()}get domNode(){return this._domNode}}class B1e{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new P,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new P,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},V1e=function(o,e){return function(t,i){e(t,i,o)}};class UL{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(e,t){return new UL(e,t.range,t.model,t.provider)}}let $L=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,n){return on.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const n=c_.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[UL.fromBaseColor(this,await mZ(this._editor.getModel(),r.colorInfo,r.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return t==="hover"||t==="clickAndHover";case 1:return t==="click"||t==="clickAndHover";case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(t.length===0||!i.hasModel())return new pf([]);const n=i.getOption(75)+8;e.setMinimumDimensions(new ut(302,n));const s=new z,r=t[0],a=i.getModel(),l=r.model;this._colorPicker=s.add(new pZ(e.fragment,l,i.getOption(163),this._themeService,"hover"));let c=!1,d=new D(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);s.add(l.onColorFlushed(async u=>{await lw(a,l,u,d,r),c=!0,d=_Z(i,d,l)})),s.add(l.onDidChangeColor(u=>{lw(a,l,u,d,r)})),s.add(i.onDidChangeModelContent(u=>{c?c=!1:(e.hide(),i.focus())}));const h={hoverPart:UL.fromBaseColor(this,r),hoverElement:this._colorPicker.domNode,dispose(){s.dispose()}};return new pf([h])}getAccessibleContent(e){return m(887,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}handleContentsChanged(){this._colorPicker?.layout()}handleHide(){this._colorPicker?.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};$L=H1e([V1e(1,pi)],$L);class Ci{static insert(e,t){return{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function NM(o,e){return!!o[e]}class jE{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=NM(e.event,t.triggerModifier),this.isMiddleClick&&t.mouseMiddleClickAction==="ctrlLeftClick"&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=NM(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class vH{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=NM(e,t.triggerModifier)}}class FS{constructor(e,t,i,n,s){this.mouseMiddleClickAction=s,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}}function wH(o,e){return o==="altKey"?je?new FS(57,"metaKey",6,"altKey",e):new FS(5,"ctrlKey",6,"altKey",e):je?new FS(6,"altKey",57,"metaKey",e):new FS(6,"altKey",5,"ctrlKey",e)}class Ck extends F{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new P),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new P),this.onExecute=this._onExecute.event,this._onCancel=this._register(new P),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=wH(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(86)||i.hasChanged(87)){const n=wH(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new jE(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new jE(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new jE(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new vH(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new vH(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);!!this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink")&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class bZ{constructor(e,t){this.range=e,this.direction=t}}class H5{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new H5(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){Bi(t),this._isResolved=!1}}}class Sm{static{this._emptyInlayHintList=Object.freeze({dispose(){},hints:[]})}static async create(e,t,i,n){const s=[],r=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,n);(c?.hints.length||a.onDidChangeInlayHints)&&s.push([c??Sm._emptyInlayHintList,a])}catch(c){Bi(c)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new Ar;return new Sm(i,s,t)}constructor(e,t,i){this._disposables=new z,this.ranges=e,this.provider=new Set;const n=[];for(const[s,r]of t){this._disposables.add(s),this.provider.add(r);for(const a of s.hints){const l=i.validatePosition(a.position);let c="before";const d=Sm._getRangeAtPosition(i,l);let h;d.getStartPosition().isBefore(l)?(h=D.fromPositions(d.getStartPosition(),l),c="after"):(h=D.fromPositions(l,d.getEndPosition()),c="before"),n.push(new H5(a,new bZ(h,c),r))}}this.items=n.sort((s,r)=>R.compare(s.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new D(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const s=e.tokenization.getLineTokens(i),r=t.column-1,a=s.findTokenIndexAtOffset(r);let l=s.getStartOffset(a),c=s.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=s.getStartOffset(a-1),c=s.getEndOffset(a-1)):c===r&&a=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Cc=function(o,e){return function(t,i){e(t,i,o)}};let kd=class extends sf{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,c,d,h,u,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){LD(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};kd=$1e([Cc(4,pe),Cc(5,at),Cc(6,Vt),Cc(7,Ne),Cc(8,pi),Cc(9,Li),Cc(10,Mn),Cc(11,ai),Cc(12,ue)],kd);function vZ(o){const e=o.get(at).getFocusedCodeEditor();return e instanceof kd?e.getParentEditor():e}const SH=new V(new j(0,122,204)),j1e={showArrow:!0,showFrame:!0,className:"",frameColor:SH,arrowColor:SH,keepEditorSelection:!1},q1e="vs.editor.contrib.zoneWidget";class K1e{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class G1e{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class z5{static{this._IdGenerator=new ZF(".arrow-decoration-")}constructor(e){this._editor=e,this._ruleName=z5._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),ET(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){ET(this._ruleName),zy(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:D.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}class Z1e{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=kl(t),LD(this.options,j1e,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new z5(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=D.isIRange(e)?D.lift(e):D.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Me.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const e=this.editor.getOption(75);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=this.options.frameWidth??Math.round(e/9);t+=2*i}return t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(75),l=this._getMaximumHeightInLines();l!==void 0&&(t=Math.min(t,l));let c=0,d=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new K1e(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new G1e(q1e+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const g=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}const h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const g=u.validateRange(new D(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(g,g.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){const i=this._getMaximumHeightInLines(),n=t&&i!==void 0?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==n&&(this.editor.changeViewZones(s=>{this._viewZone&&(this._viewZone.heightInLines=n,s.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Qn(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(75),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>e.minLines&&s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},SZ=function(o,e){return function(t,i){e(t,i,o)}};const yZ=Ve("IPeekViewService");Ge(yZ,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var lo;(function(o){o.inPeekEditor=new re("inReferenceSearchEditor",!0,m(1316,"Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(lo||(lo={}));let jL=class{static{this.ID="editor.contrib.referenceController"}constructor(e,t){e instanceof kd&&lo.inPeekEditor.bindTo(t)}dispose(){}};jL=wZ([SZ(1,Ne)],jL);nt(jL.ID,jL,0);const Y1e={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let qL=class extends Z1e{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new P,this.onDidClose=this._onDidClose.event,LD(this.options,Y1e,!1);const n=oi(this.editor);n.openedPeekWidgets.set(n.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=oi(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=ee(".head"),this._bodyElement=ee(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ee(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ti(this._titleElement,"click",s=>this._onTitleClick(s))),Y(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ee("span.filename"),this._secondaryHeading=ee("span.dirname"),this._metaHeading=ee("span.meta"),Y(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ee(".peekview-actions");Y(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new no(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new nr("peekview.close",m(1317,"Close"),ye.asClassName(Z.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:_5.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Tn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Co(this._metaHeading)):Rs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(75)*1.2),n=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};qL=wZ([SZ(2,pe)],qL);const X1e=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},m(1318,"Background color of the peek view title area.")),LZ=E("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:nc},m(1319,"Color of the peek view title.")),xZ=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m(1320,"Color of the peek view title info.")),Q1e=E("peekView.border",{dark:Gl,light:Gl,hcDark:et,hcLight:et},m(1321,"Color of the peek view borders and arrow.")),J1e=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},m(1322,"Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:nc},m(1323,"Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:nc},m(1324,"Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m(1325,"Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:nc},m(1326,"Foreground color of the selected entry in the peek view result list."));const U5=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},m(1327,"Background color of the peek view editor."));E("peekViewEditorGutter.background",U5,m(1328,"Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",U5,m(1329,"Background color of sticky scroll in the peek view editor."));E("peekViewEditorStickyScrollGutter.background",U5,m(1330,"Background color of the gutter part of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m(1331,"Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m(1332,"Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:ti,hcLight:ti},m(1333,"Match highlight border in the peek view editor."));class eSe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:F.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);const r=new Jt,a=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(l=>this.renderer.renderElement(l,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class tSe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function iSe(o,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new tSe(o,e.accessibilityProvider)}}class nSe{constructor(e,t,i,n,s={}){this.modelDisposables=new z;const r=()=>this.model,a=n.map(l=>new eSe(l,r));this.list=new ur(e,t,i,a,iSe(r,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return se.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return se.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return se.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,Ns(e.length)),this.modelDisposables.add(e.onDidIncrementLength(t=>this.list.splice(this.list.length,0,Ns(this.list.length,t))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}const sSe={separatorBorder:V.transparent};class DZ{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=Ts(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class oSe extends DZ{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class rSe extends DZ{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Mc;(function(o){o[o.Idle=0]="Idle",o[o.Busy=1]="Busy"})(Mc||(Mc={}));var KL;(function(o){o.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}o.Split=e;function t(n){return{type:"auto",index:n}}o.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}o.Invisible=i})(KL||(KL={}));class kZ extends F{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Mc.Idle,this._onDidSashChange=this._register(new P),this._onDidSashReset=this._register(new P),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Y(this.el,ee(".sash-container")),this.viewContainer=ee(".split-view-container"),this.scrollable=this._register(new z_({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>ro(me(this.el),n)})),this.scrollableElement=this._register(new zD(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new wt(this.viewContainer,"scroll")).event;this._register(i(n=>{const s=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-s.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-s.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(n=>{n.scrollTopChanged&&(this.viewContainer.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this.viewContainer.scrollLeft=n.scrollLeft)})),Y(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||sSe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,s)=>{const r=ss(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,r,s,!0)}),this._contentSize=this.viewItems.reduce((n,s)=>n+s.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let n=0;for(let s=0;s0&&(r.size=Ts(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=Ns(this.viewItems.length),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const n=this.sashItems.findIndex(a=>a.sash===e),s=da(B(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),B(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(f=>f.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const p=this.viewItems[n];d=(p.minimumSize-p.size)/2,h=(p.maximumSize-p.size)/2}else{const p=this.viewItems[n+1];d=(p.size-p.maximumSize)/2,h=(p.size-p.minimumSize)/2}let u,g;if(!l){const f=Ns(n,-1),p=Ns(n+1,this.viewItems.length),_=f.reduce((k,I)=>k+(this.viewItems[I].minimumSize-c[I]),0),b=f.reduce((k,I)=>k+(this.viewItems[I].viewMaximumSize-c[I]),0),C=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,I)=>k+(c[I]-this.viewItems[I].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,I)=>k+(c[I]-this.viewItems[I].viewMaximumSize),0),v=Math.max(_,w),S=Math.min(C,b),L=this.findFirstSnapIndex(f),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const k=this.viewItems[L],I=Math.floor(k.viewMinimumSize/2);u={index:L,limitDelta:k.visible?v-I:v+I,size:k.size}}if(typeof x=="number"){const k=this.viewItems[x],I=Math.floor(k.viewMinimumSize/2);g={index:x,limitDelta:k.visible?S+I:S-I,size:k.size}}}this.sashDragState={start:a,current:a,index:n,sizes:c,minDelta:d,maxDelta:h,alt:l,snapBefore:u,snapAfter:g,disposable:s}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:s,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,r,a,l,c);if(s){const u=t===this.sashItems.length-1,g=this.viewItems.map(w=>w.size),f=u?t:t+1,p=this.viewItems[f],_=p.size-p.maximumSize,b=p.size-p.minimumSize,C=u?t-1:t+1;this.resize(C,-h,g,void 0,void 0,_,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Ts(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==Mc.Idle)throw new Error("Cant modify splitview");this.state=Mc.Busy;try{const i=Ns(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===1),e],s=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=Ts(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,s)}finally{this.state=Mc.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Ts(i,a.minimumSize,a.maximumSize);const n=Ns(this.viewItems.length),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.relayout(s,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==Mc.Idle)throw new Error("Cant modify splitview");this.state=Mc.Busy;try{const s=ee(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=ge(()=>s.remove()),l=da(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new oSe(s,e,c,l):new rSe(s,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},g=this.orientation===0?new Qn(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:1}):new Qn(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:0}),f=this.orientation===0?k=>({sash:g,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:g,start:k.startX,current:k.currentX,alt:k.altKey}),_=se.map(g.onDidStart,f)(this.onSashStart,this),C=se.map(g.onDidChange,f)(this.onSashChange,this),v=se.map(g.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===g))(this.onSashEnd,this),S=g.onDidReset(()=>{const k=this.sashItems.findIndex(W=>W.sash===g),I=Ns(k,-1),T=Ns(k+1,this.viewItems.length),A=this.findFirstSnapIndex(I),O=this.findFirstSnapIndex(T);typeof A=="number"&&!this.viewItems[A].visible||typeof O=="number"&&!this.viewItems[O].visible||this._onDidSashReset.fire(k)}),L=da(_,C,v,S,g),x={sash:g,disposable:L};this.sashItems.splice(i-1,0,x)}s.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Mc.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,s)=>n+s.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),n,s,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=Ns(e,-1),h=Ns(e+1,this.viewItems.length);if(s)for(const x of s)NI(d,x),NI(h,x);if(n)for(const x of n)G1(d,x),G1(h,x);const u=d.map(x=>this.viewItems[x]),g=d.map(x=>i[x]),f=h.map(x=>this.viewItems[x]),p=h.map(x=>i[x]),_=d.reduce((x,k)=>x+(this.viewItems[k].minimumSize-i[k]),0),b=d.reduce((x,k)=>x+(this.viewItems[k].maximumSize-i[k]),0),C=h.length===0?Number.POSITIVE_INFINITY:h.reduce((x,k)=>x+(i[k]-this.viewItems[k].minimumSize),0),w=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((x,k)=>x+(i[k]-this.viewItems[k].maximumSize),0),v=Math.max(_,w,r),S=Math.min(C,b,a);let L=!1;if(l){const x=this.viewItems[l.index],k=t>=l.limitDelta;L=k!==x.visible,x.setVisible(k,l.size)}if(!L&&c){const x=this.viewItems[c.index],k=ta+l.size,0);let i=this.size-t;const n=Ns(this.viewItems.length-1,-1),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);for(const a of r)NI(n,a);for(const a of s)G1(n,a);typeof e=="number"&&G1(n,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),n=[...this.viewItems].reverse();e=!1;const s=n.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=n.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:C&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),vt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}class vk{static{this.TemplateId="row"}constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=vk.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(s=>[s.templateId,s]));this.renderers=[];for(const s of e){const r=n.get(s.templateId);if(!r)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=Y(e,ee(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new lSe(d,h))),l={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new kZ(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new vk(n,s,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new ur(e,this.domNode,aSe(i),[c],r)),se.any(...a.map(d=>d.onDidLayout))(([d,h])=>c.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=n.reduce((g,f)=>g+f.weight,0),u=n[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=zr(this.domNode),this.style(m_e)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`),parse:o=>_k.split(o).filter(e=>!e.startsWith("#"))});class Wt{static{this.sep="."}static{this.None=new Wt("@@none@@")}static{this.Empty=new Wt("")}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Wt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Wt((this.value?[this.value,...e]:e).join(Wt.sep))}}const g_e={ctrlCmd:!1,alt:!1};var mv;(function(o){o[o.Blur=1]="Blur",o[o.Gesture=2]="Gesture",o[o.Other=3]="Other"})(mv||(mv={}));var _a;(function(o){o[o.NONE=0]="NONE",o[o.FIRST=1]="FIRST",o[o.SECOND=2]="SECOND",o[o.LAST=3]="LAST"})(_a||(_a={}));var At;(function(o){o[o.First=1]="First",o[o.Second=2]="Second",o[o.Last=3]="Last",o[o.Next=4]="Next",o[o.Previous=5]="Previous",o[o.NextPage=6]="NextPage",o[o.PreviousPage=7]="PreviousPage",o[o.NextSeparator=8]="NextSeparator",o[o.PreviousSeparator=9]="PreviousSeparator"})(At||(At={}));var Py;(function(o){o[o.Title=1]="Title",o[o.Inline=2]="Inline",o[o.Input=3]="Input"})(Py||(Py={}));const Jn=We("quickInputService"),tB={EDITORS:"CodeEditors",FILES:"CodeFiles"};class f_e{}const p_e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};li.add(p_e.DragAndDropContribution,new f_e);class Ay{static{this.INSTANCE=new Ay}constructor(){}static getInstance(){return Ay.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}function mq(o){if(Ma&&typeof globalThis.vscode?.webUtils?.getPathForFile=="function")return globalThis.vscode?.webUtils?.getPathForFile(o)}function _q(o){const e=new fq;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,rF(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,m_e(n))}}return e}function m_e(o){const e=mq(o),t=e?_e.parse(e):void 0;return u_e(o.name,t,async()=>new Uint8Array(await o.arrayBuffer()))}const __e=Object.freeze([tB.EDITORS,tB.FILES,Ag.RESOURCES,Ag.INTERNAL_URI_LIST]);function bq(o,e=!1){const t=_q(o),i=t.get(Ag.INTERNAL_URI_LIST);if(i)t.replace(vi.uriList,i);else if(e||!t.has(vi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=mq(r);try{a?n.push(_e.file(a).toString()):n.push(_e.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(vi.uriList,rF(_k.create(n)))}for(const n of __e)t.delete(n);return t}const Ow=We("IWorkspaceEditService");class aF{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(fh.is(t))return fh.lift(t);if(Up.is(t))return Up.lift(t);throw new Error("Unsupported edit")})}}class fh extends aF{static is(e){return e instanceof fh?!0:Ui(e)&&_e.isUri(e.resource)&&Ui(e.textEdit)}static lift(e){return e instanceof fh?e:new fh(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class Up extends aF{static is(e){return e instanceof Up?!0:Ui(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Up?e:new Up(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const lF=We("IEditorCancelService"),Cq=new oe("cancellableOperation",!1,m(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));$e(lF,class{constructor(){this._tokens=new WeakMap}add(o,e){let t=this._tokens.get(o);t||(t=o.invokeWithinContext(n=>{const s=Cq.bindTo(n.get(Ie)),r=new cs;return{key:s,tokens:r}}),this._tokens.set(o,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(o){const e=this._tokens.get(o);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class b_e extends qt{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(lF).add(e,this))}dispose(){this._unregister(),super.dispose()}}re(new class extends Ki{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Cq})}runEditorCommand(o,e){o.get(lF).cancel(e)}});let vq=class UT{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?Lg("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof UT))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new UT(e,this.flags))}};class nd extends b_e{constructor(e,t,i,n){super(e,n),this._listener=new z,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!L.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!L.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class cF extends qt{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}var C_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},v_e=function(o,e){return function(t,i){e(t,i,o)}};const w_e=Te.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:VV,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class dF extends A{static{this.baseId="editor.widget.inlineProgressWidget"}constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=J(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=J("span.icon");this.domNode.append(t),t.classList.add(...Se.asClassNameArray(G.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(75);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(61)||n.hasChanged(75))&&i()})),this._register(W(this.domNode,ee.CLICK,n=>{this.delegate.cancel()}))}getId(){return dF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}let Oy=class extends A{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new ut),this._currentWidget=this._register(new ut),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Gc(()=>{const a=L.fromPositions(e);this._currentDecorations.set([{range:a,options:w_e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(dF,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Oy=C_e([v_e(2,fe)],Oy);const gd=We("openerService");function S_e(o,e){return o.with({fragment:`${e.startLineNumber},${e.startColumn}${e.endLineNumber?`-${e.endLineNumber}${e.endColumn?`,${e.endColumn}`:""}`:""}`})}function y_e(o){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(o.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},o=o.with({fragment:""})),{selection:e,uri:o}}var x_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},L_e=function(o,e){return function(t,i){e(t,i,o)}};const aa=We("markdownRendererService");let $T=class{constructor(e){this._openerService=e}render(e,t,i){const n={...t};n.actionHandler||(n.actionHandler=(r,a)=>wq(this._openerService,r,a.isTrusted)),n.codeBlockRenderer||(n.codeBlockRenderer=(r,a)=>this._defaultCodeBlockRenderer?.renderCodeBlock(r,a,n??{})??Promise.resolve(document.createElement("span")));const s=Iw(e,n,i);return s.element.classList.add("rendered-markdown"),s}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}};$T=x_e([L_e(0,gd)],$T);async function wq(o,e,t,i){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:k_e(t),skipValidation:i})}catch(n){return Ee(n),!1}}function k_e(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}$e(aa,$T,1);var D_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iB=function(o,e){return function(t,i){e(t,i,o)}},KS;let fo=class{static{KS=this}static{this.ID="editor.contrib.messageController"}static{this.MESSAGE_VISIBLE=new oe("messageVisible",!1,m(1287,"Whether the editor is currently showing an inline message"))}static get(e){return e.getContribution(KS.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new ut,this._messageListeners=new z,this._mouseOverMessage=!1,this._editor=e,this._visible=KS.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Is(Vc(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Vc(e)){const n=this._messageListeners.add(Iw(e,{actionHandler:(s,r)=>{this.closeMessage(),wq(this._openerService,s,r.isTrusted)}}));this._messageWidget.value=new LI(this._editor,t,n.element)}else this._messageWidget.value=new LI(this._editor,t,e);this._messageListeners.add(te.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&sn(ji(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(W(this._messageWidget.value.getDomNode(),ee.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(W(this._messageWidget.value.getDomNode(),ee.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new L(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(LI.fadeOut(this._messageWidget.value))}};fo=KS=D_e([iB(1,Ie),iB(2,gd)],fo);const I_e=Ki.bindToContribution(fo.get);re(new I_e({id:"leaveEditorMessage",precondition:fo.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let LI=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Xe(fo.ID,fo,4);class E_e{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new $p(new R_e(e,t))}static forStrings(){return new $p(new E_e)}static forConfigKeys(){return new $p(new N_e)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new N1,this._root.segment=i.value());const s=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new N1,n.left.segment=i.value()),s.push([-1,n]),n=n.left;else if(a<0)n.right||(n.right=new N1,n.right.segment=i.value()),s.push([1,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new N1,n.mid.segment=i.value()),s.push([0,n]),n=n.mid;else break}const r=rl.unwrap(n.value);n.value=rl.wrap(t),n.key=e;for(let a=s.length-1;a>=0;a--){const l=s[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=s[a][0],h=s[a+1][0];if(d===1&&h===1)s[a][1]=l.rotateLeft();else if(d===-1&&h===-1)s[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=s[a+1][1]=s[a+1][1].rotateRight(),s[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=s[a+1][1]=s[a+1][1].rotateLeft(),s[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(s[a-1][0]){case-1:s[a-1][1].left=s[a][1];break;case 1:s[a-1][1].right=s[a][1];break;case 0:s[a-1][1].mid=s[a][1];break}else this._root=s[0][1]}}return r}get(e){return rl.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let s=this._root;for(;s;){const r=i.cmp(s.segment);if(r>0)n.push([-1,s]),s=s.left;else if(r<0)n.push([1,s]),s=s.right;else if(i.hasNext())i.next(),n.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const r=[[1,s]],a=this._min(s.right,r);if(a.key){s.key=a.key,s.value=a.value,s.segment=a.segment;const l=a.right;if(r.length>1){const[d,h]=r[r.length-1];switch(d){case-1:h.left=l;break;case 0:CC(!1);case 1:CC(!1)}}else s.right=l;const c=this._balanceByStack(r);if(n.length>0){const[d,h]=n[n.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const r=s.left??s.right;if(n.length>0){const[a,l]=n[n.length-1];switch(a){case-1:l.left=r;break;case 0:l.mid=r;break;case 1:l.right=r;break}}else this._root=r}this._root=this._balanceByStack(n)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const n=i.balanceFactor();if(n>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):n<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),n=rl.unwrap(i.value)||n,i=i.mid;else break}return i&&rl.unwrap(i.value)||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const s=i.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?rl.unwrap(n.value):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,rl.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const sd=We("contextService");function jT(o){const e=o;return typeof e?.id=="string"&&_e.isUri(e.uri)}function M_e(o){return typeof o?.id=="string"&&!jT(o)&&!O_e(o)}const P_e={id:"empty-window"};function A_e(o,e){if(typeof o=="string"||typeof o>"u")return typeof o=="string"?{id:Fc(o)}:P_e;const t=o;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function O_e(o){const e=o;return typeof e?.id=="string"&&_e.isUri(e.configPath)}class F_e{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const qT="code-workspace";m(2050,"Code Workspace");const Sq="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function W_e(o){return o.id===Sq}var hF=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_v=function(o,e){return function(t,i){e(t,i,o)}};class uF{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}class Bg extends uF{static{this.id="text"}constructor(){super(Wt.Empty.append("text","plain")),this.id=Bg.id,this.dropMimeTypes=[vi.text],this.pasteMimeTypes=[vi.text]}async getEdit(e,t){const i=e.get(vi.text);if(!i||e.has(vi.uriList))return;const n=await i.asString();return{handledMimeType:vi.text,title:m(926,"Insert Plain Text"),insertText:n,kind:this.kind}}}class yq extends uF{constructor(){super(Wt.Empty.append("uri","path","absolute")),this.dropMimeTypes=[vi.uriList],this.pasteMimeTypes=[vi.uriList]}async getEdit(e,t){const i=await xq(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===Le.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?m(927,"Insert Uris"):m(928,"Insert Uri"):r=i.length>1?m(929,"Insert Paths"):m(930,"Insert Path"),{handledMimeType:vi.uriList,insertText:s,title:r,kind:this.kind}}}let Fy=class extends uF{constructor(e){super(Wt.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[vi.uriList],this.pasteMimeTypes=[vi.uriList]}async getEdit(e,t){const i=await xq(e);if(!i.length||t.isCancellationRequested)return;const n=Ua(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?Zee(r.uri,s):void 0}));if(n.length)return{handledMimeType:vi.uriList,insertText:n.join(" "),title:i.length>1?m(931,"Insert Relative Paths"):m(932,"Insert Relative Path"),kind:this.kind}}};Fy=hF([_v(0,sd)],Fy);class B_e{constructor(){this.kind=new Wt("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:vi.text}]}async provideDocumentPasteEdits(e,t,i,n,s){if(n.triggerKind!==GC.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:m(933,"Insert HTML"),kind:this.kind}]}}}async function xq(o){const e=o.get(vi.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of _k.parse(t))try{i.push({uri:_e.parse(n),originalText:n})}catch{}return i}const Xu={scheme:"*",hasAccessToAllModels:!0};let KT=class extends A{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(Xu,new Bg)),this._register(e.documentDropEditProvider.register(Xu,new yq)),this._register(e.documentDropEditProvider.register(Xu,new Fy(t)))}};KT=hF([_v(0,he),_v(1,sd)],KT);let GT=class extends A{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(Xu,new Bg)),this._register(e.documentPasteEditProvider.register(Xu,new yq)),this._register(e.documentPasteEditProvider.register(Xu,new Fy(t))),this._register(e.documentPasteEditProvider.register(Xu,new B_e))}};GT=hF([_v(0,he),_v(1,sd)],GT);class ua{constructor(){this.value="",this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=ua._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ua.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ua.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ua.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ua.isVariableCharacter(i)||ua.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof ua._table[i]>"u"&&!ua.isDigitCharacter(i)&&!ua.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}class __{constructor(){this._children=[]}appendChild(e){return e instanceof ks&&this._children[this._children.length-1]instanceof ks?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function r(a,l){for(const c of a)c.parent=l,r(c.children,c)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Fw)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ks extends __{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ks(this.value)}}class Lq extends __{}class ar extends Lq{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof b_?this._children[0]:void 0}clone(){const e=new ar(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class b_ extends __{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ks&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new b_;return this.options.forEach(e.appendChild,e),e}}class gF extends __{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof ba&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof ba){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new gF;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class ba extends __{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new ba(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class bv extends Lq{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new ks(t)],!0):!1}clone(){const e=new bv(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function nB(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Fw extends __{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ar&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return nB([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ar&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof bv&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new Fw;return this._children=this.children.map(t=>t.clone()),e}walk(e){nB(this.children,e)}}class Hg{constructor(){this._scanner=new ua,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new Fw;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(l=>(l instanceof ar&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):s.push(l)),!0));const r=(l,c)=>{const d=n.get(l.index);if(!d)return;const h=new ar(l.index);h.transform=l.transform;for(const u of d){const g=u.clone();h.appendChild(g),g instanceof ar&&n.has(g.index)&&!c.has(g.index)&&(c.add(g.index),r(g,c),c.delete(g.index))}t.replace(l,[h])},a=new Set;for(const l of s)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new ar(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ks(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ar(Number(t)):new bv(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new ar(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new ks("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new b_;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new ks(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new bv(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new ks("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new gF;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new ks(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new ba(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new ba(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new ba(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new ba(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new ba(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new ba(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new ba(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ks(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function kq(o,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new fh(o,{range:i,text:typeof t.insertText=="string"?Hg.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Dq(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const l of o)if(l!==r&&e(a,l)){let c=t.get(r);c||(c=[],t.set(r,c)),c.push(l)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let l=[];const c=t.get(a);return c&&(n.push(a),l=s(c),n.pop()),i.add(a),[...l,a,...s(r.slice(1))]}return s(Array.from(o))}V.white.toString(),V.white.toString();const H_e=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class Wy extends A{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new P),this._onDidEscape=this._register(new P),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(Xt.addTarget(this._element)),[ee.CLICK,Rt.Tap].forEach(s=>{this._register(W(this._element,s,r=>{if(!this.enabled){nt.stop(r);return}this._onDidClick.fire(r)}))}),this._register(W(this._element,ee.KEY_DOWN,s=>{const r=new yt(s);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(s),a=!0):r.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&nt.stop(r,!0)})),this._register(W(this._element,ee.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(W(this._element,ee.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(xr(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of uh(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e||Vc(this._label)&&Vc(e)&&fge(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(Vc(e)){const n=Iw(e,void 0,document.createElement("span"));n.dispose();const s=n.element.querySelector("p")?.innerHTML;s?Nj(t,s,H_e):on(t)}else this.options.supportIcons?on(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=gfe(e)),this.setTitle(i),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):typeof this.options.title=="string"&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter(i=>i.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...Se.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(oa().setupManagedHover(this.options.hoverDelegate??zl("element"),this._element,e)):this._hover&&this._hover.update(e)}}function kI(o,e){return e&&(o.stack||o.stacktrace)?m(29,"{0}: {1}",oB(o),sB(o.stack)||sB(o.stacktrace)):oB(o)}function sB(o){return Array.isArray(o)?o.join(` +`):o}function oB(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m(30,"A system error occurred ({0})",o.message):o.message||m(31,"An unknown error occurred. Please consult the log for more details.")}function By(o=null,e=!1){if(!o)return m(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Ua(o),i=By(t[0],e);return t.length>1?m(33,"{0} ({1} errors in total)",i,t.length):i}if(nn(o))return o;if(o.detail){const t=o.detail;if(t.error)return kI(t.error,e);if(t.exception)return kI(t.exception,e)}return o.stack?kI(o,e):o.message?o.message:m(34,"An unknown error occurred. Please consult the log for more details.")}const T1=J,V_e={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class C_ extends A{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=Z(e,T1(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(oa().setupManagedHover(zl("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(e,t){this.didEverRender&&this.keybinding===e&&C_.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let i=1;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GS=function(o,e){return function(t,i){e(t,i,o)}};const Eq="acceptSelectedCodeAction",Nq="previewSelectedCodeAction";class z_e{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}}class U_e{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let ZT=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");n.className="description",e.append(n);const s=new C_(e,lo);return{container:e,icon:t,text:i,description:n,keybinding:s}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=Se.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Q(e.group.icon.color.id))):(i.icon.className=Se.asClassName(G.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;cee(!e.hideIcon,i.icon),i.text.textContent=Hy(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=Hy(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const n=this._keybindingService.lookupKeybinding(Eq)?.getLabel(),s=this._keybindingService.lookupKeybinding(Nq)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:n&&s?this._supportsPreview&&e.canPreview?i.container.title=m(1653,"{0} to Apply, {1} to Preview",n,s):i.container.title=m(1654,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};ZT=Iq([GS(1,st)],ZT);class $_e extends UIEvent{constructor(){super("acceptSelectedAction")}}class rB extends UIEvent{constructor(){super("previewSelectedAction")}}function j_e(o){if(o.kind==="action")return o.label}let YT=class extends A{constructor(e,t,i,n,s,r,a,l){super(),this._delegate=n,this._contextViewService=r,this._keybindingService=a,this._layoutService=l,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new qt),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const c={getHeight:d=>{switch(d.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:d=>d.kind};this._list=this._register(new Qo(e,this.domNode,c,[new ZT(t,this._keybindingService),new z_e,new U_e],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:j_e},accessibilityProvider:{getAriaLabel:d=>{if(d.kind==="action"){let h=d.label?Hy(d?.label):"";return d.description&&(h=h+", "+Hy(d.description)),d.disabled&&(h=m(1655,"{0}, Disabled Reason: {1}",h,d.disabled)),h}return null},getWidgetAriaLabel:()=>m(1656,"Action Widget"),getRole:d=>{switch(d.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...s}})),this._list.style(m_),this._register(this._list.onMouseClick(d=>this.onListClick(d))),this._register(this._list.onMouseOver(d=>this.onListHover(d))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(d=>this.onListSelection(d))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(d=>d.kind==="header").length,i=this._allMenuItems.filter(d=>d.kind==="separator").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(r);let a=e;if(this._allMenuItems.length>=50)a=380;else{const d=this._allMenuItems.map((h,u)=>{const g=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(g){g.style.width="auto";const f=g.getBoundingClientRect().width;return g.style.width="",f}return 0});a=Math.max(...d,e)}const c=Math.min(r,this._layoutService.getContainer(pe(this.domNode)).clientHeight*.7);return this._list.layout(c,a),this.domNode.style.height=`${c}px`,this._list.domFocus(),a}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new rB:new $_e;this._list.setSelection([i],s)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof rB):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};YT=Iq([GS(5,ud),GS(6,st),GS(7,Ul)],YT);function Hy(o){return o.replace(/\r\n|\r|\n/g," ")}var q_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},DI=function(o,e){return function(t,i){e(t,i,o)}};E("actionBar.toggledBackground",d_,m(1657,"Background color for toggled action items in action bar."));const Vg={Visible:new oe("codeActionMenuVisible",!1,m(1658,"Whether the action widget list is visible"))},zh=We("actionWidgetService");let zg=class extends A{get isVisible(){return Vg.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new ut)}show(e,t,i,n,s,r,a,l){const c=Vg.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(YT,e,t,i,n,l);this._contextViewService.showContextView({getAnchor:()=>s,render:h=>(c.set(!0),this._renderWidget(h,d,a??[])),onHide:h=>{c.reset(),this._onWidgetClosed(h)}},r,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new z,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),s.add(W(a,ee.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),s.add(W(c,ee.POINTER_MOVE,()=>c.remove())),s.add(W(c,ee.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(n.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=s.add(xr(e));return s.add(u.onDidBlur(()=>this.hide(!0))),s}_createActionBar(e,t){if(!t.length)return;const i=J(e),n=new qs(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};zg=q_e([DI(0,ud),DI(1,Ie),DI(2,fe)],zg);$e(zh,zg,1);const Ww=1100;bt(class extends pn{constructor(){super({id:"hideCodeActionWidget",title:H(1659,"Hide action widget"),precondition:Vg.Visible,keybinding:{weight:Ww,primary:9,secondary:[1033]}})}run(o){o.get(zh).hide(!0)}});bt(class extends pn{constructor(){super({id:"selectPrevCodeAction",title:H(1660,"Select previous action"),precondition:Vg.Visible,keybinding:{weight:Ww,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(zh);e instanceof zg&&e.focusPrevious()}});bt(class extends pn{constructor(){super({id:"selectNextCodeAction",title:H(1661,"Select next action"),precondition:Vg.Visible,keybinding:{weight:Ww,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(zh);e instanceof zg&&e.focusNext()}});bt(class extends pn{constructor(){super({id:Eq,title:H(1662,"Accept selected action"),precondition:Vg.Visible,keybinding:{weight:Ww,primary:3,secondary:[2137]}})}run(o){const e=o.get(zh);e instanceof zg&&e.acceptSelected()}});bt(class extends pn{constructor(){super({id:Nq,title:H(1663,"Preview selected action"),precondition:Vg.Visible,keybinding:{weight:Ww,primary:2051}})}run(o){const e=o.get(zh);e instanceof zg&&e.acceptSelected(!0)}});var Tq=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jp=function(o,e){return function(t,i){e(t,i,o)}},XT;let QT=class extends A{static{XT=this}static{this.baseId="editor.widget.postEditWidget"}constructor(e,t,i,n,s,r,a,l,c,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this.additionalActions=l,this._keybindingService=d,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(ue(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ue((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(u=>{this.dispose()})),this._register(te.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=J(".post-edit-widget"),this.button=this._register(new Wy(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(W(this.domNode,ee.CLICK,()=>this.showSelector()))}getId(){return XT.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=pi(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,n)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:Se.fromId(n===this.edits.activeEditIndex?G.check.id:G.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);const n=this.edits.allEdits.findIndex(s=>s===i);if(n!==this.edits.activeEditIndex)return this.onSelectNewEdit(n)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};QT=XT=Tq([jp(8,Ie),jp(9,st),jp(10,zh)],QT);let Vy=class extends A{constructor(e,t,i,n,s,r,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._getAdditionalActions=s,this._instantiationService=r,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new ut),this._register(te.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){if(!e.length||!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async b=>{const C=this._editor.getModel();C&&(await C.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:b,allEdits:t.allEdits},i,n,s))},c=(b,C)=>{Xo(b)||(this._notificationService.error(C),i&&this.show(e[0],t,l))},d=new nd(this._editor,3,void 0,s);let h;try{h=await bQ(n(a,d.token),d.token)}catch(b){return c(b,m(937,`Error resolving edit '{0}': +{1}`,a.title,By(b)))}finally{d.dispose()}if(s.isCancellationRequested)return;const u=kq(r.uri,e,h),g=e[0],f=r.deltaDecorations([],[{range:g,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let p,_;try{p=await this._bulkEditService.apply(u,{editor:this._editor,token:s}),_=r.getDecorationRange(f[0])}catch(b){return c(b,m(938,`Error applying edit '{0}': +{1}`,a.title,By(b)))}finally{r.deltaDecorations(f,[])}s.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(_??g,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(QT,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Vy=Tq([jp(5,fe),jp(6,Ow),jp(7,bi)],Vy);var K_e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ql=function(o,e){return function(t,i){e(t,i,o)}},Fr;const Rq="editor.changePasteType",G_e="editor.pasteAs.preferences",fF=new oe("pasteWidgetVisible",!1,m(917,"Whether the paste widget is showing")),II="application/vnd.code.copymetadata";let od=class extends A{static{Fr=this}static{this.ID="editor.contrib.copyPasteActionController"}static get(e){return e.getContribution(Fr.ID)}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=s,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=c,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(W(h,"copy",u=>this.handleCopy(u))),this._register(W(h,"cut",u=>this.handleCopy(u))),this._register(W(h,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new Oy("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Vy,"pasteIntoEditor",e,fF,{id:Rq,label:m(918,"Show paste options...")},()=>Fr._configureDefaultAction?[Fr._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){let t=null;if(e.clipboardData){const[_,b]=ag.getTextData(e.clipboardData);t=(b||Sl.INSTANCE.get(_))?.id||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",_.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled()))return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length)return;const s=this._editor.getOption(45);let r=n;const a=n.length===1&&n[0].isEmpty();if(a){if(!s)return;r=[new L(r[0].startLineNumber,1,r[0].startLineNumber,1+i.getLineLength(r[0].startLineNumber))]}const l=this._editor._getViewModel()?.getPlainTextToCopy(n,s,Ln),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(_=>!!_.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const u=_q(e.clipboardData),g=h.flatMap(_=>_.copyMimeTypes??[]),f=t??cf();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:g,defaultPastePayload:d});const p=h.map(_=>({providerMimeTypes:_.copyMimeTypes,operation:$i(b=>_.prepareDocumentPaste(i,r,u,b).catch(C=>{console.error(C)}))}));Fr._currentCopyOperation?.operations.forEach(_=>_.operation.cancel()),Fr._currentCopyOperation={handle:f,operations:p}}async handlePaste(e){if(e.clipboardData){const[c,d]=ag.getTextData(e.clipboardData),h=d||Sl.INSTANCE.get(c);this._logService.trace("CopyPasteController#handlePaste for id : ",h?.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;fo.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",n?.id," and text.length : ",e.clipboardData.getData("text/plain").length);const s=bq(e.clipboardData);s.delete(II);const r=Array.from(e.clipboardData.files).map(c=>c.type),a=[...e.clipboardData.types,...r,...n?.providerCopyMimeTypes??[],vi.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(c=>{const d=this._pasteAsActionContext?.preferred;return d&&!this.providerMatchesPreference(c,d)?!1:c.pasteMimeTypes?.some(h=>eB(h,a))});if(!l.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation());return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,l,i,s,n):this.doPasteInline(l,i,s,n,e)}showPasteAsNoEditMessage(e,t){const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(n=>n.value).join(", "):m(919,"empty"):t.providerId;fo.get(this._editor)?.showMessage(m(920,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,n,s){this._logService.trace("CopyPasteController#doPasteInline");const r=this._editor;if(!r.hasModel())return;const a=new nd(r,3,void 0),l=$i(async c=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new z,g=u.add(new qt(c));u.add(a.token.onCancellationRequested(()=>g.cancel()));const f=g.token;try{if(await this.mergeInDataFromCopy(e,i,n,f),f.isCancellationRequested)return;const p=e.filter(C=>this.isSupportedPasteProvider(C,i));if(!p.length||p.length===1&&p[0]instanceof Bg)return this.applyDefaultPasteHandler(i,n,f,s);const _={triggerKind:GC.Automatic},b=await this.getPasteEdits(p,i,h,t,_,f);if(u.add(b),f.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof Bg)return this.applyDefaultPasteHandler(i,n,f,s);if(b.edits.length){const C=d.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,b.edits),allEdits:b.edits},C,async(w,v)=>{if(!w.provider.resolveDocumentPasteEdit)return w;const S=w.provider.resolveDocumentPasteEdit(w,v),x=new tf,k=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(921,"Resolving paste edit for '{0}'. Click to cancel",w.title),hm(Promise.race([x.p,S]),v),{cancel:()=>x.cancel()},0);return k&&(w.insertText=k.insertText,w.additionalEdit=k.additionalEdit),w},f)}await this.applyDefaultPasteHandler(i,n,f,s)}finally{u.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),m(922,"Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{l.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,n,a.token,s)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,n,s){this._logService.trace("CopyPasteController#showPasteAsPick");const r=$i(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new z,h=d.add(new nd(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,n,s,h.token),h.token.isCancellationRequested)return;let u=t.filter(b=>this.isSupportedPasteProvider(b,n,e));e&&(u=u.filter(b=>this.providerMatchesPreference(b,e)));const g={triggerKind:GC.PasteAs,only:e&&"only"in e?e.only:void 0};let f=d.add(await this.getPasteEdits(u,n,c,i,g,h.token));if(h.token.isCancellationRequested)return;if(e&&(f={edits:f.edits.filter(b=>"only"in e?e.only.contains(b.kind):"preferences"in e?e.preferences.some(C=>C.contains(b.kind)):e.providerId===b.provider.id),dispose:f.dispose}),!f.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let p;if(e)p=f.edits.at(0);else{const b={id:"editor.pasteAs.default",label:m(923,"Configure default paste action"),edit:void 0},C=await this._quickInputService.pick([...f.edits.map(w=>({label:w.title,description:w.kind?.value,edit:w})),...Fr._configureDefaultAction?[{type:"separator"},{label:Fr._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:m(924,"Select Paste Action")});if(C===b){Fr._configureDefaultAction?.run();return}p=C?.edit}if(!p)return;const _=kq(c.uri,i,p);await this._bulkEditService.apply(_,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:m(925,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(II,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(II);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=ag.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i,n){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&Fr._currentCopyOperation?.handle===i.id){const s=Fr._currentCopyOperation.operations.filter(a=>e.some(l=>l.pasteMimeTypes.some(c=>eB(c,a.providerMimeTypes)))).map(a=>a.operation),r=await Promise.all(s);if(n.isCancellationRequested)return;for(const a of r.reverse())if(a)for(const[l,c]of a)t.replace(l,c)}if(!t.has(vi.uriList)){const s=await this._clipboardService.readResources();if(n.isCancellationRequested)return;s.length&&t.append(vi.uriList,rF(_k.create(s)))}}async getPasteEdits(e,t,i,n,s,r){const a=new z,l=await hm(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,s,r);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Xo(h)||console.error(h);return}})),r),c=Ua(l??[]).flat().filter(d=>!s.only||s.only.contains(d.kind));return{edits:Dq(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(vi.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t?.id),this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?t.preferences.some(i=>t.preferences.some(n=>n.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(G_e,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new Wt(n),r=t.findIndex(a=>s.contains(a.kind));if(r>=0)return r}return 0}};od=Fr=K_e([Ql(1,fe),Ql(2,Mt),Ql(3,Ow),Ql(4,Co),Ql(5,Pt),Ql(6,Pe),Ql(7,he),Ql(8,Jn),Ql(9,ej)],od);const Ug="9_cutcopypaste",Z_e=Ma||document.queryCommandSupported("cut"),Mq=Ma||document.queryCommandSupported("copy"),Y_e=typeof navigator.clipboard>"u"||Ks?document.queryCommandSupported("paste"):!0;function pF(o){return o.register(),o}const X_e=Z_e?pF(new n_({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ma?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(813,"Cu&&t"),order:1},{menuId:M.EditorContext,group:Ug,title:m(814,"Cut"),when:N.writable,order:1},{menuId:M.CommandPalette,group:"",title:m(815,"Cut"),order:1},{menuId:M.SimpleEditorContext,group:Ug,title:m(816,"Cut"),when:N.writable,order:1}]})):void 0,Q_e=Mq?pF(new n_({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ma?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(817,"&&Copy"),order:2},{menuId:M.EditorContext,group:Ug,title:m(818,"Copy"),order:2},{menuId:M.CommandPalette,group:"",title:m(819,"Copy"),order:1},{menuId:M.SimpleEditorContext,group:Ug,title:m(820,"Copy"),order:2}]})):void 0;un.appendMenuItem(M.MenubarEditMenu,{submenu:M.MenubarCopy,title:H(825,"Copy As"),group:"2_ccp",order:3});un.appendMenuItem(M.EditorContext,{submenu:M.EditorContextCopy,title:H(826,"Copy As"),group:Ug,order:3});un.appendMenuItem(M.EditorContext,{submenu:M.EditorContextShare,title:H(827,"Share"),group:"11_share",order:-1,when:q.and(q.notEquals("resourceScheme","output"),N.editorTextFocus)});un.appendMenuItem(M.ExplorerContext,{submenu:M.ExplorerContextShare,title:H(828,"Share"),group:"11_share",order:-1});const EI=Y_e?pF(new n_({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ma?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m(821,"&&Paste"),order:4},{menuId:M.EditorContext,group:Ug,title:m(822,"Paste"),when:N.writable,order:4},{menuId:M.CommandPalette,group:"",title:m(823,"Paste"),order:1},{menuId:M.SimpleEditorContext,group:Ug,title:m(824,"Paste"),when:N.writable,order:4}]})):void 0;class J_e extends le{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:H(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(Mt);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(IN.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),IN.forceCopyWithSyntaxHighlighting=!1)}}function Pq(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Mt);n.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");const s=t.get(et).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const r=s.getOption(45),a=s.getSelection();return a&&a.isEmpty()&&!r||(s.getOption(170)&&e==="cut"?(aB(s),n.trace("registerExecCommandImpl (before execCommand copy)"),s.getContainerDomNode().ownerDocument.execCommand("copy"),s.trigger(void 0,"cut",void 0),n.trace("registerExecCommandImpl (after execCommand copy)")):(aB(s),n.trace("registerExecCommandImpl (before execCommand "+e+")"),s.getContainerDomNode().ownerDocument.execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Mt);return n.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),n.trace("registerExecCommandImpl (before execCommand "+e+")"),fw().execCommand(e),n.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function aB(o){if(o.getOption(170)){const t=l4.get(o.getId());t&&t.onWillCopy()}}Pq(X_e,"cut");Pq(Q_e,"copy");EI&&(EI.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Mt);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const i=o.get(et),n=o.get(Co),s=o.get(ts),r=o.get(h_e),a=i.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const h=l4.get(a.getId());h&&h.onWillPaste()}const c=rn.create(!0);t.trace("registerExecCommandImpl (before triggerPaste)");const d=n.triggerPaste(_t().vscodeWindowId);return d?(t.trace("registerExecCommandImpl (triggerPaste defined)"),d.then(async()=>{if(t.trace("registerExecCommandImpl (after triggerPaste)"),r.quality!=="stable"){const h=c.elapsed();s.publicLog2("editorAsyncPaste",{duration:h})}return od.get(a)?.finishedPaste()??Promise.resolve()})):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),Bl?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const h=await n.readText();if(h!==""){const u=Sl.INSTANCE.get(h);let g=!1,f=null,p=null;u&&(g=a.getOption(45)&&!!u.isFromEmptySelection,f=typeof u.multicursorText<"u"?u.multicursorText:null,p=u.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",h.length," id : ",u?.id,")"),a.trigger("keyboard","paste",{text:h,pasteOnNewLine:g,multicursorText:f,mode:p})}})()):!0)}return!1}),EI.addImplementation(0,"generic-dom",(o,e)=>(o.get(Mt).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),o.get(Co).triggerPaste(_t().vscodeWindowId)??!1)));Mq&&se(J_e);const bk=Object.freeze({id:"editor",order:5,type:"object",title:m(147,"Editor"),scope:6}),zy={...bk,properties:{"editor.tabSize":{type:"number",default:Pn.tabSize,minimum:1,maximum:100,markdownDescription:m(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Pn.insertSpaces,markdownDescription:m(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Pn.detectIndentation,markdownDescription:m(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Pn.trimAutoWhitespace,description:m(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Pn.largeFileOptimizations,description:m(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m(154,"Turn off Word Based Suggestions."),m(155,"Only suggest words from the active document."),m(156,"Suggest words from all open documents of the same language."),m(157,"Suggest words from all open documents.")],description:m(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m(159,"Semantic highlighting enabled for all color themes."),m(160,"Semantic highlighting disabled for all color themes."),m(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:m(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:m(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:m(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:m(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:m(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:m(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:m(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m(174,"The opening bracket character or string sequence.")},{type:"string",description:m(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m(177,"The opening bracket character or string sequence.")},{type:"string",description:m(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:En.maxComputationTime,description:m(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:En.maxFileSize,description:m(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:En.renderSideBySide,description:m(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:En.renderSideBySideInlineBreakpoint,description:m(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:En.useInlineViewWhenSpaceIsLimited,description:m(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:En.renderMarginRevertIcon,description:m(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:En.renderGutterMenu,description:m(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:En.ignoreTrimWhitespace,description:m(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:En.renderIndicators,description:m(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:En.diffCodeLens,description:m(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:En.diffWordWrap,markdownEnumDescriptions:[m(189,"Lines will never wrap."),m(190,"Lines will wrap at the viewport width."),m(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:En.diffAlgorithm,markdownEnumDescriptions:[m(192,"Uses the legacy diffing algorithm."),m(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:En.hideUnchangedRegions.enabled,markdownDescription:m(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:En.hideUnchangedRegions.revealLineCount,markdownDescription:m(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:En.hideUnchangedRegions.minimumLineCount,markdownDescription:m(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:En.hideUnchangedRegions.contextLineCount,markdownDescription:m(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:En.experimental.showMoves,markdownDescription:m(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:En.experimental.showEmptyDecorations,description:m(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:En.experimental.useTrueInlineView,description:m(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function ebe(o){return typeof o.type<"u"||typeof o.anyOf<"u"}for(const o of ap){const e=o.schema;if(typeof e<"u")if(ebe(e))zy.properties[`editor.${o.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(zy.properties[t]=e[t])}let R1=null;function Aq(){return R1===null&&(R1=Object.create(null),Object.keys(zy.properties).forEach(o=>{R1[o]=!0})),R1}function tbe(o){return Aq()[`editor.${o}`]||!1}function ibe(o){return Aq()[`diffEditor.${o}`]||!1}const nbe=li.as($a.Configuration);nbe.registerConfiguration(zy);const Ut=new class{constructor(){this.QuickFix=new Wt("quickfix"),this.Refactor=new Wt("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Wt("notebook"),this.Source=new Wt("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var vo;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(vo||(vo={}));function sbe(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>Oq(e,t,o.include))||!o.includeSourceActions&&Ut.Source.contains(e))}function obe(o,e){const t=e.kind?new Wt(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>Oq(t,i,o.include))||!o.includeSourceActions&&t&&Ut.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function Oq(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class ml{static fromUser(e,t){return!e||typeof e!="object"?new ml(t.kind,t.apply,!1):new ml(ml.getKindFromUser(e,t.kind),ml.getApplyFromUser(e,t.apply),ml.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Wt(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class rbe{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){Ri(i)}t&&(this.action.edit=t.edit)}return this}}const Fq="editor.action.codeAction",mF="editor.action.quickFix",Wq="editor.action.autoFix",Bq="editor.action.refactor",Hq="editor.action.sourceAction",JT="editor.action.organizeImports",eR="editor.action.fixAll",abe=1e3;class Gb extends A{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:us(e.diagnostics)?us(t.diagnostics)?Gb.codeActionsPreferredComparator(e,t):-1:us(t.diagnostics)?1:Gb.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Gb.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ut.QuickFix.contains(new Wt(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const lB={actions:[],documentation:void 0};async function _p(o,e,t,i,n,s){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],Ut.Notebook]},l={only:r.include?.value,trigger:i.type},c=new cF(e,s),d=i.type===2,h=lbe(o,e,d?a:r),u=new z,g=h.map(async p=>{const _=setTimeout(()=>n.report(p),1250);try{const b=await p.provideCodeActions(e,t,l,c.token);if(c.token.isCancellationRequested)return b?.dispose(),lB;b&&u.add(b);const C=(b?.actions||[]).filter(v=>v&&obe(r,v)),w=dbe(p,C,r.include);return{actions:C.map(v=>new rbe(v,p)),documentation:w}}catch(b){if(Xo(b))throw b;return Ri(b),lB}finally{clearTimeout(_)}}),f=o.onDidChange(()=>{const p=o.all(e);jt(p,h)||c.cancel()});try{const p=await Promise.all(g),_=p.map(w=>w.actions).flat(),b=[...Ua(p.map(w=>w.documentation)),...cbe(o,e,i,_)],C=new Gb(_,b,u);return u.add(C),C}catch(p){throw u.dispose(),p}finally{f.dispose(),c.dispose()}}function lbe(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>sbe(t,new Wt(n))):!0)}function*cbe(o,e,t,i){if(e&&i.length)for(const n of o.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(s=>s.action)))}function dbe(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Wt(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Wt(n.kind)))return s.command}}var ih;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions",o.FromAILightbulb="fromAILightbulb",o.FromProblemsHover="fromProblemsHover"})(ih||(ih={}));async function hbe(o,e,t,i,n=Ve.None){const s=o.get(Ow),r=o.get(Pt),a=o.get(ts),l=o.get(bi),c=o.get(dd);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),c.playSignal(Ze.codeActionTriggered),await e.resolve(n),!n.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await s.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==ih.OnSave,showPreview:i?.preview,reason:jn.codeAction({kind:e.action.kind,providerId:ek.fromExtensionId(e.provider?.extensionId)})})).isApplied)){if(e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const h=ube(d);l.error(typeof h=="string"?h:m(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>c.playSignal(Ze.codeActionApplied),abe)}}function ube(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}Ye.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof _e))throw br();const{codeActionProvider:s}=o.get(he),r=o.get(ei).getModel(e);if(!r)throw br();const a=ae.isISelection(t)?ae.liftSelection(t):L.isIRange(t)?r.validateRange(t):void 0;if(!a)throw br();const l=typeof i=="string"?new Wt(i):void 0,c=await _p(s,r,a,{type:1,triggerAction:vo.Default,filter:{includeSourceActions:!0,include:l}},Rc.None,Ve.None),d=[],h=Math.min(c.validActions.length,typeof n=="number"?n:0);for(let u=0;uu.action)}finally{setTimeout(()=>c.dispose(),100)}});var ri;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(ri||(ri={}));(function(o){function e(l,c){return c-l}o.compare=e;const t=Object.create(null);t[o.Error]=m(1732,"Error"),t[o.Warning]=m(1733,"Warning"),t[o.Info]=m(1734,"Info");function i(l){return t[l]||""}o.toString=i;const n=Object.create(null);n[o.Error]=m(1735,"Errors"),n[o.Warning]=m(1736,"Warnings"),n[o.Info]=m(1737,"Infos");function s(l){return n[l]||""}o.toStringPlural=s;function r(l){switch(l){case ni.Error:return o.Error;case ni.Warning:return o.Warning;case ni.Info:return o.Info;case ni.Ignore:return o.Hint}}o.fromSeverity=r;function a(l){switch(l){case o.Error:return ni.Error;case o.Warning:return ni.Warning;case o.Info:return ni.Info;case o.Hint:return ni.Ignore}}o.toSeverity=a})(ri||(ri={}));var Uy;(function(o){function t(n){return i(n,!0)}o.makeKey=t;function i(n,s){const r=[""];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(""),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(""),n.severity!==void 0&&n.severity!==null?r.push(ri.toString(n.severity)):r.push(""),n.message&&s?r.push(n.message.replace("¦","\\¦")):r.push(""),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(""),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(""),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(""),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(""),r.push(""),r.join("¦")}o.makeKeyOptionalMessage=i})(Uy||(Uy={}));const $l=We("markerService");var gbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fbe=function(o,e){return function(t,i){e(t,i,o)}},tR;let iR=class{static{tR=this}static{this.codeActionCommands=[Bq,Fq,Hq,JT,eR]}constructor(e){this.keybindingService=e}getResolver(){const e=new On(()=>this.keybindingService.getKeybindings().filter(t=>tR.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===JT?i={kind:Ut.SourceOrganizeImports.value}:t.command===eR&&(i={kind:Ut.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...ml.fromUser(i,{kind:Wt.None,apply:"never"})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Wt(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};iR=tR=gbe([fbe(0,st)],iR);E("symbolIcon.arrayForeground",Ue,m(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",Ue,m(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",Ue,m(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",Ue,m(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",Ue,m(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",Ue,m(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",Ue,m(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",Ue,m(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",Ue,m(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",Ue,m(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",Ue,m(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",Ue,m(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",Ue,m(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",Ue,m(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",Ue,m(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",Ue,m(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",Ue,m(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",Ue,m(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",Ue,m(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",Ue,m(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",Ue,m(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",Ue,m(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",Ue,m(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const Vq=Object.freeze({kind:Wt.Empty,title:m(866,"More Actions...")}),pbe=Object.freeze([{kind:Ut.QuickFix,title:m(867,"Quick Fix")},{kind:Ut.RefactorExtract,title:m(868,"Extract"),icon:G.wrench},{kind:Ut.RefactorInline,title:m(869,"Inline"),icon:G.wrench},{kind:Ut.RefactorRewrite,title:m(870,"Rewrite"),icon:G.wrench},{kind:Ut.RefactorMove,title:m(871,"Move"),icon:G.wrench},{kind:Ut.SurroundWith,title:m(872,"Surround With"),icon:G.surroundWith},{kind:Ut.Source,title:m(873,"Source Action"),icon:G.symbolFile},Vq]);function mbe(o,e,t){if(!e)return o.map(s=>({kind:"action",item:s,group:Vq,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!s.action.edit?.edits.length}));const i=pbe.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Wt(s.action.kind):Wt.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:G.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}const zq=new oe("supportedCodeAction",""),cB="_typescript.applyFixAllCodeAction";class _be extends A{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new mo),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>wh(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:vo.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(73).enabled;if(i!==zr.Off){{if(i===zr.On)return t;if(i===zr.OnCode){if(!t.isEmpty())return t;const s=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=s.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===s.getLineMaxColumn(r)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var Tu;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(Xo(r))return nR;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Tu||(Tu={}));const nR=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class bbe extends A{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new ut),this._state=Tu.Empty,this._onDidChangeState=this._register(new P),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new ut),this._disposed=!1,this._supportedCodeActions=zq.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Tu.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Tu.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new _be(this._editor,this._markerService,i=>{if(!i){this.setState(Tu.Empty);return}const n=i.selection.getStartPosition(),s=$i(async l=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===vo.QuickFix||i.trigger.filter?.include?.contains(Ut.QuickFix))){const d=await _p(this._registry,e,i.selection,i.trigger,Rc.None,l);this.codeActionsDisposable.value=d;const h=[...d.allActions];if(l.isCancellationRequested)return d.dispose(),nR;const u=d.validActions?.some(f=>f.action.kind&&Ut.QuickFix.contains(new Wt(f.action.kind))&&!f.action.isAI),g=this._markerService.read({resource:e.uri});if(u){for(const f of d.validActions)f.action.command?.arguments?.some(p=>typeof p=="string"&&p.includes(cB))&&(f.action.diagnostics=[...g.filter(p=>p.relatedInformation)]);return{validActions:d.validActions,allActions:h,documentation:d.documentation,hasAutoFix:d.hasAutoFix,hasAIFix:d.hasAIFix,allAIFixes:d.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=d}}}else if(!u&&g.length>0){const f=i.selection.getPosition();let p=f,_=Number.MAX_VALUE;const b=[...d.validActions];for(const w of g){const v=w.endColumn,S=w.endLineNumber,x=w.startLineNumber;if(S===f.lineNumber||x===f.lineNumber){p=new R(S,v);const k={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:Ut.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},D=new ae(p.lineNumber,p.column,p.lineNumber,p.column),I=await _p(this._registry,e,D,k,Rc.None,l);if(l.isCancellationRequested)return I.dispose(),nR;if(I.validActions.length!==0){for(const T of I.validActions)T.action.command?.arguments?.some(F=>typeof F=="string"&&F.includes(cB))&&(T.action.diagnostics=[...g.filter(F=>F.relatedInformation)]);d.allActions.length===0&&h.push(...I.allActions),Math.abs(f.column-v)<_?b.unshift(...I.validActions):b.push(...I.validActions)}_=Math.abs(f.column-v)}}const C=b.filter((w,v,S)=>S.findIndex(x=>x.action.title===w.action.title)===v);return C.sort((w,v)=>w.action.isPreferred&&!v.action.isPreferred?-1:!w.action.isPreferred&&v.action.isPreferred||w.action.isAI&&!v.action.isAI?1:!w.action.isAI&&v.action.isAI?-1:0),{validActions:C,allActions:h,documentation:d.documentation,hasAutoFix:d.hasAutoFix,hasAIFix:d.hasAIFix,allAIFixes:d.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=d}}}}if(i.trigger.type===1){const d=await _p(this._registry,e,i.selection,i.trigger,Rc.None,l);return this.codeActionsDisposable.value=d,d}const c=await _p(this._registry,e,i.selection,i.trigger,Rc.None,l);return this.codeActionsDisposable.value=c,c});i.trigger.type===1&&this._progressService?.showWhile(s,250);const r=new Tu.Triggered(i.trigger,n,s);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&r.type===1&&r.trigger.type===2&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:vo.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Cbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vbe=function(o,e){return function(t,i){e(t,i,o)}},Yf;const dB=Ht("gutter-lightbulb",G.lightBulb,m(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),hB=Ht("gutter-lightbulb-auto-fix",G.lightbulbAutofix,m(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),uB=Ht("gutter-lightbulb-sparkle",G.lightbulbSparkle,m(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),gB=Ht("gutter-lightbulb-aifix-auto-fix",G.lightbulbSparkleAutofix,m(877,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),fB=Ht("gutter-lightbulb-sparkle-filled",G.sparkleFilled,m(878,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var ga;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(ga||(ga={}));let Cv=class extends A{static{Yf=this}static{this.GUTTER_DECORATION=Te.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:Se.asClassName(G.lightBulb),glyphMargin:{position:Aa.Left},stickiness:1})}static{this.ID="editor.contrib.lightbulbWidget"}static{this._posPref=[0]}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new P),this.onClick=this._onClick.event,this._state=ga.Hidden,this._gutterState=ga.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+dB.id,"codicon-"+gB.id,"codicon-"+hB.id,"codicon-"+uB.id,"codicon-"+fB.id],this.gutterDecoration=Yf.GUTTER_DECORATION,this._domNode=J("div.lightBulbWidget"),this._domNode.role="listbox",this._register(Xt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==1||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(XJ(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:n,height:s}=pi(this._domNode),r=this._editor.getOption(75);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(te.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(Wq)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(mF)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:n,height:s}=pi(i.target.element),r=this._editor.getOption(75);let a=Math.floor(r/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,f=S=>S>2&&this._editor.getTopForLineNumber(S)===this._editor.getTopForLineNumber(S-1),p=this._editor.getLineDecorations(a);let _=!1;if(p)for(const S of p){const x=S.options.glyphMarginClassName;if(x&&!this.lightbulbClasses.some(k=>x.includes(k))){_=!0;break}}let b=a,C=1;if(!g){const S=x=>{const k=r.getLineContent(x);return/^\s*$|^\s+/.test(k)||k.length<=C};if(a>1&&!f(a-1)){const x=r.getLineCount(),k=a===x,D=a>1&&S(a-1),I=!k&&S(a+1),T=S(a),F=!I&&!D;if(!I&&!D&&!_)return this.gutterState=new ga.Showing(e,t,i,{position:{lineNumber:b,column:C},preference:Yf._posPref}),this.renderGutterLightbub(),this.hide();D||k||D&&!T?b-=1:(I||F&&T)&&(b+=1)}else if(a===1&&(a===r.getLineCount()||!S(a+1)&&!S(a)))if(this.gutterState=new ga.Showing(e,t,i,{position:{lineNumber:b,column:C},preference:Yf._posPref}),_)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a{this._gutterDecorationID=t.addDecoration(new L(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new L(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=m(879,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=m(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=m(881,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=m(882,"Show Code Actions")))}set title(e){this._domNode.title=e}};Cv=Yf=Cbe([vbe(1,st)],Cv);var wbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Za=function(o,e){return function(t,i){e(t,i,o)}},Xf;const Sbe="quickfix-edit-highlight";let $g=class extends A{static{Xf=this}static{this.ID="editor.contrib.codeActionController"}static get(e){return e.getContribution(Xf.ID)}constructor(e,t,i,n,s,r,a,l,c,d,h){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._progressService=h,this._activeCodeActions=this._register(new ut),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new bbe(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new On(()=>{const u=this._editor.getContribution(Cv.ID);return u&&this._register(u.onClick(g=>this.showCodeActionsFromLightbulb(g.actions,g))),u}),this._resolver=n.createInstance(iR),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,ih.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){if(!this._editor.hasModel())return;fo.get(this._editor)?.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,n){const s=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(hbe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:vo.QuickFix,filter:{}}),s.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(n){Ee(n);return}if(!(this._disposed||this._editor.getSelection()?.startLineNumber!==e.position.lineNumber))if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===1){if(e.trigger.filter?.include){const s=this.tryGetValidActionToApply(e.trigger,t);if(s){try{this.hideLightBulbWidget(),await this.applyCodeAction(s,!1,!1,ih.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const r=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(r&&r.action.disabled){fo.get(this._editor)?.showMessage(r.action.disabled,e.trigger.context.position),t.dispose();return}}}const n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){fo.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}static{this.DECORATION=Te.register({description:"quickfix-highlight",className:Sbe})}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=R.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,d)=>{this.applyCodeAction(c,!0,!!d,i.fromLightbulb?ih.FromAILightbulb:ih.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:c=>{this._editor?.focus(),n.clear()},onHover:async(c,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=c.action.kind;if(u){const g=new Wt(u);h=[Ut.RefactorExtract,Ut.RefactorInline,Ut.RefactorRewrite,Ut.RefactorMove,Ut.Source].some(p=>p.contains(g))}return{canPreview:h||!!c.action.edit?.edits.length}},onFocus:c=>{if(c&&c.action){const d=c.action.ranges,h=c.action.diagnostics;if(n.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(g=>({range:g,options:Xf.DECORATION})):d.map(g=>({range:g,options:Xf.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(f=>({range:f,options:Xf.DECORATION}));n.set(u);const g=h[0];if(g.startLineNumber&&g.startColumn){const f=this._editor.getModel()?.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn})?.word;Pa(m(863,"Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,mbe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=pi(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>({id:s.id,label:s.title,tooltip:s.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(s.id,...s.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:m(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};$g=Xf=wbe([Za(1,$l),Za(2,Ie),Za(3,fe),Za(4,he),Za(5,id),Za(6,Pt),Za(7,Pe),Za(8,zh),Za(9,fe),Za(10,id)],$g);Tr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Ec));const i=o.getColor(Gd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Na(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function Bw(o){return q.regex(zq.keys()[0],new RegExp("(\\s|^)"+_o(o.value)+"\\b"))}const _F={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:m(831,"Kind of the code action to run.")},apply:{type:"string",description:m(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[m(833,"Always apply the first returned code action."),m(834,"Apply the first returned code action if it is the only one."),m(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:m(836,"Controls if only preferred code actions should be returned.")}}};function pf(o,e,t,i,n=vo.Default){o.hasModel()&&$g.get(o)?.manualTriggerAtCurrentPosition(e,n,t,i)}class ybe extends le{constructor(){super({id:mF,label:H(853,"Quick Fix..."),precondition:q.and(N.writable,N.hasCodeActionsProvider),kbOpts:{kbExpr:N.textInputFocus,primary:2137,weight:100}})}run(e,t){return pf(t,m(837,"No code actions available"),void 0,void 0,vo.QuickFix)}}class xbe extends Ki{constructor(){super({id:Fq,precondition:q.and(N.writable,N.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:_F}]}})}runEditorCommand(e,t,i){const n=ml.fromUser(i,{kind:Wt.Empty,apply:"ifSingle"});return pf(t,typeof i?.kind=="string"?n.preferred?m(838,"No preferred code actions for '{0}' available",i.kind):m(839,"No code actions for '{0}' available",i.kind):n.preferred?m(840,"No preferred code actions available"):m(841,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class Lbe extends le{constructor(){super({id:Bq,label:H(854,"Refactor..."),precondition:q.and(N.writable,N.hasCodeActionsProvider),kbOpts:{kbExpr:N.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:q.and(N.writable,Bw(Ut.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:_F}]}})}run(e,t,i){const n=ml.fromUser(i,{kind:Ut.Refactor,apply:"never"});return pf(t,typeof i?.kind=="string"?n.preferred?m(842,"No preferred refactorings for '{0}' available",i.kind):m(843,"No refactorings for '{0}' available",i.kind):n.preferred?m(844,"No preferred refactorings available"):m(845,"No refactorings available"),{include:Ut.Refactor.contains(n.kind)?n.kind:Wt.None,onlyIncludePreferredActions:n.preferred},n.apply,vo.Refactor)}}class kbe extends le{constructor(){super({id:Hq,label:H(855,"Source Action..."),precondition:q.and(N.writable,N.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:q.and(N.writable,Bw(Ut.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:_F}]}})}run(e,t,i){const n=ml.fromUser(i,{kind:Ut.Source,apply:"never"});return pf(t,typeof i?.kind=="string"?n.preferred?m(846,"No preferred source actions for '{0}' available",i.kind):m(847,"No source actions for '{0}' available",i.kind):n.preferred?m(848,"No preferred source actions available"):m(849,"No source actions available"),{include:Ut.Source.contains(n.kind)?n.kind:Wt.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,vo.SourceAction)}}class Dbe extends le{constructor(){super({id:JT,label:H(856,"Organize Imports"),precondition:q.and(N.writable,Bw(Ut.SourceOrganizeImports)),kbOpts:{kbExpr:N.textInputFocus,primary:1581,weight:100},metadata:{description:H(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return pf(t,m(850,"No organize imports action available"),{include:Ut.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",vo.OrganizeImports)}}class Ibe extends le{constructor(){super({id:eR,label:H(858,"Fix All"),precondition:q.and(N.writable,Bw(Ut.SourceFixAll))})}run(e,t){return pf(t,m(851,"No fix all action available"),{include:Ut.SourceFixAll,includeSourceActions:!0},"ifSingle",vo.FixAll)}}class Ebe extends le{constructor(){super({id:Wq,label:H(859,"Auto Fix..."),precondition:q.and(N.writable,Bw(Ut.QuickFix)),kbOpts:{kbExpr:N.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return pf(t,m(852,"No auto fixes available"),{include:Ut.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",vo.AutoFix)}}Xe($g.ID,$g,3);Xe(Cv.ID,Cv,4);se(ybe);se(Lbe);se(kbe);se(Dbe);se(Ebe);se(Ibe);re(new xbe);li.as($a.Configuration).registerConfiguration({...bk,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:m(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});li.as($a.Configuration).registerConfiguration({...bk,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:m(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});li.as($a.Configuration).registerConfiguration({...bk,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:m(862,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class Rm{constructor(){this.lenses=[]}static{this.Empty=new Rm}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){ef(e)&&(this._store??=new z,this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function Uq(o,e,t){const i=o.ordered(e),n=new Map,s=new Rm,r=i.map(async(a,l)=>{n.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&s.add(c,a)}catch(c){Ri(c)}});return await Promise.all(r),t.isCancellationRequested?(s.dispose(),Rm.Empty):(s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:n.get(a.provider)n.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),s)}Ye.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;Je(_e.isUri(t)),Je(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(he),s=o.get(ei).getModel(t);if(!s)throw br();const r=[],a=new z;return Uq(n,s,Ve.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(s,d.symbol,Ve.None)).then(h=>r.push(h||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var Nbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tbe=function(o,e){return function(t,i){e(t,i,o)}};const $q=We("ICodeLensCache");class pB{constructor(e,t){this.lineCount=e,this.data=t}}let sR=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new na(20,.75);const t="codelens/cache";ib(wt,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n);const s=te.filter(e.onWillSaveState,r=>r.reason===gh.SHUTDOWN);te.once(s)(r=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new Rm;n.add({lenses:i},this._fakeProvider);const s=new pB(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new L(a,1,a,11)});const r=new Rm;r.add({lenses:s},this._fakeProvider),this._cache.set(i,new pB(n.lineCount,r))}}catch{}}};sR=Nbe([Tbe(0,ps)],sR);$e($q,sR,1);class Rbe{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class $y{static{this._idPool=0}constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${$y._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:mB},h=>this._decorationIds[d]=h),a?a=L.plusRange(a,c.symbol.range):a=L.lift(c.symbol.range)}),this._viewZone=new Rbe(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new $y(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!!(i&&L.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:mB},s=>this._decorationIds[n]=s)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bB=function(o,e){return function(t,i){e(t,i,o)}};const Rr=We("ILanguageFeatureDebounceService");var jy;(function(o){const e=new WeakMap;let t=0;function i(n){let s=e.get(n);return s===void 0&&(s=++t,e.set(n,s)),s}o.of=i})(jy||(jy={}));class Pbe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Abe{constructor(e,t,i,n,s,r){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=r,this._cache=new na(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>cL(jy.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?ws(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new Pfe(6),this._cache.set(i,n));const s=ws(n.update(t),this._min,this._max);return lL(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new Aj;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return ws(e,this._min,this._max)}}let oR=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,s=i?.max??n**2,r=i?.key??void 0,a=`${jy.of(e)},${n}${r?","+r:""}`;let l=this._data.get(a);return l||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),l=new Pbe(n*1.5)):l=new Abe(this._logService,t,e,this._overallAverage()|0||n*1.5,n,s),this._data.set(a,l)),l}_overallAverage(){const e=new Aj;for(const t of this._data.values())e.update(t.default());return e.value}};oR=Mbe([bB(0,Mt),bB(1,bF)],oR);$e(Rr,oR,1);var Obe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},H_=function(o,e){return function(t,i){e(t,i,o)}};let vv=class{static{this.ID="css.editor.codeLens"}constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new z,this._localToDispose=new z,this._lenses=[],this._oldCodeLensModels=new z,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new St(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),n=this._editor.getOption(59),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",js.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Gc(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new St(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=$i(s=>Uq(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const r=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=r,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},Ee)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(ue(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(s=>{const r=[];let a=-1;this._lenses.forEach(c=>{!c.isValid()||a===c.getLineNumber()?r.push(c):(c.update(s),a=c.getLineNumber())});const l=new NI;r.forEach(c=>{c.dispose(l,s),this._lenses.splice(this._lenses.indexOf(c),1)}),l.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(ue(()=>{if(this._editor.getModel()){const n=Wa.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new NI;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=Wa.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new NI;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;c.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(r=>{const a=r.computeIfNecessary(e);a&&(t.push(a),i.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}const n=Date.now(),s=$i(r=>{const a=t.map((l,c)=>{const d=new Array(l.length),h=l.map((u,g)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,r)).then(f=>{d[g]=f},Ri):(d[g]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!r.isCancellationRequested&&!i[c].isDisposed()&&i[c].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const r=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{Ee(r),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};vv=Obe([H_(1,he),H_(2,Rr),H_(3,Pt),H_(4,bi),H_(5,$q)],vv);Xe(vv.ID,vv,1);se(class extends le{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:N.hasCodeLensProvider,label:H(884,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(Jn),n=e.get(Pt),s=e.get(bi),r=t.getSelection().positionLineNumber,a=t.getContribution(vv.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&c.push({label:u.symbol.command.title,command:u.symbol.command});if(c.length===0)return;const d=await i.pick(c,{canPickMany:!1,placeHolder:m(883,"Select a command")});if(!d)return;let h=d.command;if(l.isDisposed){const g=(await a.getModel())?.lenses.find(f=>f.symbol.range.startLineNumber===r&&f.symbol.command?.title===h.title);if(!g||!g.symbol.command)return;h=g.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}}});const jq=[];function v_(o){jq.push(o)}function Fbe(){return jq.slice(0)}class TI{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class db{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class jg{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(const e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}}const mf=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var qq=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rR=function(o,e){return function(t,i){e(t,i,o)}};let wv=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new V(new j(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?V.Format.CSS.formatRGBA(a):V.Format.CSS.formatRGB(a),c=r?V.Format.CSS.formatHSLA(a):V.Format.CSS.formatHSL(a),d=r?V.Format.CSS.formatHexA(a):V.Format.CSS.formatHex(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:c,textEdit:{range:n,text:c}}),h.push({label:d,textEdit:{range:n,text:d}}),h}};wv=qq([rR(0,eo)],wv);let aR=class extends A{constructor(e,t){super(),this._register(e.colorProvider.register("*",new wv(t)))}};aR=qq([rR(0,he),rR(1,eo)],aR);async function Kq(o,e,t,i="auto"){return CF(new Wbe,o,e,t,i)}function Gq(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class Wbe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class Bbe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class Hbe{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,Ve.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function CF(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(n!=="always"&&d instanceof wv)r=d;else try{await o.compute(d,t,i,a)&&(s=!0)}catch(h){Ri(h)}}return s?a:r&&n!=="never"?(await o.compute(r,t,i,a),a):[]}function Zq(o,e){const{colorProvider:t}=o.get(he),i=o.get(ei).getModel(e);if(!i)throw br();const n=o.get(Pe).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,defaultColorDecoratorsEnablement:n}}var Vbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},RI=function(o,e){return function(t,i){e(t,i,o)}},lR;const Yq=Object.create({});let Mm=class extends A{static{lR=this}static{this.ID="editor.contrib.colorDetector"}static{this.RECOMPUTE_TIME=1e3}constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new z),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new zbe),this._colorDecorationClassRefs=this._register(new z),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new $L(this._editor)),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:lR.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(27),l=s.hasChanged(167);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new mo,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=$i(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new rn(!1),n=await Kq(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Ee(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Te.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let s=0;sthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Mm=lR=Vbe([RI(1,Pe),RI(2,he),RI(3,Rr)],Mm);class zbe extends A{constructor(){super(...arguments),this._onDidChange=this._register(new P),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}const Xq="editor.action.showHover",Ube="editor.action.showDefinitionPreviewHover",$be="editor.action.hideHover",jbe="editor.action.scrollUpHover",qbe="editor.action.scrollDownHover",Kbe="editor.action.scrollLeftHover",Gbe="editor.action.scrollRightHover",Zbe="editor.action.pageUpHover",Ybe="editor.action.pageDownHover",Xbe="editor.action.goToTopHover",Qbe="editor.action.goToBottomHover",Ck="editor.action.increaseHoverVerbosityLevel",Jbe=m(1102,"Increase Hover Verbosity Level"),vk="editor.action.decreaseHoverVerbosityLevel",eCe=m(1103,"Decrease Hover Verbosity Level"),Sv="editor.action.inlineSuggest.commit",Qq="editor.action.inlineSuggest.showPrevious",Jq="editor.action.inlineSuggest.showNext",tCe="editor.action.inlineSuggest.jump",eK="editor.action.inlineSuggest.hide",cR="editor.action.inlineSuggest.toggleShowCollapsed";var vF=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qr=function(o,e){return function(t,i){e(t,i,o)}},ZS;let dR=class extends A{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=dt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=$(this,n=>{const s=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const r=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const a=new R(s.lineNumber,Math.min(r,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Xn((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=$(c=>{const d=c.store.add(this.instantiationService.createInstance(Pm.hot.read(c),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(d),c.store.add(ue(()=>e.removeContentWidget(d))),c.store.add(xe(h=>{this.position.read(h)&&r.lastTriggerKind.read(h)!==Ws.Explicit&&r.triggerExplicitly()})),d}),l=ld(this,(c,d)=>!!this.position.read(c)||!!d);s.add(xe(c=>{l.read(c)&&a.read(c)}))}))}};dR=vF([qr(2,fe)],dR);const iCe=Ht("inline-suggestion-hints-next",G.chevronRight,m(1207,"Icon for show next parameter hint.")),nCe=Ht("inline-suggestion-hints-previous",G.chevronLeft,m(1208,"Icon for show previous parameter hint."));let Pm=class extends A{static{ZS=this}static{this.hot=lk(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,i){const n=new Uo(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=m(1209,"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._warning=a,this._relayout=l,this._commandService=c,this.keybindingService=h,this._contextKeyService=u,this._menuService=g,this.id=`InlineSuggestionHintsContentWidget${ZS.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=$(f=>{const p=this._warning.read(f);return p?typeof p.message=="string"?p.message:f.store.add(Iw(p.message)).element:void 0}),this._warningMessageNode=Ae.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:$(f=>this._warning.read(f)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Qe("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,Qe("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(Qq,m(1210,"Previous"),Se.asClassName(nCe))),this.availableSuggestionCountAction=this._register(new Uo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(Jq,m(1211,"Next"),Se.asClassName(iCe))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(M.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new St(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new St(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(xe(f=>{this._warningMessageContentNode.read(f),this._warningMessageNode.readEffect(f),this._relayout()})),this.toolBar=this._register(d.createInstance(hR,this.nodes.toolBar,M.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,p)=>{if(f instanceof $o)return d.createInstance(oCe,f,void 0);if(f===this.availableSuggestionCountAction){const _=new sCe(void 0,f,{label:!0,icon:!1});return _.setClass("availableSuggestionCount"),_}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{ZS._dropDownVisible=f})),this._register(xe(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(xe(f=>{const p=this._suggestionCount.read(f),_=this._currentSuggestionIdx.read(f);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${_+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(xe(f=>{const _=this._extraCommands.read(f).map(b=>({class:void 0,id:b.command.id,enabled:!0,tooltip:b.command.tooltip||"",label:b.command.title,run:C=>this._commandService.executeCommand(b.command.id)}));for(const[b,C]of this.inlineCompletionsActionsMenus.getActions())for(const w of C)w instanceof $o&&_.push(w);_.length>0&&_.unshift(new Fi),this.toolBar.setAdditionalSecondaryActions(_)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Pm=ZS=vF([qr(8,Pt),qr(9,fe),qr(10,st),qr(11,Ie),qr(12,Er)],Pm);class sCe extends Nm{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class oCe extends Eh{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=Qe("div.keybinding").root;this._register(new C_(t,lo,{disableTitle:!0,...V_e})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let hR=class extends Ny{constructor(e,t,i,n,s,r,a,l,c){super(e,{resetMenu:t,...i},n,s,r,a,l,c),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const{primary:e,secondary:t}=iq(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){jt(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){jt(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};hR=vF([qr(3,Er),qr(4,Ie),qr(5,Jo),qr(6,st),qr(7,Pt),qr(8,ts)],hR);function wk(o,e,t){const i=pi(o);return!(ei.left+i.width||ti.top+i.height)}class rCe{constructor(e,t,i,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=n}}class tK extends A{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new P),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new MI(i=>this._triggerAsyncComputation(i),0)),this._syncComputationScheduler=this._register(new MI(i=>this._triggerSyncComputation(i),0)),this._loadingMessageScheduler=this._register(new MI(i=>this._triggerLoadingMessage(i),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=xQ(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(t){Ee(t)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;const t=this._state===0,i=this._state===4;this._onResult.fire(new rCe(this._result.slice(0),t,i,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class MI extends A{constructor(e,t){super(),this._scheduler=this._register(new St(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}class wF{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new P,this._onDidResize=new P,this._sashListener=new z,this._size=new at(0,0),this._minSize=new at(0,0),this._maxSize=new at(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new $n(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new $n(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new $n(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:xy.North}),this._southSash=new $n(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:xy.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(te.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(te.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(te.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(te.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new at(t,e);at.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const aCe=30,lCe=24;class cCe extends A{constructor(e,t=new at(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new wF),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=at.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new at(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?R.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:pi(t).top+i.top-aCe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=pi(t),s=Ch(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-lCe}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),s=Math.min(Math.max(n,i),e),r=Math.min(e,s);let a;return this._editor.getOption(69).above?a=r<=n?1:2:a=r<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}const M1=J;let SF=class extends A{constructor(e){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!e),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new ww(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class Sk extends A{static render(e,t,i){return new Sk(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Z(e,M1("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Z(this.actionContainer,M1("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Z(this.action,M1("span.icon")).classList.add(...t.iconClass.split(" ")),this.actionRenderedLabel=i?`${t.label} (${i})`:t.label;const n=Z(this.action,M1("span"));n.textContent=this.actionRenderedLabel,this._store.add(new nK(this.actionContainer,t.run)),this._store.add(new sK(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function iK(o,e){return o&&e?m(7,"Inspect this in the accessible view with {0}.",e):o?m(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class nK extends A{constructor(e,t){super(),this._register(W(e,ee.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class sK extends A{constructor(e,t,i){super(),this._register(W(e,ee.KEY_DOWN,n=>{const s=new yt(n);i.some(r=>s.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var dCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},P1=function(o,e){return function(t,i){e(t,i,o)}},Wr;const CB=30;let uR=class extends cCe{static{Wr=this}static{this.ID="editor.contrib.resizableContentHoverWidget"}static{this._lastDimensions=new at(0,0)}get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,s){const r=e.getOption(75)+8,a=150,l=new at(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new SF(!0)),this._onDidResize=this._register(new P),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new P),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new P),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=l,this._hoverVisibleKey=N.hoverVisible.bindTo(t),this._hoverFocusedKey=N.hoverFocused.bindTo(t),Z(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(59)&&this._updateFont()}));const c=this._register(xr(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(d=>{this._onDidScroll.fire(d)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return Wr.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Wr._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Wr._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return Wr._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Wr._applyMaxDimensions(this._hover.contentsDomNode,e,t),Wr._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),Wr._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new at(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){Wr._lastDimensions=new at(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let i=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{i+=n.clientHeight}),Math.min(e,i)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Wr._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,Wr._lastDimensions.width);this._resizableNode.maxSize=new at(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=Dc(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const s=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&iK(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");s&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+s)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new at(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new at(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new at(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=Dc(e),i=so(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=Dc(e),i=so(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=Dc(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-CB})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+CB})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};uR=Wr=dCe([P1(1,Ie),P1(2,Pe),P1(3,kn),P1(4,st)],uR);function vB(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),c=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+c*c)}class qy{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return Yi.EMPTY;const n=qy._getLineDecorations(this._editor,i);return Yi.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(i,n,e.source,t):Yi.EMPTY))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=qy._getLineDecorations(this._editor,t);let n=[];for(const s of this._participants)n=n.concat(s.computeSync(t,i,e.source));return Ua(n)}}class oK{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new hCe(this,t,this.isComplete,this.options)}}class hCe extends oK{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}var uCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wB=function(o,e){return function(t,i){e(t,i,o)}};const SB=J;let Ky=class extends A{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=SB("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=Z(this.hoverElement,SB("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(Sk.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(zl("element"),n.actionContainer,n.actionRenderedLabel)),this.actions.push(n),n}append(e){const t=Z(this.actionsElement,e);return this._hasContent=!0,t}};Ky=uCe([wB(0,st),wB(1,Ms)],Ky);const rK={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class fd extends So{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new P),this._onKeyDown=this._register(new P),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Se.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(oa().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(this.enabled){if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)}})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...Se.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...Se.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}class gR extends So{static{this.CLASS_NAME="monaco-checkbox"}constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new P),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}}class aK extends gR{constructor(e,t,i){const n=new fd({title:e,isChecked:t,icon:G.check,actionClassName:gR.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...rK});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(G.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class lK extends gR{constructor(e,t,i){let n;switch(t){case!0:n=G.check;break;case"mixed":n=G.dash;break;case!1:n=void 0;break}const s=new fd({title:e,isChecked:t===!0,icon:n,actionClassName:aK.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...rK});super(s,s.domNode,i),this._state=t,this._register(s),this._register(this.checkbox.onChange(r=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(r)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=e===!0,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(G.check);break;case"mixed":this.checkbox.setIcon(G.dash);break;case!1:this.checkbox.setIcon(void 0);break}super.applyStyles(e)}}class Br{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(n.changeDecorationOptions(this._highlightedDecorationId,Br._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,Br._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let s=this._editor.getModel().getDecorationRange(t);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const r=s.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);s=new L(s.startLineNumber,s.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(s,Br._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=Br._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=Br._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let g=1,f=e.length;g=p.startLineNumber?p.endLineNumber>u&&(u=p.endLineNumber):(s.push({range:new L(h,1,u,1),options:Br._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=p.startLineNumber,u=p.endLineNumber)}s.push({range:new L(h,1,u,1),options:Br._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Br._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return s;if(!(s.startColumn0){const i=[];for(let r=0;rL.compareRangesUsingStarts(r.range,a.range));const n=[];let s=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):o[0][0].toUpperCase()!==o[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function yB(o,e,t){return o[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&o[0].split(t).length===e.split(t).length}function xB(o,e,t){const i=e.split(t),n=o[0].split(t);let s="";return i.forEach((r,a)=>{s+=cK([n[a]],r)+t}),s.slice(0,-1)}class LB{constructor(e){this.staticValue=e,this.kind=0}}class fCe{constructor(e){this.pieces=e,this.kind=1}}class Am{static fromStaticValue(e){return new Am([fg.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new LB(""):e.length===1&&e[0].staticValue!==null?this._state=new LB(e[0].staticValue):this._state=new fCe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?cK(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const l=[],c=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=c){l.push(a.slice(h));break}switch(r.caseOps[d]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),d++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),d++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=n)break;const r=o.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,pt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},_Ce)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new L(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,nh);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=jC(n.map(l=>l.range),l=>L.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===1?(i===1?i=s.getLineCount():i--,n=s.getLineMaxColumn(i)):n--,new R(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===s.getLineMaxColumn(i)?(i===s.getLineCount()?i=1:i++,n=1):n++,new R(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()Zb._getSearchRange(this._editor.getModel(),s));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=nh?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new du(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const n=this._editor.getModel(),s=n.getValue(1),r=n.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=s.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=s.replace(i,a.buildReplaceString(null,c));const d=new wO(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let r=0,a=i.length;rr.range),n);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(s=>new ae(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn));const n=this._editor.getSelection();for(let s=0,r=i.length;s=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function gK(o,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const s=document.createElement("a");t.disposables.add(Li(s,"click",r=>{t.callback(String(e.index),r)})),n=s}else e.type===8?n=document.createElement("br"):e.type===1&&(n=o);n&&o!==n&&o.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(s=>{gK(n,s,t,i)})}function xCe(o,e){const t={type:1,children:[]};let i=0,n=t;const s=[],r=new yCe(o);for(;!r.eos();){let a=r.next();const l=a==="\\"&&fR(r.peek())!==0;if(l&&(a=r.next()),!l&&LCe(a)&&a===r.peek()){r.advance(),n.type===2&&(n=s.pop());const c=fR(a);if(n.type===c||n.type===5&&c===6)n=s.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),n.children.push(d),s.push(n),n=d}}else if(a===` +`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function LCe(o,e){return fR(o)!==0}function fR(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class kCe{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class DCe{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new kCe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const Tf=J;let ICe=class extends So{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new ut),this._onDidChange=this._register(new P),this._onDidHeightChange=this._register(new P),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Z(e,Tf(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",s=Z(this.element,Tf(".ibwrapper"));if(this.input=Z(s,Tf(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Z(s,Tf("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new FU(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Z(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const r=this._register(new mt(e.ownerDocument,"selectionchange")),a=te.filter(r.event,()=>e.ownerDocument.getSelection()?.anchorNode===s);this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new qs(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(oa().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Dc(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return gL(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&go(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Hc(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=so(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{if(!this.message)return null;e=Z(n,Tf(".monaco-inputbox-container")),t();const s=Tf("span.monaco-inputbox-message");this.message.formatContent?SCe(this.message.content,void 0,s):wCe(this.message.content,void 0,s),s.classList.add(this.classForType(this.message.type));const r=this.stylesForType(this.message.type);return s.style.backgroundColor=r.background??"",s.style.color=r.foreground??"",s.style.border=r.border?`1px solid ${r.border}`:"",Z(e,s),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m(9,"Error: {0}",this.message.content):this.message.type===2?i=m(10,"Warning: {0}",this.message.content):i=m(11,"Info: {0}",this.message.content),Is(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${Hc(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Dc(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,s=t.value;i!==null&&n!==null&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}};class fK extends ICe{constructor(e,t,i){const n=m(12," or {0} for history","⇅"),s=m(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new P),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new P),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new DCe(i.history,100));const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:s,l=this.placeholder+a;i.showPlaceholderOnFocus&&!gL(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(s)||a(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Pa(this.value?this.value:m(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Pa(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const ECe=m(1,"input");class pK extends So{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new ut),this.additionalToggles=[],this._onDidOptionChange=this._register(new P),this._onKeyDown=this._register(new P),this._onMouseDown=this._register(new P),this._onInput=this._register(new P),this._onKeyUp=this._register(new P),this._onCaseSensitiveKeyDown=this._register(new P),this._onRegexKeyDown=this._register(new P),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||ECe,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=!!i.flexibleHeight,l=!!i.flexibleWidth,c=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fK(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){const d=i?.hoverLifecycleOptions||{groupId:"find-input"};this.regex=this._register(new uK({appendTitle:r,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.regex.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(u=>{this._onRegexKeyDown.fire(u)})),this.wholeWords=this._register(new hK({appendTitle:s,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.wholeWords.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new dK({appendTitle:n,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(u=>{this._onCaseSensitiveKeyDown.fire(u)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const g=h.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let f=-1;u.equals(17)?f=(g+1)%h.length:u.equals(15)&&(g===0?f=h.length-1:f=g-1),u.equals(9)?(h[g].blur(),this.inputBox.focus()):f>=0&&h[f].focus(),nt.stop(u,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(W(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(W(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new z;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((t,i)=>t+i.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const NCe=m(5,"input"),TCe=m(6,"Preserve Case");class RCe extends fd{constructor(e){super({icon:G.preserveCase,title:TCe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class MCe extends So{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onPreserveCaseKeyDown(){return this._onPreserveCaseKeyDown.event}constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new P),this._onKeyDown=this._register(new P),this._onMouseDown=this._register(new P),this._onInput=this._register(new P),this._onKeyUp=this._register(new P),this._onPreserveCaseKeyDown=this._register(new P),this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||NCe;const s=n.appendPreserveCaseLabel||"",r=n.history||new Set([]),a=!!n.flexibleHeight,l=!!n.flexibleWidth,c=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fK(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new RCe({appendTitle:s,isChecked:!1,hoverLifecycleOptions:n.hoverLifecycleOptions,...n.toggleStyles})),this._register(this.preserveCase.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const g=d.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let f=-1;u.equals(17)?f=(g+1)%d.length:u.equals(15)&&(g===0?f=d.length-1:f=g-1),u.equals(9)?(d[g].blur(),this.inputBox.focus()):f>=0&&d[f].focus(),nt.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox?.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var mK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_K=function(o,e){return function(t,i){e(t,i,o)}};const xF=new oe("suggestWidgetVisible",!1,m(1698,"Whether suggestion are visible")),LF="historyNavigationWidgetFocus",bK="historyNavigationForwardsEnabled",CK="historyNavigationBackwardsEnabled";let Yb;const H1=[];function vK(o,e){if(H1.includes(e))throw new Error("Cannot register the same widget multiple times");H1.push(e);const t=new z,i=new oe(LF,!1).bindTo(o),n=new oe(bK,!0).bindTo(o),s=new oe(CK,!0).bindTo(o),r=()=>{i.set(!0),Yb=e},a=()=>{i.set(!1),Yb===e&&(Yb=void 0)};return gL(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(ue(()=>{H1.splice(H1.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:s,dispose(){t.dispose()}}}let pR=class extends pK{constructor(e,t,i,n){super(e,t,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(vK(s,this.inputBox))}};pR=mK([_K(3,Ie)],pR);let mR=class extends MCe{constructor(e,t,i,n,s=!1){super(e,t,s,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(vK(r,this.inputBox))}};mR=mK([_K(3,Ie)],mR);fn.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:q.and(q.has(LF),q.equals(CK,!0),q.not("isComposing"),xF.isEqualTo(!1)),primary:16,secondary:[528],handler:o=>{Yb?.showPreviousValue()}});fn.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:q.and(q.has(LF),q.equals(bK,!0),q.not("isComposing"),xF.isEqualTo(!1)),primary:18,secondary:[530],handler:o=>{Yb?.showNextValue()}});function kB(o){return o.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&o.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const DB=Ht("find-collapsed",G.chevronRight,m(956,"Icon to indicate that the editor find widget is collapsed.")),IB=Ht("find-expanded",G.chevronDown,m(957,"Icon to indicate that the editor find widget is expanded.")),PCe=Ht("find-selection",G.selection,m(958,"Icon for 'Find in Selection' in the editor find widget.")),ACe=Ht("find-replace",G.replace,m(959,"Icon for 'Replace' in the editor find widget.")),OCe=Ht("find-replace-all",G.replaceAll,m(960,"Icon for 'Replace All' in the editor find widget.")),FCe=Ht("find-previous-match",G.arrowUp,m(961,"Icon for 'Find Previous' in the editor find widget.")),WCe=Ht("find-next-match",G.arrowDown,m(962,"Icon for 'Find Next' in the editor find widget.")),BCe=m(963,"Find / Replace"),HCe=m(964,"Find"),VCe=m(965,"Find"),zCe=m(966,"Previous Match"),UCe=m(967,"Next Match"),$Ce=m(968,"Find in Selection"),jCe=m(969,"Close"),qCe=m(970,"Replace"),KCe=m(971,"Replace"),GCe=m(972,"Replace"),ZCe=m(973,"Replace All"),YCe=m(974,"Toggle Replace"),XCe=m(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",nh),QCe=m(976,"{0} of {1}"),EB=m(977,"No results"),Ya=419,JCe=275,eve=JCe-54;let V_=69;const tve=33,NB=ze?256:2048;class PI{constructor(e){this.afterLineNumber=e,this.heightInPx=tve,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function TB(o,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){o.stopPropagation();return}}function RB(o,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(165)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(50)){const h=this._codeEditor.getOption(50).loop;this._state.change({loop:h},!1);const u=this._codeEditor.getOption(50).addExtraSpaceOnTop;u&&!this._viewZone&&(this._viewZone=new PI(0),this._showViewZone()),!u&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const d=await this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}})),this._findInputFocused=yk.bindTo(r),this._findFocusTracker=this._register(xr(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=yF.bindTo(r),this._replaceFocusTracker=this._register(xr(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new PI(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return kF.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(104)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=so(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Ee)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=V_+"px",this._state.matchesCount>=nh?this._matchesCount.title=XCe:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=nh&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Lg(QCe,i,t)}else e=EB;this._matchesCount.appendChild(document.createTextNode(e)),Is(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),V_=Math.max(V_,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===EB)return i===""?m(978,"{0} found",e):m(979,"{0} found for '{1}'",e,i);if(t){const n=m(980,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();return s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1?`${s.getLineContent(t.startLineNumber)}, ${n}`:n}return m(981,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=pi(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(s?s.left:0),a=s?s.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=hz(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new PI(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const s=this._getHeight();if(s===i.heightInPx)return;const r=s-i.heightInPx;i.heightInPx=s,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let s=this._getHeight();if(s-=this._codeEditor.getOption(96).top,s<=0)return;i.heightInPx=s,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,n=e.minimap.minimapWidth;let s=!1,r=!1,a=!1;if(this._resized&&so(this._domNode)>Ya){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=so(this._findInput.domNode);return}if(Ya+28+n>=i&&(r=!0),Ya+28+n-V_>=i&&(a=!0),Ya+28+n-V_>=i+50&&(s=!0),this._domNode.classList.toggle("collapsed-find-widget",s),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!s&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:s,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=so(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!L.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(NB|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return TB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return RB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(NB|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return TB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return RB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const i=this._codeEditor.getOption(50).history,n=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new pR(null,this._contextViewProvider,{width:eve,label:HCe,placeholder:VCe,appendCaseSensitiveLabel:this._keybindingLabelFor(Tt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Tt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Tt.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>kB(this._keybindingService),inputBoxStyles:Iy,toggleStyles:Dy,history:i==="workspace"?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(h=>{h.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(h)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),Gs&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const s={groupId:"find-widget"};this._prevBtn=this._register(new fu({label:zCe+this._keybindingLabelFor(Tt.PreviousMatchFindAction),icon:FCe,hoverLifecycleOptions:s,onTrigger:()=>{Ud(this._codeEditor.getAction(Tt.PreviousMatchFindAction)).run().then(void 0,Ee)}},this._hoverService)),this._nextBtn=this._register(new fu({label:UCe+this._keybindingLabelFor(Tt.NextMatchFindAction),icon:WCe,hoverLifecycleOptions:s,onTrigger:()=>{Ud(this._codeEditor.getAction(Tt.NextMatchFindAction)).run().then(void 0,Ee)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const a=document.createElement("div");a.className="find-actions",r.appendChild(a),a.appendChild(this._matchesCount),a.appendChild(this._prevBtn.domNode),a.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new fd({icon:PCe,title:$Ce+this._keybindingLabelFor(Tt.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:s,inputActiveOptionBackground:Q(d_),inputActiveOptionBorder:Q(_w),inputActiveOptionForeground:Q(bw)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),a.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new fu({label:jCe+this._keybindingLabelFor(Tt.CloseFindWidgetCommand),icon:qj,hoverLifecycleOptions:s,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new mR(null,void 0,{label:qCe,placeholder:KCe,appendPreserveCaseLabel:this._keybindingLabelFor(Tt.TogglePreserveCaseCommand),history:n==="workspace"?this._replaceWidgetHistory:new Set([]),flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>kB(this._keybindingService),inputBoxStyles:Iy,toggleStyles:Dy,hoverLifecycleOptions:s},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),h.preventDefault())})),this._replaceBtn=this._register(new fu({label:GCe+this._keybindingLabelFor(Tt.ReplaceOneAction),icon:ACe,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new fu({label:ZCe+this._keybindingLabelFor(Tt.ReplaceAllAction),icon:OCe,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const l=document.createElement("div");l.className="replace-part",l.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",l.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new fu({label:YCe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=so(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=BCe,this._domNode.role="dialog",this._domNode.style.width=`${Ya}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(l),this._resizeSash=this._register(new $n(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=Ya;this._register(this._resizeSash.onDidStart(()=>{d=so(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const u=d+h.startX-h.currentX;if(ug||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=so(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=so(this._domNode);if(hthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}}class fu extends So{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+Se.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},e.hoverLifecycleOptions)),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{if(n.equals(10)||n.equals(3)){this._opts.onTrigger(),n.preventDefault();return}this._opts.onKeyDown?.(n)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Se.asClassNameArray(DB)),this._domNode.classList.add(...Se.asClassNameArray(IB))):(this._domNode.classList.remove(...Se.asClassNameArray(IB)),this._domNode.classList.add(...Se.asClassNameArray(DB)))}}Tr((o,e)=>{const t=o.getColor(Gd);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Na(o.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=o.getColor(rse);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Na(o.type)?"dashed":"solid"} ${i}; }`);const n=o.getColor(Ge);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const s=o.getColor(sse);s&&e.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const r=o.getColor(ose);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var ive=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},MB=function(o,e){return function(t,i){e(t,i,o)}};let _R=class extends A{constructor(e,t,i,n){super(),this._container=e,this._getContent=t,this._clipboardService=i,this._hoverService=n,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new fu({label:m(1128,"Copy"),icon:G.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const e=this._getContent();e&&(await this._clipboardService.writeText(e),Pa(m(1129,"Copied to clipboard")))}};_R=ive([MB(2,Co),MB(3,Ms)],_R);class nve{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function sve(o,e,t,i,n){const s=await Promise.resolve(o.provideHover(t,i,n)).catch(Ri);if(!(!s||!ove(s)))return new nve(o,s,e)}function DF(o,e,t,i,n=!1){const r=o.ordered(e,n).map((a,l)=>sve(a,l,e,t,i));return Yi.fromPromisesResolveOrder(r).coalesce()}async function wK(o,e,t,i,n=!1){const s=[];for await(const r of DF(o,e,t,i,n))s.push(r.hover);return s}Js("_executeHoverProvider",(o,e,t)=>{const i=o.get(he);return wK(i.hoverProvider,e,t,Ve.None)});Js("_executeHoverProvider_recursive",(o,e,t)=>{const i=o.get(he);return wK(i.hoverProvider,e,t,Ve.None,!0)});function ove(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var rve=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rf=function(o,e){return function(t,i){e(t,i,o)}};const Qu=J,ave=Ht("hover-increase-verbosity",G.add,m(1130,"Icon for increaseing hover verbosity.")),lve=Ht("hover-decrease-verbosity",G.remove,m(1131,"Icon for decreasing hover verbosity."));class Gr{constructor(e,t,i,n,s,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s,this.source=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class SK{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case oo.Increase:return this.hover.canIncreaseVerbosity??!1;case oo.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let yv=class{constructor(e,t,i,n,s,r,a){this._editor=e,this._markdownRendererService=t,this._configurationService=i,this._languageFeaturesService=n,this._keybindingService=s,this._hoverService=r,this._commandService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new Gr(this,e.range,[new Kn().appendText(m(1132,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let u=!1;d>=0&&l>d&&e.range.startColumn>=d&&(u=!0,r.push(new Gr(this,e.range,[{value:m(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Gr(this,e.range,[{value:m(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const f of t){const p=f.range.startLineNumber===n?f.range.startColumn:1,_=f.range.endLineNumber===n?f.range.endColumn:s,b=f.options.hoverMessage;if(!b||Em(b))continue;f.options.beforeContentClassName&&(g=!0);const C=new L(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new Gr(this,C,rO(b),g,a++))}return r}computeAsync(e,t,i,n){if(!this._editor.hasModel()||e.type!==1)return Yi.EMPTY;const s=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(s)?this._getMarkdownHovers(r,s,e,n):Yi.EMPTY}async*_getMarkdownHovers(e,t,i,n){const s=i.range.getStartPosition(),r=DF(e,t,s,n);for await(const a of r)if(!Em(a.hover.contents)){const l=a.hover.range?L.lift(a.hover.range):i.range,c=new SK(a.hover,a.provider,s);yield new Gr(this,l,a.hover.contents,!1,a.ordinal,c)}}renderHoverParts(e,t){return this._renderedHoverParts=new cve(t,e.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){this._renderedHoverParts?.handleScroll(e)}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}updateMarkdownHoverVerbosityLevel(e,t){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t))}};yv=rve([Rf(1,aa),Rf(2,Pe),Rf(3,he),Rf(4,st),Rf(5,Ms),Rf(6,Pt)],yv);class V1{constructor(e,t,i,n){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=n}dispose(){this.disposables.dispose()}}class cve{constructor(e,t,i,n,s,r,a,l,c,d){this._hoverParticipant=i,this._editor=n,this._commandService=s,this._keybindingService=r,this._hoverService=a,this._configurationService=l,this._markdownRendererService=c,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new z,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(ue(()=>{this.renderedHoverParts.forEach(h=>{h.dispose()}),this._ongoingHoverOperations.forEach(h=>{h.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(Bn(n=>n.ordinal,uo)),e.map(n=>{const s=this._renderHoverPart(n,i);return t.appendChild(s.hoverElement),s})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,s=e.source,r=new z;if(r.add(i),!s)return new V1(e,n,r);const a=s.supportsVerbosityAction(oo.Increase),l=s.supportsVerbosityAction(oo.Decrease);if(!a&&!l)return new V1(e,n,r);const c=Qu("div.verbosity-actions");n.prepend(c);const d=Qu("div.verbosity-actions-inner");return c.append(d),r.add(this._renderHoverExpansionAction(d,oo.Increase,a)),r.add(this._renderHoverExpansionAction(d,oo.Decrease,l)),new V1(e,n,r,d)}_renderMarkdownHover(e,t){return yK(this._editor,e,this._markdownRendererService,t)}_renderHoverExpansionAction(e,t,i){const n=new z,s=t===oo.Increase,r=Z(e,Qu(Se.asCSSSelector(s?ave:lve)));r.tabIndex=0;const a=new Tm("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,r,hve(this._keybindingService,t))),!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===oo.Increase?Ck:vk,{focus:!0});return n.add(new nK(r,l)),n.add(new sK(r,l,[3,10])),n}handleScroll(e){this.renderedHoverParts.forEach(t=>{const i=t.actionsContainer;if(!i)return;const n=t.hoverElement,r=e.scrollTop+e.height,a=n.offsetTop,l=n.clientHeight,c=a+l,d=22;let h;c<=r||a>=r?h=l-d:h=r-a-d,i.style.top=`${h}px`})}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const n=this._getRenderedHoverPartAtIndex(t),s=n?.hoverPart.source;if(!n||!s?.supportsVerbosityAction(e))return;const r=await this._fetchHover(s,i,e);if(!r)return;const a=new SK(r,s.hoverProvider,s.hoverPosition),l=n.hoverPart,c=new Gr(this._hoverParticipant,l.range,r.contents,l.isBeforeContent,l.ordinal,a),d=this._updateRenderedHoverPart(t,c);if(d)return{hoverPart:c,hoverElement:d.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(e,t,i){let n=i===oo.Increase?1:-1;const s=e.hoverProvider,r=this._ongoingHoverOperations.get(s);r&&(r.tokenSource.cancel(),n+=r.verbosityDelta);const a=new qt;this._ongoingHoverOperations.set(s,{verbosityDelta:n,tokenSource:a});const l={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let c;try{c=await Promise.resolve(s.provideHover(t,e.hoverPosition,a.token,l))}catch(d){Ri(d)}return a.dispose(),this._ongoingHoverOperations.delete(s),c}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),n=this.renderedHoverParts[e],s=n.hoverElement,r=i.hoverElement,a=Array.from(r.children);s.replaceChildren(...a);const l=new V1(t,s,i.disposables,i.actionsContainer);return n.dispose(),this.renderedHoverParts[e]=l,l}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function dve(o,e,t,i){e.sort(Bn(s=>s.ordinal,uo));const n=[];for(const s of e){const r=yK(t,s,i,o.onContentsChanged);o.fragment.appendChild(r.hoverElement),n.push(r)}return new jg(n)}function yK(o,e,t,i){const n=new z,s=Qu("div.hover-row"),r=Qu("div.hover-row-contents");s.appendChild(r);const a=e.contents;for(const c of a){if(Em(c))continue;const d=Qu("div.markdown-hover"),h=Z(d,Qu("div.hover-contents")),u=n.add(t.render(c,{context:o,asyncRenderCallback:()=>{h.className="hover-contents code-hover-contents",i()}}));h.appendChild(u.element),r.appendChild(d)}return{hoverPart:e,hoverElement:s,dispose(){n.dispose()}}}function hve(o,e){switch(e){case oo.Increase:{const t=o.lookupKeybinding(Ck);return t?m(1135,"Increase Hover Verbosity ({0})",t.getLabel()):m(1136,"Increase Hover Verbosity")}case oo.Decrease:{const t=o.lookupKeybinding(vk);return t?m(1137,"Decrease Hover Verbosity ({0})",t.getLabel()):m(1138,"Decrease Hover Verbosity")}}}const PB=J;class uve extends A{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,this._domNode=PB(".saturation-wrap"),Z(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Z(this._domNode,this._canvas),this.selection=PB(".saturation-selection"),Z(this._domNode,this.selection),this.layout(),this._register(W(this._domNode,ee.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new l_);const t=pi(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=W(e.target.ownerDocument,ee.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new V(new bl(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=V.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class gve extends A{constructor(e){super(),this._onClicked=this._register(new P),this.onClicked=this._onClicked.event,this._button=Z(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(W(this._button,ee.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const z_=J;class xK extends A{constructor(e,t,i){super(),this.model=t,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,i==="standalone"?(this.domNode=Z(e,z_(".standalone-strip")),this.overlay=Z(this.domNode,z_(".standalone-overlay"))):(this.domNode=Z(e,z_(".strip")),this.overlay=Z(this.domNode,z_(".overlay"))),this.slider=Z(this.domNode,z_(".slider")),this.slider.style.top="0px",this._register(W(this.domNode,ee.POINTER_DOWN,n=>this.onPointerDown(n))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new l_),i=pi(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=W(e.target.ownerDocument,ee.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class fve extends xK{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,s=new V(new j(t,i,n,1)),r=new V(new j(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class pve extends xK{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}const mve=J;class _ve extends A{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=mve(".colorpicker-body"),Z(e,this._domNode),this._saturationBox=new uve(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new fve(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new pve(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n==="standalone"&&(this._insertButton=this._register(new gve(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new V(new bl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new V(new bl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new V(new bl(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const bve=J;class Cve extends A{constructor(e){super(),this._onClicked=this._register(new P),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Z(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Z(this._button,t),Z(t,bve(".button"+Se.asCSSSelector(Ht("color-picker-close",G.close,m(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(W(this._button,ee.CLICK,()=>{this._onClicked.fire()}))}}const z1=J;class vve extends A{constructor(e,t,i,n){super(),this.model=t,this.type=n,this._closeButton=null,this._domNode=z1(".colorpicker-header"),Z(e,this._domNode),this._pickedColorNode=Z(this._domNode,z1(".picked-color")),Z(this._pickedColorNode,z1("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Z(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=m(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=Z(this._domNode,z1(".original-color")),this._originalColorNode.style.backgroundColor=V.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Z0)||V.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(Z0)||V.white})),this._register(W(this._pickedColorNode,ee.CLICK,()=>this.model.selectNextColorPresentation())),this._register(W(this._originalColorNode,ee.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=V.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.type==="standalone"&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Cve(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=V.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const wve=J;class LK extends So{constructor(e,t,i,n,s){super(),this.model=t,this.pixelRatio=i,this._register(OC.getInstance(pe(e)).onDidChange(()=>this.layout())),this._domNode=wve(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new vve(this._domNode,this.model,n,s)),this.body=this._register(new _ve(this._domNode,this.model,this.pixelRatio,s))}layout(){this.body.layout()}get domNode(){return this._domNode}}class Sve{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new P,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new P,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new P,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xve=function(o,e){return function(t,i){e(t,i,o)}};class Gy{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(e,t){return new Gy(e,t.range,t.model,t.provider)}}let Zy=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,n){return Yi.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const n=Mm.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[Gy.fromBaseColor(this,await kK(this._editor.getModel(),r.colorInfo,r.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return t==="hover"||t==="clickAndHover";case 1:return t==="click"||t==="clickAndHover";case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(t.length===0||!i.hasModel())return new jg([]);const n=i.getOption(75)+8;e.setMinimumDimensions(new at(302,n));const s=new z,r=t[0],a=i.getModel(),l=r.model;this._colorPicker=s.add(new LK(e.fragment,l,i.getOption(163),this._themeService,"hover"));let c=!1,d=new L(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);s.add(l.onColorFlushed(async u=>{await xv(a,l,u,d,r),c=!0,d=DK(i,d,l)})),s.add(l.onDidChangeColor(u=>{xv(a,l,u,d,r)})),s.add(i.onDidChangeModelContent(u=>{c?c=!1:(e.hide(),i.focus())}));const h={hoverPart:Gy.fromBaseColor(this,r),hoverElement:this._colorPicker.domNode,dispose(){s.dispose()}};return new jg([h])}getAccessibleContent(e){return m(887,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}handleContentsChanged(){this._colorPicker?.layout()}handleHide(){this._colorPicker?.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};Zy=yve([xve(1,ci)],Zy);class gi{static insert(e,t){return{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function bR(o,e){return!!o[e]}class AI{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=bR(e.event,t.triggerModifier),this.isMiddleClick&&t.mouseMiddleClickAction==="ctrlLeftClick"&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=bR(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class AB{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=bR(e,t.triggerModifier)}}class U1{constructor(e,t,i,n,s){this.mouseMiddleClickAction=s,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}}function OB(o,e){return o==="altKey"?ze?new U1(57,"metaKey",6,"altKey",e):new U1(5,"ctrlKey",6,"altKey",e):ze?new U1(6,"altKey",57,"metaKey",e):new U1(6,"altKey",5,"ctrlKey",e)}class xk extends A{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new P),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new P),this.onExecute=this._onExecute.event,this._onCancel=this._register(new P),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=OB(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(86)||i.hasChanged(87)){const n=OB(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new AI(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new AI(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new AI(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new AB(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new AB(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);!!this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink")&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class IK{constructor(e,t){this.range=e,this.direction=t}}class IF{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new IF(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){Ri(t),this._isResolved=!1}}}class qp{static{this._emptyInlayHintList=Object.freeze({dispose(){},hints:[]})}static async create(e,t,i,n){const s=[],r=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,n);(c?.hints.length||a.onDidChangeInlayHints)&&s.push([c??qp._emptyInlayHintList,a])}catch(c){Ri(c)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new wr;return new qp(i,s,t)}constructor(e,t,i){this._disposables=new z,this.ranges=e,this.provider=new Set;const n=[];for(const[s,r]of t){this._disposables.add(s),this.provider.add(r);for(const a of s.hints){const l=i.validatePosition(a.position);let c="before";const d=qp._getRangeAtPosition(i,l);let h;d.getStartPosition().isBefore(l)?(h=L.fromPositions(d.getStartPosition(),l),c="after"):(h=L.fromPositions(l,d.getEndPosition()),c="before"),n.push(new IF(a,new IK(h,c),r))}}this.items=n.sort((s,r)=>R.compare(s.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new L(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const s=e.tokenization.getLineTokens(i),r=t.column-1,a=s.findTokenIndexAtOffset(r);let l=s.getStartOffset(a),c=s.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=s.getStartOffset(a-1),c=s.getEndOffset(a-1)):c===r&&a=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jl=function(o,e){return function(t,i){e(t,i,o)}};let rd=class extends Pg{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,c,d,h,u,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){EL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};rd=Dve([Jl(4,fe),Jl(5,et),Jl(6,Pt),Jl(7,Ie),Jl(8,ci),Jl(9,bi),Jl(10,kn),Jl(11,ti),Jl(12,he)],rd);function NK(o){const e=o.get(et).getFocusedCodeEditor();return e instanceof rd?e.getParentEditor():e}const FB=new V(new j(0,122,204)),Ive={showArrow:!0,showFrame:!0,className:"",frameColor:FB,arrowColor:FB,keepEditorSelection:!1},Eve="vs.editor.contrib.zoneWidget";class Nve{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Tve{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class NF{static{this._IdGenerator=new F4(".arrow-decoration-")}constructor(e){this._editor=e,this._ruleName=NF._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),CN(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){CN(this._ruleName),K0(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:L.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}class Rve{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new z,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=dl(t),EL(this.options,Ive,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new NF(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=L.isIRange(e)?L.lift(e):L.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Te.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const e=this.editor.getOption(75);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=this.options.frameWidth??Math.round(e/9);t+=2*i}return t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(75),l=this._getMaximumHeightInLines();l!==void 0&&(t=Math.min(t,l));let c=0,d=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new Nve(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new Tve(Eve+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const g=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}const h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const g=u.validateRange(new L(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(g,g.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){const i=this._getMaximumHeightInLines(),n=t&&i!==void 0?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==n&&(this.editor.changeViewZones(s=>{this._viewZone&&(this._viewZone.heightInLines=n,s.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new $n(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(75),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>e.minLines&&s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},RK=function(o,e){return function(t,i){e(t,i,o)}};const MK=We("IPeekViewService");$e(MK,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var Xs;(function(o){o.inPeekEditor=new oe("inReferenceSearchEditor",!0,m(1316,"Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(Xs||(Xs={}));let Yy=class{static{this.ID="editor.contrib.referenceController"}constructor(e,t){e instanceof rd&&Xs.inPeekEditor.bindTo(t)}dispose(){}};Yy=TK([RK(1,Ie)],Yy);Xe(Yy.ID,Yy,0);const Mve={headerBackgroundColor:V.white,primaryHeadingColor:V.fromHex("#333333"),secondaryHeadingColor:V.fromHex("#6c6c6cb3")};let Xy=class extends Rve{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new P,this.onDidClose=this._onDidClose.event,EL(this.options,Mve,!1);const n=Jt(this.editor);n.openedPeekWidgets.set(n.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=Jt(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=J(".head"),this._bodyElement=J(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=J(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Li(this._titleElement,"click",s=>this._onTitleClick(s))),Z(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=J("span.filename"),this._secondaryHeading=J("span.dirname"),this._metaHeading=J("span.meta"),Z(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=J(".peekview-actions");Z(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new qs(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new Uo("peekview.close",m(1317,"Close"),Se.asClassName(G.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:oF.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:xn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,ro(this._metaHeading)):Ss(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(75)*1.2),n=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};Xy=TK([RK(2,fe)],Xy);const Pve=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},m(1318,"Background color of the peek view title area.")),PK=E("peekViewTitleLabel.foreground",{dark:V.white,light:V.black,hcDark:V.white,hcLight:Hl},m(1319,"Color of the peek view title.")),AK=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m(1320,"Color of the peek view title info.")),Ave=E("peekView.border",{dark:Tl,light:Tl,hcDark:Ge,hcLight:Ge},m(1321,"Color of the peek view borders and arrow.")),Ove=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:V.black,hcLight:V.white},m(1322,"Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:V.white,hcLight:Hl},m(1323,"Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:V.white,light:"#1E1E1E",hcDark:V.white,hcLight:Hl},m(1324,"Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m(1325,"Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:V.white,light:"#6C6C6C",hcDark:V.white,hcLight:Hl},m(1326,"Foreground color of the selected entry in the peek view result list."));const TF=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:V.black,hcLight:V.white},m(1327,"Background color of the peek view editor."));E("peekViewEditorGutter.background",TF,m(1328,"Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",TF,m(1329,"Background color of sticky scroll in the peek view editor."));E("peekViewEditorStickyScrollGutter.background",TF,m(1330,"Background color of the gutter part of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m(1331,"Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m(1332,"Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m(1333,"Match highlight border in the peek view editor."));class Fve{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:A.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);const r=new qt,a=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(l=>this.renderer.renderElement(l,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class Wve{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Bve(o,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new Wve(o,e.accessibilityProvider)}}class Hve{constructor(e,t,i,n,s={}){this.modelDisposables=new z;const r=()=>this.model,a=n.map(l=>new Fve(l,r));this.list=new Qo(e,t,i,a,Bve(r,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return te.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return te.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return te.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,vs(e.length)),this.modelDisposables.add(e.onDidIncrementLength(t=>this.list.splice(this.list.length,0,vs(this.list.length,t))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}const Vve={separatorBorder:V.transparent};class OK{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){if(e!==this.visible){e?(this.size=ws(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(i){console.error("Splitview: Failed to set visible view"),console.error(i)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class zve extends OK{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Uve extends OK{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var uc;(function(o){o[o.Idle=0]="Idle",o[o.Busy=1]="Busy"})(uc||(uc={}));var Qy;(function(o){o.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}o.Split=e;function t(n){return{type:"auto",index:n}}o.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}o.Invisible=i})(Qy||(Qy={}));class FK extends A{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=uc.Idle,this._onDidSashChange=this._register(new P),this._onDidSashReset=this._register(new P),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Z(this.el,J(".sash-container")),this.viewContainer=J(".split-view-container"),this.scrollable=this._register(new u_({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Zs(pe(this.el),n)})),this.scrollableElement=this._register(new KL(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new mt(this.viewContainer,"scroll")).event;this._register(i(n=>{const s=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-s.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-s.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(n=>{n.scrollTopChanged&&(this.viewContainer.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this.viewContainer.scrollLeft=n.scrollLeft)})),Z(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Vve),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,s)=>{const r=Yn(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,r,s,!0)}),this._contentSize=this.viewItems.reduce((n,s)=>n+s.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let n=0;for(let s=0;s0&&(r.size=ws(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=vs(this.viewItems.length),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const n=this.sashItems.findIndex(a=>a.sash===e),s=Yr(W(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),W(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(f=>f.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const p=this.viewItems[n];d=(p.minimumSize-p.size)/2,h=(p.maximumSize-p.size)/2}else{const p=this.viewItems[n+1];d=(p.size-p.maximumSize)/2,h=(p.size-p.minimumSize)/2}let u,g;if(!l){const f=vs(n,-1),p=vs(n+1,this.viewItems.length),_=f.reduce((D,I)=>D+(this.viewItems[I].minimumSize-c[I]),0),b=f.reduce((D,I)=>D+(this.viewItems[I].viewMaximumSize-c[I]),0),C=p.length===0?Number.POSITIVE_INFINITY:p.reduce((D,I)=>D+(c[I]-this.viewItems[I].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((D,I)=>D+(c[I]-this.viewItems[I].viewMaximumSize),0),v=Math.max(_,w),S=Math.min(C,b),x=this.findFirstSnapIndex(f),k=this.findFirstSnapIndex(p);if(typeof x=="number"){const D=this.viewItems[x],I=Math.floor(D.viewMinimumSize/2);u={index:x,limitDelta:D.visible?v-I:v+I,size:D.size}}if(typeof k=="number"){const D=this.viewItems[k],I=Math.floor(D.viewMinimumSize/2);g={index:k,limitDelta:D.visible?S+I:S-I,size:D.size}}}this.sashDragState={start:a,current:a,index:n,sizes:c,minDelta:d,maxDelta:h,alt:l,snapBefore:u,snapAfter:g,disposable:s}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:s,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,r,a,l,c);if(s){const u=t===this.sashItems.length-1,g=this.viewItems.map(w=>w.size),f=u?t:t+1,p=this.viewItems[f],_=p.size-p.maximumSize,b=p.size-p.minimumSize,C=u?t-1:t+1;this.resize(C,-h,g,void 0,void 0,_,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=ws(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==uc.Idle)throw new Error("Cant modify splitview");this.state=uc.Busy;try{const i=vs(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===1),e],s=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=ws(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,s)}finally{this.state=uc.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=ws(i,a.minimumSize,a.maximumSize);const n=vs(this.viewItems.length),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.relayout(s,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==uc.Idle)throw new Error("Cant modify splitview");this.state=uc.Busy;try{const s=J(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=ue(()=>s.remove()),l=Yr(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new zve(s,e,c,l):new Uve(s,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},g=this.orientation===0?new $n(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:1}):new $n(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:0}),f=this.orientation===0?D=>({sash:g,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:g,start:D.startX,current:D.currentX,alt:D.altKey}),_=te.map(g.onDidStart,f)(this.onSashStart,this),C=te.map(g.onDidChange,f)(this.onSashChange,this),v=te.map(g.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===g))(this.onSashEnd,this),S=g.onDidReset(()=>{const D=this.sashItems.findIndex(B=>B.sash===g),I=vs(D,-1),T=vs(D+1,this.viewItems.length),F=this.findFirstSnapIndex(I),O=this.findFirstSnapIndex(T);typeof F=="number"&&!this.viewItems[F].visible||typeof O=="number"&&!this.viewItems[O].visible||this._onDidSashReset.fire(D)}),x=Yr(_,C,v,S,g),k={sash:g,disposable:x};this.sashItems.splice(i-1,0,k)}s.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=uc.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,s)=>n+s.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),n,s,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=vs(e,-1),h=vs(e+1,this.viewItems.length);if(s)for(const k of s)kD(d,k),kD(h,k);if(n)for(const k of n)i1(d,k),i1(h,k);const u=d.map(k=>this.viewItems[k]),g=d.map(k=>i[k]),f=h.map(k=>this.viewItems[k]),p=h.map(k=>i[k]),_=d.reduce((k,D)=>k+(this.viewItems[D].minimumSize-i[D]),0),b=d.reduce((k,D)=>k+(this.viewItems[D].maximumSize-i[D]),0),C=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,D)=>k+(i[D]-this.viewItems[D].minimumSize),0),w=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,D)=>k+(i[D]-this.viewItems[D].maximumSize),0),v=Math.max(_,w,r),S=Math.min(C,b,a);let x=!1;if(l){const k=this.viewItems[l.index],D=t>=l.limitDelta;x=D!==k.visible,k.setVisible(D,l.size)}if(!x&&c){const k=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const n=vs(this.viewItems.length-1,-1),s=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);for(const a of r)kD(n,a);for(const a of s)i1(n,a);typeof e=="number"&&i1(n,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),n=[...this.viewItems].reverse();e=!1;const s=n.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=n.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:C&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),pt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}class Lk{static{this.TemplateId="row"}constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Lk.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(s=>[s.templateId,s]));this.renderers=[];for(const s of e){const r=n.get(s.templateId);if(!r)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=Z(e,J(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new jve(d,h))),l={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new FK(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new Lk(n,s,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Qo(e,this.domNode,$ve(i),[c],r)),te.any(...a.map(d=>d.onDidLayout))(([d,h])=>c.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=n.reduce((g,f)=>g+f.weight,0),u=n[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=Ir(this.domNode),this.style(Jfe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}var Go;(function(o){o[o.Expanded=0]="Expanded",o[o.Collapsed=1]="Collapsed",o[o.PreserveOrExpanded=2]="PreserveOrExpanded",o[o.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Go||(Go={}));var Sg;(function(o){o[o.Unknown=0]="Unknown",o[o.Twistie=1]="Twistie",o[o.Element=2]="Element",o[o.Filter=3]="Filter"})(Sg||(Sg={}));class Qo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class j5{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}class qd{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class yH{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new qd(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Pl{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,s,r]=Pl._getElements(e),[a,l,c]=Pl._getElements(t);this._hasStrings=r&&c,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Pl._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,s=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(cp.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new qd(e,0,i,n-i+1)]):e<=t?(cp.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new qd(e,t-e+1,i,0)]):(cp.Assert(e===t+1,"originalStart should only be one more than originalEnd"),cp.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,s),c=r[0],d=a[0];if(l!==null)return l;if(!s[0]){const h=this.ComputeDiffRecursive(e,c,i,d,s);let u=[];return s[0]?u=[new qd(c+1,t-(c+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(c+1,t,d+1,n,s),this.ConcatenateChanges(h,u)}return[new qd(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b,C){let w=null,v=null,S=new LH,L=t,x=i,k=g[0]-_[0]-n,I=-1073741824,T=this.m_forwardHistory.length-1;do{const A=k+e;A===L||A=0&&(c=this.m_forwardHistory[T],e=c[0],L=1,x=c.length-1)}while(--T>=-1);if(w=S.getReverseChanges(),C[0]){let A=g[0]+1,O=_[0]+1;if(w!==null&&w.length>0){const W=w[w.length-1];A=Math.max(A,W.getOriginalEnd()),O=Math.max(O,W.getModifiedEnd())}v=[new qd(A,u-A+1,O,p-O+1)]}else{S=new LH,L=r,x=a,k=g[0]-_[0]-l,I=1073741824,T=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=k+s;A===L||A=d[A+1]?(h=d[A+1]-1,f=h-k-l,h>I&&S.MarkNextChange(),I=h+1,S.AddOriginalElement(h+1,f+1),k=A+1-s):(h=d[A-1],f=h-k-l,h>I&&S.MarkNextChange(),I=h,S.AddModifiedElement(h+1,f+1),k=A-1-s),T>=0&&(d=this.m_reverseHistory[T],s=d[0],L=1,x=d.length-1)}while(--T>=-1);v=S.getChanges()}return this.ConcatenateChanges(w,v)}ComputeRecursionPoint(e,t,i,n,s,r,a){let l=0,c=0,d=0,h=0,u=0,g=0;e--,i--,s[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=t-e+(n-i),p=f+1,_=new Int32Array(p),b=new Int32Array(p),C=n-i,w=t-e,v=e-i,S=t-n,x=(w-C)%2===0;_[C]=e,b[w]=t,a[0]=!1;for(let k=1;k<=f/2+1;k++){let I=0,T=0;d=this.ClipDiagonalBound(C-k,k,C,p),h=this.ClipDiagonalBound(C+k,k,C,p);for(let O=d;O<=h;O+=2){O===d||OI+T&&(I=l,T=c),!x&&Math.abs(O-w)<=k-1&&l>=b[O])return s[0]=l,r[0]=c,W<=b[O]&&k<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,x,a):null}const A=(I-e+(T-i)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(I,A))return a[0]=!0,s[0]=I,r[0]=T,A>0&&k<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,x,a):(e++,i++,[new qd(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(w-k,k,w,p),g=this.ClipDiagonalBound(w+k,k,w,p);for(let O=u;O<=g;O+=2){O===u||O=b[O+1]?l=b[O+1]-1:l=b[O-1],c=l-(O-w)-S;const W=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(b[O]=l,x&&Math.abs(O-C)<=k&&l<=_[O])return s[0]=l,r[0]=c,W>=_[O]&&k<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,x,a):null}if(k<=1447){let O=new Int32Array(h-d+2);O[0]=C-d+1,dp.Copy2(_,d,O,1,h-d+1),this.m_forwardHistory.push(O),O=new Int32Array(g-u+2),O[0]=w-u+1,dp.Copy2(b,u,O,1,g-u+1),this.m_reverseHistory.push(O)}}return this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,s=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,s=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,g=i.modifiedStart-h;if(uc&&(c=p,l=h)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&g>l&&(l=g,c=h,d=u)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){const s=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return s+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return dp.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],dp.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return dp.Copy(e,0,n,0,e.length),dp.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(cp.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),cp.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let s=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new qd(n,s,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e"u"?!1:i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=typeof i.autoExpandSingleChildren>"u"?!1:i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Je.empty(),n={}){if(e.length===0)throw new Qo(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=Je.empty(),s,r=s.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],c=t[t.length-1],d=new Pl({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(p=>e.getId(p.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const h=t.slice(0,-1),u=(p,_,b)=>{if(r>0)for(let C=0;Cb.originalStart-_.originalStart))u(g,f,g-(p.originalStart+p.originalLength)),g=p.originalStart,f=p.modifiedStart-c,this.spliceSimple([...h,g],p.originalLength,Je.slice(l,f,f+p.modifiedLength),s);u(g,f,g)}spliceSimple(e,t,i=Je.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=Je.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,h,n)),g=e[e.length-1];let f=0;for(let S=g;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of C)S.visible&&w++;if(w!==0)for(let S=g+p.length;S0&&s){const S=L=>{s(L),L.children.forEach(S)};C.forEach(S)}if(c&&d){const S=C.reduce((L,x)=>L+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this._onDidSpliceRenderedNodes.fire({start:l,deleteCount:S,elements:h})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:C});let v=a;for(;v;){if(v.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}v=v.parent}}rerender(e){if(e.length===0)throw new Qo(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!qE(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,n){const s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:l,elements:a.slice(1)}),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(qE(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!qE(t)&&t.recursive)for(const s of e.children)n=this._setNodeCollapseState(s,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,s,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,n&&s.push(a);const c=e.children||Je.empty(),d=n&&l!==0&&!a.collapsed;let h=0,u=1;for(const g of c){const f=this.createTreeNode(g,a,l,d,s,r);a.children.push(f),u+=f.renderNodeCount,f.visible&&(f.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=l===2?h>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,n&&s.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),s===0)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||s!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,s,i,n&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=s===2?a:s===1,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):L1(i)?(e.filterData=i.data,mf(i.visibility)):(e.filterData=void 0,mf(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Qo(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Qo(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:s&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Qo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function KE(o){return o instanceof g1?new hSe(o):o}class uSe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=F.None,this.disposables=new z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(KE(e),t)}onDragOver(e,t,i,n,s,r=!0){const a=this.dnd.onDragOver(KE(e),t&&t.element,i,n,s),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=pd(()=>{const g=this.modelProvider(),f=g.getNodeLocation(t);g.isCollapsed(f)&&g.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const g=typeof a=="boolean"?a:a.accept,f=typeof a=="boolean"?void 0:a.effect;return{accept:g,effect:f,feedback:[i]}}return a}if(a.bubble===1){const g=this.modelProvider(),f=g.getNodeLocation(t),p=g.getParentNodeLocation(f),_=g.getNode(p),b=p&&g.getListIndex(p);return this.onDragOver(e,_,b,n,s,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),h=c.getListIndex(d),u=c.getListRenderCount(d);return{...a,feedback:Ns(h,h+u)}}drop(e,t,i,n,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(KE(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function gSe(o,e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(i.element)}},dnd:t.dnd&&e.add(new uSe(o,t.dnd)),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(i){return t.multipleSelectionController.isSelectionSingleChangeEvent({...i,element:i.element})},isSelectionRangeChangeEvent(i){return t.multipleSelectionController.isSelectionRangeChangeEvent({...i,element:i.element})}},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(i){const n=o(),s=n.getNodeLocation(i),r=n.getParentNodeLocation(s);return n.getNode(r).visibleChildrenCount},getPosInSet(i){return i.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?i=>t.accessibilityProvider.isChecked(i.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?i=>t.accessibilityProvider.getRole(i.element):()=>"treeitem",getAriaLabel(i){return t.accessibilityProvider.getAriaLabel(i.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?i=>t.accessibilityProvider.getAriaLevel(i.element):i=>i.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(i=>t.accessibilityProvider.getActiveDescendantId(i.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(i){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i.element)}}}}class q5{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}var _f;(function(o){o.None="none",o.OnHover="onHover",o.Always="always"})(_f||(_f={}));class fSe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new z,this.onDidChange=se.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class AC{static{this.DefaultIndent=8}constructor(e,t,i,n,s,r={}){this.renderer=e,this.model=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=AC.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=F.None,this.disposables=new z,this.templateId=e.templateId,this.updateOptions(r),se.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Ts(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)n.indentSize=AC.DefaultIndent+(i.depth-1)*this.indent,this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==_f.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);if(this.indentGuidesDisposable.dispose(),t){const i=new z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Y(e,ee(".monaco-tl-row")),i=Y(t,ee(".monaco-tl-indent")),n=Y(t,ee(".monaco-tl-twistie")),s=Y(t,ee(".monaco-tl-contents")),r=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:F.None,indentSize:0,templateData:r}}renderElement(e,t,i,n){i.indentSize=AC.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...n,indent:i.indentSize})}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,{...n,indent:i.indentSize}),typeof n?.height=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=`${t.indentSize+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...ye.asClassNameArray(Z.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...ye.asClassNameArray(Z.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Tn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new z;for(;;){const n=this.model.getNodeLocation(e),s=this.model.getParentNodeLocation(n);if(!s)break;const r=this.model.getNode(s),a=ee(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(ge(()=>this.renderedIndentGuides.delete(r,a))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach(i=>{const n=this.model.getNodeLocation(i);try{const s=this.model.getParentNodeLocation(n);i.collapsible&&i.children.length>0&&!i.collapsed?t.add(i):s&&t.add(this.model.getNode(s))}catch{}}),this.activeIndentNodes.forEach(i=>{t.has(i)||this.renderedIndentGuides.forEach(i,n=>n.classList.remove("active"))}),t.forEach(i=>{this.activeIndentNodes.has(i)||this.renderedIndentGuides.forEach(i,n=>n.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),vt(this.disposables)}}function pSe(o,e){const t=e.toLowerCase().indexOf(o);let i;if(t>-1){i=[Number.MAX_SAFE_INTEGER,0];for(let n=o.length;n>0;n--)i.push(t+n-1)}return i}class IZ{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=Ba.Fuzzy,this._findMode=Jo.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new z}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:L1(r)?i=mf(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:ga.Default,visibility:i};const n=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(const r of s){const a=r&&r.toString();if(typeof a>"u")return{data:ga.Default,visibility:i};let l;if(this._findMatchType===Ba.Contiguous?l=pSe(this._lowercasePattern,a.toLowerCase()):l=rf(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),l)return this._matchCount++,s.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this._findMode===Jo.Filter?typeof this._defaultFindVisibility=="number"?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:ga.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){vt(this.disposables)}}class mSe{constructor(e){this.stateMap=new Map(e.map(t=>[t.id,{...t}]))}get(e){const t=this.stateMap.get(e);if(t===void 0)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(i===void 0)throw new Error(`No state found for toggle id ${e}`);return i.isChecked===t?!1:(i.isChecked=t,!0)}}var Jo;(function(o){o[o.Highlight=0]="Highlight",o[o.Filter=1]="Filter"})(Jo||(Jo={}));var Ba;(function(o){o[o.Fuzzy=0]="Fuzzy",o[o.Contiguous=1]="Contiguous"})(Ba||(Ba={}));var Yd;(function(o){o.Mode="mode",o.MatchType="matchType"})(Yd||(Yd={}));class _Se{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.widget?.setPlaceHolder(e)}constructor(e,t,i,n={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=n,this._pattern="",this._onDidChangePattern=new P,this._onDidChangeOpenState=new P,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new z,this.disposables=new z,this.toggles=new mSe(n.toggles??[]),this._placeholder=n.placeholder??m(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){this.toggles.set(e,t),this.widget?.setToggleState(e,t)}renderMessage(e,t){e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:2,content:t??m(21,"No results found.")}):this.widget?.showMessage({type:2}):this.widget?.clearMessage()}alertResults(e){Ws(e?m(23,"{0} results",e):m(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}let EZ=class extends _Se{get mode(){return this.toggles.get(Yd.Mode)?Jo.Filter:Jo.Highlight}set mode(e){if(e===this.mode)return;const t=e===Jo.Filter;this.updateToggleState(Yd.Mode,t),this.placeholder=t?m(24,"Type to filter"):m(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(Yd.MatchType)?Ba.Fuzzy:Ba.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(Yd.MatchType,e===Ba.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n={}){const s=n.defaultFindMode??Jo.Highlight,r=n.defaultFindMatchType??Ba.Fuzzy,a=[{id:Yd.Mode,icon:Z.listFilter,title:m(26,"Filter"),isChecked:s===Jo.Filter},{id:Yd.MatchType,icon:Z.searchFuzzy,title:m(27,"Fuzzy Match"),isChecked:r===Ba.Fuzzy}];t.findMatchType=r,t.findMode=s,super(e,t,i,{...n,toggles:a}),this.filter=t,this._onDidChangeMode=new P,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new P,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(this.pattern.length!==0&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!ga.isDefault(e.filterData)}render(){const t=this.filter.matchCount===0&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(t),this.pattern.length&&this.alertResults(this.filter.matchCount)}};function bSe(o,e){return o.position===e.position&&NZ(o,e)}function NZ(o,e){return o.node.element===e.node.element&&o.startIndex===e.startIndex&&o.height===e.height&&o.endIndex===e.endIndex}class CSe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Qt(this.stickyNodes,e.stickyNodes,bSe)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Qt(this.stickyNodes,e.stickyNodes,NZ)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class vSe{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let xH=class extends F{constructor(e,t,i,n,s,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new vSe,this.paddingTop=r.paddingTop??0,this._widget=this._register(new wSe(i.getScrollableElement(),i,e,n,s,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(l=>{const c=this._widget.state;if(!c)return;if(l.deleteCount>0&&c.stickyNodes.some(u=>!this.model.has(this.model.getNodeLocation(u.node)))){this.update();return}c.stickyNodes.some(u=>{const g=this.model.getListIndex(this.model.getNodeLocation(u.node));return g>=l.start&&g=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,s=this.getNextStickyNode(i,void 0,n);for(;s&&(t.push(s),n+=s.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(s),!i)));)s=this.getNextStickyNode(i,s.node,n);const r=this.constrainStickyNodes(t);return r.length?new CSe(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),s=t;return this.view.scrollTop===n-s}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:s}=this.getNodeRange(e),r=this.calculateStickyNodePosition(s,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:s}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const s=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const n=this.model.getListRenderCount(t),s=i+n-1;return{startIndex:i,endIndex:s}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let s=0;s0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const n=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${n.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const n=e.stickyNodes[i],{element:s,disposable:r}=this.createElement(n,i,e.count);t[i]=s,this._rootDomNode.appendChild(s),this._previousStateDisposables.add(r)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const n=e.startIndex,s=document.createElement("div");s.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(s.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(s.style.lineHeight=`${e.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${n}`),s.setAttribute("data-parity",n%2===0?"even":"odd"),s.setAttribute("id",this.view.getElementID(n));const r=this.setAccessibilityAttributes(s,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(u=>u.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(s);l.renderElement(c,e.startIndex,d,{height:e.height});const h=ge(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,{height:e.height}),l.disposeTemplate(d),s.remove()});return{element:s,disposable:h}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return F.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const s=this.accessibilityProvider.getAriaLabel(t),r=s&&typeof s!="string"?s:Ot(s),a=ke(c=>{const d=c.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof s=="string"||s&&e.setAttribute("aria-label",s.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class SSe extends F{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new P,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new P,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(B(this.container,"focus",()=>this.onFocus())),this._register(B(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!Zv(t)&&!EC(t)){this.focusedLast()&&this.view.domFocus();return}if(!Oc(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const n=this.state.stickyNodes[this.focusedIndex].node.element,s=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:s,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!Zv(t)&&!EC(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const n=Ts(i,0,t.count-1);this.setFocus(n)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=s-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function WS(o){let e=Sg.Unknown;return PI(o.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Sg.Twistie:PI(o.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Sg.Element:PI(o.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Sg.Filter),{browserEvent:o.browserEvent,element:o.element?o.element.element:null,target:e}}function ySe(o){const e=Zv(o.browserEvent.target);return{element:o.element?o.element.element:null,browserEvent:o.browserEvent,anchor:o.anchor,isStickyScroll:e}}function j0(o,e){e(o),o.children.forEach(t=>j0(t,e))}class GE{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new P,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Qt(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const n=this;this._onDidChange.fire({get elements(){return n.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>j0(d,c)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>j0(l,n));const s=new Map,r=l=>s.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>j0(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const h=s.get(c);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class LSe extends NK{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(DK(e.browserEvent.target)||$a(e.browserEvent.target)||qb(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,s=EC(e.browserEvent.target);let r=!1;if(s?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,s)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!s||n)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),n){e.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(c_e(e.browserEvent.target)||d_e(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),s=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!Zv(t)&&!EC(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!Zv(t)&&!EC(t)){super.onContextMenu(e);return}}}class xSe extends ur{constructor(e,t,i,n,s,r,a,l){super(e,t,i,n,l),this.focusTrait=s,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new LSe(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],s=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&n.push(e+l),this.selectionTrait.has(a)&&s.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),n.length>0&&super.setFocus(bd([...super.getFocus(),...n])),s.length>0&&super.setSelection(bd([...super.getSelection(),...s])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class TZ{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return se.filter(se.map(this.view.onMouseDblClick,WS),e=>e.target!==Sg.Filter)}get onMouseOver(){return se.map(this.view.onMouseOver,WS)}get onMouseOut(){return se.map(this.view.onMouseOut,WS)}get onContextMenu(){return se.any(se.filter(se.map(this.view.onContextMenu,ySe),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??se.None)}get onPointer(){return se.map(this.view.onPointer,WS)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return se.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){this._user=e,this._options=s,this.eventBufferer=new Kw,this.onDidChangeFindOpenState=se.None,this.onDidChangeStickyScrollFocused=se.None,this.disposables=new z,this.onDidSwapModel=this.disposables.add(new P),this.onDidChangeModelRelay=this.disposables.add(new sb),this.onDidSpliceModelRelay=this.disposables.add(new sb),this.onDidChangeCollapseStateRelay=this.disposables.add(new sb),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new sb),this.onDidChangeActiveNodesRelay=this.disposables.add(new sb),this._onWillRefilter=new P,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new P,this.modelDisposables=new z,s.keyboardNavigationLabelProvider&&(s.findWidgetEnabled??!0)&&(this.findFilter=new IZ(s.keyboardNavigationLabelProvider,s.filter,s.defaultFindVisibility),s={...s,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,s),this.treeDelegate=new q5(i);const r=this.disposables.add(new fSe(this.onDidChangeActiveNodesRelay.event)),a=new c$;this.renderers=n.map(l=>new AC(l,this.model,this.onDidChangeCollapseStateRelay.event,r,a,s));for(const l of this.renderers)this.disposables.add(l);if(this.focus=new GE(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new GE(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new GE(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new xSe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...gSe(()=>this.model,this.disposables,s),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),s.keyboardSupport!==!1){const l=se.chain(this.view.onKeyDown,c=>c.filter(d=>!$a(d.target)).map(d=>new Et(d)));se.chain(l,c=>c.filter(d=>d.keyCode===15))(this.onLeftArrow,this,this.disposables),se.chain(l,c=>c.filter(d=>d.keyCode===17))(this.onRightArrow,this,this.disposables),se.chain(l,c=>c.filter(d=>d.keyCode===10))(this.onSpace,this,this.disposables)}if((s.findWidgetEnabled??!0)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const l={styles:s.findWidgetStyles,defaultFindMode:s.defaultFindMode,defaultFindMatchType:s.defaultFindMatchType,showNotFoundMessage:s.showNotFoundMessage};this.findController=this.disposables.add(new EZ(this,this.findFilter,s.contextViewProvider,l)),this.focusNavigationFilter=c=>this.findController.shouldAllowFocus(c),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=se.None,this.onDidChangeFindMatchType=se.None;s.enableStickyScroll&&(this.stickyScrollController=new xH(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=zr(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_f.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_f.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new xH(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=se.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const s=ad(e.listFocusAndSelectionOutline,ad(e.listSelectionOutline,e.listFocusOutline??""));s&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=Oc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=Oc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=Oc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Oc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=Oc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Oc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:s,deleteCount:r,elements:a})=>this.view.splice(s,r,a)));const t=se.forEach(e.onDidSpliceModel,s=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(s),this.selection.onDidModelSplice(s)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new P),n=this.modelDisposables.add(new Fr(0));this.modelDisposables.add(se.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{n.trigger(()=>{const s=new Set;for(const r of this.focus.getNodes())s.add(r);for(const r of this.selection.getNodes())s.add(r);i.fire([...s.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=se.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){vt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}class K5{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new dSe(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare(i,n){return t.sorter.compare(i.element,n.element)}}),this.identityProvider=t.identityProvider}setChildren(e,t=Je.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Je.empty(),i){const n=new Set,s=new Set,r=l=>{if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.add(d),this.nodesByIdentity.set(d,c)}i.onDidCreateNode?.(c)},a=l=>{if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=Je.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Je.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Go.Collapsed||t.collapsed===Go.PreserveOrCollapsed?r=!0:t.collapsed===Go.Expanded||t.collapsed===Go.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let s;return typeof t.collapsed>"u"||t.collapsed===Go.PreserveOrCollapsed||t.collapsed===Go.PreserveOrExpanded?s=i.collapsed:t.collapsed===Go.Collapsed?s=!0:t.collapsed===Go.Expanded?s=!1:s=!!t.collapsed,{...t,collapsible:n,collapsed:s,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),Je.map(n,s=>({element:s.element,collapsible:s.collapsible,collapsed:s.collapsed,children:this.resortChildren(s,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Qo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Qo(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Qo(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Qo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function q0(o){const e=[o.element],t=o.incompressible||!1;return{element:{elements:e,incompressible:t},children:Je.map(Je.from(o.children),q0),collapsible:o.collapsible,collapsed:o.collapsed}}function K0(o){const e=[o.element],t=o.incompressible||!1;let i,n;for(;[n,i]=Je.consume(Je.from(o.children),2),!(n.length!==1||n[0].incompressible);)o=n[0],e.push(o.element);return{element:{elements:e,incompressible:t},children:Je.map(Je.concat(n,i),K0),collapsible:o.collapsible,collapsed:o.collapsed}}function TM(o,e=0){let t;return eTM(i,0)),e===0&&o.element.incompressible?{element:o.element.elements[e],children:t,incompressible:!0,collapsible:o.collapsible,collapsed:o.collapsed}:{element:o.element.elements[e],children:t,collapsible:o.collapsible,collapsed:o.collapsed}}function DH(o){return TM(o,0)}function RZ(o,e,t){return o.element===e?{...o,children:t}:{...o,children:Je.map(Je.from(o.children),i=>RZ(i,e,t))}}const DSe=o=>({getId(e){return e.elements.map(t=>o.getId(t).toString()).join("\0")}});class kSe{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new K5(e,t),this.enabled=typeof t.compressionEnabled>"u"?!0:t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=Je.empty(),i){const n=i.diffIdentityProvider&&DSe(i.diffIdentityProvider);if(e===null){const f=Je.map(t,this.enabled?K0:q0);this._setChildren(null,f,{diffIdentityProvider:n,diffDepth:1/0});return}const s=this.nodes.get(e);if(!s)throw new Qo(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),c=DH(r),d=RZ(c,e,t),h=(this.enabled?K0:q0)(d),u=i.diffIdentityProvider?((f,p)=>i.diffIdentityProvider.getId(f)===i.diffIdentityProvider.getId(p)):void 0;if(Qt(h.element.elements,r.element.elements,u)){this._setChildren(s,h.children||Je.empty(),{diffIdentityProvider:n,diffDepth:1});return}const g=l.children.map(f=>f===r?h:f);this._setChildren(l.element,g,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=Je.map(i,DH),s=Je.map(n,e?K0:q0);this._setChildren(null,s,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,s=a=>{for(const l of a.element.elements)n.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)n.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:s,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Qo(this.user,`Tree element not found: ${e}`);return t}}const ISe=o=>o[o.length-1];class G5{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new G5(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function ESe(o,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(o(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){const n=t.elements;for(let s=0;s({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidSpliceRenderedNodes(){return se.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return se.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return se.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||ISe;const i=n=>this.elementMapper(n.elements);this.nodeMapper=new j5(n=>new G5(i,n)),this.model=new kSe(e,ESe(i,t))}setChildren(e,t=Je.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var TSe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class Z5 extends TZ{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=Je.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new K5(e,t)}}class MZ{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),s.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?.(e,t)??!1}}TSe([Ii],MZ.prototype,"compressedTreeNodeProvider",null);class RSe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let n=0;ni||n>=t-1&&tthis,a=new RSe(()=>this.model),l=n.map(c=>new MZ(r,a,c));super(e,t,i,l,{...MSe(r,s),stickyScrollDelegate:a})}setChildren(e,t=Je.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new NSe(e,t)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function ZE(o){return{...o,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function RM(o,e){return e.parent?e.parent===o?!0:RM(o,e.parent):!1}function PSe(o,e){return o===e||RM(o,e)||RM(e,o)}class Y5{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new Y5(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class ASe{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...ye.asClassNameArray(Z.treeItemLoading)),!0):(t.classList.remove(...ye.asClassNameArray(Z.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function kH(o){return{browserEvent:o.browserEvent,elements:o.elements.map(e=>e.element)}}function IH(o){return{browserEvent:o.browserEvent,element:o.element&&o.element.element,target:o.target}}class OSe extends g1{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function YE(o){return o instanceof g1?new OSe(o):o}class FSe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(YE(e),t)}onDragOver(e,t,i,n,s,r=!0){return this.dnd.onDragOver(YE(e),t&&t.element,i,n,s)}drop(e,t,i,n,s){this.dnd.drop(YE(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}class WSe extends IZ{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);if(!this.isFindSessionActive||this.findMode===Jo.Highlight||!this.findProvider.isVisible)return i;const n=L1(i)?i.visibility:i;return mf(n)===0?0:this.findProvider.isVisible(e)?i:0}}class BSe extends EZ{constructor(e,t,i,n,s){super(e,i,n,s),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(ge(async()=>{this.activeSession&&await this.findProvider.endSession?.()}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=this.activeFindMetadata.matchCount===0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){if(!this.activeSession||!this.activeFindMetadata)return!0;const t=e.element?.element;return t&&this.activeFindMetadata.isMatch(t)?!0:!ga.isDefault(e.filterData)}}function AZ(o){return o&&{...o,collapseByDefault:!0,identityProvider:o.identityProvider&&{getId(e){return o.identityProvider.getId(e.element)}},dnd:o.dnd&&new FSe(o.dnd),multipleSelectionController:o.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return o.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return o.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:o.accessibilityProvider&&{...o.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:o.accessibilityProvider.getRole?e=>o.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:o.accessibilityProvider.isChecked?e=>!!o.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return o.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return o.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:o.accessibilityProvider.getWidgetRole?()=>o.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:o.accessibilityProvider.getAriaLevel&&(e=>o.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:o.accessibilityProvider.getActiveDescendantId&&(e=>o.accessibilityProvider.getActiveDescendantId(e.element))},filter:o.filter&&{filter(e,t){return o.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:o.keyboardNavigationLabelProvider&&{...o.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return o.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof o.expandOnlyOnTwistieClick>"u"?void 0:typeof o.expandOnlyOnTwistieClick!="function"?o.expandOnlyOnTwistieClick:(e=>o.expandOnlyOnTwistieClick(e.element)),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof o.defaultFindVisibility=="number"?o.defaultFindVisibility:typeof o.defaultFindVisibility>"u"?2:o.defaultFindVisibility(e.element),stickyScrollDelegate:o.stickyScrollDelegate}}function MM(o,e){e(o),o.children.forEach(t=>MM(t,e))}class OZ{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return se.map(this.tree.onDidChangeFocus,kH)}get onDidChangeSelection(){return se.map(this.tree.onDidChangeSelection,kH)}get onMouseDblClick(){return se.map(this.tree.onMouseDblClick,IH)}get onPointer(){return se.map(this.tree.onPointer,IH)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,r={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new P,this._onDidChangeNodeSlowState=new P,this.nodeMapper=new j5(c=>new Y5(c)),this.disposables=new z,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=c=>r.collapseByDefault?r.collapseByDefault(c)?Go.PreserveOrCollapsed:Go.PreserveOrExpanded:void 0;let a=!1,l;if(r.findProvider&&(r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider&&(a=!0,l=new WSe(r.findProvider,r.keyboardNavigationLabelProvider,r.filter)),this.tree=this.createTree(e,t,i,n,{...r,findWidgetEnabled:!a,filter:l??r.filter}),this.root=ZE({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const c={styles:r.findWidgetStyles,showNotFoundMessage:r.showNotFoundMessage,defaultFindMatchType:r.defaultFindMatchType,defaultFindMode:r.defaultFindMode};this.findController=this.disposables.add(new BSe(this.tree,r.findProvider,l,this.tree.options.contextViewProvider,c)),this.focusNavigationFilter=d=>this.findController.shouldFocusWhenNavigating(d),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,n,s){const r=new q5(i),a=n.map(c=>new ASe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=AZ(s)||{};return new Z5(e,t,r,a,l)}updateOptions(e={}){this.findController&&(e.defaultFindMode!==void 0&&(this.findController.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(t=>t.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(t=>t.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,n,s){if(typeof this.root.element>"u")throw new Qo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await se.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,s),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Qo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await se.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await i.refreshPromise,await se.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await se.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t){const i=this.identityProvider?.getId(e).toString();throw new Qo(this.user,`Data tree node not found${i?`: ${i}`:""}`)}return t}async refreshAndRenderNode(e,t,i,n){this.disposables.isDisposed||(await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n))}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((s,r)=>{!n&&PSe(r,e)&&(n=s.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){const n=Qi(async()=>{const s=await this.doRefreshNode(e,t,i);e.stale=!1,await rv.settled(s.map(r=>this.doRefreshSubTree(r,t,i)))});return e.refreshPromise=n,this.subTreeRefreshPromises.set(e,n),n.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),n}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(Je.empty());else{const s=this.doGetChildren(e);if(qN(s))n=Promise.resolve(s);else{const r=ql(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=s.finally(()=>r.cancel())}}try{const s=await n;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),hr(s))return[];throw s}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return qN(i)?this.processChildren(i):(t=Qi(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Te))}setChildren(e,t,i,n){const s=[...t];if(e.children.length===0&&s.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=s.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=ZE({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&p.defaultCollapseState===Go.PreserveOrExpanded&&l.push(p),p}const u=this.identityProvider.getId(d).toString(),g=a.get(u);if(g){const p=g.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=h,i?g.collapsed?(p.children.forEach(_=>MM(_,b=>this.nodes.delete(b.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):h&&!g.collapsed&&l.push(p),p}const f=ZE({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(f),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(f),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1||h&&f.defaultCollapseState===Go.PreserveOrExpanded)&&l.push(f),f});for(const d of r.values())MM(d,h=>this.nodes.delete(h.element));for(const d of c)this.nodes.set(d.element,d);return wy(e.children,0,e.children.length,c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,n,s),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Je.map(e.children,n=>this.asTreeElement(n,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class X5{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new X5(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class HSe{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...ye.asClassNameArray(Z.treeItemLoading)),!0):(t.classList.remove(...ye.asClassNameArray(Z.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=vt(this.disposables)}}function VSe(o){const e=o&&AZ(o);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return o.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}},stickyScrollDelegate:e.stickyScrollDelegate}}class zSe extends OZ{constructor(e,t,i,n,s,r,a={}){super(e,t,i,s,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new j5(l=>new X5(l)),this.filter=a.filter}createTree(e,t,i,n,s){const r=new q5(i),a=n.map(c=>new HSe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=VSe(s)||{};return new PZ(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=g=>this.identityProvider.getId(g).toString(),s=g=>{const f=new Set;for(const p of g){const _=this.tree.getCompressedTreeNode(p===this.root?null:p);if(_.element)for(const b of _.element.elements)f.add(n(b.element))}return f},r=s(this.tree.getSelection()),a=s(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let h=!1;const u=g=>{const f=g.element;if(f)for(let p=0;p{const i=this.filter.filter(t,1),n=USe(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function USe(o){return typeof o=="boolean"?o?1:0:L1(o)?mf(o.visibility):mf(o)}class $Se extends TZ{constructor(e,t,i,n,s,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=s,this.identityProvider=r.identityProvider}createModel(e,t){return new K5(e,t)}}new re("isMac",je,m(1684,"Whether the operating system is macOS"));new re("isLinux",oo,m(1685,"Whether the operating system is Linux"));const wk=new re("isWindows",Rn,m(1686,"Whether the operating system is Windows")),FZ=new re("isWeb",ic,m(1687,"Whether the platform is a web browser"));new re("isMacNative",je&&!ic,m(1688,"Whether the operating system is macOS on a non-browser platform"));new re("isIOS",Or,m(1689,"Whether the operating system is iOS"));new re("isMobile",rU,m(1690,"Whether the platform is a mobile web browser"));new re("isDevelopment",!1,!0);new re("productQualityType","",m(1691,"Quality type of VS Code"));const WZ="inputFocus",Q5=new re(WZ,!1,m(1692,"Whether keyboard focus is inside an input box"));var Fd=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qt=function(o,e){return function(t,i){e(t,i,o)}};const Kr=Ve("listService");class jSe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new z,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),lD(e.getHTMLElement())&&this.setLastFocusedList(e),da(e.onDidFocus(()=>this.setLastFocusedList(e)),ge(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const cw=new re("listScrollAtBoundary","none");K.or(cw.isEqualTo("top"),cw.isEqualTo("both"));K.or(cw.isEqualTo("bottom"),cw.isEqualTo("both"));const BZ=new re("listFocus",!0),HZ=new re("treestickyScrollFocused",!1),Sk=new re("listSupportsMultiselect",!0),VZ=K.and(BZ,K.not(WZ),HZ.negate()),J5=new re("listHasSelectionOrFocus",!1),e3=new re("listDoubleSelection",!1),t3=new re("listMultiSelection",!1),yk=new re("listSelectionNavigation",!1),qSe=new re("listSupportsFind",!0),i3=new re("treeElementCanCollapse",!1),KSe=new re("treeElementHasParent",!1),n3=new re("treeElementCanExpand",!1),GSe=new re("treeElementHasChild",!1),ZSe=new re("treeFindOpen",!1),zZ="listTypeNavigationMode",UZ="listAutomaticKeyboardNavigation";function Lk(o,e){const t=o.createScoped(e.getHTMLElement());return BZ.bindTo(t),t}function xk(o,e){const t=cw.bindTo(o),i=()=>{const n=e.scrollTop===0,s=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&s?t.set("both"):n?t.set("top"):s?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const Hf="workbench.list.multiSelectModifier",G0="workbench.list.openMode",Pr="workbench.list.horizontalScrolling",s3="workbench.list.defaultFindMode",o3="workbench.list.typeNavigationMode",GL="workbench.list.keyboardNavigation",nl="workbench.list.scrollByPage",r3="workbench.list.defaultFindMatchType",dw="workbench.tree.indent",ZL="workbench.tree.renderIndentGuides",sl="workbench.list.smoothScrolling",Ql="workbench.list.mouseWheelScrollSensitivity",Jl="workbench.list.fastScrollSensitivity",YL="workbench.tree.expandMode",XL="workbench.tree.enableStickyScroll",QL="workbench.tree.stickyScrollMaxItemCount";function ec(o){return o.getValue(Hf)==="alt"}class YSe extends F{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=ec(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Hf)&&(this.useAltAsMultipleSelectionModifier=ec(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:IK(e)}isSelectionRangeChangeEvent(e){return EK(e)}}function Dk(o,e){const t=o.get(Oe),i=o.get(dt),n=new z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(sl),mouseWheelScrollSensitivity:t.getValue(Ql),fastScrollSensitivity:t.getValue(Jl),multipleSelectionController:e.multipleSelectionController??n.add(new YSe(t)),keyboardNavigationEventFilter:JSe(i),scrollByPage:!!t.getValue(nl)},n]}let EH=class extends ur{constructor(e,t,i,n,s,r,a,l,c){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(Pr),[h,u]=c.invokeFunction(Dk,s);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Lk(r,this),this.disposables.add(xk(this.contextKeyService,this)),this.listSupportsMultiSelect=Sk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),yk.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=J5.bindTo(this.contextKeyService),this.listDoubleSelection=e3.bindTo(this.contextKeyService),this.listMultiSelection=t3.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=ec(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const f=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(f.length>0||p.length>0),this.listMultiSelection.set(f.length>1),this.listDoubleSelection.set(f.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const f=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(f.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(Hf)&&(this._useAltAsMultipleSelectionModifier=ec(l));let p={};if(f.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Pr);p={...p,horizontalScrolling:_}}if(f.affectsConfiguration(nl)){const _=!!l.getValue(nl);p={...p,scrollByPage:_}}if(f.affectsConfiguration(sl)){const _=!!l.getValue(sl);p={...p,smoothScrolling:_}}if(f.affectsConfiguration(Ql)){const _=l.getValue(Ql);p={...p,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Jl)){const _=l.getValue(Jl);p={...p,fastScrollSensitivity:_}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new $Z(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Of(e):q_)}};EH=Fd([qt(5,Ne),qt(6,Kr),qt(7,Oe),qt(8,pe)],EH);let NH=class extends nSe{constructor(e,t,i,n,s,r,a,l,c){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(Pr),[h,u]=c.invokeFunction(Dk,s);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new z,this.disposables.add(u),this.contextKeyService=Lk(r,this),this.disposables.add(xk(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=Sk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),yk.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=ec(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(Hf)&&(this._useAltAsMultipleSelectionModifier=ec(l));let p={};if(f.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Pr);p={...p,horizontalScrolling:_}}if(f.affectsConfiguration(nl)){const _=!!l.getValue(nl);p={...p,scrollByPage:_}}if(f.affectsConfiguration(sl)){const _=!!l.getValue(sl);p={...p,smoothScrolling:_}}if(f.affectsConfiguration(Ql)){const _=l.getValue(Ql);p={...p,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Jl)){const _=l.getValue(Jl);p={...p,fastScrollSensitivity:_}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new $Z(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Of(e):q_)}dispose(){this.disposables.dispose(),super.dispose()}};NH=Fd([qt(5,Ne),qt(6,Kr),qt(7,Oe),qt(8,pe)],NH);let TH=class extends $5{constructor(e,t,i,n,s,r,a,l,c,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Pr),[u,g]=d.invokeFunction(Dk,r);super(e,t,i,n,s,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(g),this.contextKeyService=Lk(a,this),this.disposables.add(xk(this.contextKeyService,this)),this.listSupportsMultiSelect=Sk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),yk.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=J5.bindTo(this.contextKeyService),this.listDoubleSelection=e3.bindTo(this.contextKeyService),this.listMultiSelection=t3.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=ec(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Hf)&&(this._useAltAsMultipleSelectionModifier=ec(c));let _={};if(p.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const b=!!c.getValue(Pr);_={..._,horizontalScrolling:b}}if(p.affectsConfiguration(nl)){const b=!!c.getValue(nl);_={..._,scrollByPage:b}}if(p.affectsConfiguration(sl)){const b=!!c.getValue(sl);_={..._,smoothScrolling:b}}if(p.affectsConfiguration(Ql)){const b=c.getValue(Ql);_={..._,mouseWheelScrollSensitivity:b}}if(p.affectsConfiguration(Jl)){const b=c.getValue(Jl);_={..._,fastScrollSensitivity:b}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new XSe(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Of(e):q_)}dispose(){this.disposables.dispose(),super.dispose()}};TH=Fd([qt(6,Ne),qt(7,Kr),qt(8,Oe),qt(9,pe)],TH);class a3 extends F{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new P),this.onDidOpen=this._onDidOpen.event,this._register(se.filter(this.widget.onDidChangeSelection,i=>Oc(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(G0)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(G0)&&(this.openOnSingleClick=t?.configurationService.getValue(G0)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,s=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const s=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class $Z extends a3{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class XSe extends a3{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class QSe extends a3{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function JSe(o){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=o.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let JL=class extends Z5{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(x1,s);super(e,t,i,n,d),this.disposables.add(u),this.internals=new bf(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};JL=Fd([qt(5,pe),qt(6,Ne),qt(7,Kr),qt(8,Oe)],JL);let RH=class extends PZ{constructor(e,t,i,n,s,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(x1,s);super(e,t,i,n,d),this.disposables.add(u),this.internals=new bf(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};RH=Fd([qt(5,pe),qt(6,Ne),qt(7,Kr),qt(8,Oe)],RH);let MH=class extends $Se{constructor(e,t,i,n,s,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(x1,r);super(e,t,i,n,s,h),this.disposables.add(g),this.internals=new bf(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};MH=Fd([qt(6,pe),qt(7,Ne),qt(8,Kr),qt(9,Oe)],MH);let PM=class extends OZ{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(x1,r);super(e,t,i,n,s,h),this.disposables.add(g),this.internals=new bf(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};PM=Fd([qt(6,pe),qt(7,Ne),qt(8,Kr),qt(9,Oe)],PM);let PH=class extends zSe{constructor(e,t,i,n,s,r,a,l,c,d,h){const{options:u,getTypeNavigationMode:g,disposable:f}=l.invokeFunction(x1,a);super(e,t,i,n,s,r,u),this.disposables.add(f),this.internals=new bf(this,a,g,a.overrideStyles,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};PH=Fd([qt(7,pe),qt(8,Ne),qt(9,Kr),qt(10,Oe)],PH);function jZ(o){const e=o.getValue(s3);if(e==="highlight")return Jo.Highlight;if(e==="filter")return Jo.Filter;const t=o.getValue(GL);if(t==="simple"||t==="highlight")return Jo.Highlight;if(t==="filter")return Jo.Filter}function qZ(o){const e=o.getValue(r3);if(e==="fuzzy")return Ba.Fuzzy;if(e==="contiguous")return Ba.Contiguous}function x1(o,e){const t=o.get(Oe),i=o.get(Md),n=o.get(Ne),s=o.get(pe),r=()=>{const u=n.getContextKeyValue(zZ);if(u==="automatic")return Rl.Automatic;if(u==="trigger"||n.getContextKeyValue(UZ)===!1)return Rl.Trigger;const f=t.getValue(o3);if(f==="automatic")return Rl.Automatic;if(f==="trigger")return Rl.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(Pr),[l,c]=s.invokeFunction(Dk,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(ZL);return{getTypeNavigationMode:r,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(dw)=="number"?t.getValue(dw):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(sl),defaultFindMode:e.defaultFindMode??jZ(t),defaultFindMatchType:e.defaultFindMatchType??qZ(t),horizontalScrolling:a,scrollByPage:!!t.getValue(nl),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(YL)==="doubleClick",contextViewProvider:i,findWidgetStyles:Vbe,enableStickyScroll:!!t.getValue(XL),stickyScrollMaxItemCount:Number(t.getValue(QL))}}}let bf=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Lk(s,e),this.disposables.push(xk(this.contextKeyService,e)),this.listSupportsMultiSelect=Sk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),yk.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=qSe.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=J5.bindTo(this.contextKeyService),this.hasDoubleSelection=e3.bindTo(this.contextKeyService),this.hasMultiSelection=t3.bindTo(this.contextKeyService),this.treeElementCanCollapse=i3.bindTo(this.contextKeyService),this.treeElementHasParent=KSe.bindTo(this.contextKeyService),this.treeElementCanExpand=n3.bindTo(this.contextKeyService),this.treeElementHasChild=GSe.bindTo(this.contextKeyService),this.treeFindOpen=ZSe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=HZ.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=ec(a),this.updateStyleOverrides(n);const c=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(zZ),d.add(UZ),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(Hf)&&(this._useAltAsMultipleSelectionModifier=ec(a)),h.affectsConfiguration(dw)){const g=a.getValue(dw);u={...u,indent:g}}if(h.affectsConfiguration(ZL)&&t.renderIndentGuides===void 0){const g=a.getValue(ZL);u={...u,renderIndentGuides:g}}if(h.affectsConfiguration(sl)){const g=!!a.getValue(sl);u={...u,smoothScrolling:g}}if(h.affectsConfiguration(s3)||h.affectsConfiguration(GL)){const g=jZ(a);u={...u,defaultFindMode:g}}if(h.affectsConfiguration(o3)||h.affectsConfiguration(GL)){const g=i();u={...u,typeNavigationMode:g}}if(h.affectsConfiguration(r3)){const g=qZ(a);u={...u,defaultFindMatchType:g}}if(h.affectsConfiguration(Pr)&&t.horizontalScrolling===void 0){const g=!!a.getValue(Pr);u={...u,horizontalScrolling:g}}if(h.affectsConfiguration(nl)){const g=!!a.getValue(nl);u={...u,scrollByPage:g}}if(h.affectsConfiguration(YL)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(YL)==="doubleClick"}),h.affectsConfiguration(XL)){const g=a.getValue(XL);u={...u,enableStickyScroll:g}}if(h.affectsConfiguration(QL)){const g=Math.max(1,a.getValue(QL));u={...u,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(Ql)){const g=a.getValue(Ql);u={...u,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Jl)){const g=a.getValue(Jl);u={...u,fastScrollSensitivity:g}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new QSe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?Of(e):q_)}dispose(){this.disposables=vt(this.disposables)}};bf=Fd([qt(4,Ne),qt(5,Kr),qt(6,Oe)],bf);const e0e=fi.as(rl.Configuration);e0e.registerConfiguration({id:"workbench",order:7,title:m(1705,"Workbench"),type:"object",properties:{[Hf]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),m(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[G0]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Pr]:{type:"boolean",default:!1,description:m(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[nl]:{type:"boolean",default:!1,description:m(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[dw]:{type:"number",default:8,minimum:4,maximum:40,description:m(1712,"Controls tree indentation in pixels.")},[ZL]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m(1713,"Controls whether the tree should render indent guides.")},[sl]:{type:"boolean",default:!1,description:m(1714,"Controls whether lists and trees have smooth scrolling.")},[Ql]:{type:"number",default:1,markdownDescription:m(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Jl]:{type:"number",default:5,markdownDescription:m(1716,"Scrolling speed multiplier when pressing `Alt`.")},[s3]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m(1718,"Filter elements when searching.")],default:"highlight",description:m(1719,"Controls the default find mode for lists and trees in the workbench.")},[GL]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m(1724,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[r3]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m(1725,"Use fuzzy matching when searching."),m(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:m(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[YL]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[XL]:{type:"boolean",default:!0,description:m(1729,"Controls whether sticky scrolling is enabled in trees.")},[QL]:{type:"number",minimum:1,default:7,markdownDescription:m(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[o3]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class Id{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=LR.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?m(1088,"{0} in {1} on line {2} at column {3}",e.value,Br(this.uri),this.range.startLineNumber,this.range.startColumn):m(1087,"in {0} on line {1} at column {2}",Br(this.uri),this.range.startLineNumber,this.range.startColumn)}}class t0e{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),c=new D(n,l.startColumn,n,s),d=new D(r,a,r,1073741824),h=i.getValueInRange(c).replace(/^\s+/,""),u=i.getValueInRange(e),g=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+g,highlight:{start:h.length,end:h.length+u.length}}}}class u_{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new gi}dispose(){vt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m(1089,"1 symbol in {0}, full path {1}",Br(this.uri),this.uri.fsPath):m(1090,"{0} symbols in {1}, full path {2}",e,Br(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new t0e(i))}catch(i){Te(i)}return this}}class ko{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new P,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(ko._compareReferences);let n;for(const s of e)if((!n||!ei.isEqual(n.uri,s.uri,!0))&&(n=new u_(this,s.uri),this.groups.push(n)),n.children.length===0||ko._compareReferences(s,n.children[n.children.length-1])!==0){const r=new Id(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){vt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new ko(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m(1091,"No results found"):this.references.length===1?m(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:pa(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLens.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&D.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return ei.compare(e.uri,t.uri)||D.compareRangesUsingStarts(e.range,t.range)}}class AM extends F{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new _t),this.element=Y(e,ee(".monaco-count-badge")),this._register(ge(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){this.titleFormat!==""&&!this.hover.value?this.hover.value=va().setupDelayedHoverAtMouse(this.element,()=>({content:Gg(this.titleFormat,this.count),appearance:{compact:!0}})):this.titleFormat===""&&this.hover.value&&(this.hover.value=void 0)}render(){this.element.textContent=Gg(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class Oh extends F{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=Y(e,ee("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n,s){e||(e=""),n&&(e=Oh.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&xo(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render(s))}render(e){const t=[];let i=0;for(const n of this.highlights){if(n.end===n.start)continue;if(i{n=s===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class kb{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||xo(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class hw extends F{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new kb(Y(e,ee(".monaco-icon-label")))),this.labelContainer=Y(this.domNode.element,ee(".monaco-icon-label-container")),this.nameContainer=Y(this.labelContainer,ee("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new s0e(this.nameContainer,!!t.supportIcons)):this.nameNode=new i0e(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??oc("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.bold&&n.push("bold"),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let l;if(!a||!Si(a)?(l=ee(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,ye.isThemeIcon(i.iconPath)){const c=ye.asClassName(i.iconPath);l.className=`monaco-icon-label-iconpath ${c}`,l.style.backgroundImage=""}else l.style.backgroundImage=Yl(i?.iconPath);l.style.backgroundRepeat="no-repeat",l.style.backgroundPosition="center",l.style.backgroundSize="contain"}else a&&a.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();if(l instanceof Oh){const c=i?.supportIcons??this.creationOptions?.supportIcons;l.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines,c),this.setupHover(l.element,i?.descriptionTitle)}else l.textContent=t&&i?.labelEscapeNewLines?Oh.escapeNewLines(t,[]):t||"",this.setupHover(l.element,i?.descriptionTitle||""),l.empty=!t}if(i?.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let n=e;if(this.creationOptions?.hoverTargetOverride){if(!un(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}const s=va().setupManagedHover(this.hoverDelegate,n,t);s&&this.customHovers.set(e,s)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new kb(nie(this.nameContainer,ee("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new kb(Y(e.element,ee("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new kb(Y(this.labelContainer,ee("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new Oh(Y(e.element,ee("span.label-description")))):this.descriptionNode=this._register(new kb(Y(e.element,ee("span.label-description"))))}return this.descriptionNode}}class i0e{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&xo(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=Y(this.container,ee("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const s={start:i,end:i+n.length},r=t.map(a=>Xn.intersect(s,a)).filter(a=>!Xn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,r})}class s0e extends F{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&xo(this.options,t))return;this.label=e,this.options=t;const i=t?.supportIcons??this.supportIcons;if(typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new Oh(Y(this.container,ee("a.label-name",{id:t?.domId}))))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=t?.separator||"/",s=n0e(e,n,t?.matches);for(let r=0;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ik=function(o,e){return function(t,i){e(t,i,o)}},OM;let FM=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof ko||e instanceof u_}getChildren(e){if(e instanceof ko)return e.groups;if(e instanceof u_)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};FM=kk([Ik(0,ys)],FM);class o0e{getHeight(){return 23}getTemplateId(e){return e instanceof u_?ex.id:Ek.id}}let WM=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof Id){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return Br(e.uri)}};WM=kk([Ik(0,dt)],WM);class r0e{getId(e){return e instanceof Id?e.id:e.uri}}let BM=class extends F{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new hw(i,{supportHighlights:!0})),this.badge=this._register(new AM(Y(i,ee(".count")),{},$K)),e.appendChild(i)}set(e,t){const i=CD(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(m(1081,"{0} references",n)):this.badge.setTitleFormat(m(1082,"{0} reference",n))}};BM=kk([Ik(1,Cf)],BM);let ex=class{static{OM=this}static{this.id="FileReferencesRenderer"}constructor(e){this._instantiationService=e,this.templateId=OM.id}renderTemplate(e){return this._instantiationService.createInstance(BM,e)}renderElement(e,t,i){i.set(e.element,c1(e.filterData))}disposeTemplate(e){e.dispose()}};ex=OM=kk([Ik(0,pe)],ex);class a0e extends F{constructor(e){super(),this.label=this._register(new Oh(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${Br(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:s}=i;t&&!ga.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,c1(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[s]))}}}class Ek{constructor(){this.templateId=Ek.id}static{this.id="OneReferenceRenderer"}renderTemplate(e){return new a0e(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}}class l0e{getWidgetAriaLabel(){return m(1083,"References")}getAriaLabel(e){return e.ariaMessage}}var KZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Wu=function(o,e){return function(t,i){e(t,i,o)}};class l3{static{this.DecorationOptions=Me.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"})}constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new z,this._callOnModelChange=new z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let r=0;rthis.labelService.getUriBasenameLabel(i.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const n=e.elements.map(s=>this.getDragURI(s)).filter(Boolean);n.length&&(t.dataTransfer.setData(of.RESOURCES,JSON.stringify(n)),t.dataTransfer.setData(of.TEXT,n.join(` -`)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};HM=KZ([Wu(0,Cf)],HM);let VM=class extends qL{constructor(e,t,i,n,s,r,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new z,this._callOnDispose=new z,this._onDidSelectReference=new P,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new ut(0,0),this._isClosing=!1,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),vt(this._preview),vt(this._previewNotAvailableMessage),vt(this._tree),vt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Q1e)||V.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(X1e)||V.transparent,primaryHeadingColor:e.getColor(LZ),secondaryHeadingColor:e.getColor(xZ)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Y(e,ee("div.messages")),Rs(this._messageContainer),this._splitView=new kZ(e,{orientation:1}),this._previewContainer=Y(e,ee("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(kd,this._previewContainer,t,{},this.editor),Rs(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(nf,m(1084,"no preview available"),rr,nf.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=Y(e,ee("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new l0e,keyboardNavigationLabelProvider:this._instantiationService.createInstance(WM),identityProvider:new r0e,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:J1e},dnd:this._instantiationService.createInstance(HM)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Ti(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(d0e,"ReferencesWidget",this._treeContainer,new o0e,[this._instantiationService.createInstance(ex),this._instantiationService.createInstance(Ek)],this._instantiationService.createInstance(FM),i),this._splitView.addView({onDidChange:se.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},KL.Distribute),this._splitView.addView({onDidChange:se.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},KL.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Id&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")})),Rs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new ut(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=m(1085,"No results"),Co(this._messageContainer),Promise.resolve(void 0)):(Rs(this._messageContainer),this._decorationsManager=new l3(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Co(this._treeContainer),Co(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Id)return e;if(e instanceof u_&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Ie.inMemory?this.setTitle(zie(e.uri),this._uriLabel.getUriLabel(CD(e.uri))):this.setTitle(m(1086,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}vt(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=D.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};VM=KZ([Wu(3,pi),Wu(4,ys),Wu(5,pe),Wu(6,yZ),Wu(7,Cf),Wu(8,dt)],VM);var h0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hp=function(o,e){return function(t,i){e(t,i,o)}},Z0;const Vf=new re("referenceSearchVisible",!1,m(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let vf=class{static{Z0=this}static{this.ID="editor.contrib.referencesController"}static get(e){return e.getContribution(Z0.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Vf.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=c0e.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(VM,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m(1079,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{if(a!==this._requestIdPool||!this._widget){l.dispose();return}return this._model?.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m(1080,"{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,d=new R(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(99)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=D.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(n=>{if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(i),this._widget.focusOnReferenceTree();else{const s=Z0.get(n),r=this._model.clone();this.closeWidget(),n.focus(),s?.toggleWidget(i,Qi(a=>Promise.resolve(r)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,Te(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};vf=Z0=h0e([hp(2,Ne),hp(3,at),hp(4,Li),hp(5,pe),hp(6,Ls),hp(7,Oe)],vf);function zf(o,e){const t=vZ(o);if(!t)return;const i=vf.get(t);i&&e(i)}Sn.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Hi(2089,60),when:K.or(Vf,lo.inPeekEditor),handler(o){zf(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Sn.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:K.or(Vf,lo.inPeekEditor),handler(o){zf(o,e=>{e.goToNextOrPreviousReference(!0)})}});Sn.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:K.or(Vf,lo.inPeekEditor),handler(o){zf(o,e=>{e.goToNextOrPreviousReference(!1)})}});it.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");it.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");it.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");it.registerCommand("closeReferenceSearch",o=>zf(o,e=>e.closeWidget()));Sn.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:K.and(lo.inPeekEditor,K.not("config.editor.stablePeek"))});Sn.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:K.and(Vf,K.not("config.editor.stablePeek"),K.or(N.editorTextFocus,Q5.negate()))});Sn.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:K.and(Vf,VZ,i3.negate(),n3.negate()),handler(o){const t=o.get(Kr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Id&&zf(o,i=>i.revealReference(t[0]))}});Sn.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:K.and(Vf,VZ,i3.negate(),n3.negate()),handler(o){const t=o.get(Kr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Id&&zf(o,i=>i.openReference(t[0],!0,!0))}});it.registerCommand("openReference",o=>{const t=o.get(Kr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Id&&zf(o,i=>i.openReference(t[0],!1,!0))});var GZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zb=function(o,e){return function(t,i){e(t,i,o)}};const c3=new re("hasSymbols",!1,m(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),Nk=Ve("ISymbolNavigationService");let zM=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=c3.bindTo(e)}reset(){this._ctxHasSymbols.reset(),this._currentState?.dispose(),this._currentMessage?.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new UM(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const h of t.references)if(zh(h.uri,a.uri))c=!0,d=d||D.containsPosition(h.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=da(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:D.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?m(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):m(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};zM=GZ([Zb(0,Ne),Zb(1,at),Zb(2,Li),Zb(3,dt)],zM);Ge(Nk,zM,1);ae(new class extends tn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:c3,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(Nk).revealNext(e)}});Sn.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:c3,primary:9,handler(o){o.get(Nk).reset()}});let UM=class{constructor(e){this._listener=new Map,this._disposables=new z,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),vt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,da(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};UM=GZ([Zb(0,at)],UM);function $M(o,e){return e.uri.scheme===o.uri.scheme?!0:!nT(e.uri,Ie.walkThroughSnippet,Ie.vscodeChatCodeBlock,Ie.vscodeChatCodeCompareBlock)}async function D1(o,e,t,i,n){const r=t.ordered(o,i).map(l=>Promise.resolve(n(l,o,e)).then(void 0,c=>{Bi(c)})),a=await Promise.all(r);return ol(a.flat()).filter(l=>$M(o,l))}function k1(o,e,t,i,n){return D1(e,t,o,i,(s,r,a)=>s.provideDefinition(r,a,n))}function d3(o,e,t,i,n){return D1(e,t,o,i,(s,r,a)=>s.provideDeclaration(r,a,n))}function h3(o,e,t,i,n){return D1(e,t,o,i,(s,r,a)=>s.provideImplementation(r,a,n))}function u3(o,e,t,i,n){return D1(e,t,o,i,(s,r,a)=>s.provideTypeDefinition(r,a,n))}function I1(o,e,t,i,n,s){return D1(e,t,o,n,async(r,a,l)=>{const c=(await r.provideReferences(a,l,{includeDeclaration:!0},s))?.filter(h=>$M(a,h));if(!i||!c||c.length!==2)return c;const d=(await r.provideReferences(a,l,{includeDeclaration:!1},s))?.filter(h=>$M(a,h));return d&&d.length===1?d:c})}async function lc(o){const e=await o(),t=new ko(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ho("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(ue),n=k1(i.definitionProvider,e,t,!1,$e.None);return lc(()=>n)});ho("_executeDefinitionProvider_recursive",(o,e,t)=>{const i=o.get(ue),n=k1(i.definitionProvider,e,t,!0,$e.None);return lc(()=>n)});ho("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(ue),n=u3(i.typeDefinitionProvider,e,t,!1,$e.None);return lc(()=>n)});ho("_executeTypeDefinitionProvider_recursive",(o,e,t)=>{const i=o.get(ue),n=u3(i.typeDefinitionProvider,e,t,!0,$e.None);return lc(()=>n)});ho("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(ue),n=d3(i.declarationProvider,e,t,!1,$e.None);return lc(()=>n)});ho("_executeDeclarationProvider_recursive",(o,e,t)=>{const i=o.get(ue),n=d3(i.declarationProvider,e,t,!0,$e.None);return lc(()=>n)});ho("_executeReferenceProvider",(o,e,t)=>{const i=o.get(ue),n=I1(i.referenceProvider,e,t,!1,!1,$e.None);return lc(()=>n)});ho("_executeReferenceProvider_recursive",(o,e,t)=>{const i=o.get(ue),n=I1(i.referenceProvider,e,t,!1,!0,$e.None);return lc(()=>n)});ho("_executeImplementationProvider",(o,e,t)=>{const i=o.get(ue),n=h3(i.implementationProvider,e,t,!1,$e.None);return lc(()=>n)});ho("_executeImplementationProvider_recursive",(o,e,t)=>{const i=o.get(ue),n=h3(i.implementationProvider,e,t,!0,$e.None);return lc(()=>n)});vn.appendMenuItem(M.EditorContext,{submenu:M.EditorContextPeek,title:m(1038,"Peek"),group:"navigation",order:100});class g_{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof g_||R.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Ys extends Ca{static{this._allSymbolNavigationCommands=new Map}static{this._activeAlternativeCommands=new Set}static all(){return Ys._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Je.wrap(t.menu))(i.id===M.EditorContext||i.id===M.EditorContextPeek)&&(i.when=K.and(e.precondition,i.when));return t}constructor(e,t){super(Ys._patchConfig(t)),this.configuration=e,Ys._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Li),r=e.get(at),a=e.get(yd),l=e.get(Nk),c=e.get(ue),d=e.get(pe),h=t.getModel(),u=t.getPosition(),g=g_.is(i)?i:new g_(h,u),f=new Ld(t,5),p=Vm(this._getLocationModel(c,g.model,g.position,f.token),f.token).then(async _=>{if(!_||f.token.isCancellationRequested)return;Ws(_.ariaMessage);let b;if(_.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);w!==void 0&&!Ys._activeAlternativeCommands.has(w)&&Ys._allSymbolNavigationCommands.has(w)&&(b=Ys._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);Do.get(t)?.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)Ys._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{Ys._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,n)},_=>{s.error(_)}).finally(()=>{f.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof kd)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(zce(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:D.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const n=vf.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Qi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}class E1 extends Ys{async _getLocationModel(e,t,i,n){return new ko(await k1(e.definitionProvider,t,i,!1,n),m(1039,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?m(1040,"No definition found for '{0}'",e.word):m(1041,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}}Lt(class jM extends E1{static{this.id="editor.action.revealDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:jM.id,title:{...H(1065,"Go to Definition"),mnemonicTitle:m(1042,"Go to &&Definition")},precondition:N.hasDefinitionProvider,keybinding:[{when:N.editorTextFocus,primary:70,weight:100},{when:K.and(N.editorTextFocus,FZ),primary:2118,weight:100}],menu:[{id:M.EditorContext,group:"navigation",order:1.1},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),it.registerCommandAlias("editor.action.goToDeclaration",jM.id)}});Lt(class qM extends E1{static{this.id="editor.action.revealDefinitionAside"}constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:qM.id,title:H(1066,"Open Definition to the Side"),precondition:K.and(N.hasDefinitionProvider,N.isInEmbeddedEditor.toNegated()),keybinding:[{when:N.editorTextFocus,primary:Hi(2089,70),weight:100},{when:K.and(N.editorTextFocus,FZ),primary:Hi(2089,2118),weight:100}]}),it.registerCommandAlias("editor.action.openDeclarationToTheSide",qM.id)}});Lt(class KM extends E1{static{this.id="editor.action.peekDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:KM.id,title:H(1067,"Peek Definition"),precondition:K.and(N.hasDefinitionProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:2}}),it.registerCommandAlias("editor.action.previewDeclaration",KM.id)}});class ZZ extends Ys{async _getLocationModel(e,t,i,n){return new ko(await d3(e.declarationProvider,t,i,!1,n),m(1043,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?m(1044,"No declaration found for '{0}'",e.word):m(1045,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}}Lt(class YZ extends ZZ{static{this.id="editor.action.revealDeclaration"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:YZ.id,title:{...H(1068,"Go to Declaration"),mnemonicTitle:m(1046,"Go to &&Declaration")},precondition:K.and(N.hasDeclarationProvider,N.isInEmbeddedEditor.toNegated()),menu:[{id:M.EditorContext,group:"navigation",order:1.3},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m(1047,"No declaration found for '{0}'",e.word):m(1048,"No declaration found")}});Lt(class extends ZZ{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:H(1069,"Peek Declaration"),precondition:K.and(N.hasDeclarationProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:3}})}});class XZ extends Ys{async _getLocationModel(e,t,i,n){return new ko(await u3(e.typeDefinitionProvider,t,i,!1,n),m(1049,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?m(1050,"No type definition found for '{0}'",e.word):m(1051,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}}Lt(class QZ extends XZ{static{this.ID="editor.action.goToTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:QZ.ID,title:{...H(1070,"Go to Type Definition"),mnemonicTitle:m(1052,"Go to &&Type Definition")},precondition:N.hasTypeDefinitionProvider,keybinding:{when:N.editorTextFocus,primary:0,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.4},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}});Lt(class JZ extends XZ{static{this.ID="editor.action.peekTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:JZ.ID,title:H(1071,"Peek Type Definition"),precondition:K.and(N.hasTypeDefinitionProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:4}})}});class eY extends Ys{async _getLocationModel(e,t,i,n){return new ko(await h3(e.implementationProvider,t,i,!1,n),m(1053,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?m(1054,"No implementation found for '{0}'",e.word):m(1055,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}}Lt(class tY extends eY{static{this.ID="editor.action.goToImplementation"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:tY.ID,title:{...H(1072,"Go to Implementations"),mnemonicTitle:m(1056,"Go to &&Implementations")},precondition:N.hasImplementationProvider,keybinding:{when:N.editorTextFocus,primary:2118,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}});Lt(class iY extends eY{static{this.ID="editor.action.peekImplementation"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:iY.ID,title:H(1073,"Peek Implementations"),precondition:K.and(N.hasImplementationProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:3142,weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:5}})}});class nY extends Ys{_getNoResultFoundMessage(e){return e?m(1057,"No references found for '{0}'",e.word):m(1058,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}}Lt(class extends nY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...H(1074,"Go to References"),mnemonicTitle:m(1059,"Go to &&References")},precondition:K.and(N.hasReferenceProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:1094,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new ko(await I1(e.referenceProvider,t,i,!0,!1,n),m(1060,"References"))}});Lt(class extends nY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:H(1075,"Peek References"),precondition:K.and(N.hasReferenceProvider,lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new ko(await I1(e.referenceProvider,t,i,!1,!1,n),m(1061,"References"))}});class u0e extends Ys{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:H(1076,"Go to Any Symbol"),precondition:K.and(lo.notInPeekEditor,N.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new ko(this._references,m(1062,"Locations"))}_getNoResultFoundMessage(e){return e&&m(1063,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}}it.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:be},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{rt(be.isUri(e)),rt(R.isIPosition(t)),rt(Array.isArray(i)),rt(typeof n>"u"||typeof n=="string"),rt(typeof r>"u"||typeof r=="boolean");const a=o.get(at),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(il(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends u0e{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);c.get(pe).invokeFunction(d.run.bind(d),l)})}});it.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:be},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(o,e,t,i,n)=>{o.get(Vt).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});it.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{rt(be.isUri(e)),rt(R.isIPosition(t));const i=o.get(ue),n=o.get(at);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!il(s)||!s.hasModel())return;const r=vf.get(s);if(!r)return;const a=Qi(c=>I1(i.referenceProvider,s.getModel(),R.lift(t),!1,!1,c).then(d=>new ko(d,m(1064,"References")))),l=new D(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});it.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function g0e(o,e,t,i){const n=o.get(ys),s=o.get(gr),r=o.get(Vt),a=o.get(pe),l=o.get(Li);if(await i.item.resolve($e.None),!i.part.location)return;const c=i.part.location,d=[],h=new Set(vn.getMenuItems(M.EditorContext).map(g=>sm(g)?g.command.id:Rf()));for(const g of Ys.all())h.has(g.desc.id)&&d.push(new nr(g.desc.id,sr.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const f=await n.createModelReference(c.uri);try{const p=new g_(f.object.textEditorModel,D.getStartPosition(c.range)),_=i.item.anchor.range;await a.invokeFunction(g.runEditorCommand.bind(g),e,p,_)}finally{f.dispose()}}));if(i.part.command){const{command:g}=i.part;d.push(new $i),d.push(new nr(g.id,g.title,void 0,!0,async()=>{try{await r.executeCommand(g.id,...g.arguments??[])}catch(f){l.notify({severity:U_.Error,source:i.item.provider.displayName,message:f})}}))}const u=e.getOption(144);s.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const g=wi(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function sY(o,e,t,i){const s=await o.get(ys).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,l=r.get(Ne),c=lo.inPeekEditor.getValue(l),d=!a&&t.getOption(101)&&!c;return new E1({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new g_(s.object.textEditorModel,D.getStartPosition(i.range)),D.lift(i.range))}),s.dispose()}var f0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},up=function(o,e){return function(t,i){e(t,i,o)}},Ip;class tx{constructor(){this._entries=new ba(50)}get(e){const t=tx._key(e);return this._entries.get(t)}set(e,t){const i=tx._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const oY=Ve("IInlayHintsCache");Ge(oY,tx,1);class GM{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class p0e{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}class m0e{constructor(){this._store=new _t,this._tokenSource=new Jt}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new Jt,this._store.value=new z,{store:this._store.value,token:this._tokenSource.token}}}let uw=class{static{Ip=this}static{this.ID="editor.contrib.InlayHints"}static{this._MAX_DECORATORS=1500}static{this._whitespaceData={}}static get(e){return e.getContribution(Ip.ID)??void 0}constructor(e,t,i,n,s,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=s,this._notificationService=r,this._instaService=a,this._disposables=new z,this._sessionDisposables=new z,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new BD(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let c,d;e.enabled==="onUnlessPressed"?(c=0,d=1):(c=1,d=0),this._activeRenderMode=c,this._sessionDisposables.add(Zc.getInstance().event(h=>{if(!this._editor.hasModel())return;const u=h.altKey&&h.ctrlKey&&!(h.shiftKey||h.metaKey)?d:c;if(u!==this._activeRenderMode){this._activeRenderMode=u;const g=this._editor.getModel(),f=this._copyInlayHintsWithCurrentAnchor(g);this._updateHintsDecorators([g.getFullModelRange()],f),a.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(ge(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let n;const s=new Set;this._sessionDisposables.add(t.onWillDispose(()=>n?.cancel()));const r=this._sessionDisposables.add(new m0e),a=new It(async()=>{const c=Date.now(),{store:d,token:h}=r.reset();try{const u=await Sm.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),h);if(a.delay=this._debounceInfo.update(t,Date.now()-c),h.isCancellationRequested){u.dispose();return}for(const g of u.provider)typeof g.onDidChangeInlayHints=="function"&&!s.has(g)&&(s.add(g),d.add(g.onDidChangeInlayHints(()=>{a.isScheduled()||a.schedule()})));d.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(u){Te(u)}},this._debounceInfo.get(t));this._sessionDisposables.add(a),a.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(c=>{(c.scrollTopChanged||!a.isScheduled())&&a.schedule()}));const l=this._sessionDisposables.add(new _t);this._sessionDisposables.add(this._editor.onDidChangeModelContent(c=>{const d=Math.max(a.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+d},l.value=pd(()=>a.schedule(0),d),a.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(159)&&a.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>a.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new z,t=e.add(new Ck(this._editor)),i=new z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[s]=n,r=this._getInlayHintLabelPart(s),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Jt;i.add(ge(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new p0e(r,s.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new D(c,1,c,a.getLineMaxColumn(c)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(ge(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async n=>{const s=this._getInlayHintLabelPart(n);if(s){const r=s.part;r.location?this._instaService.invokeFunction(sY,n,this._editor,r.location):$T.is(r.command)&&await this._invokeCommand(r.command,s.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve($e.None),ws(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(s=>Ci.replace(D.lift(s.range),s.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Si(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(g0e,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==6)return;const t=e.target.detail.injectedText?.options;if(t instanceof Gh&&t?.attachedData instanceof GM)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:U_.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const s=e.getDecorationRange(i);if(s){const r=new bZ(s,n.item.anchor.direction),a=n.item.with({anchor:r});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const s of i.sort(D.compareRangesUsingStarts)){const r=t.validateRange(new D(s.startLineNumber-30,s.startColumn,s.endLineNumber+30,s.endColumn));n.length===0||!D.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=D.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some(_=>_.containsPosition(this._cursorInfo.position))){const{position:_}=this._cursorInfo;this._cursorInfo=void 0;const b=new Map;for(const S of this._editor.getLineDecorations(_.lineNumber)??[]){const L=this._decorationsMetadata.get(S.id);if(S.range.startColumn>_.column)continue;const x=L?.decoration.options[L.item.anchor.direction];if(x&&x.attachedData!==Ip._whitespaceData){const k=b.get(L.item)??0;b.set(L.item,k+x.content.length)}}const C=t.filter(S=>S.anchor.range.startLineNumber===_.lineNumber&&S.anchor.range.endColumn<=_.column),w=Array.from(b.values());let v;for(;;){const S=C.shift(),L=w.shift();if(!L&&!S)break;if(S)i.set(S,L??0),v=S;else if(v&&L){let x=i.get(v);x+=L,x+=w.reduce((k,I)=>k+I,0),w.length=0;break}}}const n=[],s=(_,b,C,w,v)=>{const S={content:C,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:b.className,cursorStops:w,attachedData:v};n.push({item:_,classNameRef:b,decoration:{range:_.anchor.range,options:{description:"InlayHint",showIfCollapsed:_.anchor.range.isEmpty(),collapseOnReplaceEdit:!_.anchor.range.isEmpty(),stickiness:0,[_.anchor.direction]:this._activeRenderMode===0?S:void 0}}})},r=(_,b)=>{const C=this._ruleFactory.createClassNameRef({width:`${a/3|0}px`,display:"inline-block"});s(_,C," ",b?Lr.Right:Lr.None,Ip._whitespaceData)},{fontSize:a,fontFamily:l,padding:c,isUniform:d}=this._getLayoutInfo(),h=this._editor.getOption(159).maximumLength,u="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(u,l);let g={line:0,totalLen:0};for(let _=0;_h)continue;b.hint.paddingLeft&&r(b,!1);const C=typeof b.hint.label=="string"?[{label:b.hint.label}]:b.hint.label,w=i.get(b);let v=0;for(let S=0;S0&&(T=T.slice(0,-O)+"…",A=!0),v+=T.length,w!==void 0){const W=v-w;W>=0&&(v-=W,T=T.slice(0,-(1+W))+"…",A=!0)}if(c&&(x&&(k||A)?(I.padding=`1px ${Math.max(1,a/4)|0}px`,I.borderRadius=`${a/4|0}px`):x?(I.padding=`1px 0 1px ${Math.max(1,a/4)|0}px`,I.borderRadius=`${a/4|0}px 0 0 ${a/4|0}px`):k||A?(I.padding=`1px ${Math.max(1,a/4)|0}px 1px 0`,I.borderRadius=`0 ${a/4|0}px ${a/4|0}px 0`):I.padding="1px 0 1px 0"),s(b,this._ruleFactory.createClassNameRef(I),_0e(T),k&&!b.hint.paddingRight?Lr.Right:Lr.None,new GM(b,S)),A)break}if(w!==void 0&&vIp._MAX_DECORATORS)break}const f=[];for(const[_,b]of this._decorationsMetadata){const C=this._editor.getModel()?.getDecorationRange(_);C&&e.some(w=>w.containsRange(C))&&(f.push(_),b.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const p=el.capture(this._editor);this._editor.changeDecorations(_=>{const b=_.deltaDecorations(f,n.map(C=>C.decoration));for(let C=0;Ci)&&(s=i);const r=e.fontFamily||n;return{fontSize:s,fontFamily:r,padding:t,isUniform:!t&&r===n&&s===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};uw=Ip=f0e([up(1,ue),up(2,qr),up(3,oY),up(4,Vt),up(5,Li),up(6,pe)],uw);function _0e(o){return o.replace(/[ \t]/g," ")}it.registerCommand("_executeInlayHintProvider",async(o,...e)=>{const[t,i]=e;rt(be.isUri(t)),rt(D.isIRange(i));const{inlayHintsProvider:n}=o.get(ue),s=await o.get(ys).createModelReference(t);try{const r=await Sm.create(n,s.object.textEditorModel,[D.lift(i)],$e.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{s.dispose()}});var b0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yu=function(o,e){return function(t,i){e(t,i,o)}};class AH extends Gb{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let ix=class extends aw{constructor(e,t,i,n,s,r,a,l){super(e,t,s,a,i,n,l),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!uw.get(this._editor)||e.target.type!==6)return null;const i=e.target.detail.injectedText?.options;return i instanceof Gh&&i.attachedData instanceof GM?new AH(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,n){return e instanceof AH?new on(async s=>{const{part:r}=e;if(await r.item.resolve(n),n.isCancellationRequested)return;let a;typeof r.item.hint.tooltip=="string"?a=new ts().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(a=r.item.hint.tooltip),a&&s.emitOne(new la(this,e.range,[a],!1,0)),ws(r.item.hint.textEdits)&&s.emitOne(new la(this,e.range,[new ts().appendText(m(1164,"Double-click to insert"))],!1,10001));let l;if(typeof r.part.tooltip=="string"?l=new ts().appendText(r.part.tooltip):r.part.tooltip&&(l=r.part.tooltip),l&&s.emitOne(new la(this,e.range,[l],!1,1)),r.part.location||r.part.command){let d;const u=this._editor.getOption(86)==="altKey"?je?m(1165,"cmd + click"):m(1166,"ctrl + click"):je?m(1167,"option + click"):m(1168,"alt + click");r.part.location&&r.part.command?d=new ts().appendText(m(1169,"Go to Definition ({0}), right click for more",u)):r.part.location?d=new ts().appendText(m(1170,"Go to Definition ({0})",u)):r.part.command&&(d=new ts(`[${m(1171,"Execute Command")}](${z1e(r.part.command)} "${r.part.command.title}") (${u})`,{isTrusted:!0})),d&&s.emitOne(new la(this,e.range,[d],!1,1e4))}const c=this._resolveInlayHintLabelPartHover(r,n);for await(const d of c)s.emitOne(d)}):on.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:n}=e.part.location,s=await this._resolverService.createModelReference(i);try{const r=s.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(r))return;for await(const a of B5(this._languageFeaturesService.hoverProvider,r,new R(n.startLineNumber,n.startColumn),t))o_(a.hover.contents)||(yield new la(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal))}finally{s.dispose()}}};ix=b0e([yu(1,Sa),yu(2,dt),yu(3,Us),yu(4,Oe),yu(5,ys),yu(6,ue),yu(7,Vt)],ix);var rY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nx=function(o,e){return function(t,i){e(t,i,o)}};class OH{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let ZM=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._dispoables=new z,this._markers=[],this._nextIdx=-1,be.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let c=av(a.resource.toString(),l.resource.toString());return c===0&&(n==="position"?c=D.compareRangesUsingStarts(a,l)||ui.compare(a.severity,l.severity):c=ui.compare(a.severity,l.severity)||D.compareRangesUsingStarts(a,l)),c},r=()=>{let a=this._markerService.read({resource:be.isUri(e)?e:void 0,severities:ui.Error|ui.Warning|ui.Info});return typeof e=="function"&&(a=a.filter(l=>this._resourceFilter(l.resource))),a.sort(s),Qt(a,this._markers,(l,c)=>l.resource.toString()===c.resource.toString()&&l.startLineNumber===c.startLineNumber&&l.startColumn===c.startColumn&&l.endLineNumber===c.endLineNumber&&l.endColumn===c.endColumn&&l.severity===c.severity&&l.message===c.message)?!1:(this._markers=a,!0)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&r()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new OH(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=this._markers.findIndex(s=>zh(s.resource,e.uri));if(n<0)n=m4(this._markers.length,s=>av(this._markers[s].resource.toString(),e.uri.toString())),n<0&&(n=~n),i?this._nextIdx=n:this._nextIdx=(this._markers.length+n-1)%this._markers.length;else{let s=!1,r=!1;for(let a=n;an.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gp=function(o,e){return function(t,i){e(t,i,o)}},QM;class v0e{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Ti(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new Sj(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){vt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=No(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Tn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=ee("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=Y(this._codeLink,ee("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(Tn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ws(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(75)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,p.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(p,g);const _=document.createElement("span");_.innerText=g.message,f.appendChild(p),f.appendChild(_),this._lines+=1,u.appendChild(f)}}const c=this._editor.getOption(59),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ui.Error:t=m(1024,"Error");break;case ui.Warning:t=m(1025,"Warning");break;case ui.Info:t=m(1026,"Info");break;case ui.Hint:t=m(1027,"Hint");break}let i=m(1028,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let gw=class extends qL{static{QM=this}static{this.TitleMenu=new M("gotoErrorTitleMenu")}constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new z,this._onDidSelectRelatedInformation=new P,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ui.Warning,this._backgroundColor=V.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(L0e);let t=JM,i=w0e;this._severity===ui.Warning?(t=Y0,i=S0e):this._severity===ui.Info&&(t=e2,i=y0e);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(LZ),secondaryHeadingColor:e.getColor(xZ)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const t=this._menuService.getMenuActions(QM.TitleMenu,this._contextKeyService),i=Zbe(t);this._actionbarWidget.push(i,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Y(e,ee(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new v0e(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=D.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m(1029,"{0} of {1} problems",t,i):m(1030,"{0} of {1} problem",t,i);this.setTitle(Br(a.uri),l)}this._icon.className=`codicon ${XM.className(ui.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};gw=QM=C0e([gp(1,pi),gp(2,Pd),gp(3,Ur),gp(4,pe),gp(5,Ne),gp(6,Cf)],gw);const FH=wv(MD,Zoe),WH=wv(vd,Sv),BH=wv(Gl,yv),JM=E("editorMarkerNavigationError.background",{dark:FH,light:FH,hcDark:et,hcLight:et},m(1031,"Editor marker navigation widget error color.")),w0e=E("editorMarkerNavigationError.headerBackground",{dark:Pe(JM,.1),light:Pe(JM,.1),hcDark:null,hcLight:null},m(1032,"Editor marker navigation widget error heading background.")),Y0=E("editorMarkerNavigationWarning.background",{dark:WH,light:WH,hcDark:et,hcLight:et},m(1033,"Editor marker navigation widget warning color.")),S0e=E("editorMarkerNavigationWarning.headerBackground",{dark:Pe(Y0,.1),light:Pe(Y0,.1),hcDark:"#0C141F",hcLight:Pe(Y0,.2)},m(1034,"Editor marker navigation widget warning heading background.")),e2=E("editorMarkerNavigationInfo.background",{dark:BH,light:BH,hcDark:et,hcLight:et},m(1035,"Editor marker navigation widget info color.")),y0e=E("editorMarkerNavigationInfo.headerBackground",{dark:Pe(e2,.1),light:Pe(e2,.1),hcDark:null,hcLight:null},m(1036,"Editor marker navigation widget info heading background.")),L0e=E("editorMarkerNavigation.background",Ri,m(1037,"Editor marker navigation widget background."));var x0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},BS=function(o,e){return function(t,i){e(t,i,o)}},Yb;let wf=class{static{Yb=this}static{this.ID="editor.contrib.markerController"}static get(e){return e.getContribution(Yb.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new z,this._editor=e,this._widgetVisible=lY.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(gw,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!D.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:D.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new R(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._getOrCreateModel(t?void 0:i.uri);if(n.move(e,i,this._editor.getPosition()),!!n.selected)if(n.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);s&&(Yb.get(s)?.close(),Yb.get(s)?.navigate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}};wf=Yb=x0e([BS(1,aY),BS(2,Ne),BS(3,at),BS(4,pe)],wf);class Tk extends de{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&await wf.get(t)?.navigate(this._next,this._multiFile)}}class ym extends Tk{static{this.ID="editor.action.marker.next"}static{this.LABEL=H(1020,"Go to Next Problem (Error, Warning, Info)")}constructor(){super(!0,!1,{id:ym.ID,label:ym.LABEL,precondition:void 0,kbOpts:{kbExpr:N.focus,primary:578,weight:100},menuOpts:{menuId:gw.TitleMenu,title:ym.LABEL.value,icon:Kt("marker-navigation-next",Z.arrowDown,m(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}}class OC extends Tk{static{this.ID="editor.action.marker.prev"}static{this.LABEL=H(1021,"Go to Previous Problem (Error, Warning, Info)")}constructor(){super(!1,!1,{id:OC.ID,label:OC.LABEL,precondition:void 0,kbOpts:{kbExpr:N.focus,primary:1602,weight:100},menuOpts:{menuId:gw.TitleMenu,title:OC.LABEL.value,icon:Kt("marker-navigation-previous",Z.arrowUp,m(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}}class D0e extends Tk{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:H(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:66,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class k0e extends Tk{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:H(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:1090,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}nt(wf.ID,wf,4);oe(ym);oe(OC);oe(D0e);oe(k0e);const lY=new re("markersNavigationVisible",!1),I0e=tn.bindToContribution(wf.get);ae(new I0e({id:"closeMarkersNavigation",precondition:lY,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:N.focus,primary:9,secondary:[1033]}}));var E0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XE=function(o,e){return function(t,i){e(t,i,o)}};const Gr=ee;class cY{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const HH={type:1,filter:{include:Yt.QuickFix},triggerAction:Po.QuickFixHover};let t2=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range;if(!i.isValidRange(e.range))return[];const s=n.startLineNumber,r=i.getLineMaxColumn(s),a=[];for(const l of t){const c=l.range.startLineNumber===s?l.range.startColumn:1,d=l.range.endLineNumber===s?l.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,l);if(!h)continue;const u=new D(e.range.startLineNumber,c,e.range.startLineNumber,d);a.push(new cY(this,u,h))}return a}renderHoverParts(e,t){if(!t.length)return new pf([]);const i=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),i.push(a)});const n=t.length===1?t[0]:t.sort((r,a)=>ui.compare(r.marker.severity,a.marker.severity))[0],s=this._renderMarkerStatusbar(e,n);return new pf(i,s)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new z,i=Gr("div.hover-row"),n=Y(i,Gr("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const c=Y(n,Gr("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,s||a)if(a&&typeof a!="string"){const h=Gr("span");if(s){const p=Y(h,Gr("span"));p.innerText=s}const u=Y(h,Gr("a.code-link"));u.setAttribute("href",a.target.toString(!0)),t.add(B(u,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const g=Y(u,Gr("span"));g.innerText=a.value;const f=Y(n,h);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const h=Y(n,Gr("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(ws(l))for(const{message:h,resource:u,startLineNumber:g,startColumn:f}of l){const p=Y(n,Gr("div"));p.style.marginTop="8px";const _=Y(p,Gr("a"));_.innerText=`${Br(u)}(${g}, ${f}): `,_.style.cursor="pointer",t.add(B(_,"click",C=>{if(C.stopPropagation(),C.preventDefault(),this._openerService){const w={selection:{startLineNumber:g,startColumn:f}};this._openerService.open(u,{fromUserGesture:!0,editorOptions:w}).catch(Te)}}));const b=Y(p,Gr("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new z;if(t.marker.severity===ui.Error||t.marker.severity===ui.Warning||t.marker.severity===ui.Info){const n=wf.get(this._editor);n&&e.statusBar.addAction({label:m(1139,"View Problem"),commandId:ym.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const n=e.statusBar.append(Gr("div"));this.recentMarkerCodeActionsInfo&&(WL.makeKey(this.recentMarkerCodeActionsInfo.marker)===WL.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=m(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?F.None:pd(()=>n.textContent=m(1141,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(ge(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=m(1142,"No quick fixes available");return}n.style.display="none";let l=!1;i.add(ge(()=>{l||a.dispose()})),e.statusBar.addAction({label:m(1143,"Quick Fix..."),commandId:I5,run:d=>{l=!0;const h=ff.get(this._editor),u=wi(d);e.hide(),h?.showCodeActions(HH,a,{x:u.left,y:u.top,width:u.width,height:u.height})}});const c=a.validActions.find(d=>d.action.isAI);c&&e.statusBar.addAction({label:c.action.title,commandId:c.action.command?.id??"",iconClass:ye.asClassName(Z.sparkle),run:()=>{ff.get(this._editor)?.applyCodeAction(c,!1,!1,yh.FromProblemsHover)}}),e.onContentsChanged()},Te)}return i}getCodeActions(e){return Qi(t=>Kp(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),HH,Jc.None,t))}};t2=E0e([XE(1,j4),XE(2,Pd),XE(3,ue)],t2);var dY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lm=function(o,e){return function(t,i){e(t,i,o)}},i2,n2;let s2=i2=class extends F{constructor(e,t,i,n,s,r,a){super();const l=t.hoverParts;this._renderedHoverParts=this._register(new o2(e,i,l,n,s,r,a));const c=t.options,d=c.anchor,{showAtPosition:h,showAtSecondaryPosition:u}=i2.computeHoverPositions(e,d.range,l);this.shouldAppearBeforeContent=l.some(g=>g.isBeforeContent),this.showAtPosition=h,this.showAtSecondaryPosition=u,this.initialMousePosX=d.initialMousePosX,this.initialMousePosY=d.initialMousePosY,this.shouldFocus=c.shouldFocus,this.source=c.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),g=d.getLineMinColumn(u.startLineNumber),f=new R(u.startLineNumber,g);n=h.convertViewPositionToModelPosition(f).column}const s=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===s,g=h.endLineNumber===s;if(u&&g){const p=h.startColumn,_=Math.min(r,p);r=Math.max(_,n)}d.forceShowAtRange&&(a=h)}let l,c;if(a){const d=a.getStartPosition();l=d,c=d}else l=t.getStartPosition(),c=new R(s,r);return{showAtPosition:l,showAtSecondaryPosition:c}}};s2=i2=dY([Lm(4,dt),Lm(5,Us),Lm(6,Mo)],s2);class N0e{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}let o2=class extends F{static{n2=this}static{this._DECORATION_OPTIONS=Me.register({description:"content-hover-highlight",className:"hoverHighlight"})}constructor(e,t,i,n,s,r,a){super(),this._hoverService=r,this._clipboardService=a,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=n,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,n,s,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return F.None;let i=t[0].range;for(const s of t){const r=s.range;i=D.plusRange(i,r)}const n=e.createDecorationsCollection();return n.set([{range:i,options:n2._DECORATION_OPTIONS}]),ge(()=>{n.clear()})}_renderParts(e,t,i,n,s){const r=new zL(n,s),a={fragment:this._fragment,statusBar:r,...i},l=new z;l.add(r);for(const d of e){const h=this._renderHoverPartsForParticipant(t,d,a);l.add(h);for(const u of h.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:d,hoverPart:u.hoverPart,hoverElement:u.hoverElement})}const c=this._renderStatusBar(this._fragment,r);return c&&(l.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),l}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(r=>r.owner===t);return n.length>0?t.renderHoverParts(i,n):new pf([])}_renderStatusBar(e,t){if(t.hasContent)return new N0e(e,t)}_registerListenersOnRenderedParts(){const e=new z;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(B(n,te.FOCUS_IN,s=>{s.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(B(n,te.FOCUS_OUT,s=>{s.stopPropagation(),this._focusedHoverPartIndex=-1})),t.type==="hoverPart"&&t.hoverPart instanceof cY&&e.add(new EM(n,()=>t.participant.getAccessibleContent(t.hoverPart),this._clipboardService,this._hoverService))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof aw&&!(i instanceof ix));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof $L)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let n;t>=0?n={start:t,endExclusive:t+1}:n=this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let s=n.start;s=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const s=this._renderedParts.findIndex(r=>r.type==="hoverPart"&&r.participant===e);if(s===-1)throw new ve;return t-s}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex(r=>r.type==="hoverPart"&&r.participant===e),n=t.reverse().findIndex(r=>r.type==="hoverPart"&&r.participant===e),s=n>=0?t.length-n:n;return{start:i,endExclusive:s+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}};o2=n2=dY([Lm(4,dt),Lm(5,Us),Lm(6,Mo)],o2);var T0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},HS=function(o,e){return function(t,i){e(t,i,o)}};let r2=class extends F{constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=n,this._clipboardService=s,this._currentResult=null,this._renderedContentHover=this._register(new _t),this._onContentsChanged=this._register(new P),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(LM,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new jG(this._editor,new VL(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of Bf.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>t.handleResize?.())})),this._register(this._contentHoverWidget.onDidScroll(t=>{this._participants.forEach(i=>i.handleScroll?.(t))})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(t=>t.handleContentsChanged?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{const i=t.hasLoadingMessage?this._addLoadingMessage(t):t.value;this._withResult(new ZG(i,t.isComplete,t.options))}));const e=this._contentHoverWidget.getDomNode();this._register(Ti(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(Ti(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(bi.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(e,t,i,n,s){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1;const a=this._editor.getOption(69).sticky,l=s&&this._contentHoverWidget.isMouseGettingCloser(s.event.posx,s.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?this._currentResult&&this._currentResult.options.anchor.equals(e)?!0:this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const a={anchor:e,source:i,shouldFocus:n,insistOnKeepingHoverVisible:s};this._hoverOperation.start(t,a)}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const n=e.hoverParts.length===0,s=e.options.insistOnKeepingHoverVisible;n&&s||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new s2(this._editor,e,this._participants,t,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(e=>e.handleHide?.())}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:s=>{this._contentHoverWidget.setMinimumDimensions(s)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const s=i[0];return this._startShowingOrUpdateHover(s,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;switch(i.type){case 6:{t.push(new VE(0,i.range,e.event.posx,e.event.posy));break}case 7:{const n=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexts.priority-n.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!mk(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new VE(0,e,void 0,void 0),t,i,n,null)}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover.value?.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){return this._renderedContentHover.value?.focusedHoverPartIndex??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){if(this._renderedContentHover.value?.hoverPartsCount===1){this.focusHoverPartWithIndex(0);return}this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){this._renderedContentHover.value?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){return this._renderedContentHover.value?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};r2=T0e([HS(1,pe),HS(2,dt),HS(3,Us),HS(4,Mo)],r2);function hY(o){const e=o.target;return!!e&&e.type===6&&e.detail.injectedText?.options.attachedData===HG}var R0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QE=function(o,e){return function(t,i){e(t,i,o)}},a2;let ls=class extends F{static{a2=this}static{this.ID="editor.contrib.contentHover"}constructor(e,t,i,n){super(),this._editor=e,this._instantiationService=i,this._keybindingService=n,this._onHoverContentsChanged=this._register(new P),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new z,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new It(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(t.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(t.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(a2.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||hY(e)}_isMouseOnContentHoverWidget(e){return this._contentWidget?mk(this._contentWidget.getDomNode(),e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,n=(d,h)=>{const u=this._isMouseOnContentHoverWidget(d);return h&&u},s=d=>{const h=t.isColorPickerVisible,u=this._isMouseOnContentHoverWidget(d),g=h&&u,f=h&&this._isMouseDown;return g||f},r=(d,h)=>{const u=d.event.browserEvent.view;return u?h&&t.containsNode(u.document.activeElement)&&!u.getSelection()?.isCollapsed:!1},a=t.isFocused,l=t.isResizing,c=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||a||l||c||n(e,i)||s(e)||r(e,i)}_onEditorMouseMove(e){if(this._ignoreMouseEvents)return;if(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(this._shouldRescheduleHoverComputation()){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);return}this._reactToEditorMouseMove(e)}_shouldRescheduleHoverComputation(){const e=this._hoverSettings.hidingDelay;return(this._contentWidget?.isVisible??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents||!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&e.keyCode===2||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1,n=t.kind===2&&(t.commandId===VG||t.commandId===fk||t.commandId===pk)&&this._contentWidget.isVisible;return i||n}_isModifierKeyPressed(e){return e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4}hideContentHover(){d_.dropDownVisible||this._contentWidget?.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(r2,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,n){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._contentWidget?.dispose()}};ls=a2=R0e([QE(1,gr),QE(2,pe),QE(3,dt)],ls);class VH extends F{static{this.ID="editor.contrib.colorContribution"}constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if(t!=="click"&&t!=="clickAndHover"||!hY(e))return;const i=this._editor.getContribution(ls.ID);if(!i||i.isColorPickerVisible)return;const n=e.target.range;if(!n)return;const s=new D(n.startLineNumber,n.startColumn+1,n.endLineNumber,n.endColumn+1);i.showContentHover(s,1,1,!1)}}var M0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},P0e=function(o,e){return function(t,i){e(t,i,o)}};class g3{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}static fromBaseColor(e,t){return new g3(e,t.range,t.model,t.provider)}}class A0e extends F{constructor(e,t,i,n){super();const s=e.getModel(),r=i.model;this.color=i.model.color,this.colorPicker=this._register(new pZ(t.fragment,r,e.getOption(163),n,"standalone")),this._register(r.onColorFlushed(a=>{this.color=a})),this._register(r.onDidChangeColor(a=>{lw(s,r,a,i.range,i)})),this._register(e.onDidChangeModelContent(a=>{t.hide(),e.focus()})),lw(s,r,this.color,i.range,i)}}let l2=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel()||!c_.get(this._editor))return null;const s=await FG(i,this._editor.getModel(),$e.None);let r=null,a=null;for(const u of s){const g=u.colorInfo;D.containsRange(g.range,e.range)&&(r=g,a=u.provider)}const l=r??e,c=a??t,d=!!r;return{colorHover:g3.fromBaseColor(this,await mZ(this._editor.getModel(),l,c)),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new D(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await lw(this._editor.getModel(),t,this._color,i,e),i=_Z(this._editor,i,t))}renderHoverParts(e,t){if(!(t.length===0||!this._editor.hasModel()))return this._setMinimumDimensions(e),this._renderedParts=new A0e(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new ut(302,t))}get _color(){return this._renderedParts?.color}};l2=M0e([P0e(1,pi)],l2);var O0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ib=function(o,e){return function(t,i){e(t,i,o)}},c2;class F0e{constructor(e,t){this.value=e,this.foundInEditor=t}}const zH=8,W0e=22;let d2=class extends F{static{c2=this}static{this.ID="editor.contrib.standaloneColorPickerWidget"}constructor(e,t,i,n,s,r,a,l){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=s,this._languageFeaturesService=r,this._editorWorkerService=a,this._hoverService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new P),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new _t),this._renderedStatusBar=this._register(new _t),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(l2,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Wr(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const g=u.target.element?.classList;g&&g.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return c2.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new F0e(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new ow(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new zL(this._keybindingService,this._hoverService));const n={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(n,[e]),!this._renderedHoverParts.value){this._renderedStatusBar.clear(),this._renderedHoverParts.clear();return}const s=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const r=s.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-W0e-zH,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const d=s.header,h=d.pickedColorNode;h.style.width=a+zH+"px";const u=d.originalColorNode;u.style.width=l+"px",s.header.closeButton?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};d2=c2=O0e([Ib(3,pe),Ib(4,dt),Ib(5,ue),Ib(6,uo),Ib(7,Us)],d2);var B0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},UH=function(o,e){return function(t,i){e(t,i,o)}},h2;let Sf=class extends F{static{h2=this}static{this.ID="editor.contrib.standaloneColorPickerController"}constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=N.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=N.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(d2,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(h2.ID)}};Sf=h2=B0e([UH(1,Ne),UH(2,pe)],Sf);class H0e extends Ca{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...H(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:m(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:M.CommandPalette}],metadata:{description:H(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){Sf.get(t)?.showOrFocus()}}class V0e extends de{constructor(){super({id:"editor.action.hideColorPicker",label:H(891,"Hide the Color Picker"),precondition:N.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:H(892,"Hide the standalone color picker.")}})}run(e,t){Sf.get(t)?.hide()}}class z0e extends de{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:H(893,"Insert Color with Standalone Color Picker"),precondition:N.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:H(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){Sf.get(t)?.insertColor()}}oe(V0e);oe(z0e);Lt(H0e);nt(VH.ID,VH,2);nt(Sf.ID,Sf,1);nt(c_.ID,c_,1);Y_(CM);Bf.register($L);it.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof be))throw Rr();const{model:i,colorProviderRegistry:n,defaultColorDecoratorsEnablement:s}=BG(o,t);return T5(new iwe,n,i,$e.None,s)});it.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e;if(!i)return;const{uri:n,range:s}=i;if(!(n instanceof be)||!Array.isArray(t)||t.length!==4||!D.isIRange(s))throw Rr();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=BG(o,n),[c,d,h,u]=t;return T5(new nwe({range:s,color:{red:c,green:d,blue:h,alpha:u}}),a,r,$e.None,l)});class xh{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(c);let g=h.lastIndexOf(t,l-1+t.length),f=u.indexOf(i,d-1-i.length);if(g!==-1&&f!==-1)if(a===c)h.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const _=h.substring(g+t.length),b=u.substring(0,f);(_.indexOf(i)>=0||b.indexOf(i)>=0)&&(g=-1,f=-1)}let p;g!==-1&&f!==-1?(n&&g+t.length0&&u.charCodeAt(f-1)===32&&(i=" "+i,f-=1),p=xh._createRemoveBlockCommentOperations(new D(a,g+t.length+1,c,f+1),t,i)):(p=xh._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const _ of p)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return D.isEmpty(e)?n.push(Ci.delete(new D(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Ci.delete(new D(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Ci.delete(new D(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return D.isEmpty(e)?s.push(Ci.replace(new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Ci.insert(new R(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Ci.insert(new R(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new le(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new le(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class Pc{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;cs?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class f3 extends de{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ai);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(29),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>D.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lu=function(o,e){return function(t,i){e(t,i,o)}},u2;let fw=class{static{u2=this}static{this.ID="editor.contrib.contextmenu"}static get(e){return e.getContribution(u2.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=c.srcElement;h.shadowRoot&&Vh(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(30)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const s of n){const[,r]=s;let a=0;for(const l of r)if(l instanceof Ig){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new jm(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new $i)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=wi(this._editor.getDomNode()),a=r.left+s.left,l=r.top+s.top+s.height;i={x:a,y:l}}const n=this._editor.getOption(144)&&!Or;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:s=>{const r=this._keybindingFor(s);if(r)return new r_(s,s,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=s;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new r_(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||tve(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(81);let i=0;const n=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),s=(c,d)=>new jm(`menu-action-${++i}`,c,d,void 0),r=(c,d,h,u,g)=>{if(!d)return n({label:c,enabled:d,run:()=>{}});const f=_=>()=>{this._configurationService.updateValue(h,_)},p=[];for(const _ of g)p.push(n({label:_.label,checked:u===_.value,run:f(_.value)}));return s(c,p)},a=[];a.push(n({label:m(901,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new $i),a.push(n({label:m(902,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(m(903,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:m(904,"Proportional"),value:"proportional"},{label:m(905,"Fill"),value:"fill"},{label:m(906,"Fit"),value:"fit"}])),a.push(r(m(907,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:m(908,"Mouse Over"),value:"mouseover"},{label:m(909,"Always"),value:"always"}]));const l=this._editor.getOption(144)&&!Or;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};fw=u2=K0e([Lu(1,gr),Lu(2,Md),Lu(3,Ne),Lu(4,dt),Lu(5,Ur),Lu(6,Oe),Lu(7,xd)],fw);class G0e extends de{constructor(){super({id:"editor.action.showContextMenu",label:H(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:1092,weight:100}})}run(e,t){fw.get(t)?.showContextMenu()}}nt(fw.ID,fw,2);oe(G0e);class JE{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new JE(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new eN(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new eN(new JE(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new eN(new JE(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}class Z0e extends de{constructor(){super({id:"cursorUndo",label:H(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:2099,weight:100}})}run(e,t,i){f_.get(t)?.cursorUndo()}}class Y0e extends de{constructor(){super({id:"cursorRedo",label:H(912,"Cursor Redo"),precondition:void 0})}run(e,t,i){f_.get(t)?.cursorRedo()}}nt(f_.ID,f_,0);oe(Z0e);oe(Y0e);class X0e{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new D(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new le(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new le(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(42)||this._editor.getOption(28)||(fp(e)&&(this._modifierPressed=!0),this._mouseDown&&fp(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(42)||this._editor.getOption(28)||(fp(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===xm.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const n=(this._editor.getSelections()||[]).filter(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}fp(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new R(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:s,selectionStartColumn:r}=n;i=[new le(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new le(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(fp(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(xm.ID,new X0e(this._dragSelection,t,fp(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}static{this._DECORATION_OPTIONS=Me.register({description:"dnd-target",className:"dnd-target"})}showAt(e){this._dndDecorationIds.set([{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),options:xm._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}nt(xm.ID,xm,2);const Q0e="editor.action.pasteAs";nt(Dd.ID,Dd,0);Y_(rM);ae(new class extends tn{constructor(){super({id:SG,precondition:D5,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e){return Dd.get(e)?.changePasteType()}});ae(new class extends tn{constructor(){super({id:"editor.hidePasteWidget",precondition:D5,kbOpts:{weight:100,primary:9}})}runEditorCommand(o,e){Dd.get(e)?.clearWidgets()}});oe(class uY extends de{static{this.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:m(913,`The kind of the paste edit to try pasting with. +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}var Po;(function(o){o[o.Expanded=0]="Expanded",o[o.Collapsed=1]="Collapsed",o[o.PreserveOrExpanded=2]="PreserveOrExpanded",o[o.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Po||(Po={}));var Ju;(function(o){o[o.Unknown=0]="Unknown",o[o.Twistie=1]="Twistie",o[o.Element=2]="Element",o[o.Filter=3]="Filter"})(Ju||(Ju={}));class Wo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class MF{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}class Ld{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class WB{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Ld(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class _l{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,s,r]=_l._getElements(e),[a,l,c]=_l._getElements(t);this._hasStrings=r&&c,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(_l._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,s=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(Mf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new Ld(e,0,i,n-i+1)]):e<=t?(Mf.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new Ld(e,t-e+1,i,0)]):(Mf.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Mf.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,s),c=r[0],d=a[0];if(l!==null)return l;if(!s[0]){const h=this.ComputeDiffRecursive(e,c,i,d,s);let u=[];return s[0]?u=[new Ld(c+1,t-(c+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(c+1,t,d+1,n,s),this.ConcatenateChanges(h,u)}return[new Ld(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b,C){let w=null,v=null,S=new BB,x=t,k=i,D=g[0]-_[0]-n,I=-1073741824,T=this.m_forwardHistory.length-1;do{const F=D+e;F===x||F=0&&(c=this.m_forwardHistory[T],e=c[0],x=1,k=c.length-1)}while(--T>=-1);if(w=S.getReverseChanges(),C[0]){let F=g[0]+1,O=_[0]+1;if(w!==null&&w.length>0){const B=w[w.length-1];F=Math.max(F,B.getOriginalEnd()),O=Math.max(O,B.getModifiedEnd())}v=[new Ld(F,u-F+1,O,p-O+1)]}else{S=new BB,x=r,k=a,D=g[0]-_[0]-l,I=1073741824,T=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const F=D+s;F===x||F=d[F+1]?(h=d[F+1]-1,f=h-D-l,h>I&&S.MarkNextChange(),I=h+1,S.AddOriginalElement(h+1,f+1),D=F+1-s):(h=d[F-1],f=h-D-l,h>I&&S.MarkNextChange(),I=h,S.AddModifiedElement(h+1,f+1),D=F-1-s),T>=0&&(d=this.m_reverseHistory[T],s=d[0],x=1,k=d.length-1)}while(--T>=-1);v=S.getChanges()}return this.ConcatenateChanges(w,v)}ComputeRecursionPoint(e,t,i,n,s,r,a){let l=0,c=0,d=0,h=0,u=0,g=0;e--,i--,s[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=t-e+(n-i),p=f+1,_=new Int32Array(p),b=new Int32Array(p),C=n-i,w=t-e,v=e-i,S=t-n,k=(w-C)%2===0;_[C]=e,b[w]=t,a[0]=!1;for(let D=1;D<=f/2+1;D++){let I=0,T=0;d=this.ClipDiagonalBound(C-D,D,C,p),h=this.ClipDiagonalBound(C+D,D,C,p);for(let O=d;O<=h;O+=2){O===d||OI+T&&(I=l,T=c),!k&&Math.abs(O-w)<=D-1&&l>=b[O])return s[0]=l,r[0]=c,B<=b[O]&&D<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,k,a):null}const F=(I-e+(T-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(I,F))return a[0]=!0,s[0]=I,r[0]=T,F>0&&D<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,k,a):(e++,i++,[new Ld(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(w-D,D,w,p),g=this.ClipDiagonalBound(w+D,D,w,p);for(let O=u;O<=g;O+=2){O===u||O=b[O+1]?l=b[O+1]-1:l=b[O-1],c=l-(O-w)-S;const B=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(b[O]=l,k&&Math.abs(O-C)<=D&&l<=_[O])return s[0]=l,r[0]=c,B>=_[O]&&D<=1448?this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,k,a):null}if(D<=1447){let O=new Int32Array(h-d+2);O[0]=C-d+1,Pf.Copy2(_,d,O,1,h-d+1),this.m_forwardHistory.push(O),O=new Int32Array(g-u+2),O[0]=w-u+1,Pf.Copy2(b,u,O,1,g-u+1),this.m_reverseHistory.push(O)}}return this.WALKTRACE(C,d,h,v,w,u,g,S,_,b,l,t,s,c,n,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,s=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,s=h.modifiedStart+h.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){const u=i.originalStart-h,g=i.modifiedStart-h;if(uc&&(c=p,l=h)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&g>l&&(l=g,c=h,d=u)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){const s=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return s+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return Pf.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],Pf.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return Pf.Copy(e,0,n,0,e.length),Pf.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(Mf.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Mf.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let s=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Ld(n,s,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e"u"?!1:i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=typeof i.autoExpandSingleChildren>"u"?!1:i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Ke.empty(),n={}){if(e.length===0)throw new Wo(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=Ke.empty(),s,r=s.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],c=t[t.length-1],d=new _l({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(p=>e.getId(p.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const h=t.slice(0,-1),u=(p,_,b)=>{if(r>0)for(let C=0;Cb.originalStart-_.originalStart))u(g,f,g-(p.originalStart+p.originalLength)),g=p.originalStart,f=p.modifiedStart-c,this.spliceSimple([...h,g],p.originalLength,Ke.slice(l,f,f+p.modifiedLength),s);u(g,f,g)}spliceSimple(e,t,i=Ke.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=Ke.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,h,n)),g=e[e.length-1];let f=0;for(let S=g;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of C)S.visible&&w++;if(w!==0)for(let S=g+p.length;S0&&s){const S=x=>{s(x),x.children.forEach(S)};C.forEach(S)}if(c&&d){const S=C.reduce((x,k)=>x+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this._onDidSpliceRenderedNodes.fire({start:l,deleteCount:S,elements:h})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:C});let v=a;for(;v;){if(v.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}v=v.parent}}rerender(e){if(e.length===0)throw new Wo(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!OI(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,n){const s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:l,elements:a.slice(1)}),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(OI(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!OI(t)&&t.recursive)for(const s of e.children)n=this._setNodeCollapseState(s,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,s,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,n&&s.push(a);const c=e.children||Ke.empty(),d=n&&l!==0&&!a.collapsed;let h=0,u=1;for(const g of c){const f=this.createTreeNode(g,a,l,d,s,r);a.children.push(f),u+=f.renderNodeCount,f.visible&&(f.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=l===2?h>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,n&&s.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),s===0)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||s!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,s,i,n&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=s===2?a:s===1,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):Hw(i)?(e.filterData=i.data,qg(i.visibility)):(e.filterData=void 0,qg(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Wo(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Wo(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:s&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Wo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function FI(o){return o instanceof Ew?new Gve(o):o}class Zve{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=A.None,this.disposables=new z}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(FI(e),t)}onDragOver(e,t,i,n,s,r=!0){const a=this.dnd.onDragOver(FI(e),t&&t.element,i,n,s),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=Gc(()=>{const g=this.modelProvider(),f=g.getNodeLocation(t);g.isCollapsed(f)&&g.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const g=typeof a=="boolean"?a:a.accept,f=typeof a=="boolean"?void 0:a.effect;return{accept:g,effect:f,feedback:[i]}}return a}if(a.bubble===1){const g=this.modelProvider(),f=g.getNodeLocation(t),p=g.getParentNodeLocation(f),_=g.getNode(p),b=p&&g.getListIndex(p);return this.onDragOver(e,_,b,n,s,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),h=c.getListIndex(d),u=c.getListRenderCount(d);return{...a,feedback:vs(h,h+u)}}drop(e,t,i,n,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(FI(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Yve(o,e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(i.element)}},dnd:t.dnd&&e.add(new Zve(o,t.dnd)),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(i){return t.multipleSelectionController.isSelectionSingleChangeEvent({...i,element:i.element})},isSelectionRangeChangeEvent(i){return t.multipleSelectionController.isSelectionRangeChangeEvent({...i,element:i.element})}},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(i){const n=o(),s=n.getNodeLocation(i),r=n.getParentNodeLocation(s);return n.getNode(r).visibleChildrenCount},getPosInSet(i){return i.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?i=>t.accessibilityProvider.isChecked(i.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?i=>t.accessibilityProvider.getRole(i.element):()=>"treeitem",getAriaLabel(i){return t.accessibilityProvider.getAriaLabel(i.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?i=>t.accessibilityProvider.getAriaLevel(i.element):i=>i.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(i=>t.accessibilityProvider.getActiveDescendantId(i.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(i){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i.element)}}}}class PF{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}var Kg;(function(o){o.None="none",o.OnHover="onHover",o.Always="always"})(Kg||(Kg={}));class Xve{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new z,this.onDidChange=te.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class Xb{static{this.DefaultIndent=8}constructor(e,t,i,n,s,r={}){this.renderer=e,this.model=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Xb.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=A.None,this.disposables=new z,this.templateId=e.templateId,this.updateOptions(r),te.map(i,a=>a.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=ws(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)n.indentSize=Xb.DefaultIndent+(i.depth-1)*this.indent,this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Kg.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);if(this.indentGuidesDisposable.dispose(),t){const i=new z;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Z(e,J(".monaco-tl-row")),i=Z(t,J(".monaco-tl-indent")),n=Z(t,J(".monaco-tl-twistie")),s=Z(t,J(".monaco-tl-contents")),r=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:A.None,indentSize:0,templateData:r}}renderElement(e,t,i,n){i.indentSize=Xb.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...n,indent:i.indentSize})}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,{...n,indent:i.indentSize}),typeof n?.height=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=`${t.indentSize+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Se.asClassNameArray(G.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...Se.asClassNameArray(G.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(xn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new z;for(;;){const n=this.model.getNodeLocation(e),s=this.model.getParentNodeLocation(n);if(!s)break;const r=this.model.getNode(s),a=J(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(ue(()=>this.renderedIndentGuides.delete(r,a))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach(i=>{const n=this.model.getNodeLocation(i);try{const s=this.model.getParentNodeLocation(n);i.collapsible&&i.children.length>0&&!i.collapsed?t.add(i):s&&t.add(this.model.getNode(s))}catch{}}),this.activeIndentNodes.forEach(i=>{t.has(i)||this.renderedIndentGuides.forEach(i,n=>n.classList.remove("active"))}),t.forEach(i=>{this.activeIndentNodes.has(i)||this.renderedIndentGuides.forEach(i,n=>n.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),pt(this.disposables)}}function Qve(o,e){const t=e.toLowerCase().indexOf(o);let i;if(t>-1){i=[Number.MAX_SAFE_INTEGER,0];for(let n=o.length;n>0;n--)i.push(t+n-1)}return i}class WK{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=ya.Fuzzy,this._findMode=Bo.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new z}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:Hw(r)?i=qg(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Jr.Default,visibility:i};const n=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(const r of s){const a=r&&r.toString();if(typeof a>"u")return{data:Jr.Default,visibility:i};let l;if(this._findMatchType===ya.Contiguous?l=Qve(this._lowercasePattern,a.toLowerCase()):l=Og(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),l)return this._matchCount++,s.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this._findMode===Bo.Filter?typeof this._defaultFindVisibility=="number"?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:Jr.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){pt(this.disposables)}}class Jve{constructor(e){this.stateMap=new Map(e.map(t=>[t.id,{...t}]))}get(e){const t=this.stateMap.get(e);if(t===void 0)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(i===void 0)throw new Error(`No state found for toggle id ${e}`);return i.isChecked===t?!1:(i.isChecked=t,!0)}}var Bo;(function(o){o[o.Highlight=0]="Highlight",o[o.Filter=1]="Filter"})(Bo||(Bo={}));var ya;(function(o){o[o.Fuzzy=0]="Fuzzy",o[o.Contiguous=1]="Contiguous"})(ya||(ya={}));var Ed;(function(o){o.Mode="mode",o.MatchType="matchType"})(Ed||(Ed={}));class ewe{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.widget?.setPlaceHolder(e)}constructor(e,t,i,n={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=n,this._pattern="",this._onDidChangePattern=new P,this._onDidChangeOpenState=new P,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new z,this.disposables=new z,this.toggles=new Jve(n.toggles??[]),this._placeholder=n.placeholder??m(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){this.toggles.set(e,t),this.widget?.setToggleState(e,t)}renderMessage(e,t){e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:2,content:t??m(21,"No results found.")}):this.widget?.showMessage({type:2}):this.widget?.clearMessage()}alertResults(e){Is(e?m(23,"{0} results",e):m(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}let BK=class extends ewe{get mode(){return this.toggles.get(Ed.Mode)?Bo.Filter:Bo.Highlight}set mode(e){if(e===this.mode)return;const t=e===Bo.Filter;this.updateToggleState(Ed.Mode,t),this.placeholder=t?m(24,"Type to filter"):m(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(Ed.MatchType)?ya.Fuzzy:ya.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(Ed.MatchType,e===ya.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n={}){const s=n.defaultFindMode??Bo.Highlight,r=n.defaultFindMatchType??ya.Fuzzy,a=[{id:Ed.Mode,icon:G.listFilter,title:m(26,"Filter"),isChecked:s===Bo.Filter},{id:Ed.MatchType,icon:G.searchFuzzy,title:m(27,"Fuzzy Match"),isChecked:r===ya.Fuzzy}];t.findMatchType=r,t.findMode=s,super(e,t,i,{...n,toggles:a}),this.filter=t,this._onDidChangeMode=new P,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new P,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(this.pattern.length!==0&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Jr.isDefault(e.filterData)}render(){const t=this.filter.matchCount===0&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(t),this.pattern.length&&this.alertResults(this.filter.matchCount)}};function twe(o,e){return o.position===e.position&&HK(o,e)}function HK(o,e){return o.node.element===e.node.element&&o.startIndex===e.startIndex&&o.height===e.height&&o.endIndex===e.endIndex}class iwe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return jt(this.stickyNodes,e.stickyNodes,twe)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!jt(this.stickyNodes,e.stickyNodes,HK)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class nwe{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let HB=class extends A{constructor(e,t,i,n,s,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new nwe,this.paddingTop=r.paddingTop??0,this._widget=this._register(new swe(i.getScrollableElement(),i,e,n,s,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(l=>{const c=this._widget.state;if(!c)return;if(l.deleteCount>0&&c.stickyNodes.some(u=>!this.model.has(this.model.getNodeLocation(u.node)))){this.update();return}c.stickyNodes.some(u=>{const g=this.model.getListIndex(this.model.getNodeLocation(u.node));return g>=l.start&&g=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,s=this.getNextStickyNode(i,void 0,n);for(;s&&(t.push(s),n+=s.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(s),!i)));)s=this.getNextStickyNode(i,s.node,n);const r=this.constrainStickyNodes(t);return r.length?new iwe(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),s=t;return this.view.scrollTop===n-s}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:s}=this.getNodeRange(e),r=this.calculateStickyNodePosition(s,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:s}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const s=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const n=this.model.getListRenderCount(t),s=i+n-1;return{startIndex:i,endIndex:s}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let s=0;s0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const n=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${n.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const n=e.stickyNodes[i],{element:s,disposable:r}=this.createElement(n,i,e.count);t[i]=s,this._rootDomNode.appendChild(s),this._previousStateDisposables.add(r)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const n=e.startIndex,s=document.createElement("div");s.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(s.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(s.style.lineHeight=`${e.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${n}`),s.setAttribute("data-parity",n%2===0?"even":"odd"),s.setAttribute("id",this.view.getElementID(n));const r=this.setAccessibilityAttributes(s,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(u=>u.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(s);l.renderElement(c,e.startIndex,d,{height:e.height});const h=ue(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,{height:e.height}),l.disposeTemplate(d),s.remove()});return{element:s,disposable:h}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return A.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const s=this.accessibilityProvider.getAriaLabel(t),r=s&&typeof s!="string"?s:Nt(s),a=xe(c=>{const d=c.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof s=="string"||s&&e.setAttribute("aria-label",s.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class owe extends A{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new P,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new P,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(W(this.container,"focus",()=>this.onFocus())),this._register(W(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!hv(t)&&!jb(t)){this.focusedLast()&&this.view.domFocus();return}if(!pc(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const n=this.state.stickyNodes[this.focusedIndex].node.element,s=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:s,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!hv(t)&&!jb(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const n=ws(i,0,t.count-1);this.setFocus(n)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=s-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function $1(o){let e=Ju.Unknown;return ND(o.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Ju.Twistie:ND(o.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Ju.Element:ND(o.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Ju.Filter),{browserEvent:o.browserEvent,element:o.element?o.element.element:null,target:e}}function rwe(o){const e=hv(o.browserEvent.target);return{element:o.element?o.element.element:null,browserEvent:o.browserEvent,anchor:o.anchor,isStickyScroll:e}}function YS(o,e){e(o),o.children.forEach(t=>YS(t,e))}class WI{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new P,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&jt(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const n=this;this._onDidChange.fire({get elements(){return n.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>YS(d,c)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>YS(l,n));const s=new Map,r=l=>s.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>YS(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const h=s.get(c);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class awe extends Hj{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Oj(e.browserEvent.target)||Ia(e.browserEvent.target)||lb(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,s=jb(e.browserEvent.target);let r=!1;if(s?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,s)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!s||n)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),n){e.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(qfe(e.browserEvent.target)||Kfe(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),s=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!hv(t)&&!jb(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!hv(t)&&!jb(t)){super.onContextMenu(e);return}}}class lwe extends Qo{constructor(e,t,i,n,s,r,a,l){super(e,t,i,n,l),this.focusTrait=s,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new awe(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],s=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&n.push(e+l),this.selectionTrait.has(a)&&s.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),n.length>0&&super.setFocus(Xc([...super.getFocus(),...n])),s.length>0&&super.setSelection(Xc([...super.getSelection(),...s])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class VK{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return te.filter(te.map(this.view.onMouseDblClick,$1),e=>e.target!==Ju.Filter)}get onMouseOver(){return te.map(this.view.onMouseOver,$1)}get onMouseOut(){return te.map(this.view.onMouseOut,$1)}get onContextMenu(){return te.any(te.filter(te.map(this.view.onContextMenu,rwe),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??te.None)}get onPointer(){return te.map(this.view.onPointer,$1)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return te.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){this._user=e,this._options=s,this.eventBufferer=new cw,this.onDidChangeFindOpenState=te.None,this.onDidChangeStickyScrollFocused=te.None,this.disposables=new z,this.onDidSwapModel=this.disposables.add(new P),this.onDidChangeModelRelay=this.disposables.add(new L_),this.onDidSpliceModelRelay=this.disposables.add(new L_),this.onDidChangeCollapseStateRelay=this.disposables.add(new L_),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new L_),this.onDidChangeActiveNodesRelay=this.disposables.add(new L_),this._onWillRefilter=new P,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new P,this.modelDisposables=new z,s.keyboardNavigationLabelProvider&&(s.findWidgetEnabled??!0)&&(this.findFilter=new WK(s.keyboardNavigationLabelProvider,s.filter,s.defaultFindVisibility),s={...s,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,s),this.treeDelegate=new PF(i);const r=this.disposables.add(new Xve(this.onDidChangeActiveNodesRelay.event)),a=new xz;this.renderers=n.map(l=>new Xb(l,this.model,this.onDidChangeCollapseStateRelay.event,r,a,s));for(const l of this.renderers)this.disposables.add(l);if(this.focus=new WI(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new WI(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new WI(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new lwe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...Yve(()=>this.model,this.disposables,s),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),s.keyboardSupport!==!1){const l=te.chain(this.view.onKeyDown,c=>c.filter(d=>!Ia(d.target)).map(d=>new yt(d)));te.chain(l,c=>c.filter(d=>d.keyCode===15))(this.onLeftArrow,this,this.disposables),te.chain(l,c=>c.filter(d=>d.keyCode===17))(this.onRightArrow,this,this.disposables),te.chain(l,c=>c.filter(d=>d.keyCode===10))(this.onSpace,this,this.disposables)}if((s.findWidgetEnabled??!0)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const l={styles:s.findWidgetStyles,defaultFindMode:s.defaultFindMode,defaultFindMatchType:s.defaultFindMatchType,showNotFoundMessage:s.showNotFoundMessage};this.findController=this.disposables.add(new BK(this,this.findFilter,s.contextViewProvider,l)),this.focusNavigationFilter=c=>this.findController.shouldAllowFocus(c),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=te.None,this.onDidChangeFindMatchType=te.None;s.enableStickyScroll&&(this.stickyScrollController=new HB(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=Ir(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Kg.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Kg.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new HB(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=te.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const s=Hc(e.listFocusAndSelectionOutline,Hc(e.listSelectionOutline,e.listFocusOutline??""));s&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=pc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=pc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=pc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=pc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=pc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=pc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:s,deleteCount:r,elements:a})=>this.view.splice(s,r,a)));const t=te.forEach(e.onDidSpliceModel,s=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(s),this.selection.onDidModelSplice(s)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new P),n=this.modelDisposables.add(new yr(0));this.modelDisposables.add(te.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{n.trigger(()=>{const s=new Set;for(const r of this.focus.getNodes())s.add(r);for(const r of this.selection.getNodes())s.add(r);i.fire([...s.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=te.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){pt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}class AF{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Kve(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare(i,n){return t.sorter.compare(i.element,n.element)}}),this.identityProvider=t.identityProvider}setChildren(e,t=Ke.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ke.empty(),i){const n=new Set,s=new Set,r=l=>{if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.add(d),this.nodesByIdentity.set(d,c)}i.onDidCreateNode?.(c)},a=l=>{if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const d=this.identityProvider.getId(c.element).toString();s.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=Ke.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Ke.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Po.Collapsed||t.collapsed===Po.PreserveOrCollapsed?r=!0:t.collapsed===Po.Expanded||t.collapsed===Po.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let s;return typeof t.collapsed>"u"||t.collapsed===Po.PreserveOrCollapsed||t.collapsed===Po.PreserveOrExpanded?s=i.collapsed:t.collapsed===Po.Collapsed?s=!0:t.collapsed===Po.Expanded?s=!1:s=!!t.collapsed,{...t,collapsible:n,collapsed:s,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),Ke.map(n,s=>({element:s.element,collapsible:s.collapsible,collapsed:s.collapsed,children:this.resortChildren(s,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Wo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Wo(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Wo(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Wo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function XS(o){const e=[o.element],t=o.incompressible||!1;return{element:{elements:e,incompressible:t},children:Ke.map(Ke.from(o.children),XS),collapsible:o.collapsible,collapsed:o.collapsed}}function QS(o){const e=[o.element],t=o.incompressible||!1;let i,n;for(;[n,i]=Ke.consume(Ke.from(o.children),2),!(n.length!==1||n[0].incompressible);)o=n[0],e.push(o.element);return{element:{elements:e,incompressible:t},children:Ke.map(Ke.concat(n,i),QS),collapsible:o.collapsible,collapsed:o.collapsed}}function CR(o,e=0){let t;return eCR(i,0)),e===0&&o.element.incompressible?{element:o.element.elements[e],children:t,incompressible:!0,collapsible:o.collapsible,collapsed:o.collapsed}:{element:o.element.elements[e],children:t,collapsible:o.collapsible,collapsed:o.collapsed}}function VB(o){return CR(o,0)}function zK(o,e,t){return o.element===e?{...o,children:t}:{...o,children:Ke.map(Ke.from(o.children),i=>zK(i,e,t))}}const cwe=o=>({getId(e){return e.elements.map(t=>o.getId(t).toString()).join("\0")}});class dwe{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new AF(e,t),this.enabled=typeof t.compressionEnabled>"u"?!0:t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=Ke.empty(),i){const n=i.diffIdentityProvider&&cwe(i.diffIdentityProvider);if(e===null){const f=Ke.map(t,this.enabled?QS:XS);this._setChildren(null,f,{diffIdentityProvider:n,diffDepth:1/0});return}const s=this.nodes.get(e);if(!s)throw new Wo(this.user,"Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),c=VB(r),d=zK(c,e,t),h=(this.enabled?QS:XS)(d),u=i.diffIdentityProvider?((f,p)=>i.diffIdentityProvider.getId(f)===i.diffIdentityProvider.getId(p)):void 0;if(jt(h.element.elements,r.element.elements,u)){this._setChildren(s,h.children||Ke.empty(),{diffIdentityProvider:n,diffDepth:1});return}const g=l.children.map(f=>f===r?h:f);this._setChildren(l.element,g,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=Ke.map(i,VB),s=Ke.map(n,e?QS:XS);this._setChildren(null,s,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,s=a=>{for(const l of a.element.elements)n.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)n.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:s,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Wo(this.user,`Tree element not found: ${e}`);return t}}const hwe=o=>o[o.length-1];class OF{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new OF(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function uwe(o,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(o(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){const n=t.elements;for(let s=0;s({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidSpliceRenderedNodes(){return te.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(n=>this.nodeMapper.map(n))}))}get onDidChangeCollapseState(){return te.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return te.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||hwe;const i=n=>this.elementMapper(n.elements);this.nodeMapper=new MF(n=>new OF(i,n)),this.model=new dwe(e,uwe(i,t))}setChildren(e,t=Ke.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var fwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class FF extends VK{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=Ke.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new AF(e,t)}}class UK{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),s.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?.(e,t)??!1}}fwe([Si],UK.prototype,"compressedTreeNodeProvider",null);class pwe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let n=0;ni||n>=t-1&&tthis,a=new pwe(()=>this.model),l=n.map(c=>new UK(r,a,c));super(e,t,i,l,{...mwe(r,s),stickyScrollDelegate:a})}setChildren(e,t=Ke.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new gwe(e,t)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function BI(o){return{...o,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function vR(o,e){return e.parent?e.parent===o?!0:vR(o,e.parent):!1}function _we(o,e){return o===e||vR(o,e)||vR(e,o)}class WF{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new WF(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class bwe{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Se.asClassNameArray(G.treeItemLoading)),!0):(t.classList.remove(...Se.asClassNameArray(G.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function zB(o){return{browserEvent:o.browserEvent,elements:o.elements.map(e=>e.element)}}function UB(o){return{browserEvent:o.browserEvent,element:o.element&&o.element.element,target:o.target}}class Cwe extends Ew{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function HI(o){return o instanceof Ew?new Cwe(o):o}class vwe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(HI(e),t)}onDragOver(e,t,i,n,s,r=!0){return this.dnd.onDragOver(HI(e),t&&t.element,i,n,s)}drop(e,t,i,n,s){this.dnd.drop(HI(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}class wwe extends WK{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);if(!this.isFindSessionActive||this.findMode===Bo.Highlight||!this.findProvider.isVisible)return i;const n=Hw(i)?i.visibility:i;return qg(n)===0?0:this.findProvider.isVisible(e)?i:0}}class Swe extends BK{constructor(e,t,i,n,s){super(e,i,n,s),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(ue(async()=>{this.activeSession&&await this.findProvider.endSession?.()}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=this.activeFindMetadata.matchCount===0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){if(!this.activeSession||!this.activeFindMetadata)return!0;const t=e.element?.element;return t&&this.activeFindMetadata.isMatch(t)?!0:!Jr.isDefault(e.filterData)}}function jK(o){return o&&{...o,collapseByDefault:!0,identityProvider:o.identityProvider&&{getId(e){return o.identityProvider.getId(e.element)}},dnd:o.dnd&&new vwe(o.dnd),multipleSelectionController:o.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return o.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return o.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:o.accessibilityProvider&&{...o.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:o.accessibilityProvider.getRole?e=>o.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:o.accessibilityProvider.isChecked?e=>!!o.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return o.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return o.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:o.accessibilityProvider.getWidgetRole?()=>o.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:o.accessibilityProvider.getAriaLevel&&(e=>o.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:o.accessibilityProvider.getActiveDescendantId&&(e=>o.accessibilityProvider.getActiveDescendantId(e.element))},filter:o.filter&&{filter(e,t){return o.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:o.keyboardNavigationLabelProvider&&{...o.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return o.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof o.expandOnlyOnTwistieClick>"u"?void 0:typeof o.expandOnlyOnTwistieClick!="function"?o.expandOnlyOnTwistieClick:(e=>o.expandOnlyOnTwistieClick(e.element)),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof o.defaultFindVisibility=="number"?o.defaultFindVisibility:typeof o.defaultFindVisibility>"u"?2:o.defaultFindVisibility(e.element),stickyScrollDelegate:o.stickyScrollDelegate}}function wR(o,e){e(o),o.children.forEach(t=>wR(t,e))}class qK{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return te.map(this.tree.onDidChangeFocus,zB)}get onDidChangeSelection(){return te.map(this.tree.onDidChangeSelection,zB)}get onMouseDblClick(){return te.map(this.tree.onMouseDblClick,UB)}get onPointer(){return te.map(this.tree.onPointer,UB)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,r={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new P,this._onDidChangeNodeSlowState=new P,this.nodeMapper=new MF(c=>new WF(c)),this.disposables=new z,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=c=>r.collapseByDefault?r.collapseByDefault(c)?Po.PreserveOrCollapsed:Po.PreserveOrExpanded:void 0;let a=!1,l;if(r.findProvider&&(r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider&&(a=!0,l=new wwe(r.findProvider,r.keyboardNavigationLabelProvider,r.filter)),this.tree=this.createTree(e,t,i,n,{...r,findWidgetEnabled:!a,filter:l??r.filter}),this.root=BI({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const c={styles:r.findWidgetStyles,showNotFoundMessage:r.showNotFoundMessage,defaultFindMatchType:r.defaultFindMatchType,defaultFindMode:r.defaultFindMode};this.findController=this.disposables.add(new Swe(this.tree,r.findProvider,l,this.tree.options.contextViewProvider,c)),this.focusNavigationFilter=d=>this.findController.shouldFocusWhenNavigating(d),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,n,s){const r=new PF(i),a=n.map(c=>new bwe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=jK(s)||{};return new FF(e,t,r,a,l)}updateOptions(e={}){this.findController&&(e.defaultFindMode!==void 0&&(this.findController.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(t=>t.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(t=>t.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,n,s){if(typeof this.root.element>"u")throw new Wo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,s),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Wo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await i.refreshPromise,await te.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await te.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t){const i=this.identityProvider?.getId(e).toString();throw new Wo(this.user,`Data tree node not found${i?`: ${i}`:""}`)}return t}async refreshAndRenderNode(e,t,i,n){this.disposables.isDisposed||(await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n))}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((s,r)=>{!n&&_we(r,e)&&(n=s.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){const n=$i(async()=>{const s=await this.doRefreshNode(e,t,i);e.stale=!1,await SC.settled(s.map(r=>this.doRefreshSubTree(r,t,i)))});return e.refreshPromise=n,this.subTreeRefreshPromises.set(e,n),n.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),n}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(Ke.empty());else{const s=this.doGetChildren(e);if(OE(s))n=Promise.resolve(s);else{const r=El(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=s.finally(()=>r.cancel())}}try{const s=await n;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Xo(s))return[];throw s}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return OE(i)?this.processChildren(i):(t=$i(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Ee))}setChildren(e,t,i,n){const s=[...t];if(e.children.length===0&&s.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=s.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=BI({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&p.defaultCollapseState===Po.PreserveOrExpanded&&l.push(p),p}const u=this.identityProvider.getId(d).toString(),g=a.get(u);if(g){const p=g.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=h,i?g.collapsed?(p.children.forEach(_=>wR(_,b=>this.nodes.delete(b.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):h&&!g.collapsed&&l.push(p),p}const f=BI({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(f),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(f),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1||h&&f.defaultCollapseState===Po.PreserveOrExpanded)&&l.push(f),f});for(const d of r.values())wR(d,h=>this.nodes.delete(h.element));for(const d of c)this.nodes.set(d.element,d);return k0(e.children,0,e.children.length,c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,n,s),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Ke.map(e.children,n=>this.asTreeElement(n,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class BF{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new BF(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class ywe{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...Se.asClassNameArray(G.treeItemLoading)),!0):(t.classList.remove(...Se.asClassNameArray(G.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=pt(this.disposables)}}function xwe(o){const e=o&&jK(o);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return o.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}},stickyScrollDelegate:e.stickyScrollDelegate}}class Lwe extends qK{constructor(e,t,i,n,s,r,a={}){super(e,t,i,s,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new MF(l=>new BF(l)),this.filter=a.filter}createTree(e,t,i,n,s){const r=new PF(i),a=n.map(c=>new ywe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=xwe(s)||{};return new $K(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=g=>this.identityProvider.getId(g).toString(),s=g=>{const f=new Set;for(const p of g){const _=this.tree.getCompressedTreeNode(p===this.root?null:p);if(_.element)for(const b of _.element.elements)f.add(n(b.element))}return f},r=s(this.tree.getSelection()),a=s(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let h=!1;const u=g=>{const f=g.element;if(f)for(let p=0;p{const i=this.filter.filter(t,1),n=kwe(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function kwe(o){return typeof o=="boolean"?o?1:0:Hw(o)?qg(o.visibility):qg(o)}class Dwe extends VK{constructor(e,t,i,n,s,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=s,this.identityProvider=r.identityProvider}createModel(e,t){return new AF(e,t)}}new oe("isMac",ze,m(1684,"Whether the operating system is macOS"));new oe("isLinux",Gs,m(1685,"Whether the operating system is Linux"));const kk=new oe("isWindows",Ln,m(1686,"Whether the operating system is Windows")),KK=new oe("isWeb",Bl,m(1687,"Whether the platform is a web browser"));new oe("isMacNative",ze&&!Bl,m(1688,"Whether the operating system is macOS on a non-browser platform"));new oe("isIOS",Sr,m(1689,"Whether the operating system is iOS"));new oe("isMobile",wV,m(1690,"Whether the platform is a mobile web browser"));new oe("isDevelopment",!1,!0);new oe("productQualityType","",m(1691,"Quality type of VS Code"));const GK="inputFocus",HF=new oe(GK,!1,m(1692,"Whether keyboard focus is inside an input box"));var md=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Bt=function(o,e){return function(t,i){e(t,i,o)}};const Mr=We("listService");class Iwe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new z,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),gL(e.getHTMLElement())&&this.setLastFocusedList(e),Yr(e.onDidFocus(()=>this.setLastFocusedList(e)),ue(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const Lv=new oe("listScrollAtBoundary","none");q.or(Lv.isEqualTo("top"),Lv.isEqualTo("both"));q.or(Lv.isEqualTo("bottom"),Lv.isEqualTo("both"));const ZK=new oe("listFocus",!0),YK=new oe("treestickyScrollFocused",!1),Dk=new oe("listSupportsMultiselect",!0),XK=q.and(ZK,q.not(GK),YK.negate()),VF=new oe("listHasSelectionOrFocus",!1),zF=new oe("listDoubleSelection",!1),UF=new oe("listMultiSelection",!1),Ik=new oe("listSelectionNavigation",!1),Ewe=new oe("listSupportsFind",!0),$F=new oe("treeElementCanCollapse",!1),Nwe=new oe("treeElementHasParent",!1),jF=new oe("treeElementCanExpand",!1),Twe=new oe("treeElementHasChild",!1),Rwe=new oe("treeFindOpen",!1),QK="listTypeNavigationMode",JK="listAutomaticKeyboardNavigation";function Ek(o,e){const t=o.createScoped(e.getHTMLElement());return ZK.bindTo(t),t}function Nk(o,e){const t=Lv.bindTo(o),i=()=>{const n=e.scrollTop===0,s=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&s?t.set("both"):n?t.set("top"):s?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const _f="workbench.list.multiSelectModifier",JS="workbench.list.openMode",vr="workbench.list.horizontalScrolling",qF="workbench.list.defaultFindMode",KF="workbench.list.typeNavigationMode",Jy="workbench.list.keyboardNavigation",Va="workbench.list.scrollByPage",GF="workbench.list.defaultFindMatchType",kv="workbench.tree.indent",ex="workbench.tree.renderIndentGuides",za="workbench.list.smoothScrolling",Al="workbench.list.mouseWheelScrollSensitivity",Ol="workbench.list.fastScrollSensitivity",tx="workbench.tree.expandMode",ix="workbench.tree.enableStickyScroll",nx="workbench.tree.stickyScrollMaxItemCount";function Fl(o){return o.getValue(_f)==="alt"}class Mwe extends A{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Fl(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(_f)&&(this.useAltAsMultipleSelectionModifier=Fl(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Wj(e)}isSelectionRangeChangeEvent(e){return Bj(e)}}function Tk(o,e){const t=o.get(Pe),i=o.get(st),n=new z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(za),mouseWheelScrollSensitivity:t.getValue(Al),fastScrollSensitivity:t.getValue(Ol),multipleSelectionController:e.multipleSelectionController??n.add(new Mwe(t)),keyboardNavigationEventFilter:Owe(i),scrollByPage:!!t.getValue(Va)},n]}let $B=class extends Qo{constructor(e,t,i,n,s,r,a,l,c){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(vr),[h,u]=c.invokeFunction(Tk,s);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Ek(r,this),this.disposables.add(Nk(this.contextKeyService,this)),this.listSupportsMultiSelect=Dk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),Ik.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=VF.bindTo(this.contextKeyService),this.listDoubleSelection=zF.bindTo(this.contextKeyService),this.listMultiSelection=UF.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Fl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const f=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(f.length>0||p.length>0),this.listMultiSelection.set(f.length>1),this.listDoubleSelection.set(f.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const f=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(f.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(_f)&&(this._useAltAsMultipleSelectionModifier=Fl(l));let p={};if(f.affectsConfiguration(vr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(vr);p={...p,horizontalScrolling:_}}if(f.affectsConfiguration(Va)){const _=!!l.getValue(Va);p={...p,scrollByPage:_}}if(f.affectsConfiguration(za)){const _=!!l.getValue(za);p={...p,smoothScrolling:_}}if(f.affectsConfiguration(Al)){const _=l.getValue(Al);p={...p,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Ol)){const _=l.getValue(Ol);p={...p,fastScrollSensitivity:_}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new eG(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?gf(e):m_)}};$B=md([Bt(5,Ie),Bt(6,Mr),Bt(7,Pe),Bt(8,fe)],$B);let jB=class extends Hve{constructor(e,t,i,n,s,r,a,l,c){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(vr),[h,u]=c.invokeFunction(Tk,s);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new z,this.disposables.add(u),this.contextKeyService=Ek(r,this),this.disposables.add(Nk(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=Dk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),Ik.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=Fl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(_f)&&(this._useAltAsMultipleSelectionModifier=Fl(l));let p={};if(f.affectsConfiguration(vr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(vr);p={...p,horizontalScrolling:_}}if(f.affectsConfiguration(Va)){const _=!!l.getValue(Va);p={...p,scrollByPage:_}}if(f.affectsConfiguration(za)){const _=!!l.getValue(za);p={...p,smoothScrolling:_}}if(f.affectsConfiguration(Al)){const _=l.getValue(Al);p={...p,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Ol)){const _=l.getValue(Ol);p={...p,fastScrollSensitivity:_}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new eG(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?gf(e):m_)}dispose(){this.disposables.dispose(),super.dispose()}};jB=md([Bt(5,Ie),Bt(6,Mr),Bt(7,Pe),Bt(8,fe)],jB);let qB=class extends RF{constructor(e,t,i,n,s,r,a,l,c,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(vr),[u,g]=d.invokeFunction(Tk,r);super(e,t,i,n,s,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(g),this.contextKeyService=Ek(a,this),this.disposables.add(Nk(this.contextKeyService,this)),this.listSupportsMultiSelect=Dk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Ik.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=VF.bindTo(this.contextKeyService),this.listDoubleSelection=zF.bindTo(this.contextKeyService),this.listMultiSelection=UF.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Fl(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(_f)&&(this._useAltAsMultipleSelectionModifier=Fl(c));let _={};if(p.affectsConfiguration(vr)&&this.horizontalScrolling===void 0){const b=!!c.getValue(vr);_={..._,horizontalScrolling:b}}if(p.affectsConfiguration(Va)){const b=!!c.getValue(Va);_={..._,scrollByPage:b}}if(p.affectsConfiguration(za)){const b=!!c.getValue(za);_={..._,smoothScrolling:b}}if(p.affectsConfiguration(Al)){const b=c.getValue(Al);_={..._,mouseWheelScrollSensitivity:b}}if(p.affectsConfiguration(Ol)){const b=c.getValue(Ol);_={..._,fastScrollSensitivity:b}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new Pwe(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?gf(e):m_)}dispose(){this.disposables.dispose(),super.dispose()}};qB=md([Bt(6,Ie),Bt(7,Mr),Bt(8,Pe),Bt(9,fe)],qB);class ZF extends A{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new P),this.onDidOpen=this._onDidOpen.event,this._register(te.filter(this.widget.onDidChangeSelection,i=>pc(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(JS)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(JS)&&(this.openOnSingleClick=t?.configurationService.getValue(JS)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,s=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const s=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class eG extends ZF{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Pwe extends ZF{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Awe extends ZF{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function Owe(o){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=o.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let sx=class extends FF{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(Vw,s);super(e,t,i,n,d),this.disposables.add(u),this.internals=new Gg(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};sx=md([Bt(5,fe),Bt(6,Ie),Bt(7,Mr),Bt(8,Pe)],sx);let KB=class extends $K{constructor(e,t,i,n,s,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(Vw,s);super(e,t,i,n,d),this.disposables.add(u),this.internals=new Gg(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};KB=md([Bt(5,fe),Bt(6,Ie),Bt(7,Mr),Bt(8,Pe)],KB);let GB=class extends Dwe{constructor(e,t,i,n,s,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(Vw,r);super(e,t,i,n,s,h),this.disposables.add(g),this.internals=new Gg(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};GB=md([Bt(6,fe),Bt(7,Ie),Bt(8,Mr),Bt(9,Pe)],GB);let SR=class extends qK{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(Vw,r);super(e,t,i,n,s,h),this.disposables.add(g),this.internals=new Gg(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};SR=md([Bt(6,fe),Bt(7,Ie),Bt(8,Mr),Bt(9,Pe)],SR);let ZB=class extends Lwe{constructor(e,t,i,n,s,r,a,l,c,d,h){const{options:u,getTypeNavigationMode:g,disposable:f}=l.invokeFunction(Vw,a);super(e,t,i,n,s,r,u),this.disposables.add(f),this.internals=new Gg(this,a,g,a.overrideStyles,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};ZB=md([Bt(7,fe),Bt(8,Ie),Bt(9,Mr),Bt(10,Pe)],ZB);function tG(o){const e=o.getValue(qF);if(e==="highlight")return Bo.Highlight;if(e==="filter")return Bo.Filter;const t=o.getValue(Jy);if(t==="simple"||t==="highlight")return Bo.Highlight;if(t==="filter")return Bo.Filter}function iG(o){const e=o.getValue(GF);if(e==="fuzzy")return ya.Fuzzy;if(e==="contiguous")return ya.Contiguous}function Vw(o,e){const t=o.get(Pe),i=o.get(ud),n=o.get(Ie),s=o.get(fe),r=()=>{const u=n.getContextKeyValue(QK);if(u==="automatic")return pl.Automatic;if(u==="trigger"||n.getContextKeyValue(JK)===!1)return pl.Trigger;const f=t.getValue(KF);if(f==="automatic")return pl.Automatic;if(f==="trigger")return pl.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(vr),[l,c]=s.invokeFunction(Tk,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(ex);return{getTypeNavigationMode:r,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(kv)=="number"?t.getValue(kv):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(za),defaultFindMode:e.defaultFindMode??tG(t),defaultFindMatchType:e.defaultFindMatchType??iG(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Va),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(tx)==="doubleClick",contextViewProvider:i,findWidgetStyles:xme,enableStickyScroll:!!t.getValue(ix),stickyScrollMaxItemCount:Number(t.getValue(nx))}}}let Gg=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Ek(s,e),this.disposables.push(Nk(this.contextKeyService,e)),this.listSupportsMultiSelect=Dk.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Ik.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Ewe.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=VF.bindTo(this.contextKeyService),this.hasDoubleSelection=zF.bindTo(this.contextKeyService),this.hasMultiSelection=UF.bindTo(this.contextKeyService),this.treeElementCanCollapse=$F.bindTo(this.contextKeyService),this.treeElementHasParent=Nwe.bindTo(this.contextKeyService),this.treeElementCanExpand=jF.bindTo(this.contextKeyService),this.treeElementHasChild=Twe.bindTo(this.contextKeyService),this.treeFindOpen=Rwe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=YK.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Fl(a),this.updateStyleOverrides(n);const c=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(QK),d.add(JK),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(_f)&&(this._useAltAsMultipleSelectionModifier=Fl(a)),h.affectsConfiguration(kv)){const g=a.getValue(kv);u={...u,indent:g}}if(h.affectsConfiguration(ex)&&t.renderIndentGuides===void 0){const g=a.getValue(ex);u={...u,renderIndentGuides:g}}if(h.affectsConfiguration(za)){const g=!!a.getValue(za);u={...u,smoothScrolling:g}}if(h.affectsConfiguration(qF)||h.affectsConfiguration(Jy)){const g=tG(a);u={...u,defaultFindMode:g}}if(h.affectsConfiguration(KF)||h.affectsConfiguration(Jy)){const g=i();u={...u,typeNavigationMode:g}}if(h.affectsConfiguration(GF)){const g=iG(a);u={...u,defaultFindMatchType:g}}if(h.affectsConfiguration(vr)&&t.horizontalScrolling===void 0){const g=!!a.getValue(vr);u={...u,horizontalScrolling:g}}if(h.affectsConfiguration(Va)){const g=!!a.getValue(Va);u={...u,scrollByPage:g}}if(h.affectsConfiguration(tx)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(tx)==="doubleClick"}),h.affectsConfiguration(ix)){const g=a.getValue(ix);u={...u,enableStickyScroll:g}}if(h.affectsConfiguration(nx)){const g=Math.max(1,a.getValue(nx));u={...u,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(Al)){const g=a.getValue(Al);u={...u,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(Ol)){const g=a.getValue(Ol);u={...u,fastScrollSensitivity:g}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new Awe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?gf(e):m_)}dispose(){this.disposables=pt(this.disposables)}};Gg=md([Bt(4,Ie),Bt(5,Mr),Bt(6,Pe)],Gg);const Fwe=li.as($a.Configuration);Fwe.registerConfiguration({id:"workbench",order:7,title:m(1705,"Workbench"),type:"object",properties:{[_f]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),m(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[JS]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[vr]:{type:"boolean",default:!1,description:m(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Va]:{type:"boolean",default:!1,description:m(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[kv]:{type:"number",default:8,minimum:4,maximum:40,description:m(1712,"Controls tree indentation in pixels.")},[ex]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m(1713,"Controls whether the tree should render indent guides.")},[za]:{type:"boolean",default:!1,description:m(1714,"Controls whether lists and trees have smooth scrolling.")},[Al]:{type:"number",default:1,markdownDescription:m(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Ol]:{type:"number",default:5,markdownDescription:m(1716,"Scrolling speed multiplier when pressing `Alt`.")},[qF]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m(1718,"Filter elements when searching.")],default:"highlight",description:m(1719,"Controls the default find mode for lists and trees in the workbench.")},[Jy]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m(1724,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[GF]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m(1725,"Use fuzzy matching when searching."),m(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:m(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[tx]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[ix]:{type:"boolean",default:!0,description:m(1729,"Controls whether sticky scrolling is enabled in trees.")},[nx]:{type:"number",minimum:1,default:7,markdownDescription:m(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[KF]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class ad{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=fT.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){const e=this.parent.getPreview(this)?.preview(this.range);return e?m(1088,"{0} in {1} on line {2} at column {3}",e.value,Lr(this.uri),this.range.startLineNumber,this.range.startColumn):m(1087,"in {0} on line {1} at column {2}",Lr(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Wwe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),c=new L(n,l.startColumn,n,s),d=new L(r,a,r,1073741824),h=i.getValueInRange(c).replace(/^\s+/,""),u=i.getValueInRange(e),g=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+g,highlight:{start:h.length,end:h.length+u.length}}}}class Om{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ai}dispose(){pt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m(1089,"1 symbol in {0}, full path {1}",Lr(this.uri),this.uri.fsPath):m(1090,"{0} symbols in {1}, full path {2}",e,Lr(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new Wwe(i))}catch(i){Ee(i)}return this}}class po{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new P,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(po._compareReferences);let n;for(const s of e)if((!n||!Kt.isEqual(n.uri,s.uri,!0))&&(n=new Om(this,s.uri),this.groups.push(n)),n.children.length===0||po._compareReferences(s,n.children[n.children.length-1])!==0){const r=new ad(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){pt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new po(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m(1091,"No results found"):this.references.length===1?m(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:ta(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLens.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&L.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Kt.compare(e.uri,t.uri)||L.compareRangesUsingStarts(e.range,t.range)}}class yR extends A{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new ut),this.element=Z(e,J(".monaco-count-badge")),this._register(ue(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){this.titleFormat!==""&&!this.hover.value?this.hover.value=oa().setupDelayedHoverAtMouse(this.element,()=>({content:Lg(this.titleFormat,this.count),appearance:{compact:!0}})):this.titleFormat===""&&this.hover.value&&(this.hover.value=void 0)}render(){this.element.textContent=Lg(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class ph extends A{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=Z(e,J("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n,s){e||(e=""),n&&(e=ph.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&go(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render(s))}render(e){const t=[];let i=0;for(const n of this.highlights){if(n.end===n.start)continue;if(i{n=s===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class U_{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||go(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class Dv extends A{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new U_(Z(e,J(".monaco-icon-label")))),this.labelContainer=Z(this.domNode.element,J(".monaco-icon-label-container")),this.nameContainer=Z(this.labelContainer,J("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new Vwe(this.nameContainer,!!t.supportIcons)):this.nameNode=new Bwe(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??zl("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.bold&&n.push("bold"),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let l;if(!a||!mi(a)?(l=J(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,Se.isThemeIcon(i.iconPath)){const c=Se.asClassName(i.iconPath);l.className=`monaco-icon-label-iconpath ${c}`,l.style.backgroundImage=""}else l.style.backgroundImage=Ml(i?.iconPath);l.style.backgroundRepeat="no-repeat",l.style.backgroundPosition="center",l.style.backgroundSize="contain"}else a&&a.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();if(l instanceof ph){const c=i?.supportIcons??this.creationOptions?.supportIcons;l.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines,c),this.setupHover(l.element,i?.descriptionTitle)}else l.textContent=t&&i?.labelEscapeNewLines?ph.escapeNewLines(t,[]):t||"",this.setupHover(l.element,i?.descriptionTitle||""),l.empty=!t}if(i?.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=i?.suffix??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let n=e;if(this.creationOptions?.hoverTargetOverride){if(!sn(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}const s=oa().setupManagedHover(this.hoverDelegate,n,t);s&&this.customHovers.set(e,s)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new U_(aee(this.nameContainer,J("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new U_(Z(e.element,J("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new U_(Z(this.labelContainer,J("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new ph(Z(e.element,J("span.label-description")))):this.descriptionNode=this._register(new U_(Z(e.element,J("span.label-description"))))}return this.descriptionNode}}class Bwe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&go(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=Z(this.container,J("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const s={start:i,end:i+n.length},r=t.map(a=>Un.intersect(s,a)).filter(a=>!Un.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,r})}class Vwe extends A{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&go(this.options,t))return;this.label=e,this.options=t;const i=t?.supportIcons??this.supportIcons;if(typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new ph(Z(this.container,J("a.label-name",{id:t?.domId}))))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=t?.separator||"/",s=Hwe(e,n,t?.matches);for(let r=0;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Mk=function(o,e){return function(t,i){e(t,i,o)}},xR;let LR=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof po||e instanceof Om}getChildren(e){if(e instanceof po)return e.groups;if(e instanceof Om)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};LR=Rk([Mk(0,fs)],LR);class zwe{getHeight(){return 23}getTemplateId(e){return e instanceof Om?ox.id:Pk.id}}let kR=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof ad){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return Lr(e.uri)}};kR=Rk([Mk(0,st)],kR);class Uwe{getId(e){return e instanceof ad?e.id:e.uri}}let DR=class extends A{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Dv(i,{supportHighlights:!0})),this.badge=this._register(new yR(Z(i,J(".count")),{},eq)),e.appendChild(i)}set(e,t){const i=xL(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(m(1081,"{0} references",n)):this.badge.setTitleFormat(m(1082,"{0} reference",n))}};DR=Rk([Mk(1,Zg)],DR);let ox=class{static{xR=this}static{this.id="FileReferencesRenderer"}constructor(e){this._instantiationService=e,this.templateId=xR.id}renderTemplate(e){return this._instantiationService.createInstance(DR,e)}renderElement(e,t,i){i.set(e.element,Lw(e.filterData))}disposeTemplate(e){e.dispose()}};ox=xR=Rk([Mk(0,fe)],ox);class $we extends A{constructor(e){super(),this.label=this._register(new ph(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${Lr(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:s}=i;t&&!Jr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,Lw(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[s]))}}}class Pk{constructor(){this.templateId=Pk.id}static{this.id="OneReferenceRenderer"}renderTemplate(e){return new $we(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}}class jwe{getWidgetAriaLabel(){return m(1083,"References")}getAriaLabel(e){return e.ariaMessage}}var nG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pu=function(o,e){return function(t,i){e(t,i,o)}};class YF{static{this.DecorationOptions=Te.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"})}constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new z,this._callOnModelChange=new z,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let r=0;rthis.labelService.getUriBasenameLabel(i.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const n=e.elements.map(s=>this.getDragURI(s)).filter(Boolean);n.length&&(t.dataTransfer.setData(Ag.RESOURCES,JSON.stringify(n)),t.dataTransfer.setData(Ag.TEXT,n.join(` +`)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};IR=nG([pu(0,Zg)],IR);let ER=class extends Xy{constructor(e,t,i,n,s,r,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new z,this._callOnDispose=new z,this._onDidSelectReference=new P,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new at(0,0),this._isClosing=!1,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),pt(this._preview),pt(this._previewNotAvailableMessage),pt(this._tree),pt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Ave)||V.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Pve)||V.transparent,primaryHeadingColor:e.getColor(PK),secondaryHeadingColor:e.getColor(AK)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Z(e,J("div.messages")),Ss(this._messageContainer),this._splitView=new FK(e,{orientation:1}),this._previewContainer=Z(e,J("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(rd,this._previewContainer,t,{},this.editor),Ss(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(Mg,m(1084,"no preview available"),qo,Mg.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=Z(e,J("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new jwe,keyboardNavigationLabelProvider:this._instantiationService.createInstance(kR),identityProvider:new Uwe,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Ove},dnd:this._instantiationService.createInstance(IR)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Li(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Kwe,"ReferencesWidget",this._treeContainer,new zwe,[this._instantiationService.createInstance(ox),this._instantiationService.createInstance(Pk)],this._instantiationService.createInstance(LR),i),this._splitView.addView({onDidChange:te.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},Qy.Distribute),this._splitView.addView({onDidChange:te.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},Qy.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof ad&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")})),Ss(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new at(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=m(1085,"No results"),ro(this._messageContainer),Promise.resolve(void 0)):(Ss(this._messageContainer),this._decorationsManager=new YF(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),ro(this._treeContainer),ro(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof ad)return e;if(e instanceof Om&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Le.inMemory?this.setTitle(qee(e.uri),this._uriLabel.getUriLabel(xL(e.uri))):this.setTitle(m(1086,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const n=await i;if(!this._model){n.dispose();return}pt(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=L.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};ER=nG([pu(3,ci),pu(4,fs),pu(5,fe),pu(6,MK),pu(7,Zg),pu(8,st)],ER);var Gwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Af=function(o,e){return function(t,i){e(t,i,o)}},e0;const bf=new oe("referenceSearchVisible",!1,m(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Yg=class{static{e0=this}static{this.ID="editor.contrib.referencesController"}static get(e){return e.getContribution(e0.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=bf.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",r=qwe.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(ER,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m(1079,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{if(a!==this._requestIdPool||!this._widget){l.dispose();return}return this._model?.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m(1080,"{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,d=new R(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(99)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=L.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(n=>{if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(i),this._widget.focusOnReferenceTree();else{const s=e0.get(n),r=this._model.clone();this.closeWidget(),n.focus(),s?.toggleWidget(i,$i(a=>Promise.resolve(r)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,Ee(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Yg=e0=Gwe([Af(2,Ie),Af(3,et),Af(4,bi),Af(5,fe),Af(6,ps),Af(7,Pe)],Yg);function Cf(o,e){const t=NK(o);if(!t)return;const i=Yg.get(t);i&&e(i)}fn.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Mi(2089,60),when:q.or(bf,Xs.inPeekEditor),handler(o){Cf(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});fn.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:q.or(bf,Xs.inPeekEditor),handler(o){Cf(o,e=>{e.goToNextOrPreviousReference(!0)})}});fn.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:q.or(bf,Xs.inPeekEditor),handler(o){Cf(o,e=>{e.goToNextOrPreviousReference(!1)})}});Ye.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Ye.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Ye.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Ye.registerCommand("closeReferenceSearch",o=>Cf(o,e=>e.closeWidget()));fn.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:q.and(Xs.inPeekEditor,q.not("config.editor.stablePeek"))});fn.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:q.and(bf,q.not("config.editor.stablePeek"),q.or(N.editorTextFocus,HF.negate()))});fn.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:q.and(bf,XK,$F.negate(),jF.negate()),handler(o){const t=o.get(Mr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof ad&&Cf(o,i=>i.revealReference(t[0]))}});fn.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:q.and(bf,XK,$F.negate(),jF.negate()),handler(o){const t=o.get(Mr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof ad&&Cf(o,i=>i.openReference(t[0],!0,!0))}});Ye.registerCommand("openReference",o=>{const t=o.get(Mr).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof ad&&Cf(o,i=>i.openReference(t[0],!1,!0))});var sG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hb=function(o,e){return function(t,i){e(t,i,o)}};const XF=new oe("hasSymbols",!1,m(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),Ak=We("ISymbolNavigationService");let NR=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=XF.bindTo(e)}reset(){this._ctxHasSymbols.reset(),this._currentState?.dispose(),this._currentMessage?.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new TR(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const h of t.references)if(wh(h.uri,a.uri))c=!0,d=d||L.containsPosition(h.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=Yr(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:L.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?m(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):m(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};NR=sG([hb(0,Ie),hb(1,et),hb(2,bi),hb(3,st)],NR);$e(Ak,NR,1);re(new class extends Ki{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:XF,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(Ak).revealNext(e)}});fn.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:XF,primary:9,handler(o){o.get(Ak).reset()}});let TR=class{constructor(e){this._listener=new Map,this._disposables=new z,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),pt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Yr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}};TR=sG([hb(0,et)],TR);function RR(o,e){return e.uri.scheme===o.uri.scheme?!0:!KE(e.uri,Le.walkThroughSnippet,Le.vscodeChatCodeBlock,Le.vscodeChatCodeCompareBlock)}async function zw(o,e,t,i,n){const r=t.ordered(o,i).map(l=>Promise.resolve(n(l,o,e)).then(void 0,c=>{Ri(c)})),a=await Promise.all(r);return Ua(a.flat()).filter(l=>RR(o,l))}function Uw(o,e,t,i,n){return zw(e,t,o,i,(s,r,a)=>s.provideDefinition(r,a,n))}function QF(o,e,t,i,n){return zw(e,t,o,i,(s,r,a)=>s.provideDeclaration(r,a,n))}function JF(o,e,t,i,n){return zw(e,t,o,i,(s,r,a)=>s.provideImplementation(r,a,n))}function e5(o,e,t,i,n){return zw(e,t,o,i,(s,r,a)=>s.provideTypeDefinition(r,a,n))}function $w(o,e,t,i,n,s){return zw(e,t,o,n,async(r,a,l)=>{const c=(await r.provideReferences(a,l,{includeDeclaration:!0},s))?.filter(h=>RR(a,h));if(!i||!c||c.length!==2)return c;const d=(await r.provideReferences(a,l,{includeDeclaration:!1},s))?.filter(h=>RR(a,h));return d&&d.length===1?d:c})}async function jl(o){const e=await o(),t=new po(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}Js("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(he),n=Uw(i.definitionProvider,e,t,!1,Ve.None);return jl(()=>n)});Js("_executeDefinitionProvider_recursive",(o,e,t)=>{const i=o.get(he),n=Uw(i.definitionProvider,e,t,!0,Ve.None);return jl(()=>n)});Js("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(he),n=e5(i.typeDefinitionProvider,e,t,!1,Ve.None);return jl(()=>n)});Js("_executeTypeDefinitionProvider_recursive",(o,e,t)=>{const i=o.get(he),n=e5(i.typeDefinitionProvider,e,t,!0,Ve.None);return jl(()=>n)});Js("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(he),n=QF(i.declarationProvider,e,t,!1,Ve.None);return jl(()=>n)});Js("_executeDeclarationProvider_recursive",(o,e,t)=>{const i=o.get(he),n=QF(i.declarationProvider,e,t,!0,Ve.None);return jl(()=>n)});Js("_executeReferenceProvider",(o,e,t)=>{const i=o.get(he),n=$w(i.referenceProvider,e,t,!1,!1,Ve.None);return jl(()=>n)});Js("_executeReferenceProvider_recursive",(o,e,t)=>{const i=o.get(he),n=$w(i.referenceProvider,e,t,!1,!0,Ve.None);return jl(()=>n)});Js("_executeImplementationProvider",(o,e,t)=>{const i=o.get(he),n=JF(i.implementationProvider,e,t,!1,Ve.None);return jl(()=>n)});Js("_executeImplementationProvider_recursive",(o,e,t)=>{const i=o.get(he),n=JF(i.implementationProvider,e,t,!0,Ve.None);return jl(()=>n)});un.appendMenuItem(M.EditorContext,{submenu:M.EditorContextPeek,title:m(1038,"Peek"),group:"navigation",order:100});class Fm{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Fm||R.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Bs extends sa{static{this._allSymbolNavigationCommands=new Map}static{this._activeAlternativeCommands=new Set}static all(){return Bs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Ke.wrap(t.menu))(i.id===M.EditorContext||i.id===M.EditorContextPeek)&&(i.when=q.and(e.precondition,i.when));return t}constructor(e,t){super(Bs._patchConfig(t)),this.configuration=e,Bs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(bi),r=e.get(et),a=e.get(id),l=e.get(Ak),c=e.get(he),d=e.get(fe),h=t.getModel(),u=t.getPosition(),g=Fm.is(i)?i:new Fm(h,u),f=new nd(t,5),p=hm(this._getLocationModel(c,g.model,g.position,f.token),f.token).then(async _=>{if(!_||f.token.isCancellationRequested)return;Is(_.ariaMessage);let b;if(_.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);w!==void 0&&!Bs._activeAlternativeCommands.has(w)&&Bs._allSymbolNavigationCommands.has(w)&&(b=Bs._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);fo.get(t)?.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)Bs._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{Bs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,n)},_=>{s.error(_)}).finally(()=>{f.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof rd)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(qae(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:L.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const n=Yg.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),$i(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}class jw extends Bs{async _getLocationModel(e,t,i,n){return new po(await Uw(e.definitionProvider,t,i,!1,n),m(1039,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?m(1040,"No definition found for '{0}'",e.word):m(1041,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}}bt(class MR extends jw{static{this.id="editor.action.revealDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:MR.id,title:{...H(1065,"Go to Definition"),mnemonicTitle:m(1042,"Go to &&Definition")},precondition:N.hasDefinitionProvider,keybinding:[{when:N.editorTextFocus,primary:70,weight:100},{when:q.and(N.editorTextFocus,KK),primary:2118,weight:100}],menu:[{id:M.EditorContext,group:"navigation",order:1.1},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Ye.registerCommandAlias("editor.action.goToDeclaration",MR.id)}});bt(class PR extends jw{static{this.id="editor.action.revealDefinitionAside"}constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:PR.id,title:H(1066,"Open Definition to the Side"),precondition:q.and(N.hasDefinitionProvider,N.isInEmbeddedEditor.toNegated()),keybinding:[{when:N.editorTextFocus,primary:Mi(2089,70),weight:100},{when:q.and(N.editorTextFocus,KK),primary:Mi(2089,2118),weight:100}]}),Ye.registerCommandAlias("editor.action.openDeclarationToTheSide",PR.id)}});bt(class AR extends jw{static{this.id="editor.action.peekDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:AR.id,title:H(1067,"Peek Definition"),precondition:q.and(N.hasDefinitionProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:2}}),Ye.registerCommandAlias("editor.action.previewDeclaration",AR.id)}});class oG extends Bs{async _getLocationModel(e,t,i,n){return new po(await QF(e.declarationProvider,t,i,!1,n),m(1043,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?m(1044,"No declaration found for '{0}'",e.word):m(1045,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}}bt(class rG extends oG{static{this.id="editor.action.revealDeclaration"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rG.id,title:{...H(1068,"Go to Declaration"),mnemonicTitle:m(1046,"Go to &&Declaration")},precondition:q.and(N.hasDeclarationProvider,N.isInEmbeddedEditor.toNegated()),menu:[{id:M.EditorContext,group:"navigation",order:1.3},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m(1047,"No declaration found for '{0}'",e.word):m(1048,"No declaration found")}});bt(class extends oG{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:H(1069,"Peek Declaration"),precondition:q.and(N.hasDeclarationProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:3}})}});class aG extends Bs{async _getLocationModel(e,t,i,n){return new po(await e5(e.typeDefinitionProvider,t,i,!1,n),m(1049,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?m(1050,"No type definition found for '{0}'",e.word):m(1051,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}}bt(class lG extends aG{static{this.ID="editor.action.goToTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:lG.ID,title:{...H(1070,"Go to Type Definition"),mnemonicTitle:m(1052,"Go to &&Type Definition")},precondition:N.hasTypeDefinitionProvider,keybinding:{when:N.editorTextFocus,primary:0,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.4},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}});bt(class cG extends aG{static{this.ID="editor.action.peekTypeDefinition"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:cG.ID,title:H(1071,"Peek Type Definition"),precondition:q.and(N.hasTypeDefinitionProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:4}})}});class dG extends Bs{async _getLocationModel(e,t,i,n){return new po(await JF(e.implementationProvider,t,i,!1,n),m(1053,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?m(1054,"No implementation found for '{0}'",e.word):m(1055,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}}bt(class hG extends dG{static{this.ID="editor.action.goToImplementation"}constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:hG.ID,title:{...H(1072,"Go to Implementations"),mnemonicTitle:m(1056,"Go to &&Implementations")},precondition:N.hasImplementationProvider,keybinding:{when:N.editorTextFocus,primary:2118,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}});bt(class uG extends dG{static{this.ID="editor.action.peekImplementation"}constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:uG.ID,title:H(1073,"Peek Implementations"),precondition:q.and(N.hasImplementationProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:3142,weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:5}})}});class gG extends Bs{_getNoResultFoundMessage(e){return e?m(1057,"No references found for '{0}'",e.word):m(1058,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}}bt(class extends gG{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...H(1074,"Go to References"),mnemonicTitle:m(1059,"Go to &&References")},precondition:q.and(N.hasReferenceProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),keybinding:{when:N.editorTextFocus,primary:1094,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new po(await $w(e.referenceProvider,t,i,!0,!1,n),m(1060,"References"))}});bt(class extends gG{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:H(1075,"Peek References"),precondition:q.and(N.hasReferenceProvider,Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new po(await $w(e.referenceProvider,t,i,!1,!1,n),m(1061,"References"))}});class Zwe extends Bs{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:H(1076,"Go to Any Symbol"),precondition:q.and(Xs.notInPeekEditor,N.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new po(this._references,m(1062,"Locations"))}_getNoResultFoundMessage(e){return e&&m(1063,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}}Ye.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:_e},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{Je(_e.isUri(e)),Je(R.isIPosition(t)),Je(Array.isArray(i)),Je(typeof n>"u"||typeof n=="string"),Je(typeof r>"u"||typeof r=="boolean");const a=o.get(et),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Ha(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends Zwe{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);c.get(fe).invokeFunction(d.run.bind(d),l)})}});Ye.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:_e},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(o,e,t,i,n)=>{o.get(Pt).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});Ye.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{Je(_e.isUri(e)),Je(R.isIPosition(t));const i=o.get(he),n=o.get(et);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!Ha(s)||!s.hasModel())return;const r=Yg.get(s);if(!r)return;const a=$i(c=>$w(i.referenceProvider,s.getModel(),R.lift(t),!1,!1,c).then(d=>new po(d,m(1064,"References")))),l=new L(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Ye.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function Ywe(o,e,t,i){const n=o.get(fs),s=o.get(Jo),r=o.get(Pt),a=o.get(fe),l=o.get(bi);if(await i.item.resolve(Ve.None),!i.part.location)return;const c=i.part.location,d=[],h=new Set(un.getMenuItems(M.EditorContext).map(g=>Ip(g)?g.command.id:cf()));for(const g of Bs.all())h.has(g.desc.id)&&d.push(new Uo(g.desc.id,$o.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const f=await n.createModelReference(c.uri);try{const p=new Fm(f.object.textEditorModel,L.getStartPosition(c.range)),_=i.item.anchor.range;await a.invokeFunction(g.runEditorCommand.bind(g),e,p,_)}finally{f.dispose()}}));if(i.part.command){const{command:g}=i.part;d.push(new Fi),d.push(new Uo(g.id,g.title,void 0,!0,async()=>{try{await r.executeCommand(g.id,...g.arguments??[])}catch(f){l.notify({severity:g_.Error,source:i.item.provider.displayName,message:f})}}))}const u=e.getOption(144);s.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const g=pi(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function fG(o,e,t,i){const s=await o.get(fs).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,l=r.get(Ie),c=Xs.inPeekEditor.getValue(l),d=!a&&t.getOption(101)&&!c;return new jw({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new Fm(s.object.textEditorModel,L.getStartPosition(i.range)),L.lift(i.range))}),s.dispose()}var Xwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Of=function(o,e){return function(t,i){e(t,i,o)}},Qf;class rx{constructor(){this._entries=new na(50)}get(e){const t=rx._key(e);return this._entries.get(t)}set(e,t){const i=rx._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const pG=We("IInlayHintsCache");$e(pG,rx,1);class OR{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class Qwe{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}class Jwe{constructor(){this._store=new ut,this._tokenSource=new qt}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new qt,this._store.value=new z,{store:this._store.value,token:this._tokenSource.token}}}let Iv=class{static{Qf=this}static{this.ID="editor.contrib.InlayHints"}static{this._MAX_DECORATORS=1500}static{this._whitespaceData={}}static get(e){return e.getContribution(Qf.ID)??void 0}constructor(e,t,i,n,s,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=s,this._notificationService=r,this._instaService=a,this._disposables=new z,this._sessionDisposables=new z,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new $L(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let c,d;e.enabled==="onUnlessPressed"?(c=0,d=1):(c=1,d=0),this._activeRenderMode=c,this._sessionDisposables.add(Ic.getInstance().event(h=>{if(!this._editor.hasModel())return;const u=h.altKey&&h.ctrlKey&&!(h.shiftKey||h.metaKey)?d:c;if(u!==this._activeRenderMode){this._activeRenderMode=u;const g=this._editor.getModel(),f=this._copyInlayHintsWithCurrentAnchor(g);this._updateHintsDecorators([g.getFullModelRange()],f),a.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(ue(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let n;const s=new Set;this._sessionDisposables.add(t.onWillDispose(()=>n?.cancel()));const r=this._sessionDisposables.add(new Jwe),a=new St(async()=>{const c=Date.now(),{store:d,token:h}=r.reset();try{const u=await qp.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),h);if(a.delay=this._debounceInfo.update(t,Date.now()-c),h.isCancellationRequested){u.dispose();return}for(const g of u.provider)typeof g.onDidChangeInlayHints=="function"&&!s.has(g)&&(s.add(g),d.add(g.onDidChangeInlayHints(()=>{a.isScheduled()||a.schedule()})));d.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(u){Ee(u)}},this._debounceInfo.get(t));this._sessionDisposables.add(a),a.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(c=>{(c.scrollTopChanged||!a.isScheduled())&&a.schedule()}));const l=this._sessionDisposables.add(new ut);this._sessionDisposables.add(this._editor.onDidChangeModelContent(c=>{const d=Math.max(a.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+d},l.value=Gc(()=>a.schedule(0),d),a.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(159)&&a.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>a.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new z,t=e.add(new xk(this._editor)),i=new z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[s]=n,r=this._getInlayHintLabelPart(s),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new qt;i.add(ue(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new Qwe(r,s.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new L(c,1,c,a.getLineMaxColumn(c)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(ue(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async n=>{const s=this._getInlayHintLabelPart(n);if(s){const r=s.part;r.location?this._instaService.invokeFunction(fG,n,this._editor,r.location):PN.is(r.command)&&await this._invokeCommand(r.command,s.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(Ve.None),us(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(s=>gi.replace(L.lift(s.range),s.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!mi(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(Ywe,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==6)return;const t=e.target.detail.injectedText?.options;if(t instanceof Dh&&t?.attachedData instanceof OR)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:g_.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const s=e.getDecorationRange(i);if(s){const r=new IK(s,n.item.anchor.direction),a=n.item.with({anchor:r});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const s of i.sort(L.compareRangesUsingStarts)){const r=t.validateRange(new L(s.startLineNumber-30,s.startColumn,s.endLineNumber+30,s.endColumn));n.length===0||!L.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=L.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some(_=>_.containsPosition(this._cursorInfo.position))){const{position:_}=this._cursorInfo;this._cursorInfo=void 0;const b=new Map;for(const S of this._editor.getLineDecorations(_.lineNumber)??[]){const x=this._decorationsMetadata.get(S.id);if(S.range.startColumn>_.column)continue;const k=x?.decoration.options[x.item.anchor.direction];if(k&&k.attachedData!==Qf._whitespaceData){const D=b.get(x.item)??0;b.set(x.item,D+k.content.length)}}const C=t.filter(S=>S.anchor.range.startLineNumber===_.lineNumber&&S.anchor.range.endColumn<=_.column),w=Array.from(b.values());let v;for(;;){const S=C.shift(),x=w.shift();if(!x&&!S)break;if(S)i.set(S,x??0),v=S;else if(v&&x){let k=i.get(v);k+=x,k+=w.reduce((D,I)=>D+I,0),w.length=0;break}}}const n=[],s=(_,b,C,w,v)=>{const S={content:C,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:b.className,cursorStops:w,attachedData:v};n.push({item:_,classNameRef:b,decoration:{range:_.anchor.range,options:{description:"InlayHint",showIfCollapsed:_.anchor.range.isEmpty(),collapseOnReplaceEdit:!_.anchor.range.isEmpty(),stickiness:0,[_.anchor.direction]:this._activeRenderMode===0?S:void 0}}})},r=(_,b)=>{const C=this._ruleFactory.createClassNameRef({width:`${a/3|0}px`,display:"inline-block"});s(_,C," ",b?dr.Right:dr.None,Qf._whitespaceData)},{fontSize:a,fontFamily:l,padding:c,isUniform:d}=this._getLayoutInfo(),h=this._editor.getOption(159).maximumLength,u="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(u,l);let g={line:0,totalLen:0};for(let _=0;_h)continue;b.hint.paddingLeft&&r(b,!1);const C=typeof b.hint.label=="string"?[{label:b.hint.label}]:b.hint.label,w=i.get(b);let v=0;for(let S=0;S0&&(T=T.slice(0,-O)+"…",F=!0),v+=T.length,w!==void 0){const B=v-w;B>=0&&(v-=B,T=T.slice(0,-(1+B))+"…",F=!0)}if(c&&(k&&(D||F)?(I.padding=`1px ${Math.max(1,a/4)|0}px`,I.borderRadius=`${a/4|0}px`):k?(I.padding=`1px 0 1px ${Math.max(1,a/4)|0}px`,I.borderRadius=`${a/4|0}px 0 0 ${a/4|0}px`):D||F?(I.padding=`1px ${Math.max(1,a/4)|0}px 1px 0`,I.borderRadius=`0 ${a/4|0}px ${a/4|0}px 0`):I.padding="1px 0 1px 0"),s(b,this._ruleFactory.createClassNameRef(I),e1e(T),D&&!b.hint.paddingRight?dr.Right:dr.None,new OR(b,S)),F)break}if(w!==void 0&&vQf._MAX_DECORATORS)break}const f=[];for(const[_,b]of this._decorationsMetadata){const C=this._editor.getModel()?.getDecorationRange(_);C&&e.some(w=>w.containsRange(C))&&(f.push(_),b.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const p=Wa.capture(this._editor);this._editor.changeDecorations(_=>{const b=_.deltaDecorations(f,n.map(C=>C.decoration));for(let C=0;Ci)&&(s=i);const r=e.fontFamily||n;return{fontSize:s,fontFamily:r,padding:t,isUniform:!t&&r===n&&s===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};Iv=Qf=Xwe([Of(1,he),Of(2,Rr),Of(3,pG),Of(4,Pt),Of(5,bi),Of(6,fe)],Iv);function e1e(o){return o.replace(/[ \t]/g," ")}Ye.registerCommand("_executeInlayHintProvider",async(o,...e)=>{const[t,i]=e;Je(_e.isUri(t)),Je(L.isIRange(i));const{inlayHintsProvider:n}=o.get(he),s=await o.get(fs).createModelReference(t);try{const r=await qp.create(n,s.object.textEditorModel,[L.lift(i)],Ve.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{s.dispose()}});var t1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eu=function(o,e){return function(t,i){e(t,i,o)}};class YB extends db{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let ax=class extends yv{constructor(e,t,i,n,s,r,a,l){super(e,t,s,a,i,n,l),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!Iv.get(this._editor)||e.target.type!==6)return null;const i=e.target.detail.injectedText?.options;return i instanceof Dh&&i.attachedData instanceof OR?new YB(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,n){return e instanceof YB?new Yi(async s=>{const{part:r}=e;if(await r.item.resolve(n),n.isCancellationRequested)return;let a;typeof r.item.hint.tooltip=="string"?a=new Kn().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(a=r.item.hint.tooltip),a&&s.emitOne(new Gr(this,e.range,[a],!1,0)),us(r.item.hint.textEdits)&&s.emitOne(new Gr(this,e.range,[new Kn().appendText(m(1164,"Double-click to insert"))],!1,10001));let l;if(typeof r.part.tooltip=="string"?l=new Kn().appendText(r.part.tooltip):r.part.tooltip&&(l=r.part.tooltip),l&&s.emitOne(new Gr(this,e.range,[l],!1,1)),r.part.location||r.part.command){let d;const u=this._editor.getOption(86)==="altKey"?ze?m(1165,"cmd + click"):m(1166,"ctrl + click"):ze?m(1167,"option + click"):m(1168,"alt + click");r.part.location&&r.part.command?d=new Kn().appendText(m(1169,"Go to Definition ({0}), right click for more",u)):r.part.location?d=new Kn().appendText(m(1170,"Go to Definition ({0})",u)):r.part.command&&(d=new Kn(`[${m(1171,"Execute Command")}](${Lve(r.part.command)} "${r.part.command.title}") (${u})`,{isTrusted:!0})),d&&s.emitOne(new Gr(this,e.range,[d],!1,1e4))}const c=this._resolveInlayHintLabelPartHover(r,n);for await(const d of c)s.emitOne(d)}):Yi.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:n}=e.part.location,s=await this._resolverService.createModelReference(i);try{const r=s.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(r))return;for await(const a of DF(this._languageFeaturesService.hoverProvider,r,new R(n.startLineNumber,n.startColumn),t))Em(a.hover.contents)||(yield new Gr(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal))}finally{s.dispose()}}};ax=t1e([eu(1,aa),eu(2,st),eu(3,Ms),eu(4,Pe),eu(5,fs),eu(6,he),eu(7,Pt)],ax);var mG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lx=function(o,e){return function(t,i){e(t,i,o)}};class XB{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let FR=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new P,this.onDidChange=this._onDidChange.event,this._dispoables=new z,this._markers=[],this._nextIdx=-1,_e.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let c=yC(a.resource.toString(),l.resource.toString());return c===0&&(n==="position"?c=L.compareRangesUsingStarts(a,l)||ri.compare(a.severity,l.severity):c=ri.compare(a.severity,l.severity)||L.compareRangesUsingStarts(a,l)),c},r=()=>{let a=this._markerService.read({resource:_e.isUri(e)?e:void 0,severities:ri.Error|ri.Warning|ri.Info});return typeof e=="function"&&(a=a.filter(l=>this._resourceFilter(l.resource))),a.sort(s),jt(a,this._markers,(l,c)=>l.resource.toString()===c.resource.toString()&&l.startLineNumber===c.startLineNumber&&l.startColumn===c.startColumn&&l.endLineNumber===c.endLineNumber&&l.endColumn===c.endColumn&&l.severity===c.severity&&l.message===c.message)?!1:(this._markers=a,!0)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&r()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new XB(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=this._markers.findIndex(s=>wh(s.resource,e.uri));if(n<0)n=sO(this._markers.length,s=>yC(this._markers[s].resource.toString(),e.uri.toString())),n<0&&(n=~n),i?this._nextIdx=n:this._nextIdx=(this._markers.length+n-1)%this._markers.length;else{let s=!1,r=!1;for(let a=n;an.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ff=function(o,e){return function(t,i){e(t,i,o)}},HR;class n1e{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new z,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Li(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new FU(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){pt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=bo(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);xn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=J("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=Z(this._codeLink,J("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(xn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),us(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(75)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,p.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(p,g);const _=document.createElement("span");_.innerText=g.message,f.appendChild(p),f.appendChild(_),this._lines+=1,u.appendChild(f)}}const c=this._editor.getOption(59),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case ri.Error:t=m(1024,"Error");break;case ri.Warning:t=m(1025,"Warning");break;case ri.Info:t=m(1026,"Info");break;case ri.Hint:t=m(1027,"Hint");break}let i=m(1028,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let Ev=class extends Xy{static{HR=this}static{this.TitleMenu=new M("gotoErrorTitleMenu")}constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new z,this._onDidSelectRelatedInformation=new P,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ri.Warning,this._backgroundColor=V.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(a1e);let t=VR,i=s1e;this._severity===ri.Warning?(t=t0,i=o1e):this._severity===ri.Info&&(t=zR,i=r1e);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(PK),secondaryHeadingColor:e.getColor(AK)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(n=>this.editor.focus()));const t=this._menuService.getMenuActions(HR.TitleMenu,this._contextKeyService),i=Rme(t);this._actionbarWidget.push(i,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Z(e,J(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new n1e(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=L.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m(1029,"{0} of {1} problems",t,i):m(1030,"{0} of {1} problem",t,i);this.setTitle(Lr(a.uri),l)}this._icon.className=`codicon ${BR.className(ri.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Ev=HR=i1e([Ff(1,ci),Ff(2,gd),Ff(3,Er),Ff(4,fe),Ff(5,Ie),Ff(6,Zg)],Ev);const QB=FC(WL,Jne),JB=FC(Jc,WC),e8=FC(Tl,BC),VR=E("editorMarkerNavigationError.background",{dark:QB,light:QB,hcDark:Ge,hcLight:Ge},m(1031,"Editor marker navigation widget error color.")),s1e=E("editorMarkerNavigationError.headerBackground",{dark:Re(VR,.1),light:Re(VR,.1),hcDark:null,hcLight:null},m(1032,"Editor marker navigation widget error heading background.")),t0=E("editorMarkerNavigationWarning.background",{dark:JB,light:JB,hcDark:Ge,hcLight:Ge},m(1033,"Editor marker navigation widget warning color.")),o1e=E("editorMarkerNavigationWarning.headerBackground",{dark:Re(t0,.1),light:Re(t0,.1),hcDark:"#0C141F",hcLight:Re(t0,.2)},m(1034,"Editor marker navigation widget warning heading background.")),zR=E("editorMarkerNavigationInfo.background",{dark:e8,light:e8,hcDark:Ge,hcLight:Ge},m(1035,"Editor marker navigation widget info color.")),r1e=E("editorMarkerNavigationInfo.headerBackground",{dark:Re(zR,.1),light:Re(zR,.1),hcDark:null,hcLight:null},m(1036,"Editor marker navigation widget info heading background.")),a1e=E("editorMarkerNavigation.background",ki,m(1037,"Editor marker navigation widget background."));var l1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},j1=function(o,e){return function(t,i){e(t,i,o)}},ub;let Xg=class{static{ub=this}static{this.ID="editor.contrib.markerController"}static get(e){return e.getContribution(ub.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new z,this._editor=e,this._widgetVisible=bG.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Ev,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{(!this._model?.selected||!L.containsPosition(this._model?.selected.marker,i.position))&&this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:L.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new R(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._getOrCreateModel(t?void 0:i.uri);if(n.move(e,i,this._editor.getPosition()),!!n.selected)if(n.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);s&&(ub.get(s)?.close(),ub.get(s)?.navigate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}};Xg=ub=l1e([j1(1,_G),j1(2,Ie),j1(3,et),j1(4,fe)],Xg);class Ok extends le{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&await Xg.get(t)?.navigate(this._next,this._multiFile)}}class Kp extends Ok{static{this.ID="editor.action.marker.next"}static{this.LABEL=H(1020,"Go to Next Problem (Error, Warning, Info)")}constructor(){super(!0,!1,{id:Kp.ID,label:Kp.LABEL,precondition:void 0,kbOpts:{kbExpr:N.focus,primary:578,weight:100},menuOpts:{menuId:Ev.TitleMenu,title:Kp.LABEL.value,icon:Ht("marker-navigation-next",G.arrowDown,m(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}}class Qb extends Ok{static{this.ID="editor.action.marker.prev"}static{this.LABEL=H(1021,"Go to Previous Problem (Error, Warning, Info)")}constructor(){super(!1,!1,{id:Qb.ID,label:Qb.LABEL,precondition:void 0,kbOpts:{kbExpr:N.focus,primary:1602,weight:100},menuOpts:{menuId:Ev.TitleMenu,title:Qb.LABEL.value,icon:Ht("marker-navigation-previous",G.arrowUp,m(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}}class c1e extends Ok{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:H(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:66,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class d1e extends Ok{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:H(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:1090,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Xe(Xg.ID,Xg,4);se(Kp);se(Qb);se(c1e);se(d1e);const bG=new oe("markersNavigationVisible",!1),h1e=Ki.bindToContribution(Xg.get);re(new h1e({id:"closeMarkersNavigation",precondition:bG,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:N.focus,primary:9,secondary:[1033]}}));var u1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},VI=function(o,e){return function(t,i){e(t,i,o)}};const Pr=J;class CG{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const t8={type:1,filter:{include:Ut.QuickFix},triggerAction:vo.QuickFixHover};let UR=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range;if(!i.isValidRange(e.range))return[];const s=n.startLineNumber,r=i.getLineMaxColumn(s),a=[];for(const l of t){const c=l.range.startLineNumber===s?l.range.startColumn:1,d=l.range.endLineNumber===s?l.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,l);if(!h)continue;const u=new L(e.range.startLineNumber,c,e.range.startLineNumber,d);a.push(new CG(this,u,h))}return a}renderHoverParts(e,t){if(!t.length)return new jg([]);const i=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),i.push(a)});const n=t.length===1?t[0]:t.sort((r,a)=>ri.compare(r.marker.severity,a.marker.severity))[0],s=this._renderMarkerStatusbar(e,n);return new jg(i,s)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new z,i=Pr("div.hover-row"),n=Z(i,Pr("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const c=Z(n,Pr("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,s||a)if(a&&typeof a!="string"){const h=Pr("span");if(s){const p=Z(h,Pr("span"));p.innerText=s}const u=Z(h,Pr("a.code-link"));u.setAttribute("href",a.target.toString(!0)),t.add(W(u,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const g=Z(u,Pr("span"));g.innerText=a.value;const f=Z(n,h);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const h=Z(n,Pr("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(us(l))for(const{message:h,resource:u,startLineNumber:g,startColumn:f}of l){const p=Z(n,Pr("div"));p.style.marginTop="8px";const _=Z(p,Pr("a"));_.innerText=`${Lr(u)}(${g}, ${f}): `,_.style.cursor="pointer",t.add(W(_,"click",C=>{if(C.stopPropagation(),C.preventDefault(),this._openerService){const w={selection:{startLineNumber:g,startColumn:f}};this._openerService.open(u,{fromUserGesture:!0,editorOptions:w}).catch(Ee)}}));const b=Z(p,Pr("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new z;if(t.marker.severity===ri.Error||t.marker.severity===ri.Warning||t.marker.severity===ri.Info){const n=Xg.get(this._editor);n&&e.statusBar.addAction({label:m(1139,"View Problem"),commandId:Kp.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const n=e.statusBar.append(Pr("div"));this.recentMarkerCodeActionsInfo&&(Uy.makeKey(this.recentMarkerCodeActionsInfo.marker)===Uy.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=m(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?A.None:Gc(()=>n.textContent=m(1141,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(ue(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=m(1142,"No quick fixes available");return}n.style.display="none";let l=!1;i.add(ue(()=>{l||a.dispose()})),e.statusBar.addAction({label:m(1143,"Quick Fix..."),commandId:mF,run:d=>{l=!0;const h=$g.get(this._editor),u=pi(d);e.hide(),h?.showCodeActions(t8,a,{x:u.left,y:u.top,width:u.width,height:u.height})}});const c=a.validActions.find(d=>d.action.isAI);c&&e.statusBar.addAction({label:c.action.title,commandId:c.action.command?.id??"",iconClass:Se.asClassName(G.sparkle),run:()=>{$g.get(this._editor)?.applyCodeAction(c,!1,!1,ih.FromProblemsHover)}}),e.onContentsChanged()},Ee)}return i}getCodeActions(e){return $i(t=>_p(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t8,Rc.None,t))}};UR=u1e([VI(1,MO),VI(2,gd),VI(3,he)],UR);var vG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gp=function(o,e){return function(t,i){e(t,i,o)}},$R,jR;let qR=$R=class extends A{constructor(e,t,i,n,s,r,a){super();const l=t.hoverParts;this._renderedHoverParts=this._register(new KR(e,i,l,n,s,r,a));const c=t.options,d=c.anchor,{showAtPosition:h,showAtSecondaryPosition:u}=$R.computeHoverPositions(e,d.range,l);this.shouldAppearBeforeContent=l.some(g=>g.isBeforeContent),this.showAtPosition=h,this.showAtSecondaryPosition=u,this.initialMousePosX=d.initialMousePosX,this.initialMousePosY=d.initialMousePosY,this.shouldFocus=c.shouldFocus,this.source=c.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),g=d.getLineMinColumn(u.startLineNumber),f=new R(u.startLineNumber,g);n=h.convertViewPositionToModelPosition(f).column}const s=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===s,g=h.endLineNumber===s;if(u&&g){const p=h.startColumn,_=Math.min(r,p);r=Math.max(_,n)}d.forceShowAtRange&&(a=h)}let l,c;if(a){const d=a.getStartPosition();l=d,c=d}else l=t.getStartPosition(),c=new R(s,r);return{showAtPosition:l,showAtSecondaryPosition:c}}};qR=$R=vG([Gp(4,st),Gp(5,Ms),Gp(6,Co)],qR);class g1e{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}let KR=class extends A{static{jR=this}static{this._DECORATION_OPTIONS=Te.register({description:"content-hover-highlight",className:"hoverHighlight"})}constructor(e,t,i,n,s,r,a){super(),this._hoverService=r,this._clipboardService=a,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=n,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,n,s,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return A.None;let i=t[0].range;for(const s of t){const r=s.range;i=L.plusRange(i,r)}const n=e.createDecorationsCollection();return n.set([{range:i,options:jR._DECORATION_OPTIONS}]),ue(()=>{n.clear()})}_renderParts(e,t,i,n,s){const r=new Ky(n,s),a={fragment:this._fragment,statusBar:r,...i},l=new z;l.add(r);for(const d of e){const h=this._renderHoverPartsForParticipant(t,d,a);l.add(h);for(const u of h.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:d,hoverPart:u.hoverPart,hoverElement:u.hoverElement})}const c=this._renderStatusBar(this._fragment,r);return c&&(l.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),l}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(r=>r.owner===t);return n.length>0?t.renderHoverParts(i,n):new jg([])}_renderStatusBar(e,t){if(t.hasContent)return new g1e(e,t)}_registerListenersOnRenderedParts(){const e=new z;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(W(n,ee.FOCUS_IN,s=>{s.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(W(n,ee.FOCUS_OUT,s=>{s.stopPropagation(),this._focusedHoverPartIndex=-1})),t.type==="hoverPart"&&t.hoverPart instanceof CG&&e.add(new _R(n,()=>t.participant.getAccessibleContent(t.hoverPart),this._clipboardService,this._hoverService))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof yv&&!(i instanceof ax));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof Zy)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let n;t>=0?n={start:t,endExclusive:t+1}:n=this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let s=n.start;s=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const s=this._renderedParts.findIndex(r=>r.type==="hoverPart"&&r.participant===e);if(s===-1)throw new Ce;return t-s}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex(r=>r.type==="hoverPart"&&r.participant===e),n=t.reverse().findIndex(r=>r.type==="hoverPart"&&r.participant===e),s=n>=0?t.length-n:n;return{start:i,endExclusive:s+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}};KR=jR=vG([Gp(4,st),Gp(5,Ms),Gp(6,Co)],KR);var f1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},q1=function(o,e){return function(t,i){e(t,i,o)}};let GR=class extends A{constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=n,this._clipboardService=s,this._currentResult=null,this._renderedContentHover=this._register(new ut),this._onContentsChanged=this._register(new P),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(uR,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new tK(this._editor,new qy(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of mf.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>t.handleResize?.())})),this._register(this._contentHoverWidget.onDidScroll(t=>{this._participants.forEach(i=>i.handleScroll?.(t))})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(t=>t.handleContentsChanged?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{const i=t.hasLoadingMessage?this._addLoadingMessage(t):t.value;this._withResult(new oK(i,t.isComplete,t.options))}));const e=this._contentHoverWidget.getDomNode();this._register(Li(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(Li(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(ui.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(e,t,i,n,s){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1;const a=this._editor.getOption(69).sticky,l=s&&this._contentHoverWidget.isMouseGettingCloser(s.event.posx,s.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?this._currentResult&&this._currentResult.options.anchor.equals(e)?!0:this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const a={anchor:e,source:i,shouldFocus:n,insistOnKeepingHoverVisible:s};this._hoverOperation.start(t,a)}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const n=e.hoverParts.length===0,s=e.options.insistOnKeepingHoverVisible;n&&s||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new qR(this._editor,e,this._participants,t,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(e=>e.handleHide?.())}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:s=>{this._contentHoverWidget.setMinimumDimensions(s)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const s=i[0];return this._startShowingOrUpdateHover(s,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;switch(i.type){case 6:{t.push(new TI(0,i.range,e.event.posx,e.event.posy));break}case 7:{const n=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexts.priority-n.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!wk(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new TI(0,e,void 0,void 0),t,i,n,null)}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover.value?.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){return this._renderedContentHover.value?.focusedHoverPartIndex??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){if(this._renderedContentHover.value?.hoverPartsCount===1){this.focusHoverPartWithIndex(0);return}this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){this._renderedContentHover.value?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){return this._renderedContentHover.value?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};GR=f1e([q1(1,fe),q1(2,st),q1(3,Ms),q1(4,Co)],GR);function wG(o){const e=o.target;return!!e&&e.type===6&&e.detail.injectedText?.options.attachedData===Yq}var p1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zI=function(o,e){return function(t,i){e(t,i,o)}},ZR;let es=class extends A{static{ZR=this}static{this.ID="editor.contrib.contentHover"}constructor(e,t,i,n){super(),this._editor=e,this._instantiationService=i,this._keybindingService=n,this._onHoverContentsChanged=this._register(new P),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new z,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new St(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(t.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(t.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(ZR.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||wG(e)}_isMouseOnContentHoverWidget(e){return this._contentWidget?wk(this._contentWidget.getDomNode(),e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,n=(d,h)=>{const u=this._isMouseOnContentHoverWidget(d);return h&&u},s=d=>{const h=t.isColorPickerVisible,u=this._isMouseOnContentHoverWidget(d),g=h&&u,f=h&&this._isMouseDown;return g||f},r=(d,h)=>{const u=d.event.browserEvent.view;return u?h&&t.containsNode(u.document.activeElement)&&!u.getSelection()?.isCollapsed:!1},a=t.isFocused,l=t.isResizing,c=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||a||l||c||n(e,i)||s(e)||r(e,i)}_onEditorMouseMove(e){if(this._ignoreMouseEvents)return;if(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(this._shouldRescheduleHoverComputation()){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);return}this._reactToEditorMouseMove(e)}_shouldRescheduleHoverComputation(){const e=this._hoverSettings.hidingDelay;return(this._contentWidget?.isVisible??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents||!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&e.keyCode===2||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1,n=t.kind===2&&(t.commandId===Xq||t.commandId===Ck||t.commandId===vk)&&this._contentWidget.isVisible;return i||n}_isModifierKeyPressed(e){return e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4}hideContentHover(){Pm.dropDownVisible||this._contentWidget?.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(GR,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,n){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._contentWidget?.dispose()}};es=ZR=p1e([zI(1,Jo),zI(2,fe),zI(3,st)],es);class i8 extends A{static{this.ID="editor.contrib.colorContribution"}constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if(t!=="click"&&t!=="clickAndHover"||!wG(e))return;const i=this._editor.getContribution(es.ID);if(!i||i.isColorPickerVisible)return;const n=e.target.range;if(!n)return;const s=new L(n.startLineNumber,n.startColumn+1,n.endLineNumber,n.endColumn+1);i.showContentHover(s,1,1,!1)}}var m1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_1e=function(o,e){return function(t,i){e(t,i,o)}};class t5{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}static fromBaseColor(e,t){return new t5(e,t.range,t.model,t.provider)}}class b1e extends A{constructor(e,t,i,n){super();const s=e.getModel(),r=i.model;this.color=i.model.color,this.colorPicker=this._register(new LK(t.fragment,r,e.getOption(163),n,"standalone")),this._register(r.onColorFlushed(a=>{this.color=a})),this._register(r.onDidChangeColor(a=>{xv(s,r,a,i.range,i)})),this._register(e.onDidChangeModelContent(a=>{t.hide(),e.focus()})),xv(s,r,this.color,i.range,i)}}let YR=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel()||!Mm.get(this._editor))return null;const s=await Kq(i,this._editor.getModel(),Ve.None);let r=null,a=null;for(const u of s){const g=u.colorInfo;L.containsRange(g.range,e.range)&&(r=g,a=u.provider)}const l=r??e,c=a??t,d=!!r;return{colorHover:t5.fromBaseColor(this,await kK(this._editor.getModel(),l,c)),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new L(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await xv(this._editor.getModel(),t,this._color,i,e),i=DK(this._editor,i,t))}renderHoverParts(e,t){if(!(t.length===0||!this._editor.hasModel()))return this._setMinimumDimensions(e),this._renderedParts=new b1e(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new at(302,t))}get _color(){return this._renderedParts?.color}};YR=m1e([_1e(1,ci)],YR);var C1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$_=function(o,e){return function(t,i){e(t,i,o)}},XR;class v1e{constructor(e,t){this.value=e,this.foundInEditor=t}}const n8=8,w1e=22;let QR=class extends A{static{XR=this}static{this.ID="editor.contrib.standaloneColorPickerWidget"}constructor(e,t,i,n,s,r,a,l){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=s,this._languageFeaturesService=r,this._editorWorkerService=a,this._hoverService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new P),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new ut),this._renderedStatusBar=this._register(new ut),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(YR,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(xr(this._body));this._register(h.onDidBlur(u=>{this.hide()})),this._register(h.onDidFocus(u=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(u=>{const g=u.target.element?.classList;g&&g.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(u=>{this._render(u.value,u.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return XR.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new v1e(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new wv(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new Ky(this._keybindingService,this._hoverService));const n={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(n,[e]),!this._renderedHoverParts.value){this._renderedStatusBar.clear(),this._renderedHoverParts.clear();return}const s=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const r=s.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-w1e-n8,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const d=s.header,h=d.pickedColorNode;h.style.width=a+n8+"px";const u=d.originalColorNode;u.style.width=l+"px",s.header.closeButton?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};QR=XR=C1e([$_(3,fe),$_(4,st),$_(5,he),$_(6,eo),$_(7,Ms)],QR);var S1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},s8=function(o,e){return function(t,i){e(t,i,o)}},JR;let Qg=class extends A{static{JR=this}static{this.ID="editor.contrib.standaloneColorPickerController"}constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=N.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=N.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(QR,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(JR.ID)}};Qg=JR=S1e([s8(1,Ie),s8(2,fe)],Qg);class y1e extends sa{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...H(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:m(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:M.CommandPalette}],metadata:{description:H(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){Qg.get(t)?.showOrFocus()}}class x1e extends le{constructor(){super({id:"editor.action.hideColorPicker",label:H(891,"Hide the Color Picker"),precondition:N.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:H(892,"Hide the standalone color picker.")}})}run(e,t){Qg.get(t)?.hide()}}class L1e extends le{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:H(893,"Insert Color with Standalone Color Picker"),precondition:N.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:H(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){Qg.get(t)?.insertColor()}}se(x1e);se(L1e);bt(y1e);Xe(i8.ID,i8,2);Xe(Qg.ID,Qg,1);Xe(Mm.ID,Mm,1);v_(aR);mf.register(Zy);Ye.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof _e))throw br();const{model:i,colorProviderRegistry:n,defaultColorDecoratorsEnablement:s}=Zq(o,t);return CF(new Bbe,n,i,Ve.None,s)});Ye.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e;if(!i)return;const{uri:n,range:s}=i;if(!(n instanceof _e)||!Array.isArray(t)||t.length!==4||!L.isIRange(s))throw br();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=Zq(o,n),[c,d,h,u]=t;return CF(new Hbe({range:s,color:{red:c,green:d,blue:h,alpha:u}}),a,r,Ve.None,l)});class sh{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(c);let g=h.lastIndexOf(t,l-1+t.length),f=u.indexOf(i,d-1-i.length);if(g!==-1&&f!==-1)if(a===c)h.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const _=h.substring(g+t.length),b=u.substring(0,f);(_.indexOf(i)>=0||b.indexOf(i)>=0)&&(g=-1,f=-1)}let p;g!==-1&&f!==-1?(n&&g+t.length0&&u.charCodeAt(f-1)===32&&(i=" "+i,f-=1),p=sh._createRemoveBlockCommentOperations(new L(a,g+t.length+1,c,f+1),t,i)):(p=sh._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const _ of p)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return L.isEmpty(e)?n.push(gi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(gi.delete(new L(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(gi.delete(new L(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return L.isEmpty(e)?s.push(gi.replace(new L(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(gi.insert(new R(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(gi.insert(new R(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new ae(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new ae(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class gc{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;cs?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class i5 extends le{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ti);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(29),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>L.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tu=function(o,e){return function(t,i){e(t,i,o)}},eM;let Nv=class{static{eM=this}static{this.ID="editor.contrib.contextmenu"}static get(e){return e.getContribution(eM.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new z,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=c.srcElement;h.shadowRoot&&vh(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(30)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const s of n){const[,r]=s;let a=0;for(const l of r)if(l instanceof og){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new pm(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new Fi)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=pi(this._editor.getDomNode()),a=r.left+s.left,l=r.top+s.top+s.height;i={x:a,y:l}}const n=this._editor.getOption(144)&&!Sr;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:s=>{const r=this._keybindingFor(s);if(r)return new Nm(s,s,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=s;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new Nm(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||W_e(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(81);let i=0;const n=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),s=(c,d)=>new pm(`menu-action-${++i}`,c,d,void 0),r=(c,d,h,u,g)=>{if(!d)return n({label:c,enabled:d,run:()=>{}});const f=_=>()=>{this._configurationService.updateValue(h,_)},p=[];for(const _ of g)p.push(n({label:_.label,checked:u===_.value,run:f(_.value)}));return s(c,p)},a=[];a.push(n({label:m(901,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Fi),a.push(n({label:m(902,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(m(903,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:m(904,"Proportional"),value:"proportional"},{label:m(905,"Fill"),value:"fill"},{label:m(906,"Fit"),value:"fit"}])),a.push(r(m(907,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:m(908,"Mouse Over"),value:"mouseover"},{label:m(909,"Always"),value:"always"}]));const l=this._editor.getOption(144)&&!Sr;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};Nv=eM=N1e([tu(1,Jo),tu(2,ud),tu(3,Ie),tu(4,st),tu(5,Er),tu(6,Pe),tu(7,sd)],Nv);class T1e extends le{constructor(){super({id:"editor.action.showContextMenu",label:H(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:1092,weight:100}})}run(e,t){Nv.get(t)?.showContextMenu()}}Xe(Nv.ID,Nv,2);se(T1e);class UI{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new UI(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new $I(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new $I(new UI(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new $I(new UI(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}class R1e extends le{constructor(){super({id:"cursorUndo",label:H(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:2099,weight:100}})}run(e,t,i){Wm.get(t)?.cursorUndo()}}class M1e extends le{constructor(){super({id:"cursorRedo",label:H(912,"Cursor Redo"),precondition:void 0})}run(e,t,i){Wm.get(t)?.cursorRedo()}}Xe(Wm.ID,Wm,0);se(R1e);se(M1e);class P1e{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new L(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new ae(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new ae(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(42)||this._editor.getOption(28)||(Wf(e)&&(this._modifierPressed=!0),this._mouseDown&&Wf(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(42)||this._editor.getOption(28)||(Wf(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Zp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const n=(this._editor.getSelections()||[]).filter(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}Wf(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new R(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:s,selectionStartColumn:r}=n;i=[new ae(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ae(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Wf(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Zp.ID,new P1e(this._dragSelection,t,Wf(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}static{this._DECORATION_OPTIONS=Te.register({description:"dnd-target",className:"dnd-target"})}showAt(e){this._dndDecorationIds.set([{range:new L(e.lineNumber,e.column,e.lineNumber,e.column),options:Zp._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Xe(Zp.ID,Zp,2);const A1e="editor.action.pasteAs";Xe(od.ID,od,0);v_(GT);re(new class extends Ki{constructor(){super({id:Rq,precondition:fF,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e){return od.get(e)?.changePasteType()}});re(new class extends Ki{constructor(){super({id:"editor.hidePasteWidget",precondition:fF,kbOpts:{weight:100,primary:9}})}runEditorCommand(o,e){od.get(e)?.clearWidgets()}});se(class SG extends le{static{this.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:m(913,`The kind of the paste edit to try pasting with. If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:m(914,`List of preferred paste edit kind to try applying. -The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]}}constructor(){super({id:Q0e,label:H(915,"Paste As..."),precondition:N.writable,metadata:{description:"Paste as",args:[{name:"args",schema:uY.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,i){let n;return i&&("kind"in i?n={only:new jt(i.kind)}:"preferences"in i&&(n={preferences:i.preferences.map(s=>new jt(s))})),Dd.get(t)?.pasteAs(n)}});oe(class extends de{constructor(){super({id:"editor.action.pasteAsText",label:H(916,"Paste as Text"),precondition:N.writable,canTriggerInlineEdits:!0})}run(o,e){return Dd.get(e)?.pasteAs({providerId:cf.id})}});class J0e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class $H{constructor(e){this.identifier=e}}const gY=Ve("treeViewsDndService");Ge(gY,J0e,1);var eye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},VS=function(o,e){return function(t,i){e(t,i,o)}},Ec;const tye="editor.dropIntoEditor.preferences",fY="editor.changeDropType",p3=new re("dropWidgetVisible",!1,m(934,"Whether the drop widget is showing"));let p_=class extends F{static{Ec=this}static{this.ID="editor.contrib.dropIntoEditorController"}static get(e){return e.getContribution(Ec.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=NL.getInstance(),this._dropProgressManager=this._register(t.createInstance(TL,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(OL,"dropIntoEditor",e,p3,{id:fY,label:m(935,"Show drop options...")},()=>Ec._configureDefaultAction?[Ec._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;Ec._currentDropOperation?.cancel(),e.focus(),e.setPosition(t);const n=Qi(async s=>{const r=new z,a=r.add(new Ld(e,1,void 0,s));try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(g=>l.matches(g)):!0),h=r.add(await this.getDropEdits(d,c,t,l,a.token));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(c,h.edits),g=e.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([D.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},g,async f=>f,s)}}finally{r.dispose(),Ec._currentDropOperation===n&&(Ec._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,m(936,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),Ec._currentDropOperation=n}async getDropEdits(e,t,i,n,s){const r=new z,a=await Vm(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,n,s);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:c.id}))}catch(d){hr(d)||console.error(d),console.error(d)}})),s),l=ol(a??[]).flat();return{edits:_G(l),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(tye,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new jt(n),r=t.findIndex(a=>a.kind&&s.contains(a.kind));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new sG;const t=lG(e.dataTransfer);if(this.treeItemsTransfer.hasData($H.prototype)){const i=this.treeItemsTransfer.getData($H.prototype);if(Array.isArray(i))for(const n of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t}};p_=Ec=eye([VS(1,pe),VS(2,Oe),VS(3,ue),VS(4,gY)],p_);nt(p_.ID,p_,2);Y_(oM);ae(new class extends tn{constructor(){super({id:fY,precondition:p3,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){p_.get(e)?.changeDropType()}});ae(new class extends tn{constructor(){super({id:"editor.hideDropWidget",precondition:p3,kbOpts:{weight:100,primary:9}})}runEditorCommand(o,e,t){p_.get(e)?.clearWidgets()}});class m3 extends Oo{static{this.ID="editor.contrib.findOptionsWidget"}constructor(e,t,i){super(),this._hideSoon=this._register(new It(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:J(t1),inputActiveOptionForeground:J(i1),inputActiveOptionBackground:J(H_)},s={groupId:"find-options-widget"};this.caseSensitive=this._register(new eZ({appendTitle:this._keybindingLabelFor(Wt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new tZ({appendTitle:this._keybindingLabelFor(Wt.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new iZ({appendTitle:this._keybindingLabelFor(Wt.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(B(this._domNode,te.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(B(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return m3.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}function zS(o,e){return o===1?!0:o===2?!1:e}class iye extends F{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return zS(this._isRegexOverride,this._isRegex)}get wholeWord(){return zS(this._wholeWordOverride,this._wholeWord)}get matchCase(){return zS(this._matchCaseOverride,this._matchCase)}get preserveCase(){return zS(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new P),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,s=!0),typeof i<"u"&&(D.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!D.equalsRange(h,d)))||(this._searchScope=e.searchScope,n.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,r!==this.isRegex&&(s=!0,n.isRegex=!0),a!==this.wholeWord&&(s=!0,n.wholeWord=!0),l!==this.matchCase&&(s=!0,n.matchCase=!0),c!==this.preserveCase&&(s=!0,n.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Lh}}var nye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sye=function(o,e){return function(t,i){e(t,i,o)}},Kd;let g2=class{static{Kd=this}static{this.FIND_HISTORY_KEY="workbench.find.history"}static{this._instance=null}static getOrCreate(e){return Kd._instance||(Kd._instance=new Kd(e)),Kd._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new P,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(Kd.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(Kd.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}};g2=Kd=nye([sye(0,Ls)],g2);var oye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rye=function(o,e){return function(t,i){e(t,i,o)}},Gd;let f2=class{static{Gd=this}static{this.FIND_HISTORY_KEY="workbench.replace.history"}static{this._instance=null}static getOrCreate(e){return Gd._instance||(Gd._instance=new Gd(e)),Gd._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new P,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(Gd.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(Gd.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}};f2=Gd=oye([rye(0,Ls)],f2);var pY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},na=function(o,e){return function(t,i){e(t,i,o)}},p2;const aye=524288;function m2(o,e="single",t=!1){if(!o.hasModel())return null;const i=o.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=o.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(o.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!bk.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Eo(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const n=m2(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Eo(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=m2(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(s=>!s.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new MC(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(m(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};co=p2=pY([na(1,Ne),na(2,Ls),na(3,Mo),na(4,Li),na(5,Us)],co);let _2=class extends co{constructor(e,t,i,n,s,r,a,l){super(e,i,r,a,s,l),this._contextViewService=t,this._keybindingService=n,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=g2.getOrCreate(r),this._replaceWidgetHistory=f2.getOrCreate(r)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new W5(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new m3(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};_2=pY([na(1,Md),na(2,Ne),na(3,dt),na(4,Li),na(5,Ls),na(6,Mo),na(7,Us)],_2);const lye=SD(new wD({id:Wt.StartFindAction,label:H(947,"Find"),precondition:K.or(N.focus,K.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m(941,"&&Find"),order:1}}));lye.addImplementation(0,(o,e,t)=>{const i=co.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}):!1});const cye={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class dye extends de{constructor(){super({id:Wt.StartFindWithArgs,label:H(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:cye})}async run(e,t,i){const n=co.get(t);if(n){const s=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(50).loop},s),n.setGlobalBufferTerm(n.getState().searchString)}}}class hye extends de{constructor(){super({id:Wt.StartFindWithSelection,label:H(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=co.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}async function mY(o,e){const t=co.get(o);if(!t)return;const i=()=>(e?t.moveToNextMatch():t.moveToPrevMatch())?(t.editor.pushUndoStop(),!0):!1;i()||(await t.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getState().searchString.length===0&&o.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:o.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:o.getOption(50).loop}),i())}const uye=SD(new wD({id:Wt.NextMatchFindAction,label:H(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:N.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:K.and(N.focus,bk),primary:3,weight:100}]}));uye.addImplementation(0,async(o,e,t)=>mY(e,!0));const gye=SD(new wD({id:Wt.PreviousMatchFindAction,label:H(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:N.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:K.and(N.focus,bk),primary:1027,weight:100}]}));gye.addImplementation(0,async(o,e,t)=>mY(e,!1));class fye extends de{constructor(){super({id:Wt.GoToMatchFindAction,label:H(952,"Go to Match..."),precondition:Od}),this._highlightDecorations=[]}run(e,t,i){const n=co.get(t);if(!n)return;const s=n.getState().matchesCount;if(s<1){e.get(Li).notify({severity:U_.Warning,message:m(942,"No matches. Try searching for something else.")});return}const r=e.get(as),a=new z,l=a.add(r.createInputBox());l.placeholder=m(943,"Type a number to go to a specific match (between 1 and {0})",s);const c=h=>{const u=parseInt(h);if(isNaN(u))return;const g=n.getState().matchesCount;if(u>0&&u<=g)return u-1;if(u<0&&u>=-g)return g+u},d=h=>{const u=c(h);if(typeof u=="number"){l.validationMessage=void 0,n.goToMatch(u);const g=n.getState().currentMatch;g&&this.addDecorations(t,g)}else l.validationMessage=m(944,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(h=>{d(h)})),a.add(l.onDidAccept(()=>{const h=c(l.value);typeof h=="number"?(n.goToMatch(h),l.hide()):l.validationMessage=m(945,"Please type a number between 1 and {0}",n.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:_i(Aj),position:or.Full}}}])})}}class _Y extends de{async run(e,t){const i=co.get(t);if(!i)return;const n=m2(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}class pye extends _Y{constructor(){super({id:Wt.NextSelectionMatchFindAction,label:H(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class mye extends _Y{constructor(){super({id:Wt.PreviousSelectionMatchFindAction,label:H(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const _ye=SD(new wD({id:Wt.StartFindReplaceAction,label:H(955,"Replace"),precondition:K.or(N.focus,K.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m(946,"&&Replace"),order:2}}));_ye.addImplementation(0,(o,e,t)=>{if(!e.hasModel()||e.getOption(104))return!1;const i=co.get(e);if(!i)return!1;const n=e.getSelection(),s=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(50).seedSearchStringFromSelection!=="never"&&!s,a=s||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop})});nt(co.ID,_2,0);oe(dye);oe(hye);oe(fye);oe(pye);oe(mye);const al=tn.bindToContribution(co.get);ae(new al({id:Wt.CloseFindWidgetCommand,precondition:Od,handler:o=>o.closeFindWidget(),kbOpts:{weight:105,kbExpr:K.and(N.focus,K.not("isComposing")),primary:9,secondary:[1033]}}));ae(new al({id:Wt.ToggleCaseSensitiveCommand,precondition:void 0,handler:o=>o.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:N.focus,primary:ES.primary,mac:ES.mac,win:ES.win,linux:ES.linux}}));ae(new al({id:Wt.ToggleWholeWordCommand,precondition:void 0,handler:o=>o.toggleWholeWords(),kbOpts:{weight:105,kbExpr:N.focus,primary:NS.primary,mac:NS.mac,win:NS.win,linux:NS.linux}}));ae(new al({id:Wt.ToggleRegexCommand,precondition:void 0,handler:o=>o.toggleRegex(),kbOpts:{weight:105,kbExpr:N.focus,primary:TS.primary,mac:TS.mac,win:TS.win,linux:TS.linux}}));ae(new al({id:Wt.ToggleSearchScopeCommand,precondition:void 0,handler:o=>o.toggleSearchScope(),kbOpts:{weight:105,kbExpr:N.focus,primary:RS.primary,mac:RS.mac,win:RS.win,linux:RS.linux}}));ae(new al({id:Wt.TogglePreserveCaseCommand,precondition:void 0,handler:o=>o.togglePreserveCase(),kbOpts:{weight:105,kbExpr:N.focus,primary:MS.primary,mac:MS.mac,win:MS.win,linux:MS.linux}}));ae(new al({id:Wt.ReplaceOneAction,precondition:Od,handler:o=>o.replace(),kbOpts:{weight:105,kbExpr:N.focus,primary:3094}}));ae(new al({id:Wt.ReplaceOneAction,precondition:Od,handler:o=>o.replace(),kbOpts:{weight:105,kbExpr:K.and(N.focus,A5),primary:3}}));ae(new al({id:Wt.ReplaceAllAction,precondition:Od,handler:o=>o.replaceAll(),kbOpts:{weight:105,kbExpr:N.focus,primary:2563}}));ae(new al({id:Wt.ReplaceAllAction,precondition:Od,handler:o=>o.replaceAll(),kbOpts:{weight:105,kbExpr:K.and(N.focus,A5),primary:void 0,mac:{primary:2051}}}));ae(new al({id:Wt.SelectAllMatchesAction,precondition:Od,handler:o=>o.selectAllMatches(),kbOpts:{weight:105,kbExpr:N.focus,primary:515}}));const bye={0:" ",1:"u",2:"r"},jH=65535,Aa=16777215,qH=4278190080;class tN{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<jH)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new tN(e.length),this._userDefinedStates=new tN(e.length),this._recoveredStates=new tN(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const s=e[e.length-1];return this.getStartLineNumber(s)<=i&&this.getEndLineNumber(s)>=n};for(let i=0,n=this._startIndexes.length;iAa||r>Aa)throw new Error("startLineNumber or endLineNumber must not exceed "+Aa);for(;e.length>0&&!t(s,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=s+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Aa}getEndLineNumber(e){return this._endIndexes[e]&Aa}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n>>24)+((this._endIndexes[e]&qH)>>>16);return t===jH?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(_)?(C=>CC=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?_=h:(_=d,_.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!n?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),_.source=0),d=r(++l)):(_=h,h.isCollapsed&&h.source===0&&(_.source=2)),h=a(++c);else{let b=c,C=h;for(;;){if(!C||C.startLineNumber>d.endLineNumber){_=d;break}if(C.source===1&&C.endLineNumber>d.endLineNumber)break;C=a(++b)}d=r(++l)}if(_){for(;g&&g.endLineNumber<_.startLineNumber;)g=u.pop();_.endLineNumber>_.startLineNumber&&_.startLineNumber>f&&_.endLineNumber<=i&&(!g||g.endLineNumber>=_.endLineNumber)&&(p.push(_),f=_.startLineNumber,g&&u.push(g),g=_)}}return p}}class Cye{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class vye{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new P,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Xo(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,s=-1,r=-1;const a=l=>{for(;nr&&(r=c),n++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),s=Math.max(s,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const s of e)if(!(s.startLineNumber>n.endLineNumber||n.startLineNumber>s.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const s of e){if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const r=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);(!s.checksum||r===s.checksum)&&t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,type:void 0,isCollapsed:s.isCollapsed??!0,source:s.source??0})}const n=Xo.sanitizeAndMerge(this._regions,t,i);this.updatePost(Xo.fromFoldRanges(n))}_getLinesChecksum(e,t){return Yw(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),s=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,s))&&i.push(r),s++,n=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,s=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=n,a=this._regions.length;r1){const a=o.getRegionsInside(s,(l,c)=>l.isCollapsed!==r&&c0)for(const s of i){const r=o.getRegionAtLine(s);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=o.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);n.push(...r)}o.toggleCollapseState(n)}function wye(o,e,t){const i=[];for(const n of t){const s=o.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);s.length>0&&i.push(s[0])}o.toggleCollapseState(i)}function Sye(o,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),s=o.getRegionsInside(null,n);o.toggleCollapseState(s)}function CY(o,e,t){const i=[];for(const r of t){const a=o.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,s=o.getRegionsInside(null,n);o.toggleCollapseState(s)}function b3(o,e,t){const i=o.textModel,n=o.regions,s=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&s.push(n.toRegion(r))}o.toggleCollapseState(s)}function C3(o,e,t){const i=o.regions,n=[];for(let s=i.length-1;s>=0;s--)t!==i.isCollapsed(s)&&e===i.getType(s)&&n.push(i.toRegion(s));o.toggleCollapseState(n)}function yye(o,e){let t=null;const i=e.getRegionAtLine(o);if(i!==null&&(t=i.startLineNumber,o===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function Lye(o,e){let t=e.getRegionAtLine(o);if(t!==null&&t.startLineNumber===o){if(o!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function xye(o,e){let t=e.getRegionAtLine(o);if(t!==null&&t.startLineNumber===o){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>o)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||qh(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,s=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return KH(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const s=r=>((!n||!kye(r,n))&&(n=KH(this._hiddenRanges,r)),n?n.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function kye(o,e){return o>=e.startLineNumber&&o<=e.endLineNumber}function KH(o,e){const t=Ev(o,i=>e=0&&o[t].endLineNumber>=e?o[t]:null}const Iye=5e3,Eye="indent";class v3{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Eye}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(Rye(this.editorModel,i,n,this.foldingRangesLimit))}}let Nye=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Aa||t>Aa)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let s=this._length-1,r=0;s>=0;s--,r++)i[r]=this._startIndexes[s],n[r]=this._endIndexes[s];return new Xo(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let l=0;lt){n=l;break}i+=c}}const s=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=qD(h,s);(u{}};function Rye(o,e,t,i=Tye){const n=o.getOptions().tabSize,s=new Nye(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=o.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=o.getLineCount();c>0;c--){const d=o.getLineContent(c),h=qD(d,n);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let g;if(r&&(g=d.match(r)))if(g[1]){let f=a.length-1;for(;f>0&&a[f].indent!==-2;)f--;if(f>0){a.length=f+1,u=a[f],s.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const f=u.endAbove-1;f-c>=1&&s.insertFirst(c,f,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return s.toIndentRanges(o)}const Mye=E("editor.foldBackground",{light:Pe(fh,.3),dark:Pe(fh,.3),hcDark:null,hcLight:null},m(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},m(1003,"Color of the collapsed text after the first line of a folded range."));E("editorGutter.foldingControlForeground",Uy,m(1004,"Color of the folding control in the editor gutter."));const sx=Kt("folding-expanded",Z.chevronDown,m(1005,"Icon for expanded ranges in the editor glyph margin.")),ox=Kt("folding-collapsed",Z.chevronRight,m(1006,"Icon for collapsed ranges in the editor glyph margin.")),GH=Kt("folding-manual-collapsed",ox,m(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),ZH=Kt("folding-manual-expanded",sx,m(1008,"Icon for manually expanded ranges in the editor glyph margin.")),iN={color:_i(Mye),position:1},pp=m(1009,"Click to expand the range."),US=m(1010,"Click to collapse the range.");class zo{static{this.COLLAPSED_VISUAL_DECORATION=Me.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:pp,firstLineDecorationClassName:ye.asClassName(ox)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Me.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:iN,isWholeLine:!0,linesDecorationsTooltip:pp,firstLineDecorationClassName:ye.asClassName(ox)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Me.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:pp,firstLineDecorationClassName:ye.asClassName(GH)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Me.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:iN,isWholeLine:!0,linesDecorationsTooltip:pp,firstLineDecorationClassName:ye.asClassName(GH)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Me.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:pp})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Me.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:iN,isWholeLine:!0,linesDecorationsTooltip:pp})}static{this.EXPANDED_VISUAL_DECORATION=Me.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ye.asClassName(sx),linesDecorationsTooltip:US})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Me.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ye.asClassName(sx),linesDecorationsTooltip:US})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Me.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ye.asClassName(ZH),linesDecorationsTooltip:US})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Me.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:ye.asClassName(ZH),linesDecorationsTooltip:US})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Me.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Me.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?zo.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?zo.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:zo.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:zo.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?zo.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:zo.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?zo.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:zo.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?zo.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:zo.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?zo.MANUALLY_EXPANDED_VISUAL_DECORATION:zo.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const Pye={},Aye="syntax";class w3{constructor(e,t,i,n,s){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=s,this.id=Aye,this.disposables=new z,s&&this.disposables.add(s);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return Oye(this.providers,this.editorModel,e).then(t=>this.editorModel.isDisposed()?null:t?Wye(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function Oye(o,e,t){let i=null;const n=o.map((s,r)=>Promise.resolve(s.provideFoldingRanges(e,Pye,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},Bi));return Promise.all(n).then(s=>i)}class Fye{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Aa||t>Aa)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=n,this._types[s]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;ne){i=a;break}t+=l}}const n=new Uint32Array(e),s=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new Fye(e);let n;const s=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,s.length);else if(r.start>n.start)if(r.end<=n.end)s.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,s.length);else{if(r.start>n.end){do n=s.pop();while(n&&r.start>n.end);n&&s.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,s.length)}return i.toIndentRanges()}var Bye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Eb=function(o,e){return function(t,i){e(t,i,o)}},Xb;const Pn=new re("foldingEnabled",!1);let Qh=class extends F{static{Xb=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(Xb.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return Xb._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,n,s,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new z),this.editor=e,this._foldingLimitReporter=this._register(new vY(e));const a=this.editor.getOptions();this._isEnabled=a.get(52),this._useFoldingProviders=a.get(53)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(55),this.updateDebounceInfo=s.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new zo(e),this.foldingDecorationProvider.showFoldingControls=a.get(126),this.foldingDecorationProvider.showFoldingHighlights=a.get(54),this.foldingEnabled=Pn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(56)&&this.onModelChanged(),l.hasChanged(126)||l.hasChanged(54)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(126),this.foldingDecorationProvider.showFoldingHighlights=c.get(54),this.triggerFoldingModelChanged()}l.hasChanged(53)&&(this._useFoldingProviders=this.editor.getOptions().get(53)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),l.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new vye(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new Dye(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Fr(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new It(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new v3(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Xb.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new w3(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new fn,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Qi(s=>i.compute(s));return n.then(s=>{if(s&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=s.setCollapsedAllOfType(Mf.Imports.value,!0);c&&(r=el.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(s,Hye(a)),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Te(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const s of i){const r=s.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,Te)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const n=e.target.detail,s=e.target.element.offsetLeft;if(n.offsetX-s<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,s=e.target.range;if(!s||s.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||s.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(n||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Qh=Xb=Bye([Eb(1,Ne),Eb(2,ai),Eb(3,Li),Eb(4,qr),Eb(5,ue)],Qh);class vY extends F{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new P),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Yn extends de{runEditorCommand(e,t,i){const n=e.get(ai),s=Qh.get(t);if(!s)return;const r=s.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(s,a,t,i,n);const l=t.getSelection();l&&s.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Hye(o){return!o||o.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of o){const n=i.startLineNumber;if(n>=e&&n<=t)return!0}return!1}}}function wY(o){if(!ss(o)){if(!Xi(o))return!1;const e=o;if(!ss(e.levels)&&!gd(e.levels)||!ss(e.direction)&&!hn(e.direction)||!ss(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(gd)))return!1}return!0}class Vye extends Yn{constructor(){super({id:"editor.unfold",label:H(982,"Unfold"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]}}constructor(){super({id:A1e,label:H(915,"Paste As..."),precondition:N.writable,metadata:{description:"Paste as",args:[{name:"args",schema:SG.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,i){let n;return i&&("kind"in i?n={only:new Wt(i.kind)}:"preferences"in i&&(n={preferences:i.preferences.map(s=>new Wt(s))})),od.get(t)?.pasteAs(n)}});se(class extends le{constructor(){super({id:"editor.action.pasteAsText",label:H(916,"Paste as Text"),precondition:N.writable,canTriggerInlineEdits:!0})}run(o,e){return od.get(e)?.pasteAs({providerId:Bg.id})}});class O1e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class o8{constructor(e){this.identifier=e}}const yG=We("treeViewsDndService");$e(yG,O1e,1);var F1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},K1=function(o,e){return function(t,i){e(t,i,o)}},lc;const W1e="editor.dropIntoEditor.preferences",xG="editor.changeDropType",n5=new oe("dropWidgetVisible",!1,m(934,"Whether the drop widget is showing"));let Bm=class extends A{static{lc=this}static{this.ID="editor.contrib.dropIntoEditorController"}static get(e){return e.getContribution(lc.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=Ay.getInstance(),this._dropProgressManager=this._register(t.createInstance(Oy,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(Vy,"dropIntoEditor",e,n5,{id:xG,label:m(935,"Show drop options...")},()=>lc._configureDefaultAction?[lc._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;lc._currentDropOperation?.cancel(),e.focus(),e.setPosition(t);const n=$i(async s=>{const r=new z,a=r.add(new nd(e,1,void 0,s));try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(c).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(g=>l.matches(g)):!0),h=r.add(await this.getDropEdits(d,c,t,l,a.token));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(c,h.edits),g=e.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([L.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},g,async f=>f,s)}}finally{r.dispose(),lc._currentDropOperation===n&&(lc._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,m(936,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),lc._currentDropOperation=n}async getDropEdits(e,t,i,n,s){const r=new z,a=await hm(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,n,s);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:c.id}))}catch(d){Xo(d)||console.error(d),console.error(d)}})),s),l=Ua(a??[]).flat();return{edits:Dq(l),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(W1e,{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const s=new Wt(n),r=t.findIndex(a=>a.kind&&s.contains(a.kind));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new fq;const t=bq(e.dataTransfer);if(this.treeItemsTransfer.hasData(o8.prototype)){const i=this.treeItemsTransfer.getData(o8.prototype);if(Array.isArray(i))for(const n of i){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(s)for(const[r,a]of s)t.replace(r,a)}}return t}};Bm=lc=F1e([K1(1,fe),K1(2,Pe),K1(3,he),K1(4,yG)],Bm);Xe(Bm.ID,Bm,2);v_(KT);re(new class extends Ki{constructor(){super({id:xG,precondition:n5,kbOpts:{weight:100,primary:2137}})}runEditorCommand(o,e,t){Bm.get(e)?.changeDropType()}});re(new class extends Ki{constructor(){super({id:"editor.hideDropWidget",precondition:n5,kbOpts:{weight:100,primary:9}})}runEditorCommand(o,e,t){Bm.get(e)?.clearWidgets()}});class s5 extends So{static{this.ID="editor.contrib.findOptionsWidget"}constructor(e,t,i){super(),this._hideSoon=this._register(new St(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:Q(_w),inputActiveOptionForeground:Q(bw),inputActiveOptionBackground:Q(d_)},s={groupId:"find-options-widget"};this.caseSensitive=this._register(new dK({appendTitle:this._keybindingLabelFor(Tt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new hK({appendTitle:this._keybindingLabelFor(Tt.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new uK({appendTitle:this._keybindingLabelFor(Tt.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:s,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(W(this._domNode,ee.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(W(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return s5.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}}function G1(o,e){return o===1?!0:o===2?!1:e}class B1e extends A{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return G1(this._isRegexOverride,this._isRegex)}get wholeWord(){return G1(this._wholeWordOverride,this._wholeWord)}get matchCase(){return G1(this._matchCaseOverride,this._matchCase)}get preserveCase(){return G1(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new P),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,s=!0),typeof i<"u"&&(L.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(e.searchScope?.every(d=>this._searchScope?.some(h=>!L.equalsRange(h,d)))||(this._searchScope=e.searchScope,n.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,r!==this.isRegex&&(s=!0,n.isRegex=!0),a!==this.wholeWord&&(s=!0,n.wholeWord=!0),l!==this.matchCase&&(s=!0,n.matchCase=!0),c!==this.preserveCase&&(s=!0,n.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=nh}}var H1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},V1e=function(o,e){return function(t,i){e(t,i,o)}},kd;let tM=class{static{kd=this}static{this.FIND_HISTORY_KEY="workbench.find.history"}static{this._instance=null}static getOrCreate(e){return kd._instance||(kd._instance=new kd(e)),kd._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new P,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(kd.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(kd.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}};tM=kd=H1e([V1e(0,ps)],tM);var z1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U1e=function(o,e){return function(t,i){e(t,i,o)}},Dd;let iM=class{static{Dd=this}static{this.FIND_HISTORY_KEY="workbench.replace.history"}static{this._instance=null}static getOrCreate(e){return Dd._instance||(Dd._instance=new Dd(e)),Dd._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new P,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(Dd.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(Dd.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}};iM=Dd=z1e([U1e(0,ps)],iM);var LG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ur=function(o,e){return function(t,i){e(t,i,o)}},nM;const $1e=524288;function sM(o,e="single",t=!1){if(!o.hasModel())return null;const i=o.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=o.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(o.getModel().getValueLengthInRange(i)<$1e)return o.getModel().getValueInRange(i)}return null}let Qs=class extends A{static{nM=this}static{this.ID="editor.contrib.findController"}get editor(){return this._editor}static get(e){return e.getContribution(nM.ID)}constructor(e,t,i,n,s,r){super(),this._editor=e,this._findWidgetVisible=pd.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=s,this._hoverService=r,this._updateHistoryDelayer=new yr(500),this._state=this._register(new B1e),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!yk.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=_o(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const n=sM(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=_o(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=sM(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(s=>!s.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new Zb(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(m(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Qs=nM=LG([Ur(1,Ie),Ur(2,ps),Ur(3,Co),Ur(4,bi),Ur(5,Ms)],Qs);let oM=class extends Qs{constructor(e,t,i,n,s,r,a,l){super(e,i,r,a,s,l),this._contextViewService=t,this._keybindingService=n,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=tM.getOrCreate(r),this._replaceWidgetHistory=iM.getOrCreate(r)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new kF(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new s5(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};oM=LG([Ur(1,ud),Ur(2,Ie),Ur(3,st),Ur(4,bi),Ur(5,ps),Ur(6,Co),Ur(7,Ms)],oM);const j1e=DL(new kL({id:Tt.StartFindAction,label:H(947,"Find"),precondition:q.or(N.focus,q.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m(941,"&&Find"),order:1}}));j1e.addImplementation(0,(o,e,t)=>{const i=Qs.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}):!1});const q1e={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class K1e extends le{constructor(){super({id:Tt.StartFindWithArgs,label:H(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:q1e})}async run(e,t,i){const n=Qs.get(t);if(n){const s=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(50).loop},s),n.setGlobalBufferTerm(n.getState().searchString)}}}class G1e extends le{constructor(){super({id:Tt.StartFindWithSelection,label:H(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=Qs.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}async function kG(o,e){const t=Qs.get(o);if(!t)return;const i=()=>(e?t.moveToNextMatch():t.moveToPrevMatch())?(t.editor.pushUndoStop(),!0):!1;i()||(await t.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getState().searchString.length===0&&o.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:o.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:o.getOption(50).loop}),i())}const Z1e=DL(new kL({id:Tt.NextMatchFindAction,label:H(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:N.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:q.and(N.focus,yk),primary:3,weight:100}]}));Z1e.addImplementation(0,async(o,e,t)=>kG(e,!0));const Y1e=DL(new kL({id:Tt.PreviousMatchFindAction,label:H(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:N.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:q.and(N.focus,yk),primary:1027,weight:100}]}));Y1e.addImplementation(0,async(o,e,t)=>kG(e,!1));class X1e extends le{constructor(){super({id:Tt.GoToMatchFindAction,label:H(952,"Go to Match..."),precondition:pd}),this._highlightDecorations=[]}run(e,t,i){const n=Qs.get(t);if(!n)return;const s=n.getState().matchesCount;if(s<1){e.get(bi).notify({severity:g_.Warning,message:m(942,"No matches. Try searching for something else.")});return}const r=e.get(Jn),a=new z,l=a.add(r.createInputBox());l.placeholder=m(943,"Type a number to go to a specific match (between 1 and {0})",s);const c=h=>{const u=parseInt(h);if(isNaN(u))return;const g=n.getState().matchesCount;if(u>0&&u<=g)return u-1;if(u<0&&u>=-g)return g+u},d=h=>{const u=c(h);if(typeof u=="number"){l.validationMessage=void 0,n.goToMatch(u);const g=n.getState().currentMatch;g&&this.addDecorations(t,g)}else l.validationMessage=m(944,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(h=>{d(h)})),a.add(l.onDidAccept(()=>{const h=c(l.value);typeof h=="number"?(n.goToMatch(h),l.hide()):l.validationMessage=m(945,"Please type a number between 1 and {0}",n.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:hi(YU),position:jo.Full}}}])})}}class DG extends le{async run(e,t){const i=Qs.get(t);if(!i)return;const n=sM(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}class Q1e extends DG{constructor(){super({id:Tt.NextSelectionMatchFindAction,label:H(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class J1e extends DG{constructor(){super({id:Tt.PreviousSelectionMatchFindAction,label:H(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const eSe=DL(new kL({id:Tt.StartFindReplaceAction,label:H(955,"Replace"),precondition:q.or(N.focus,q.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m(946,"&&Replace"),order:2}}));eSe.addImplementation(0,(o,e,t)=>{if(!e.hasModel()||e.getOption(104))return!1;const i=Qs.get(e);if(!i)return!1;const n=e.getSelection(),s=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(50).seedSearchStringFromSelection!=="never"&&!s,a=s||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop})});Xe(Qs.ID,oM,0);se(K1e);se(G1e);se(X1e);se(Q1e);se(J1e);const ja=Ki.bindToContribution(Qs.get);re(new ja({id:Tt.CloseFindWidgetCommand,precondition:pd,handler:o=>o.closeFindWidget(),kbOpts:{weight:105,kbExpr:q.and(N.focus,q.not("isComposing")),primary:9,secondary:[1033]}}));re(new ja({id:Tt.ToggleCaseSensitiveCommand,precondition:void 0,handler:o=>o.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:N.focus,primary:A1.primary,mac:A1.mac,win:A1.win,linux:A1.linux}}));re(new ja({id:Tt.ToggleWholeWordCommand,precondition:void 0,handler:o=>o.toggleWholeWords(),kbOpts:{weight:105,kbExpr:N.focus,primary:O1.primary,mac:O1.mac,win:O1.win,linux:O1.linux}}));re(new ja({id:Tt.ToggleRegexCommand,precondition:void 0,handler:o=>o.toggleRegex(),kbOpts:{weight:105,kbExpr:N.focus,primary:F1.primary,mac:F1.mac,win:F1.win,linux:F1.linux}}));re(new ja({id:Tt.ToggleSearchScopeCommand,precondition:void 0,handler:o=>o.toggleSearchScope(),kbOpts:{weight:105,kbExpr:N.focus,primary:W1.primary,mac:W1.mac,win:W1.win,linux:W1.linux}}));re(new ja({id:Tt.TogglePreserveCaseCommand,precondition:void 0,handler:o=>o.togglePreserveCase(),kbOpts:{weight:105,kbExpr:N.focus,primary:B1.primary,mac:B1.mac,win:B1.win,linux:B1.linux}}));re(new ja({id:Tt.ReplaceOneAction,precondition:pd,handler:o=>o.replace(),kbOpts:{weight:105,kbExpr:N.focus,primary:3094}}));re(new ja({id:Tt.ReplaceOneAction,precondition:pd,handler:o=>o.replace(),kbOpts:{weight:105,kbExpr:q.and(N.focus,yF),primary:3}}));re(new ja({id:Tt.ReplaceAllAction,precondition:pd,handler:o=>o.replaceAll(),kbOpts:{weight:105,kbExpr:N.focus,primary:2563}}));re(new ja({id:Tt.ReplaceAllAction,precondition:pd,handler:o=>o.replaceAll(),kbOpts:{weight:105,kbExpr:q.and(N.focus,yF),primary:void 0,mac:{primary:2051}}}));re(new ja({id:Tt.SelectAllMatchesAction,precondition:pd,handler:o=>o.selectAllMatches(),kbOpts:{weight:105,kbExpr:N.focus,primary:515}}));const tSe={0:" ",1:"u",2:"r"},r8=65535,Ca=16777215,a8=4278190080;class jI{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<r8)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new jI(e.length),this._userDefinedStates=new jI(e.length),this._recoveredStates=new jI(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const s=e[e.length-1];return this.getStartLineNumber(s)<=i&&this.getEndLineNumber(s)>=n};for(let i=0,n=this._startIndexes.length;iCa||r>Ca)throw new Error("startLineNumber or endLineNumber must not exceed "+Ca);for(;e.length>0&&!t(s,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=s+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Ca}getEndLineNumber(e){return this._endIndexes[e]&Ca}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n>>24)+((this._endIndexes[e]&a8)>>>16);return t===r8?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(_)?(C=>CC=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?_=h:(_=d,_.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!n?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),_.source=0),d=r(++l)):(_=h,h.isCollapsed&&h.source===0&&(_.source=2)),h=a(++c);else{let b=c,C=h;for(;;){if(!C||C.startLineNumber>d.endLineNumber){_=d;break}if(C.source===1&&C.endLineNumber>d.endLineNumber)break;C=a(++b)}d=r(++l)}if(_){for(;g&&g.endLineNumber<_.startLineNumber;)g=u.pop();_.endLineNumber>_.startLineNumber&&_.startLineNumber>f&&_.endLineNumber<=i&&(!g||g.endLineNumber>=_.endLineNumber)&&(p.push(_),f=_.startLineNumber,g&&u.push(g),g=_)}}return p}}class iSe{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class nSe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new P,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Fo(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,n)=>i.regionIndex-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,s=-1,r=-1;const a=l=>{for(;nr&&(r=c),n++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),s=Math.max(s,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const s of e)if(!(s.startLineNumber>n.endLineNumber||n.startLineNumber>s.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const s of e){if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const r=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);(!s.checksum||r===s.checksum)&&t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,type:void 0,isCollapsed:s.isCollapsed??!0,source:s.source??0})}const n=Fo.sanitizeAndMerge(this._regions,t,i);this.updatePost(Fo.fromFoldRanges(n))}_getLinesChecksum(e,t){return uw(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),s=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,s))&&i.push(r),s++,n=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,s=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=n,a=this._regions.length;r1){const a=o.getRegionsInside(s,(l,c)=>l.isCollapsed!==r&&c0)for(const s of i){const r=o.getRegionAtLine(s);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=o.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);n.push(...r)}o.toggleCollapseState(n)}function sSe(o,e,t){const i=[];for(const n of t){const s=o.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);s.length>0&&i.push(s[0])}o.toggleCollapseState(i)}function oSe(o,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),s=o.getRegionsInside(null,n);o.toggleCollapseState(s)}function EG(o,e,t){const i=[];for(const r of t){const a=o.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,s=o.getRegionsInside(null,n);o.toggleCollapseState(s)}function r5(o,e,t){const i=o.textModel,n=o.regions,s=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&s.push(n.toRegion(r))}o.toggleCollapseState(s)}function a5(o,e,t){const i=o.regions,n=[];for(let s=i.length-1;s>=0;s--)t!==i.isCollapsed(s)&&e===i.getType(s)&&n.push(i.toRegion(s));o.toggleCollapseState(n)}function rSe(o,e){let t=null;const i=e.getRegionAtLine(o);if(i!==null&&(t=i.startLineNumber,o===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function aSe(o,e){let t=e.getRegionAtLine(o);if(t!==null&&t.startLineNumber===o){if(o!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function lSe(o,e){let t=e.getRegionAtLine(o);if(t!==null&&t.startLineNumber===o){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=n)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>o)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Lh(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,s=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return l8(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const s=r=>((!n||!dSe(r,n))&&(n=l8(this._hiddenRanges,r)),n?n.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function dSe(o,e){return o>=e.startLineNumber&&o<=e.endLineNumber}function l8(o,e){const t=jC(o,i=>e=0&&o[t].endLineNumber>=e?o[t]:null}const hSe=5e3,uSe="indent";class l5{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=uSe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(pSe(this.editorModel,i,n,this.foldingRangesLimit))}}let gSe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Ca||t>Ca)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),n=new Uint32Array(this._length);for(let s=this._length-1,r=0;s>=0;s--,r++)i[r]=this._startIndexes[s],n[r]=this._endIndexes[s];return new Fo(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let l=0;lt){n=l;break}i+=c}}const s=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=XL(h,s);(u{}};function pSe(o,e,t,i=fSe){const n=o.getOptions().tabSize,s=new gSe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=o.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=o.getLineCount();c>0;c--){const d=o.getLineContent(c),h=XL(d,n);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let g;if(r&&(g=d.match(r)))if(g[1]){let f=a.length-1;for(;f>0&&a[f].indent!==-2;)f--;if(f>0){a.length=f+1,u=a[f],s.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const f=u.endAbove-1;f-c>=1&&s.insertFirst(c,f,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return s.toIndentRanges(o)}const mSe=E("editor.foldBackground",{light:Re(Kd,.3),dark:Re(Kd,.3),hcDark:null,hcLight:null},m(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},m(1003,"Color of the collapsed text after the first line of a folded range."));E("editorGutter.foldingControlForeground",G0,m(1004,"Color of the folding control in the editor gutter."));const cx=Ht("folding-expanded",G.chevronDown,m(1005,"Icon for expanded ranges in the editor glyph margin.")),dx=Ht("folding-collapsed",G.chevronRight,m(1006,"Icon for collapsed ranges in the editor glyph margin.")),c8=Ht("folding-manual-collapsed",dx,m(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),d8=Ht("folding-manual-expanded",cx,m(1008,"Icon for manually expanded ranges in the editor glyph margin.")),qI={color:hi(mSe),position:1},Bf=m(1009,"Click to expand the range."),Z1=m(1010,"Click to collapse the range.");class Io{static{this.COLLAPSED_VISUAL_DECORATION=Te.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:Bf,firstLineDecorationClassName:Se.asClassName(dx)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Te.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:qI,isWholeLine:!0,linesDecorationsTooltip:Bf,firstLineDecorationClassName:Se.asClassName(dx)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Te.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:Bf,firstLineDecorationClassName:Se.asClassName(c8)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Te.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:qI,isWholeLine:!0,linesDecorationsTooltip:Bf,firstLineDecorationClassName:Se.asClassName(c8)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Te.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:Bf})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Te.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:qI,isWholeLine:!0,linesDecorationsTooltip:Bf})}static{this.EXPANDED_VISUAL_DECORATION=Te.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Se.asClassName(cx),linesDecorationsTooltip:Z1})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Te.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Se.asClassName(cx),linesDecorationsTooltip:Z1})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Te.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Se.asClassName(d8),linesDecorationsTooltip:Z1})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Te.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Se.asClassName(d8),linesDecorationsTooltip:Z1})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Te.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Te.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Io.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Io.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Io.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Io.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Io.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Io.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Io.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Io.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Io.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Io.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Io.MANUALLY_EXPANDED_VISUAL_DECORATION:Io.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const _Se={},bSe="syntax";class c5{constructor(e,t,i,n,s){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=s,this.id=bSe,this.disposables=new z,s&&this.disposables.add(s);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return CSe(this.providers,this.editorModel,e).then(t=>this.editorModel.isDisposed()?null:t?wSe(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function CSe(o,e,t){let i=null;const n=o.map((s,r)=>Promise.resolve(s.provideFoldingRanges(e,_Se,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},Ri));return Promise.all(n).then(s=>i)}class vSe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Ca||t>Ca)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=n,this._types[s]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let n=0;ne){i=a;break}t+=l}}const n=new Uint32Array(e),s=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new vSe(e);let n;const s=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,s.length);else if(r.start>n.start)if(r.end<=n.end)s.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,s.length);else{if(r.start>n.end){do n=s.pop();while(n&&r.start>n.end);n&&s.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,s.length)}return i.toIndentRanges()}var SSe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},j_=function(o,e){return function(t,i){e(t,i,o)}},gb;const Dn=new oe("foldingEnabled",!1);let Th=class extends A{static{gb=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(gb.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return gb._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,n,s,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new z),this.editor=e,this._foldingLimitReporter=this._register(new NG(e));const a=this.editor.getOptions();this._isEnabled=a.get(52),this._useFoldingProviders=a.get(53)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(55),this.updateDebounceInfo=s.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Io(e),this.foldingDecorationProvider.showFoldingControls=a.get(126),this.foldingDecorationProvider.showFoldingHighlights=a.get(54),this.foldingEnabled=Dn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(56)&&this.onModelChanged(),l.hasChanged(126)||l.hasChanged(54)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(126),this.foldingDecorationProvider.showFoldingHighlights=c.get(54),this.triggerFoldingModelChanged()}l.hasChanged(53)&&(this._useFoldingProviders=this.editor.getOptions().get(53)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),l.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new nSe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new cSe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new yr(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new St(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new l5(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=gb.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new c5(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new rn,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=$i(s=>i.compute(s));return n.then(s=>{if(s&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=s.setCollapsedAllOfType(df.Imports.value,!0);c&&(r=Wa.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(s,ySe(a)),r?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Ee(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const n=[];for(const s of i){const r=s.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,Ee)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const n=e.target.detail,s=e.target.element.offsetLeft;if(n.offsetX-s<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,s=e.target.range;if(!s||s.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||s.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(n||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Th=gb=SSe([j_(1,Ie),j_(2,ti),j_(3,bi),j_(4,Rr),j_(5,he)],Th);class NG extends A{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new P),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class zn extends le{runEditorCommand(e,t,i){const n=e.get(ti),s=Th.get(t);if(!s)return;const r=s.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(s,a,t,i,n);const l=t.getSelection();l&&s.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function ySe(o){return!o||o.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of o){const n=i.startLineNumber;if(n>=e&&n<=t)return!0}return!1}}}function TG(o){if(!Yn(o)){if(!Ui(o))return!1;const e=o;if(!Yn(e.levels)&&!qc(e.levels)||!Yn(e.direction)&&!nn(e.direction)||!Yn(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(qc)))return!1}return!0}class xSe extends zn{constructor(){super({id:"editor.unfold",label:H(982,"Unfold"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:wY,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?bY(t,!1,s,r):X_(t,!1,s,r)}}class zye extends Yn{constructor(){super({id:"editor.unfoldRecursively",label:H(983,"Unfold Recursively"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2142),weight:100}})}invoke(e,t,i,n){X_(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Uye extends Yn{constructor(){super({id:"editor.fold",label:H(984,"Fold"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:TG,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?IG(t,!1,s,r):w_(t,!1,s,r)}}class LSe extends zn{constructor(){super({id:"editor.unfoldRecursively",label:H(983,"Unfold Recursively"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2142),weight:100}})}invoke(e,t,i,n){w_(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class kSe extends zn{constructor(){super({id:"editor.fold",label:H(984,"Fold"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:wY,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?wye(t,!0,s):a==="up"?bY(t,!0,r||1,s):X_(t,!0,r||1,s)}}class $ye extends Yn{constructor(){super({id:"editor.toggleFold",label:H(985,"Toggle Fold"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);_3(t,1,n)}}class jye extends Yn{constructor(){super({id:"editor.foldRecursively",label:H(986,"Fold Recursively"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);X_(t,!0,Number.MAX_VALUE,n)}}class qye extends Yn{constructor(){super({id:"editor.toggleFoldRecursively",label:H(987,"Toggle Fold Recursively"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);_3(t,Number.MAX_VALUE,n)}}class Kye extends Yn{constructor(){super({id:"editor.foldAllBlockComments",label:H(988,"Fold All Block Comments"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())C3(t,Mf.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Eo(a.blockCommentStartToken));b3(t,l,!0)}}}}class Gye extends Yn{constructor(){super({id:"editor.foldAllMarkerRegions",label:H(989,"Fold All Regions"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())C3(t,Mf.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);b3(t,l,!0)}}}}class Zye extends Yn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:H(990,"Unfold All Regions"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())C3(t,Mf.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);b3(t,l,!1)}}}}class Yye extends Yn{constructor(){super({id:"editor.foldAllExcept",label:H(991,"Fold All Except Selected"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);CY(t,!0,n)}}class Xye extends Yn{constructor(){super({id:"editor.unfoldAllExcept",label:H(992,"Unfold All Except Selected"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);CY(t,!1,n)}}class Qye extends Yn{constructor(){super({id:"editor.foldAll",label:H(993,"Fold All"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2069),weight:100}})}invoke(e,t,i){X_(t,!0)}}class Jye extends Yn{constructor(){super({id:"editor.unfoldAll",label:H(994,"Unfold All"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2088),weight:100}})}invoke(e,t,i){X_(t,!1)}}class pw extends Yn{static{this.ID_PREFIX="editor.foldLevel"}static{this.ID=e=>pw.ID_PREFIX+e}getFoldingLevel(){return parseInt(this.id.substr(pw.ID_PREFIX.length))}invoke(e,t,i){Sye(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}class eLe extends Yn{constructor(){super({id:"editor.gotoParentFold",label:H(995,"Go to Parent Fold"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=yye(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class tLe extends Yn{constructor(){super({id:"editor.gotoPreviousFold",label:H(996,"Go to Previous Folding Range"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=Lye(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class iLe extends Yn{constructor(){super({id:"editor.gotoNextFold",label:H(997,"Go to Next Folding Range"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=xye(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class nLe extends Yn{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:H(998,"Create Folding Range from Selection"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2135),weight:100}})}invoke(e,t,i){const n=[],s=i.getSelections();if(s){for(const r of s){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(n.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,l)=>a.startLineNumber-l.startLineNumber);const r=Xo.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(Xo.fromFoldRanges(r))}}}}class sLe extends Yn{constructor(){super({id:"editor.removeManualFoldingRanges",label:H(999,"Remove Manual Folding Ranges"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const s=[];for(const r of n){const{startLineNumber:a,endLineNumber:l}=r;s.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(s),e.triggerFoldingModelChanged()}}}class oLe extends Yn{constructor(){super({id:"editor.toggleImportFold",label:H(1e3,"Toggle Import Fold"),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],n=t.regions;for(let s=n.length-1;s>=0;s--)n.getType(s)===Mf.Imports.value&&i.push(n.toRegion(s));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}}nt(Qh.ID,Qh,0);oe(Vye);oe(zye);oe(Uye);oe(jye);oe(qye);oe(Qye);oe(Jye);oe(Kye);oe(Gye);oe(Zye);oe(Yye);oe(Xye);oe($ye);oe(eLe);oe(tLe);oe(iLe);oe(nLe);oe(sLe);oe(oLe);for(let o=1;o<=7;o++)Qie(new pw({id:pw.ID(o),label:H(1001,"Fold Level {0}",o),precondition:Pn,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2048|21+o),weight:100}}));it.registerCommand("_executeFoldingRangeProvider",async function(o,...e){const[t]=e;if(!(t instanceof be))throw Rr();const i=o.get(ue),n=o.get(ri).getModel(t);if(!n)throw Rr();const s=o.get(Oe);if(!s.getValue("editor.folding",{resource:t}))return[];const r=o.get(ai),a=s.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:t})},update:(g,f)=>{}},c=new v3(n,r,l);let d=c;if(a!=="indentation"){const g=Qh.getFoldingRangeProviders(i,n);g.length&&(d=new w3(n,g,()=>{},l,c))}const h=await d.compute($e.None),u=[];try{if(h)for(let g=0;gCi.replace(D.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",s.map(r=>Ci.replaceMove(D.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class YH{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class cLe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(YH.toKey(e))}has(e){return this._set.has(YH.toKey(e))}}function SY(o,e,t){const i=[],n=new cLe,s=o.ordered(t);for(const a of s)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class __{static{this._selectors=new bs}static setFormatterSelector(e){return{dispose:__._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const s=Je.first(__._selectors);if(s)return await s(e,t,i,n)}}async function yY(o,e,t,i,n,s,r){const a=o.get(pe),{documentRangeFormattingEditProvider:l}=o.get(ue),c=il(e)?e.getModel():e,d=l.ordered(c),h=await __.select(d,c,i,2);h&&(n.report(h),await a.invokeFunction(dLe,h,e,t,s,r))}async function dLe(o,e,t,i,n,s){const r=o.get(uo),a=o.get(Ht),l=o.get(Td);let c,d;il(t)?(c=t.getModel(),d=new Ld(t,5,void 0,n)):(c=t,d=new w5(t,n));const h=[];let u=0;for(const b of b4(i).sort(D.compareRangesUsingStarts))u>0&&D.areIntersectingOrTouching(h[u-1],b)?h[u-1]=D.fromPositions(h[u-1].getStartPosition(),b.getEndPosition()):u=h.push(b);const g=async b=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,b);const C=await e.provideDocumentRangeFormattingEdits(c,b,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,C),C},f=(b,C)=>{if(!b.length||!C.length)return!1;const w=b.reduce((v,S)=>D.plusRange(v,S.range),b[0].range);if(!C.some(v=>D.intersectRanges(w,v.range)))return!1;for(const v of b)for(const S of C)if(D.intersectRanges(v.range,S.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const b=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),_.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;_.push(await g(b))}for(let b=0;b({text:w.text,range:D.lift(w.range),forceMoveMarkers:!0})),w=>{for(const{range:v}of w)if(D.areIntersectingOrTouching(v,C))return[new le(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn)];return null})}return l.playSignal(tt.format,{userGesture:s}),!0}async function hLe(o,e,t,i,n,s){const r=o.get(pe),a=o.get(ue),l=il(e)?e.getModel():e,c=SY(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await __.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(uLe,d,e,t,n,s))}async function uLe(o,e,t,i,n,s){const r=o.get(uo),a=o.get(Td);let l,c;il(t)?(l=t.getModel(),c=new Ld(t,5,void 0,n)):(l=t,c=new w5(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(il(t))m_.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new le(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(g=>({text:g.text,range:D.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(D.areIntersectingOrTouching(f,u))return[new le(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(tt.format,{userGesture:s}),!0}async function gLe(o,e,t,i,n,s){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,s)).catch(Bi);if(ws(l))return await o.computeMoreMinimalEdits(t.uri,l)}}async function fLe(o,e,t,i,n){const s=SY(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of s){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Bi);if(ws(a))return await o.computeMoreMinimalEdits(t.uri,a)}}function LY(o,e,t,i,n,s,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,s,r)).catch(Bi).then(l=>o.computeMoreMinimalEdits(t.uri,l))}it.registerCommand("_executeFormatRangeProvider",async function(o,...e){const[t,i,n]=e;rt(be.isUri(t)),rt(D.isIRange(i));const s=o.get(ys),r=o.get(uo),a=o.get(ue),l=await s.createModelReference(t);try{return gLe(r,a,l.object.textEditorModel,D.lift(i),n,$e.None)}finally{l.dispose()}});it.registerCommand("_executeFormatDocumentProvider",async function(o,...e){const[t,i]=e;rt(be.isUri(t));const n=o.get(ys),s=o.get(uo),r=o.get(ue),a=await n.createModelReference(t);try{return fLe(s,r,a.object.textEditorModel,i,$e.None)}finally{a.dispose()}});it.registerCommand("_executeFormatOnTypeProvider",async function(o,...e){const[t,i,n,s]=e;rt(be.isUri(t)),rt(R.isIPosition(i)),rt(typeof n=="string");const r=o.get(ys),a=o.get(uo),l=o.get(ue),c=await r.createModelReference(t);try{return LY(a,l,c.object.textEditorModel,R.lift(i),n,s,$e.None)}finally{c.dispose()}});var xY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},FC=function(o,e){return function(t,i){e(t,i,o)}};let rx=class{static{this.ID="editor.contrib.autoFormat"}constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new z,this._sessionDisposables=new z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(s=>{s.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new Ey;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const s=n.charCodeAt(n.length-1);i.has(s)&&this._trigger(String.fromCharCode(s))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new Jt,s=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),s.dispose();return}for(let a=0,l=r.changes.length;a{n.token.isCancellationRequested||ws(r)&&(this._accessibilitySignalService.playSignal(tt.format,{userGesture:!1}),m_.execute(this._editor,r,!0))}).finally(()=>{s.dispose()})}};rx=xY([FC(1,ue),FC(2,uo),FC(3,Td)],rx);let ax=class{static{this.ID="editor.contrib.formatOnPaste"}constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new z,this._callOnModel=new z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(yY,this.editor,e,2,Jc.None,$e.None,!1).catch(Te))}};ax=xY([FC(1,ue),FC(2,pe)],ax);class pLe extends de{constructor(){super({id:"editor.action.formatDocument",label:H(1014,"Format Document"),precondition:K.and(N.notInCompositeEditor,N.writable,N.hasDocumentFormattingProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(pe);await e.get(yd).showWhile(i.invokeFunction(hLe,t,1,Jc.None,$e.None,!0),250)}}}class mLe extends de{constructor(){super({id:"editor.action.formatSelection",label:H(1015,"Format Selection"),precondition:K.and(N.writable,N.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2084),weight:100},contextMenuOpts:{when:N.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(pe),n=t.getModel(),s=t.getSelections().map(a=>a.isEmpty()?new D(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(yd).showWhile(i.invokeFunction(yY,t,s,1,Jc.None,$e.None,!0),250)}}nt(rx.ID,rx,2);nt(ax.ID,ax,2);oe(pLe);oe(mLe);it.registerCommand("editor.action.format",async o=>{const e=o.get(at).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=o.get(Vt);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var _Le=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nN=function(o,e){return function(t,i){e(t,i,o)}};class Gp{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;t.children.get(n)!==void 0;s++)n=`${i}_${s}`;return n}static empty(e){return e.children.size===0}}class b2 extends Gp{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class DY extends Gp{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class Hc extends Gp{static create(e,t,i){const n=new Jt(i),s=new Hc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{const h=Gp.findId(`provider_${d}`,s),u=new DY(h,s,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,n.token)).then(g=>{for(const f of g||[])Hc._makeOutlineElement(f,u);return u},g=>(Bi(g),u)).then(g=>{Gp.empty(g)?g.remove():s._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Qt(c,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Hc.create(e,t,i):s._compact()).finally(()=>{n.dispose(),l.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=Gp.findId(e,t),n=new b2(i,t,e);if(e.children)for(const s of e.children)Hc._makeOutlineElement(s,n);t.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Je.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof b2?e.push(t.symbol):e.push(...Je.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>D.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Hc._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>R.compare(D.getStartPosition(i.range),D.getStartPosition(n.range))||R.compare(D.getEndPosition(n.range),D.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Hc._flattenDocumentSymbols(e,n.children,n.name)}}const N1=Ve("IOutlineModelService");let C2=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new z,this._cache=new ba(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let s=this._cache.get(e.id);if(!s||s.versionId!==e.getVersionId()||!Qt(s.provider,n)){const a=new Jt;s={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Hc.create(i,e,a.token),model:void 0},this._cache.set(e.id,s);const l=Date.now();s.promise.then(c=>{s.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(s.model)return s.model;s.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--s.promiseCnt===0&&(s.source.cancel(),this._cache.delete(e.id))});try{return await s.promise}finally{r.dispose()}}};C2=_Le([nN(0,ue),nN(1,qr),nN(2,ri)],C2);Ge(N1,C2,1);it.registerCommand("_executeDocumentSymbolProvider",async function(o,...e){const[t]=e;rt(be.isUri(t));const i=o.get(N1),s=await o.get(ys).createModelReference(t);try{return(await i.getOrCreate(s.object.textEditorModel,$e.None)).getTopLevelSymbols()}finally{s.dispose()}});const Rk=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};var bLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CLe=function(o,e){return function(t,i){e(t,i,o)}};function vLe(o){return o instanceof kY?o._instance:o}let kY=class{constructor(e){this.instantiationService=e}init(...e){}};function wLe(o){return o.get()}let XH=class extends kY{constructor(e,t){super(t),this.init(e)}};XH=bLe([CLe(1,pe)],XH);class T1{validateOrThrow(e){const t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}}class Mk extends T1{constructor(e){super(),this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}}const SLe=new Mk("string");function yLe(){return SLe}new Mk("number");const LLe=new Mk("boolean");function QH(){return LLe}new Mk("object");class IY extends T1{validate(e){return e!==void 0?{content:void 0,error:{message:`Expected undefined, but got ${typeof e}`}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}}function xLe(){return new IY}class v2{constructor(e){this.validator=e}}function sN(o){return new v2(o)}class DLe extends T1{constructor(e){super(),this.properties=e}validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};const t={};for(const i in this.properties){const n=this.properties[i],s=e[i],r=n instanceof v2,a=r?n.validator:n;if(r&&s===void 0)continue;const{content:l,error:c}=a.validate(s);if(c)return{content:void 0,error:{message:`Error in property '${i}': ${c.message}`}};t[i]=l}return{content:t,error:void 0}}getJSONSchema(){const e=[],t={};for(const[n,s]of Object.entries(this.properties)){const r=s instanceof v2,a=r?s.validator:s;t[n]=a.getJSONSchema(),r||e.push(n)}return{type:"object",properties:t,...e.length>0?{required:e}:{}}}}function kLe(o){return new DLe(o)}class ILe extends T1{constructor(e){super(),this.validators=e}validate(e){let t;for(const i of this.validators){const{content:n,error:s}=i.validate(e);if(!s)return{content:n,error:void 0};t=s}return{content:void 0,error:t}}getJSONSchema(){return{oneOf:_te(this.validators,e=>{if(!(e instanceof IY))return e.getJSONSchema()})}}}function ELe(...o){return new ILe(o)}class NLe extends T1{constructor(e,t){super(),this._ref=e,this._validator=t}validate(e){return this._validator.validate(e)}getJSONSchema(){return{$ref:this._ref}}}function TLe(o,e){return new NLe(o,e)}const ze={Visible:O5,HasFocusedSuggestion:new re("suggestWidgetHasFocusedSuggestion",!1,m(1455,"Whether any suggestion is focused")),DetailsVisible:new re("suggestWidgetDetailsVisible",!1,m(1456,"Whether suggestion details are visible")),MultipleSuggestions:new re("suggestWidgetMultipleSuggestions",!1,m(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new re("suggestionMakesTextEdit",!0,m(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new re("acceptSuggestionOnEnter",!0,m(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new re("suggestionHasInsertAndReplaceRange",!1,m(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new re("suggestionInsertMode",void 0,{type:"string",description:m(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new re("suggestionCanResolve",!1,m(1462,"Whether the current suggestion supports to resolve further details"))},Fh=new M("suggestWidgetStatusBar");class RLe{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=ga.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,D.isIRange(t.range)?(this.editStart=new R(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new R(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new R(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new R(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new R(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new R(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range.insert)||D.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof n.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new fn(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{hr(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class R1{static{this.default=new R1}constructor(e=2,t=new Set,i=new Set,n=new Map,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=s}}class MLe{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function S3(o,e,t,i=R1.default,n={triggerKind:0},s=$e.None){const r=new fn;t=t.clone();const a=e.getWordAtPosition(t),l=a?new D(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):D.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],h=new z,u=[];let g=!1;const f=(_,b,C)=>{let w=!1;if(!b)return w;for(const v of b.suggestions)if(!i.kindFilter.has(v.kind)){if(!i.showDeprecated&&v?.tags?.includes(1))continue;v.range||(v.range=c),v.sortText||(v.sortText=typeof v.label=="string"?v.label:v.label.label),!g&&v.insertTextRules&&v.insertTextRules&4&&(g=df.guessNeedsClipboard(v.insertText)),d.push(new RLe(t,v,b,_)),w=!0}return Lf(b)&&h.add(b),u.push({providerName:_._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:C.elapsed()}),w},p=(async()=>{})();for(const _ of o.orderedGroups(e)){let b=!1;if(await Promise.all(_.map(async C=>{if(i.providerItemsToReuse.has(C)){const w=i.providerItemsToReuse.get(C);w.forEach(v=>d.push(v)),b=b||w.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(C)))try{const w=new fn,v=await C.provideCompletionItems(e,t,n,s);b=f(C,v,w)||b}catch(w){Bi(w)}})),b||s.isCancellationRequested)break}return await p,s.isCancellationRequested?(h.dispose(),Promise.reject(new Ar)):new MLe(d.sort(OLe(i.snippetSortOrder)),g,{entries:u,elapsed:r.elapsed()},h)}function y3(o,e){if(o.sortTextLow&&e.sortTextLow){if(o.sortTextLowe.sortTextLow)return 1}return o.textLabele.textLabel?1:o.completion.kind-e.completion.kind}function PLe(o,e){if(o.completion.kind!==e.completion.kind){if(o.completion.kind===28)return-1;if(e.completion.kind===28)return 1}return y3(o,e)}function ALe(o,e){if(o.completion.kind!==e.completion.kind){if(o.completion.kind===28)return 1;if(e.completion.kind===28)return-1}return y3(o,e)}const Pk=new Map;Pk.set(0,PLe);Pk.set(2,ALe);Pk.set(1,y3);function OLe(o){return Pk.get(o)}it.registerCommand("_executeCompletionItemProvider",async(o,...e)=>{const[t,i,n,s]=e;rt(be.isUri(t)),rt(R.isIPosition(i)),rt(typeof n=="string"||!n),rt(typeof s=="number"||!s);const{completionProvider:r}=o.get(ue),a=await o.get(ys).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),h=await S3(r,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?1:0});for(const u of h.items)c.length<(s??0)&&c.push(u.resolve($e.None)),l.incomplete=l.incomplete||u.container.incomplete,l.suggestions.push(u.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function FLe(o,e){o.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class Zp{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}class Tt{static{this.inlineSuggestionVisible=new re("inlineSuggestionVisible",!1,m(1192,"Whether an inline suggestion is visible"))}static{this.inlineSuggestionHasIndentation=new re("inlineSuggestionHasIndentation",!1,m(1193,"Whether the inline suggestion starts with whitespace"))}static{this.inlineSuggestionHasIndentationLessThanTabSize=new re("inlineSuggestionHasIndentationLessThanTabSize",!0,m(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"))}static{this.suppressSuggestions=new re("inlineSuggestionSuppressSuggestions",void 0,m(1195,"Whether suggestions should be suppressed for the current suggestion"))}static{this.cursorBeforeGhostText=new re("cursorBeforeGhostText",!1,m(1196,"Whether the cursor is at ghost text"))}static{this.cursorInIndentation=new re("cursorInIndentation",!1,m(1197,"Whether the cursor is in indentation"))}static{this.hasSelection=new re("editor.hasSelection",!1,m(1198,"Whether the editor has a selection"))}static{this.cursorAtInlineEdit=new re("cursorAtInlineEdit",!1,m(1199,"Whether the cursor is at an inline edit"))}static{this.inlineEditVisible=new re("inlineEditIsVisible",!1,m(1200,"Whether an inline edit is visible"))}static{this.tabShouldJumpToInlineEdit=new re("tabShouldJumpToInlineEdit",!1,m(1201,"Whether tab should jump to an inline edit."))}static{this.tabShouldAcceptInlineEdit=new re("tabShouldAcceptInlineEdit",!1,m(1202,"Whether tab should accept the inline edit."))}static{this.inInlineEditsPreviewEditor=new re("inInlineEditsPreviewEditor",!0,m(1203,"Whether the current code editor is showing an inline edits preview"))}}class WLe{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=BLe(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,s=i.length;na.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let n=0,s=0;const r=e.length;for(let a=1,l=o.getLineCount();a<=l;a++){const c=o.getLineContent(a),d=c.length+1;let h=0;if(s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},VLe=function(o,e){return function(t,i){e(t,i,o)}};let w2=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberC===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?e.getLineContent(h):e.getLineContent(C)},b=dC(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const C=Rt(e.getLineContent(h)),w=mo(b,a),v=mo(C,a);w!==v&&(g=WC(w,a,c)+this.trimStart(u))}}t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),g+` -`);const p=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,g);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,p);else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.tokenization.getLineTokens(C-1):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?g:C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.getLineContent(C-1):e.getLineContent(C)},b=dC(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const C=Rt(e.getLineContent(r.startLineNumber)),w=mo(b,a),v=mo(C,a);if(w!==v){const S=w-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),g+` -`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new D(h,1,h+1,1),null),t.addEditOperation(new D(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` -`+u),this.shouldAutoIndent(e,r)){const g={tokenization:{getLineTokens:p=>p===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(p),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:p=>p===h?e.getLineContent(r.startLineNumber):e.getLineContent(p)},f=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,f);else{const p=dC(this._autoIndent,g,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(p!==null){const _=Rt(e.getLineContent(r.startLineNumber)),b=mo(p,a),C=mo(_,a);if(b!==C){const w=b-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Vr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Vr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===Ui.None||s.indentAction===Ui.Indent?r=s.indentation+s.appendText:s.indentAction===Ui.IndentOutdent?r=s.indentation:s.indentAction===Ui.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=Rt(e.getLineContent(n));let c=Rt(r);const d=W$(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=mo(c,i),u=mo(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(ua(r)>=0){const a=e.getLineMaxColumn(s),l=am(this._autoIndent,e,new D(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(ua(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=am(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),ua(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=am(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=Rt(l),h=mo(c,n)+r,u=WC(h,n,s);u!==c&&(t.addEditOperation(new D(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(S2._COLLATOR.value.compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function zLe(o,e,t){const i=NY(o,e,t);return i?Ci.replace(new D(i.startLineNumber,1,i.endLineNumber,o.getLineMaxColumn(i.endLineNumber)),i.after.join(` -`)):null}class TY extends de{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>D.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r=u.startLineNumber;b--)g.push(i.getLineContent(b));const f=Ci.replace(u,g.join(` -`));r.push(f);const p=function(b){return b<=u.endLineNumber?u.endLineNumber-b+u.startLineNumber:b},_=function(b){if(b.isEmpty())return new le(p(b.positionLineNumber),b.positionColumn,p(b.positionLineNumber),b.positionColumn);{const C=p(b.selectionStartLineNumber),w=p(b.positionLineNumber),v=b.selectionStartColumn,S=b.positionColumn;return new le(C,v,w,S)}};a.push(_(d))}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}}class L3 extends de{static{this.ID="editor.action.trimTrailingWhitespace"}constructor(){super({id:L3.ID,label:H(1258,"Trim Trailing Whitespace"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new R(d.positionLineNumber,d.positionColumn)));const s=t.getSelection();if(s===null)return;const r=e.get(Oe),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),c=new WLe(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}}class QLe extends de{constructor(){super({id:"editor.action.deleteLines",label:H(1259,"Delete Line"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(Ci.replace(new le(h,g,u,f),"")),a.push(new le(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumbers.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class JLe extends de{constructor(){super({id:"editor.action.indentLines",label:H(1260,"Indent Line"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,th.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class exe extends de{constructor(){super({id:"editor.action.outdentLines",label:H(1261,"Outdent Line"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(e,t){lm.Outdent.runEditorCommand(e,t,null)}}class Ak extends de{static{this.ID="editor.action.insertLineBefore"}constructor(){super({id:Ak.ID,label:H(1262,"Insert Line Above"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,kD.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Ok extends de{static{this.ID="editor.action.insertLineAfter"}constructor(){super({id:Ok.ID,label:H(1263,"Insert Line Below"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,kD.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class PY extends de{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;lCi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class txe extends PY{constructor(){super({id:"deleteAllLeft",label:H(1264,"Delete All Left"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach(r=>{let a;if(r.endColumn===1&&s>0){const l=r.startLineNumber-s;a=new le(l,r.startColumn,l,r.startColumn)}else a=new le(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);s+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(D.compareRangesUsingStarts),i=i.map(s=>{if(s.isEmpty())if(s.startColumn===1){const r=Math.max(1,s.startLineNumber-1),a=s.startLineNumber===1?1:n.getLineLength(r)+1;return new D(r,a,s.startLineNumber,1)}else return new D(s.startLineNumber,1,s.startLineNumber,s.startColumn);else return new D(s.startLineNumber,1,s.endLineNumber,s.endColumn)}),i)}}class ixe extends PY{constructor(){super({id:"deleteAllRight",label:H(1265,"Delete All Right"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];for(let s=0,r=t.length,a=0;s{if(s.isEmpty()){const r=t.getLineMaxColumn(s.startLineNumber);return s.startColumn===r?new D(s.startLineNumber,s.startColumn,s.startLineNumber+1,1):new D(s.startLineNumber,s.startColumn,s.startLineNumber,r)}return s});return n.sort(D.compareRangesUsingStarts),n}}class nxe extends de{constructor(){super({id:"editor.action.joinLines",label:H(1266,"Join Lines"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(D.compareRangesUsingStarts);const s=[],r=i.reduce((u,g)=>u.isEmpty()?u.endLineNumber===g.startLineNumber?(n.equalsSelection(u)&&(n=g),g):g.startLineNumber>u.endLineNumber+1?(s.push(u),g):new le(u.startLineNumber,u.startColumn,g.endLineNumber,g.endColumn):g.startLineNumber>u.endLineNumber?(s.push(u),g):new le(u.startLineNumber,u.startColumn,g.endLineNumber,g.endColumn));s.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=n,h=0;for(let u=0,g=s.length;u=1){let T=!0;S===""&&(T=!1),T&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(T=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const A=k.substr(I-1);S+=(T?" ":"")+A,T?b=A.length+1:b=A.length}else b=0}const L=new D(p,_,C,w);if(!L.isEmpty()){let x;f.isEmpty()?(l.push(Ci.replace(L,S)),x=new le(L.startLineNumber-h,S.length-b+1,p-h,S.length-b+1)):f.startLineNumber===f.endLineNumber?(l.push(Ci.replace(L,S)),x=new le(f.startLineNumber-h,f.startColumn,f.endLineNumber-h,f.endColumn)):(l.push(Ci.replace(L,S)),x=new le(f.startLineNumber-h,f.startColumn,f.startLineNumber-h,S.length-v)),D.intersectRanges(L,n)!==null?d=x:c.push(x)}h+=L.endLineNumber-L.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class sxe extends de{constructor(){super({id:"editor.action.transpose",label:H(1267,"Transpose Characters around the Cursor"),precondition:N.writable,canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const s=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===n.getLineCount())continue;const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");s.push(new jn(new le(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u))}else{const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),u=n.getValueInRange(h).split("").reverse().join("");s.push(new M4(h,u,new le(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Uf extends de{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const s=t.getOption(148),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new D(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),h=n.getValueInRange(d);r.push(Ci.replace(d,this._modifyText(h,s)))}else{const l=n.getValueInRange(a);r.push(Ci.replace(a,this._modifyText(l,s)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class oxe extends Uf{constructor(){super({id:"editor.action.transformToUppercase",label:H(1268,"Transform to Uppercase"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleUpperCase()}}class rxe extends Uf{constructor(){super({id:"editor.action.transformToLowercase",label:H(1269,"Transform to Lowercase"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleLowerCase()}}class fa{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class lx extends Uf{static{this.titleBoundary=new fa("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu")}constructor(){super({id:"editor.action.transformToTitlecase",label:H(1270,"Transform to Title Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=lx.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}}class Dm extends Uf{static{this.caseBoundary=new fa("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new fa("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu")}constructor(){super({id:"editor.action.transformToSnakecase",label:H(1271,"Transform to Snake Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Dm.caseBoundary.get(),n=Dm.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}class Wg extends Uf{static{this.singleLineWordBoundary=new fa("[_\\s-]+","gm")}static{this.multiLineWordBoundary=new fa("[_-]+","gm")}static{this.validWordStart=new fa("^(\\p{Lu}[^\\p{Lu}])","gmu")}constructor(){super({id:"editor.action.transformToCamelcase",label:H(1272,"Transform to Camel Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=/\r\n|\r|\n/.test(e)?Wg.multiLineWordBoundary.get():Wg.singleLineWordBoundary.get(),n=Wg.validWordStart.get();if(!i||!n)return e;const s=e.split(i);return s.shift()?.replace(n,a=>a.toLocaleLowerCase())+s.map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}}class km extends Uf{static{this.wordBoundary=new fa("[_ \\t-]","gm")}static{this.wordBoundaryToMaintain=new fa("(?<=\\.)","gm")}static{this.upperCaseWordMatcher=new fa("^\\p{Lu}+$","mu")}constructor(){super({id:"editor.action.transformToPascalcase",label:H(1273,"Transform to Pascal Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=km.wordBoundary.get(),n=km.wordBoundaryToMaintain.get(),s=km.upperCaseWordMatcher.get();return!i||!n||!s?e:e.split(n).map(l=>l.split(i)).flat().map(l=>{const c=l.charAt(0).toLocaleUpperCase()+l.slice(1);return c.length>1&&s.test(c)?c.charAt(0)+c.slice(1).toLocaleLowerCase():c}).join("")}}class Im extends Uf{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}static{this.caseBoundary=new fa("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new fa("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu")}static{this.underscoreBoundary=new fa("(\\S)(_)(\\S)","gm")}constructor(){super({id:"editor.action.transformToKebabcase",label:H(1274,"Transform to Kebab Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Im.caseBoundary.get(),n=Im.singleLetters.get(),s=Im.underscoreBoundary.get();return!i||!n||!s?e:e.replace(s,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}}oe(ULe);oe($Le);oe(jLe);oe(qLe);oe(KLe);oe(GLe);oe(ZLe);oe(YLe);oe(L3);oe(QLe);oe(JLe);oe(exe);oe(Ak);oe(Ok);oe(txe);oe(ixe);oe(nxe);oe(sxe);oe(oxe);oe(rxe);oe(XLe);Dm.caseBoundary.isSupported()&&Dm.singleLetters.isSupported()&&oe(Dm);Wg.singleLineWordBoundary.isSupported()&&Wg.multiLineWordBoundary.isSupported()&&oe(Wg);km.wordBoundary.isSupported()&&oe(km);lx.titleBoundary.isSupported()&&oe(lx);Im.isSupported()&&oe(Im);const x3=Ve("dataChannelService");class axe{getDataChannel(e){return{sendData:()=>{}}}}var lxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},JH=function(o,e){return function(t,i){e(t,i,o)}};function cxe(o){return o.sourceId+" @@ "+JSON.stringify({...o,modelUri:o.modelUri?.toString(),sourceId:void 0})}let cx=class extends F{static cast(){return this}constructor(e,t,i){super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=dxe("structuredLogger.enabled:"+this._key,this._contextKeyService).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(n=>n!==void 0)}log(e){return this._isEnabledContextKeyValue.get()?(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0):!1}};cx=lxe([JH(1,Ne),JH(2,x3)],cx);function dxe(o,e){return pt(e.onDidChangeContext,()=>e.getContextKeyValue(o))}var hxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},e6=function(o,e){return function(t,i){e(t,i,o)}};let y2=class extends F{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(cx.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const n=this._loggerService?.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),s=pt(this,n.onDidChangeLogLevel,()=>n.getLevel());this._register(ke(r=>{p$(s.read(r),ln.Trace)&&r.store.add(this._editor.onDidChangeModelContent(a=>{this._editor.getModel()?.uri.scheme!=="output"&&n.trace("onDidChangeModelContent: "+a.detailedReasons.map(l=>l.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(ke(r=>{this._editor instanceof sf&&this._structuredLogger.isEnabled.read(r)&&r.store.add(this._editor.onDidChangeModelContent(a=>{const l=this._editor.getModel();if(!l)return;const c=a.detailedReasons[0],d={...c.metadata,sourceId:"TextModel.setChangeReason",source:c.metadata.source,time:Date.now(),modelUri:l.uri,modelVersion:l.getVersionId()};setTimeout(()=>{this._structuredLogger.log(d)},0)}))}))}};y2=hxe([e6(1,pe),e6(2,g$)],y2);function t6(o,e=Rn){return Hie(o,e)?o.charAt(0).toUpperCase()+o.slice(1):o}var uxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gxe=function(o,e){return function(t,i){e(t,i,o)}};class i6{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class n6{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const s=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);s&&(i=s.value,n=s.multiline)}if(i&&n&&e.snippet){const s=this._model.getLineContent(this._selection.startLineNumber),r=Rt(s,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof Os&&(a=Rt(No(c.value).pop())),!0));const l=pa(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,h)=>`${d}${a.substr(l)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class s6{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return sd(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=sd(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return y0(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(CD(this._model.uri));if(t==="TM_DIRECTORY_BASE")return y0(this._model.uri.fsPath)==="."?"":sd(y0(this._model.uri.fsPath));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class o6{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!bU(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let dx=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};dx=uxe([gxe(2,ai)],dx);class yg{constructor(){this._date=new Date}static{this.dayNames=[m(1406,"Sunday"),m(1407,"Monday"),m(1408,"Tuesday"),m(1409,"Wednesday"),m(1410,"Thursday"),m(1411,"Friday"),m(1412,"Saturday")]}static{this.dayNamesShort=[m(1413,"Sun"),m(1414,"Mon"),m(1415,"Tue"),m(1416,"Wed"),m(1417,"Thu"),m(1418,"Fri"),m(1419,"Sat")]}static{this.monthNames=[m(1420,"January"),m(1421,"February"),m(1422,"March"),m(1423,"April"),m(1424,"May"),m(1425,"June"),m(1426,"July"),m(1427,"August"),m(1428,"September"),m(1429,"October"),m(1430,"November"),m(1431,"December")]}static{this.monthNamesShort=[m(1432,"Jan"),m(1433,"Feb"),m(1434,"Mar"),m(1435,"Apr"),m(1436,"May"),m(1437,"Jun"),m(1438,"Jul"),m(1439,"Aug"),m(1440,"Sep"),m(1441,"Oct"),m(1442,"Nov"),m(1443,"Dec")]}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return yg.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return yg.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return yg.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return yg.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),n=i>0?"-":"+",s=Math.trunc(Math.abs(i/60)),r=s<10?"0"+s:s,a=Math.abs(i)-s*60,l=a<10?"0"+a:a;return n+r+":"+l}}}class r6{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=QCe(this._workspaceService.getWorkspace());if(!YCe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(nM(e))return sd(e.uri.path);let t=sd(e.configPath.path);return t.endsWith(sM)&&(t=t.substr(0,t.length-sM.length-1)),t}_resoveWorkspacePath(e){if(nM(e))return t6(e.uri.fsPath);const t=sd(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?t6(i):"/"}}class a6{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Rf()}}var fxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pxe=function(o,e){return function(t,i){e(t,i,o)}},Da;class ea{static{this._decor={active:Me.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Me.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Me.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Me.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})}}constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=m7(t.placeholders,wr.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),s=this._snippet.fullLen(i),r=D.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+s)),a=i.isFinalTabstop?ea._decor.inactiveFinal:ea._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx])if(s.transform){const r=this._placeholderDecorations.get(s),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=s.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const s=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new le(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?ea._decor.activeFinal:ea._decor.active),s.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?ea._decor.activeFinal:ea._decor.active),s.add(d)}}for(const[a,l]of this._placeholderDecorations)s.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?ea._decor.inactiveFinal:ea._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof wr){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const s=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(s);if(!r){e.delete(n.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof G_,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const s=e.shift();console.assert(s._offset!==-1),console.assert(!s._placeholderDecorations);const r=s._snippet.placeholderInfo.last.index;for(const l of s._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(r+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,s._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of s._snippet.placeholders){const c=s._snippet.offset(l),d=s._snippet.fullLen(l),h=D.fromPositions(t.getPositionAt(s._offset+c),t.getPositionAt(s._offset+c+d)),u=i.addDecoration(h,ea._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=m7(this._snippet.placeholders,wr.compareByIndex)})}}const l6={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let hx=Da=class{static adjustWhitespace(e,t,i,n,s){const r=e.getLineContent(t.lineNumber),a=Rt(r,0,t.column-1);let l;return n.walk(c=>{if(!(c instanceof Os)||c.parent instanceof G_||s&&!s.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const u=n.offset(c);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??n.toString();const g=l.charCodeAt(u-1);(g===10||g===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let g=1;gv.get(xd)),f=e.invokeWithinContext(v=>new s6(v.get(Cf),u)),p=()=>a,_=u.getValueInRange(Da.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(Da.adjustSelection(u,e.getSelection(),0,n)),C=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((v,S)=>({selection:v,idx:S})).sort((v,S)=>D.compareRangesUsingStarts(v.selection,S.selection));for(const{selection:v,idx:S}of w){let L=Da.adjustSelection(u,v,i,0),x=Da.adjustSelection(u,v,0,n);_!==u.getValueInRange(L)&&(L=v),b!==u.getValueInRange(x)&&(x=v);const k=v.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(x.endLineNumber,x.endColumn),I=new df().parse(t,!0,s),T=k.getStartPosition(),A=Da.adjustWhitespace(u,T,r||S>0&&C!==u.getLineFirstNonWhitespaceColumn(v.positionLineNumber),I);I.resolveVariables(new i6([f,new o6(p,S,w.length,e.getOption(88)==="spread"),new n6(u,v,S,l),new dx(u,v,c),new yg,new r6(g),new a6])),d[S]=Ci.replace(k,I.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new ea(e,I,A)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,s,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new df,h=new w1,u=new i6([e.invokeWithinContext(f=>new s6(f.get(Cf),c)),new o6(()=>s,0,e.getSelections().length,e.getOption(88)==="spread"),new n6(c,e.getSelection(),0,r),new dx(c,e.getSelection(),a),new yg,new r6(e.invokeWithinContext(f=>f.get(xd))),new a6]);t=t.sort((f,p)=>D.compareRangesUsingStarts(f.range,p.range));let g=0;for(let f=0;f0){const L=t[f-1].range,x=D.fromPositions(L.getEndPosition(),p.getStartPosition()),k=new Os(c.getValueInRange(x));h.appendChild(k),g+=k.value.length}const C=d.parseFragment(_,h);Da.adjustWhitespace(c,p.getStartPosition(),b!==void 0?!b:n,h,new Set(C)),h.resolveVariables(u);const w=h.toString(),v=w.slice(g);g=w.length;const S=Ci.replace(p,v);S.identifier={major:f,minor:0},S._isTracked=!0,l.push(S)}return d.ensureFinalTabstop(h,i,!0),{edits:l,snippets:[new ea(e,h,"")]}}constructor(e,t,i=l6,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){vt(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}=typeof this._template=="string"?Da.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Da.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??Jn.snippet(),t,n=>{const s=n.filter(r=>!!r.identifier);for(let r=0;rle.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=l6){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Da.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,s=>{const r=s.filter(l=>!!l.identifier);for(let l=0;lle.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{s.push(...n.get(r))})}e.sort(D.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(D.compareRangesUsingStarts);for(let s=0;s0}};hx=Da=fxe([pxe(3,ai)],hx);var mxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$S=function(o,e){return function(t,i){e(t,i,o)}},Ep;const c6={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Ss=class{static{Ep=this}static{this.ID="snippetController2"}static get(e){return e.getContribution(Ep.ID)}static{this.InSnippetMode=new re("inSnippetMode",!1,m(1402,"Whether the editor in current in snippet mode"))}static{this.HasNextTabstop=new re("hasNextTabstop",!1,m(1403,"Whether there is a next tab stop when in snippet mode"))}static{this.HasPrevTabstop=new re("hasPrevTabstop",!1,m(1404,"Whether there is a previous tab stop when in snippet mode"))}constructor(e,t,i,n,s){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=s,this._inSnippetObservable=Ee(this,!1),this._snippetListener=new z,this._modelVersionId=-1,this._inSnippet=Ep.InSnippetMode.bindTo(n),this._hasNextTabstop=Ep.HasNextTabstop.bindTo(n),this._hasPrevTabstop=Ep.HasPrevTabstop.bindTo(n)}dispose(){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?c6:{...c6,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(rt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new hx(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(c,d)=>{if(!this._session||c!==this._editor.getModel()||!R.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=c.getValueInRange(h.range),g=!!h.choice.options.find(p=>p.value===u),f=[];for(let p=0;p{s?.dispose(),r=!1},l=()=>{r||(s=this._languageFeaturesService.completionProvider.register({language:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.uri.scheme,exclusive:!0},i),this._snippetListener.add(s),r=!0)};this._choiceCompletions={provider:i,enable:l,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{FLe(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}get isInSnippetObservable(){return this._inSnippetObservable}};Ss=Ep=mxe([$S(1,Ht),$S(2,ue),$S(3,Ne),$S(4,ai)],Ss);nt(Ss.ID,Ss,4);const Fk=tn.bindToContribution(Ss.get);ae(new Fk({id:"jumpToNextSnippetPlaceholder",precondition:K.and(Ss.InSnippetMode,Ss.HasNextTabstop),handler:o=>o.next(),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:2}}));ae(new Fk({id:"jumpToPrevSnippetPlaceholder",precondition:K.and(Ss.InSnippetMode,Ss.HasPrevTabstop),handler:o=>o.prev(),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:1026}}));ae(new Fk({id:"leaveSnippet",precondition:Ss.InSnippetMode,handler:o=>o.cancel(!0),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:9,secondary:[1033]}}));ae(new Fk({id:"acceptSnippet",precondition:Ss.InSnippetMode,handler:o=>o.finish()}));function mw(o){return new _xe(o)}class _xe extends oq{constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}}const bxe=[];function Cxe(){return bxe}function d6(o){return vxe(o).map(t=>t.getEndPosition())}function vxe(o){const e=Sy.createSortPermutation(o,Kn(n=>n.range,D.compareRangesUsingStarts)),i=new yo(e.apply(o)).getNewRanges();return e.inverse().apply(i)}function wxe(o,e){const t=mw(e),i=e.getValue();return o.map(r=>t.getStringReplacement(r)).map(r=>r.removeCommonSuffixPrefix(i)).map(r=>t.getTextReplacement(r))}function Sxe(o,e){const t=Ee("result",[]),i=[];return e.add(ke(n=>{const s=o.read(n);At(r=>{if(s.length!==i.length){i.length=s.length;for(let a=0;aa.set(s[l],r))})})),t}class yxe{constructor(e){this._contextKeyService=e}bind(e,t){return bl(e,this._contextKeyService,t instanceof Function?t:i=>t.read(i))}}function h6(o,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},o);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class Lxe{constructor(e,t,i,n=xxe){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=n,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}}function xxe(o,e,t,i){return o===i?e+t:t*(-Math.pow(2,-10*o/i)+1)+e}function Dxe(o,e,t,i){return t*((o=o/i-1)*o*o+1)+e}class kxe{constructor(e){this._value=Ee(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||Wk.instance.invalidateOnNextAnimationFrame(e),t.getValue()}}class Wk{constructor(){this._counter=Er(this),this._isScheduled=!1}static{this.instance=new Wk}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,St().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}}class _w{constructor(e,t){this.lineNumber=e,this.parts=t,Wh(()=>$w(t,(i,n)=>i.column<=n.column))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new yo([...this.parts.map(s=>new Fi(D.fromPositions(new R(1,s.column)),s.lines.map(r=>r.line).join(` -`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class ux{constructor(e,t,i,n=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=n,this.lines=No(this.text).map((s,r)=>({line:s,lineDecorations:Cs.filter(this._inlineDecorations,r+1,1,s.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&Cs.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}}class L2{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new ux(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=No(this.text)}renderForScreenReader(e){return this.newLines.join(` -`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function u6(o,e){return Qt(o,e,AY)}function AY(o,e){return o===e?!0:!o||!e?!1:o instanceof _w&&e instanceof _w||o instanceof L2&&e instanceof L2?o.equals(e):!1}function ed(o,e,t){const i=t?o.range.intersectRanges(t):o.range;if(!i)return o;const n=o.text.replaceAll(`\r + `,constraint:TG,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?sSe(t,!0,s):a==="up"?IG(t,!0,r||1,s):w_(t,!0,r||1,s)}}class DSe extends zn{constructor(){super({id:"editor.toggleFold",label:H(985,"Toggle Fold"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);o5(t,1,n)}}class ISe extends zn{constructor(){super({id:"editor.foldRecursively",label:H(986,"Fold Recursively"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);w_(t,!0,Number.MAX_VALUE,n)}}class ESe extends zn{constructor(){super({id:"editor.toggleFoldRecursively",label:H(987,"Toggle Fold Recursively"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);o5(t,Number.MAX_VALUE,n)}}class NSe extends zn{constructor(){super({id:"editor.foldAllBlockComments",label:H(988,"Fold All Block Comments"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())a5(t,df.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+_o(a.blockCommentStartToken));r5(t,l,!0)}}}}class TSe extends zn{constructor(){super({id:"editor.foldAllMarkerRegions",label:H(989,"Fold All Regions"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())a5(t,df.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);r5(t,l,!0)}}}}class RSe extends zn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:H(990,"Unfold All Regions"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())a5(t,df.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);r5(t,l,!1)}}}}class MSe extends zn{constructor(){super({id:"editor.foldAllExcept",label:H(991,"Fold All Except Selected"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);EG(t,!0,n)}}class PSe extends zn{constructor(){super({id:"editor.unfoldAllExcept",label:H(992,"Unfold All Except Selected"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);EG(t,!1,n)}}class ASe extends zn{constructor(){super({id:"editor.foldAll",label:H(993,"Fold All"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2069),weight:100}})}invoke(e,t,i){w_(t,!0)}}class OSe extends zn{constructor(){super({id:"editor.unfoldAll",label:H(994,"Unfold All"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2088),weight:100}})}invoke(e,t,i){w_(t,!1)}}class Tv extends zn{static{this.ID_PREFIX="editor.foldLevel"}static{this.ID=e=>Tv.ID_PREFIX+e}getFoldingLevel(){return parseInt(this.id.substr(Tv.ID_PREFIX.length))}invoke(e,t,i){oSe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}class FSe extends zn{constructor(){super({id:"editor.gotoParentFold",label:H(995,"Go to Parent Fold"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=rSe(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class WSe extends zn{constructor(){super({id:"editor.gotoPreviousFold",label:H(996,"Go to Previous Folding Range"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=aSe(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class BSe extends zn{constructor(){super({id:"editor.gotoNextFold",label:H(997,"Go to Next Folding Range"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=lSe(n[0],t);s!==null&&i.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class HSe extends zn{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:H(998,"Create Folding Range from Selection"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2135),weight:100}})}invoke(e,t,i){const n=[],s=i.getSelections();if(s){for(const r of s){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(n.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,l)=>a.startLineNumber-l.startLineNumber);const r=Fo.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(Fo.fromFoldRanges(r))}}}}class VSe extends zn{constructor(){super({id:"editor.removeManualFoldingRanges",label:H(999,"Remove Manual Folding Ranges"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const s=[];for(const r of n){const{startLineNumber:a,endLineNumber:l}=r;s.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(s),e.triggerFoldingModelChanged()}}}class zSe extends zn{constructor(){super({id:"editor.toggleImportFold",label:H(1e3,"Toggle Import Fold"),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],n=t.regions;for(let s=n.length-1;s>=0;s--)n.getType(s)===df.Imports.value&&i.push(n.toRegion(s));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}}Xe(Th.ID,Th,0);se(xSe);se(LSe);se(kSe);se(ISe);se(ESe);se(ASe);se(OSe);se(NSe);se(TSe);se(RSe);se(MSe);se(PSe);se(DSe);se(FSe);se(WSe);se(BSe);se(HSe);se(VSe);se(zSe);for(let o=1;o<=7;o++)ite(new Tv({id:Tv.ID(o),label:H(1001,"Fold Level {0}",o),precondition:Dn,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2048|21+o),weight:100}}));Ye.registerCommand("_executeFoldingRangeProvider",async function(o,...e){const[t]=e;if(!(t instanceof _e))throw br();const i=o.get(he),n=o.get(ei).getModel(t);if(!n)throw br();const s=o.get(Pe);if(!s.getValue("editor.folding",{resource:t}))return[];const r=o.get(ti),a=s.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:t})},update:(g,f)=>{}},c=new l5(n,r,l);let d=c;if(a!=="indentation"){const g=Th.getFoldingRangeProviders(i,n);g.length&&(d=new c5(n,g,()=>{},l,c))}const h=await d.compute(Ve.None),u=[];try{if(h)for(let g=0;ggi.replace(L.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",s.map(r=>gi.replaceMove(L.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class h8{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class qSe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(h8.toKey(e))}has(e){return this._set.has(h8.toKey(e))}}function RG(o,e,t){const i=[],n=new qSe,s=o.ordered(t);for(const a of s)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class Vm{static{this._selectors=new cs}static setFormatterSelector(e){return{dispose:Vm._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const s=Ke.first(Vm._selectors);if(s)return await s(e,t,i,n)}}async function MG(o,e,t,i,n,s,r){const a=o.get(fe),{documentRangeFormattingEditProvider:l}=o.get(he),c=Ha(e)?e.getModel():e,d=l.ordered(c),h=await Vm.select(d,c,i,2);h&&(n.report(h),await a.invokeFunction(KSe,h,e,t,s,r))}async function KSe(o,e,t,i,n,s){const r=o.get(eo),a=o.get(Mt),l=o.get(dd);let c,d;Ha(t)?(c=t.getModel(),d=new nd(t,5,void 0,n)):(c=t,d=new cF(t,n));const h=[];let u=0;for(const b of rO(i).sort(L.compareRangesUsingStarts))u>0&&L.areIntersectingOrTouching(h[u-1],b)?h[u-1]=L.fromPositions(h[u-1].getStartPosition(),b.getEndPosition()):u=h.push(b);const g=async b=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,b);const C=await e.provideDocumentRangeFormattingEdits(c,b,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,C),C},f=(b,C)=>{if(!b.length||!C.length)return!1;const w=b.reduce((v,S)=>L.plusRange(v,S.range),b[0].range);if(!C.some(v=>L.intersectRanges(w,v.range)))return!1;for(const v of b)for(const S of C)if(L.intersectRanges(v.range,S.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const b=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),_.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;_.push(await g(b))}for(let b=0;b({text:w.text,range:L.lift(w.range),forceMoveMarkers:!0})),w=>{for(const{range:v}of w)if(L.areIntersectingOrTouching(v,C))return[new ae(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn)];return null})}return l.playSignal(Ze.format,{userGesture:s}),!0}async function GSe(o,e,t,i,n,s){const r=o.get(fe),a=o.get(he),l=Ha(e)?e.getModel():e,c=RG(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await Vm.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(ZSe,d,e,t,n,s))}async function ZSe(o,e,t,i,n,s){const r=o.get(eo),a=o.get(dd);let l,c;Ha(t)?(l=t.getModel(),c=new nd(t,5,void 0,n)):(l=t,c=new cF(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Ha(t))Hm.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new ae(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(g=>({text:g.text,range:L.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(L.areIntersectingOrTouching(f,u))return[new ae(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(Ze.format,{userGesture:s}),!0}async function YSe(o,e,t,i,n,s){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,s)).catch(Ri);if(us(l))return await o.computeMoreMinimalEdits(t.uri,l)}}async function XSe(o,e,t,i,n){const s=RG(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of s){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Ri);if(us(a))return await o.computeMoreMinimalEdits(t.uri,a)}}function PG(o,e,t,i,n,s,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,s,r)).catch(Ri).then(l=>o.computeMoreMinimalEdits(t.uri,l))}Ye.registerCommand("_executeFormatRangeProvider",async function(o,...e){const[t,i,n]=e;Je(_e.isUri(t)),Je(L.isIRange(i));const s=o.get(fs),r=o.get(eo),a=o.get(he),l=await s.createModelReference(t);try{return YSe(r,a,l.object.textEditorModel,L.lift(i),n,Ve.None)}finally{l.dispose()}});Ye.registerCommand("_executeFormatDocumentProvider",async function(o,...e){const[t,i]=e;Je(_e.isUri(t));const n=o.get(fs),s=o.get(eo),r=o.get(he),a=await n.createModelReference(t);try{return XSe(s,r,a.object.textEditorModel,i,Ve.None)}finally{a.dispose()}});Ye.registerCommand("_executeFormatOnTypeProvider",async function(o,...e){const[t,i,n,s]=e;Je(_e.isUri(t)),Je(R.isIPosition(i)),Je(typeof n=="string");const r=o.get(fs),a=o.get(eo),l=o.get(he),c=await r.createModelReference(t);try{return PG(a,l,c.object.textEditorModel,R.lift(i),n,s,Ve.None)}finally{c.dispose()}});var AG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jb=function(o,e){return function(t,i){e(t,i,o)}};let hx=class{static{this.ID="editor.contrib.autoFormat"}constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new z,this._sessionDisposables=new z,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(s=>{s.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new P0;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const s=n.charCodeAt(n.length-1);i.has(s)&&this._trigger(String.fromCharCode(s))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new qt,s=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),s.dispose();return}for(let a=0,l=r.changes.length;a{n.token.isCancellationRequested||us(r)&&(this._accessibilitySignalService.playSignal(Ze.format,{userGesture:!1}),Hm.execute(this._editor,r,!0))}).finally(()=>{s.dispose()})}};hx=AG([Jb(1,he),Jb(2,eo),Jb(3,dd)],hx);let ux=class{static{this.ID="editor.contrib.formatOnPaste"}constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new z,this._callOnModel=new z,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(MG,this.editor,e,2,Rc.None,Ve.None,!1).catch(Ee))}};ux=AG([Jb(1,he),Jb(2,fe)],ux);class QSe extends le{constructor(){super({id:"editor.action.formatDocument",label:H(1014,"Format Document"),precondition:q.and(N.notInCompositeEditor,N.writable,N.hasDocumentFormattingProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(fe);await e.get(id).showWhile(i.invokeFunction(GSe,t,1,Rc.None,Ve.None,!0),250)}}}class JSe extends le{constructor(){super({id:"editor.action.formatSelection",label:H(1015,"Format Selection"),precondition:q.and(N.writable,N.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2084),weight:100},contextMenuOpts:{when:N.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(fe),n=t.getModel(),s=t.getSelections().map(a=>a.isEmpty()?new L(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(id).showWhile(i.invokeFunction(MG,t,s,1,Rc.None,Ve.None,!0),250)}}Xe(hx.ID,hx,2);Xe(ux.ID,ux,2);se(QSe);se(JSe);Ye.registerCommand("editor.action.format",async o=>{const e=o.get(et).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=o.get(Pt);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var e0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KI=function(o,e){return function(t,i){e(t,i,o)}};class bp{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;t.children.get(n)!==void 0;s++)n=`${i}_${s}`;return n}static empty(e){return e.children.size===0}}class rM extends bp{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class OG extends bp{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class Cc extends bp{static create(e,t,i){const n=new qt(i),s=new Cc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{const h=bp.findId(`provider_${d}`,s),u=new OG(h,s,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,n.token)).then(g=>{for(const f of g||[])Cc._makeOutlineElement(f,u);return u},g=>(Ri(g),u)).then(g=>{bp.empty(g)?g.remove():s._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);jt(c,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Cc.create(e,t,i):s._compact()).finally(()=>{n.dispose(),l.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=bp.findId(e,t),n=new rM(i,t,e);if(e.children)for(const s of e.children)Cc._makeOutlineElement(s,n);t.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Ke.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof rM?e.push(t.symbol):e.push(...Ke.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>L.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Cc._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>R.compare(L.getStartPosition(i.range),L.getStartPosition(n.range))||R.compare(L.getEndPosition(n.range),L.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Cc._flattenDocumentSymbols(e,n.children,n.name)}}const qw=We("IOutlineModelService");let aM=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new z,this._cache=new na(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let s=this._cache.get(e.id);if(!s||s.versionId!==e.getVersionId()||!jt(s.provider,n)){const a=new qt;s={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Cc.create(i,e,a.token),model:void 0},this._cache.set(e.id,s);const l=Date.now();s.promise.then(c=>{s.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(s.model)return s.model;s.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--s.promiseCnt===0&&(s.source.cancel(),this._cache.delete(e.id))});try{return await s.promise}finally{r.dispose()}}};aM=e0e([KI(0,he),KI(1,Rr),KI(2,ei)],aM);$e(qw,aM,1);Ye.registerCommand("_executeDocumentSymbolProvider",async function(o,...e){const[t]=e;Je(_e.isUri(t));const i=o.get(qw),s=await o.get(fs).createModelReference(t);try{return(await i.getOrCreate(s.object.textEditorModel,Ve.None)).getTopLevelSymbols()}finally{s.dispose()}});const Fk=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};var t0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i0e=function(o,e){return function(t,i){e(t,i,o)}};function n0e(o){return o instanceof FG?o._instance:o}let FG=class{constructor(e){this.instantiationService=e}init(...e){}};function s0e(o){return o.get()}let u8=class extends FG{constructor(e,t){super(t),this.init(e)}};u8=t0e([i0e(1,fe)],u8);class Kw{validateOrThrow(e){const t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}}class Wk extends Kw{constructor(e){super(),this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}}const o0e=new Wk("string");function r0e(){return o0e}new Wk("number");const a0e=new Wk("boolean");function g8(){return a0e}new Wk("object");class WG extends Kw{validate(e){return e!==void 0?{content:void 0,error:{message:`Expected undefined, but got ${typeof e}`}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}}function l0e(){return new WG}class lM{constructor(e){this.validator=e}}function GI(o){return new lM(o)}class c0e extends Kw{constructor(e){super(),this.properties=e}validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};const t={};for(const i in this.properties){const n=this.properties[i],s=e[i],r=n instanceof lM,a=r?n.validator:n;if(r&&s===void 0)continue;const{content:l,error:c}=a.validate(s);if(c)return{content:void 0,error:{message:`Error in property '${i}': ${c.message}`}};t[i]=l}return{content:t,error:void 0}}getJSONSchema(){const e=[],t={};for(const[n,s]of Object.entries(this.properties)){const r=s instanceof lM,a=r?s.validator:s;t[n]=a.getJSONSchema(),r||e.push(n)}return{type:"object",properties:t,...e.length>0?{required:e}:{}}}}function d0e(o){return new c0e(o)}class h0e extends Kw{constructor(e){super(),this.validators=e}validate(e){let t;for(const i of this.validators){const{content:n,error:s}=i.validate(e);if(!s)return{content:n,error:void 0};t=s}return{content:void 0,error:t}}getJSONSchema(){return{oneOf:wJ(this.validators,e=>{if(!(e instanceof WG))return e.getJSONSchema()})}}}function u0e(...o){return new h0e(o)}class g0e extends Kw{constructor(e,t){super(),this._ref=e,this._validator=t}validate(e){return this._validator.validate(e)}getJSONSchema(){return{$ref:this._ref}}}function f0e(o,e){return new g0e(o,e)}const Be={Visible:xF,HasFocusedSuggestion:new oe("suggestWidgetHasFocusedSuggestion",!1,m(1455,"Whether any suggestion is focused")),DetailsVisible:new oe("suggestWidgetDetailsVisible",!1,m(1456,"Whether suggestion details are visible")),MultipleSuggestions:new oe("suggestWidgetMultipleSuggestions",!1,m(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new oe("suggestionMakesTextEdit",!0,m(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new oe("acceptSuggestionOnEnter",!0,m(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new oe("suggestionHasInsertAndReplaceRange",!1,m(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new oe("suggestionInsertMode",void 0,{type:"string",description:m(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new oe("suggestionCanResolve",!1,m(1462,"Whether the current suggestion supports to resolve further details"))},mh=new M("suggestWidgetStatusBar");class p0e{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Jr.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,L.isIRange(t.range)?(this.editStart=new R(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new R(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new R(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||L.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new R(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new R(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new R(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||L.spansMultipleLines(t.range.insert)||L.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof n.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new rn(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Xo(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class Gw{static{this.default=new Gw}constructor(e=2,t=new Set,i=new Set,n=new Map,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=s}}class m0e{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function d5(o,e,t,i=Gw.default,n={triggerKind:0},s=Ve.None){const r=new rn;t=t.clone();const a=e.getWordAtPosition(t),l=a?new L(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):L.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],h=new z,u=[];let g=!1;const f=(_,b,C)=>{let w=!1;if(!b)return w;for(const v of b.suggestions)if(!i.kindFilter.has(v.kind)){if(!i.showDeprecated&&v?.tags?.includes(1))continue;v.range||(v.range=c),v.sortText||(v.sortText=typeof v.label=="string"?v.label:v.label.label),!g&&v.insertTextRules&&v.insertTextRules&4&&(g=Hg.guessNeedsClipboard(v.insertText)),d.push(new p0e(t,v,b,_)),w=!0}return ef(b)&&h.add(b),u.push({providerName:_._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:C.elapsed()}),w},p=(async()=>{})();for(const _ of o.orderedGroups(e)){let b=!1;if(await Promise.all(_.map(async C=>{if(i.providerItemsToReuse.has(C)){const w=i.providerItemsToReuse.get(C);w.forEach(v=>d.push(v)),b=b||w.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(C)))try{const w=new rn,v=await C.provideCompletionItems(e,t,n,s);b=f(C,v,w)||b}catch(w){Ri(w)}})),b||s.isCancellationRequested)break}return await p,s.isCancellationRequested?(h.dispose(),Promise.reject(new wr)):new m0e(d.sort(C0e(i.snippetSortOrder)),g,{entries:u,elapsed:r.elapsed()},h)}function h5(o,e){if(o.sortTextLow&&e.sortTextLow){if(o.sortTextLowe.sortTextLow)return 1}return o.textLabele.textLabel?1:o.completion.kind-e.completion.kind}function _0e(o,e){if(o.completion.kind!==e.completion.kind){if(o.completion.kind===28)return-1;if(e.completion.kind===28)return 1}return h5(o,e)}function b0e(o,e){if(o.completion.kind!==e.completion.kind){if(o.completion.kind===28)return 1;if(e.completion.kind===28)return-1}return h5(o,e)}const Bk=new Map;Bk.set(0,_0e);Bk.set(2,b0e);Bk.set(1,h5);function C0e(o){return Bk.get(o)}Ye.registerCommand("_executeCompletionItemProvider",async(o,...e)=>{const[t,i,n,s]=e;Je(_e.isUri(t)),Je(R.isIPosition(i)),Je(typeof n=="string"||!n),Je(typeof s=="number"||!s);const{completionProvider:r}=o.get(he),a=await o.get(fs).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),h=await d5(r,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?1:0});for(const u of h.items)c.length<(s??0)&&c.push(u.resolve(Ve.None)),l.incomplete=l.incomplete||u.container.incomplete,l.suggestions.push(u.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function v0e(o,e){o.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class Cp{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}class kt{static{this.inlineSuggestionVisible=new oe("inlineSuggestionVisible",!1,m(1192,"Whether an inline suggestion is visible"))}static{this.inlineSuggestionHasIndentation=new oe("inlineSuggestionHasIndentation",!1,m(1193,"Whether the inline suggestion starts with whitespace"))}static{this.inlineSuggestionHasIndentationLessThanTabSize=new oe("inlineSuggestionHasIndentationLessThanTabSize",!0,m(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"))}static{this.suppressSuggestions=new oe("inlineSuggestionSuppressSuggestions",void 0,m(1195,"Whether suggestions should be suppressed for the current suggestion"))}static{this.cursorBeforeGhostText=new oe("cursorBeforeGhostText",!1,m(1196,"Whether the cursor is at ghost text"))}static{this.cursorInIndentation=new oe("cursorInIndentation",!1,m(1197,"Whether the cursor is in indentation"))}static{this.hasSelection=new oe("editor.hasSelection",!1,m(1198,"Whether the editor has a selection"))}static{this.cursorAtInlineEdit=new oe("cursorAtInlineEdit",!1,m(1199,"Whether the cursor is at an inline edit"))}static{this.inlineEditVisible=new oe("inlineEditIsVisible",!1,m(1200,"Whether an inline edit is visible"))}static{this.tabShouldJumpToInlineEdit=new oe("tabShouldJumpToInlineEdit",!1,m(1201,"Whether tab should jump to an inline edit."))}static{this.tabShouldAcceptInlineEdit=new oe("tabShouldAcceptInlineEdit",!1,m(1202,"Whether tab should accept the inline edit."))}static{this.inInlineEditsPreviewEditor=new oe("inInlineEditsPreviewEditor",!0,m(1203,"Whether the current code editor is showing an inline edits preview"))}}class w0e{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=S0e(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,s=i.length;na.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let n=0,s=0;const r=e.length;for(let a=1,l=o.getLineCount();a<=l;a++){const c=o.getLineContent(a),d=c.length+1;let h=0;if(s=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},x0e=function(o,e){return function(t,i){e(t,i,o)}};let cM=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberC===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?e.getLineContent(h):e.getLineContent(C)},b=kb(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const C=Dt(e.getLineContent(h)),w=no(b,a),v=no(C,a);w!==v&&(g=eC(w,a,c)+this.trimStart(u))}}t.addEditOperation(new L(r.startLineNumber,1,r.startLineNumber,1),g+` +`);const p=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,g);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,p);else{const _={tokenization:{getLineTokens:C=>C===r.startLineNumber?e.tokenization.getLineTokens(h):C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.tokenization.getLineTokens(C-1):e.tokenization.getLineTokens(C),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:C=>C===r.startLineNumber?g:C>=r.startLineNumber+1&&C<=r.endLineNumber+1?e.getLineContent(C-1):e.getLineContent(C)},b=kb(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const C=Dt(e.getLineContent(r.startLineNumber)),w=no(b,a),v=no(C,a);if(w!==v){const S=w-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new L(r.startLineNumber,1,r.startLineNumber,1),g+` +`)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new L(h,1,h+1,1),null),t.addEditOperation(new L(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` +`+u),this.shouldAutoIndent(e,r)){const g={tokenization:{getLineTokens:p=>p===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(p),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:p=>p===h?e.getLineContent(r.startLineNumber):e.getLineContent(p)},f=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,f);else{const p=kb(this._autoIndent,g,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(p!==null){const _=Dt(e.getLineContent(r.startLineNumber)),b=no(p,a),C=no(_,a);if(b!==C){const w=b-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Dr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Dr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===Oi.None||s.indentAction===Oi.Indent?r=s.indentation+s.appendText:s.indentAction===Oi.IndentOutdent?r=s.indentation:s.indentAction===Oi.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=Dt(e.getLineContent(n));let c=Dt(r);const d=Jz(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=no(c,i),u=no(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(Qr(r)>=0){const a=e.getLineMaxColumn(s),l=Tp(this._autoIndent,e,new L(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(Qr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Tp(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),Qr(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=Tp(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=Dt(l),h=no(c,n)+r,u=eC(h,n,s);u!==c&&(t.addEditOperation(new L(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(dM._COLLATOR.value.compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function L0e(o,e,t){const i=HG(o,e,t);return i?gi.replace(new L(i.startLineNumber,1,i.endLineNumber,o.getLineMaxColumn(i.endLineNumber)),i.after.join(` +`)):null}class VG extends le{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>L.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r=u.startLineNumber;b--)g.push(i.getLineContent(b));const f=gi.replace(u,g.join(` +`));r.push(f);const p=function(b){return b<=u.endLineNumber?u.endLineNumber-b+u.startLineNumber:b},_=function(b){if(b.isEmpty())return new ae(p(b.positionLineNumber),b.positionColumn,p(b.positionLineNumber),b.positionColumn);{const C=p(b.selectionStartLineNumber),w=p(b.positionLineNumber),v=b.selectionStartColumn,S=b.positionColumn;return new ae(C,v,w,S)}};a.push(_(d))}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}}class u5 extends le{static{this.ID="editor.action.trimTrailingWhitespace"}constructor(){super({id:u5.ID,label:H(1258,"Trim Trailing Whitespace"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new R(d.positionLineNumber,d.positionColumn)));const s=t.getSelection();if(s===null)return;const r=e.get(Pe),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),c=new w0e(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}}class A0e extends le{constructor(){super({id:"editor.action.deleteLines",label:H(1259,"Delete Line"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(gi.replace(new ae(h,g,u,f),"")),a.push(new ae(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumbers.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class O0e extends le{constructor(){super({id:"editor.action.indentLines",label:H(1260,"Indent Line"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Pd.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class F0e extends le{constructor(){super({id:"editor.action.outdentLines",label:H(1261,"Outdent Line"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(e,t){Rp.Outdent.runEditorCommand(e,t,null)}}class Hk extends le{static{this.ID="editor.action.insertLineBefore"}constructor(){super({id:Hk.ID,label:H(1262,"Insert Line Above"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,RL.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Vk extends le{static{this.ID="editor.action.insertLineAfter"}constructor(){super({id:Vk.ID,label:H(1263,"Insert Line Below"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,RL.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class $G extends le{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;lgi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class W0e extends $G{constructor(){super({id:"deleteAllLeft",label:H(1264,"Delete All Left"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach(r=>{let a;if(r.endColumn===1&&s>0){const l=r.startLineNumber-s;a=new ae(l,r.startColumn,l,r.startColumn)}else a=new ae(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);s+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(L.compareRangesUsingStarts),i=i.map(s=>{if(s.isEmpty())if(s.startColumn===1){const r=Math.max(1,s.startLineNumber-1),a=s.startLineNumber===1?1:n.getLineLength(r)+1;return new L(r,a,s.startLineNumber,1)}else return new L(s.startLineNumber,1,s.startLineNumber,s.startColumn);else return new L(s.startLineNumber,1,s.endLineNumber,s.endColumn)}),i)}}class B0e extends $G{constructor(){super({id:"deleteAllRight",label:H(1265,"Delete All Right"),precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];for(let s=0,r=t.length,a=0;s{if(s.isEmpty()){const r=t.getLineMaxColumn(s.startLineNumber);return s.startColumn===r?new L(s.startLineNumber,s.startColumn,s.startLineNumber+1,1):new L(s.startLineNumber,s.startColumn,s.startLineNumber,r)}return s});return n.sort(L.compareRangesUsingStarts),n}}class H0e extends le{constructor(){super({id:"editor.action.joinLines",label:H(1266,"Join Lines"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(L.compareRangesUsingStarts);const s=[],r=i.reduce((u,g)=>u.isEmpty()?u.endLineNumber===g.startLineNumber?(n.equalsSelection(u)&&(n=g),g):g.startLineNumber>u.endLineNumber+1?(s.push(u),g):new ae(u.startLineNumber,u.startColumn,g.endLineNumber,g.endColumn):g.startLineNumber>u.endLineNumber?(s.push(u),g):new ae(u.startLineNumber,u.startColumn,g.endLineNumber,g.endColumn));s.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=n,h=0;for(let u=0,g=s.length;u=1){let T=!0;S===""&&(T=!1),T&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(T=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const F=D.substr(I-1);S+=(T?" ":"")+F,T?b=F.length+1:b=F.length}else b=0}const x=new L(p,_,C,w);if(!x.isEmpty()){let k;f.isEmpty()?(l.push(gi.replace(x,S)),k=new ae(x.startLineNumber-h,S.length-b+1,p-h,S.length-b+1)):f.startLineNumber===f.endLineNumber?(l.push(gi.replace(x,S)),k=new ae(f.startLineNumber-h,f.startColumn,f.endLineNumber-h,f.endColumn)):(l.push(gi.replace(x,S)),k=new ae(f.startLineNumber-h,f.startColumn,f.startLineNumber-h,S.length-v)),L.intersectRanges(x,n)!==null?d=k:c.push(k)}h+=x.endLineNumber-x.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class V0e extends le{constructor(){super({id:"editor.action.transpose",label:H(1267,"Transpose Characters around the Cursor"),precondition:N.writable,canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const s=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===n.getLineCount())continue;const h=new L(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");s.push(new Fn(new ae(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u))}else{const h=new L(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),u=n.getValueInRange(h).split("").reverse().join("");s.push(new wO(h,u,new ae(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class vf extends le{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const s=t.getOption(148),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new L(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),h=n.getValueInRange(d);r.push(gi.replace(d,this._modifyText(h,s)))}else{const l=n.getValueInRange(a);r.push(gi.replace(a,this._modifyText(l,s)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class z0e extends vf{constructor(){super({id:"editor.action.transformToUppercase",label:H(1268,"Transform to Uppercase"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleUpperCase()}}class U0e extends vf{constructor(){super({id:"editor.action.transformToLowercase",label:H(1269,"Transform to Lowercase"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleLowerCase()}}class ea{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class gx extends vf{static{this.titleBoundary=new ea("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu")}constructor(){super({id:"editor.action.transformToTitlecase",label:H(1270,"Transform to Title Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=gx.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}}class Yp extends vf{static{this.caseBoundary=new ea("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new ea("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu")}constructor(){super({id:"editor.action.transformToSnakecase",label:H(1271,"Transform to Snake Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Yp.caseBoundary.get(),n=Yp.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}class pg extends vf{static{this.singleLineWordBoundary=new ea("[_\\s-]+","gm")}static{this.multiLineWordBoundary=new ea("[_-]+","gm")}static{this.validWordStart=new ea("^(\\p{Lu}[^\\p{Lu}])","gmu")}constructor(){super({id:"editor.action.transformToCamelcase",label:H(1272,"Transform to Camel Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=/\r\n|\r|\n/.test(e)?pg.multiLineWordBoundary.get():pg.singleLineWordBoundary.get(),n=pg.validWordStart.get();if(!i||!n)return e;const s=e.split(i);return s.shift()?.replace(n,a=>a.toLocaleLowerCase())+s.map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}}class Xp extends vf{static{this.wordBoundary=new ea("[_ \\t-]","gm")}static{this.wordBoundaryToMaintain=new ea("(?<=\\.)","gm")}static{this.upperCaseWordMatcher=new ea("^\\p{Lu}+$","mu")}constructor(){super({id:"editor.action.transformToPascalcase",label:H(1273,"Transform to Pascal Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Xp.wordBoundary.get(),n=Xp.wordBoundaryToMaintain.get(),s=Xp.upperCaseWordMatcher.get();return!i||!n||!s?e:e.split(n).map(l=>l.split(i)).flat().map(l=>{const c=l.charAt(0).toLocaleUpperCase()+l.slice(1);return c.length>1&&s.test(c)?c.charAt(0)+c.slice(1).toLocaleLowerCase():c}).join("")}}class Qp extends vf{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}static{this.caseBoundary=new ea("(\\p{Ll})(\\p{Lu})","gmu")}static{this.singleLetters=new ea("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu")}static{this.underscoreBoundary=new ea("(\\S)(_)(\\S)","gm")}constructor(){super({id:"editor.action.transformToKebabcase",label:H(1274,"Transform to Kebab Case"),precondition:N.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Qp.caseBoundary.get(),n=Qp.singleLetters.get(),s=Qp.underscoreBoundary.get();return!i||!n||!s?e:e.replace(s,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}}se(k0e);se(D0e);se(I0e);se(E0e);se(N0e);se(T0e);se(R0e);se(M0e);se(u5);se(A0e);se(O0e);se(F0e);se(Hk);se(Vk);se(W0e);se(B0e);se(H0e);se(V0e);se(z0e);se(U0e);se(P0e);Yp.caseBoundary.isSupported()&&Yp.singleLetters.isSupported()&&se(Yp);pg.singleLineWordBoundary.isSupported()&&pg.multiLineWordBoundary.isSupported()&&se(pg);Xp.wordBoundary.isSupported()&&se(Xp);gx.titleBoundary.isSupported()&&se(gx);Qp.isSupported()&&se(Qp);const g5=We("dataChannelService");class $0e{getDataChannel(e){return{sendData:()=>{}}}}var j0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},f8=function(o,e){return function(t,i){e(t,i,o)}};function q0e(o){return o.sourceId+" @@ "+JSON.stringify({...o,modelUri:o.modelUri?.toString(),sourceId:void 0})}let fx=class extends A{static cast(){return this}constructor(e,t,i){super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=K0e("structuredLogger.enabled:"+this._key,this._contextKeyService).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(n=>n!==void 0)}log(e){return this._isEnabledContextKeyValue.get()?(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0):!1}};fx=j0e([f8(1,Ie),f8(2,g5)],fx);function K0e(o,e){return dt(e.onDidChangeContext,()=>e.getContextKeyValue(o))}var G0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},p8=function(o,e){return function(t,i){e(t,i,o)}};let hM=class extends A{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(fx.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const n=this._loggerService?.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),s=dt(this,n.onDidChangeLogLevel,()=>n.getLevel());this._register(xe(r=>{Nz(s.read(r),Ji.Trace)&&r.store.add(this._editor.onDidChangeModelContent(a=>{this._editor.getModel()?.uri.scheme!=="output"&&n.trace("onDidChangeModelContent: "+a.detailedReasons.map(l=>l.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(xe(r=>{this._editor instanceof Pg&&this._structuredLogger.isEnabled.read(r)&&r.store.add(this._editor.onDidChangeModelContent(a=>{const l=this._editor.getModel();if(!l)return;const c=a.detailedReasons[0],d={...c.metadata,sourceId:"TextModel.setChangeReason",source:c.metadata.source,time:Date.now(),modelUri:l.uri,modelVersion:l.getVersionId()};setTimeout(()=>{this._structuredLogger.log(d)},0)}))}))}};hM=G0e([p8(1,fe),p8(2,Iz)],hM);function m8(o,e=Ln){return $ee(o,e)?o.charAt(0).toUpperCase()+o.slice(1):o}var Z0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Y0e=function(o,e){return function(t,i){e(t,i,o)}};class _8{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class b8{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const s=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);s&&(i=s.value,n=s.multiline)}if(i&&n&&e.snippet){const s=this._model.getLineContent(this._selection.startLineNumber),r=Dt(s,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof ks&&(a=Dt(bo(c.value).pop())),!0));const l=ta(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,h)=>`${d}${a.substr(l)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class C8{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Fc(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Fc(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return ES(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(xL(this._model.uri));if(t==="TM_DIRECTORY_BASE")return ES(this._model.uri.fsPath)==="."?"":Fc(ES(this._model.uri.fsPath));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class v8{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(n=>!MV(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let px=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};px=Z0e([Y0e(2,ti)],px);class eg{constructor(){this._date=new Date}static{this.dayNames=[m(1406,"Sunday"),m(1407,"Monday"),m(1408,"Tuesday"),m(1409,"Wednesday"),m(1410,"Thursday"),m(1411,"Friday"),m(1412,"Saturday")]}static{this.dayNamesShort=[m(1413,"Sun"),m(1414,"Mon"),m(1415,"Tue"),m(1416,"Wed"),m(1417,"Thu"),m(1418,"Fri"),m(1419,"Sat")]}static{this.monthNames=[m(1420,"January"),m(1421,"February"),m(1422,"March"),m(1423,"April"),m(1424,"May"),m(1425,"June"),m(1426,"July"),m(1427,"August"),m(1428,"September"),m(1429,"October"),m(1430,"November"),m(1431,"December")]}static{this.monthNamesShort=[m(1432,"Jan"),m(1433,"Feb"),m(1434,"Mar"),m(1435,"Apr"),m(1436,"May"),m(1437,"Jun"),m(1438,"Jul"),m(1439,"Aug"),m(1440,"Sep"),m(1441,"Oct"),m(1442,"Nov"),m(1443,"Dec")]}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return eg.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return eg.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return eg.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return eg.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),n=i>0?"-":"+",s=Math.trunc(Math.abs(i/60)),r=s<10?"0"+s:s,a=Math.abs(i)-s*60,l=a<10?"0"+a:a;return n+r+":"+l}}}class w8{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=A_e(this._workspaceService.getWorkspace());if(!M_e(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(jT(e))return Fc(e.uri.path);let t=Fc(e.configPath.path);return t.endsWith(qT)&&(t=t.substr(0,t.length-qT.length-1)),t}_resoveWorkspacePath(e){if(jT(e))return m8(e.uri.fsPath);const t=Fc(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?m8(i):"/"}}class S8{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return cf()}}var X0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Q0e=function(o,e){return function(t,i){e(t,i,o)}},ha;class Hr{static{this._decor={active:Te.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Te.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Te.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Te.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})}}constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=B3(t.placeholders,ar.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),s=this._snippet.fullLen(i),r=L.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+s)),a=i.isFinalTabstop?Hr._decor.inactiveFinal:Hr._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx])if(s.transform){const r=this._placeholderDecorations.get(s),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=s.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",n)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{const s=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new ae(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?Hr._decor.activeFinal:Hr._decor.active),s.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?Hr._decor.activeFinal:Hr._decor.active),s.add(d)}}for(const[a,l]of this._placeholderDecorations)s.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?Hr._decor.inactiveFinal:Hr._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof ar){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const s=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(s);if(!r){e.delete(n.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof b_,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const s=e.shift();console.assert(s._offset!==-1),console.assert(!s._placeholderDecorations);const r=s._snippet.placeholderInfo.last.index;for(const l of s._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=n.index+(r+1)/this._nestingLevel:l.index=n.index+l.index/this._nestingLevel;this._snippet.replace(n,s._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of s._snippet.placeholders){const c=s._snippet.offset(l),d=s._snippet.fullLen(l),h=L.fromPositions(t.getPositionAt(s._offset+c),t.getPositionAt(s._offset+c+d)),u=i.addDecoration(h,Hr._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=B3(this._snippet.placeholders,ar.compareByIndex)})}}const y8={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let mx=ha=class{static adjustWhitespace(e,t,i,n,s){const r=e.getLineContent(t.lineNumber),a=Dt(r,0,t.column-1);let l;return n.walk(c=>{if(!(c instanceof ks)||c.parent instanceof b_||s&&!s.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const u=n.offset(c);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??n.toString();const g=l.charCodeAt(u-1);(g===10||g===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let g=1;gv.get(sd)),f=e.invokeWithinContext(v=>new C8(v.get(Zg),u)),p=()=>a,_=u.getValueInRange(ha.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(ha.adjustSelection(u,e.getSelection(),0,n)),C=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((v,S)=>({selection:v,idx:S})).sort((v,S)=>L.compareRangesUsingStarts(v.selection,S.selection));for(const{selection:v,idx:S}of w){let x=ha.adjustSelection(u,v,i,0),k=ha.adjustSelection(u,v,0,n);_!==u.getValueInRange(x)&&(x=v),b!==u.getValueInRange(k)&&(k=v);const D=v.setStartPosition(x.startLineNumber,x.startColumn).setEndPosition(k.endLineNumber,k.endColumn),I=new Hg().parse(t,!0,s),T=D.getStartPosition(),F=ha.adjustWhitespace(u,T,r||S>0&&C!==u.getLineFirstNonWhitespaceColumn(v.positionLineNumber),I);I.resolveVariables(new _8([f,new v8(p,S,w.length,e.getOption(88)==="spread"),new b8(u,v,S,l),new px(u,v,c),new eg,new w8(g),new S8])),d[S]=gi.replace(D,I.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new Hr(e,I,F)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,s,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new Hg,h=new Fw,u=new _8([e.invokeWithinContext(f=>new C8(f.get(Zg),c)),new v8(()=>s,0,e.getSelections().length,e.getOption(88)==="spread"),new b8(c,e.getSelection(),0,r),new px(c,e.getSelection(),a),new eg,new w8(e.invokeWithinContext(f=>f.get(sd))),new S8]);t=t.sort((f,p)=>L.compareRangesUsingStarts(f.range,p.range));let g=0;for(let f=0;f0){const x=t[f-1].range,k=L.fromPositions(x.getEndPosition(),p.getStartPosition()),D=new ks(c.getValueInRange(k));h.appendChild(D),g+=D.value.length}const C=d.parseFragment(_,h);ha.adjustWhitespace(c,p.getStartPosition(),b!==void 0?!b:n,h,new Set(C)),h.resolveVariables(u);const w=h.toString(),v=w.slice(g);g=w.length;const S=gi.replace(p,v);S.identifier={major:f,minor:0},S._isTracked=!0,l.push(S)}return d.ensureFinalTabstop(h,i,!0),{edits:l,snippets:[new Hr(e,h,"")]}}constructor(e,t,i=y8,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){pt(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}=typeof this._template=="string"?ha.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):ha.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??jn.snippet(),t,n=>{const s=n.filter(r=>!!r.identifier);for(let r=0;rae.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=y8){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=ha.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,s=>{const r=s.filter(l=>!!l.identifier);for(let l=0;lae.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{s.push(...n.get(r))})}e.sort(L.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(L.compareRangesUsingStarts);for(let s=0;s0}};mx=ha=X0e([Q0e(3,ti)],mx);var J0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Y1=function(o,e){return function(t,i){e(t,i,o)}},Jf;const x8={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let gs=class{static{Jf=this}static{this.ID="snippetController2"}static get(e){return e.getContribution(Jf.ID)}static{this.InSnippetMode=new oe("inSnippetMode",!1,m(1402,"Whether the editor in current in snippet mode"))}static{this.HasNextTabstop=new oe("hasNextTabstop",!1,m(1403,"Whether there is a next tab stop when in snippet mode"))}static{this.HasPrevTabstop=new oe("hasPrevTabstop",!1,m(1404,"Whether there is a previous tab stop when in snippet mode"))}constructor(e,t,i,n,s){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=s,this._inSnippetObservable=De(this,!1),this._snippetListener=new z,this._modelVersionId=-1,this._inSnippet=Jf.InSnippetMode.bindTo(n),this._hasNextTabstop=Jf.HasNextTabstop.bindTo(n),this._hasPrevTabstop=Jf.HasPrevTabstop.bindTo(n)}dispose(){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?x8:{...x8,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Je(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new mx(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const i={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(c,d)=>{if(!this._session||c!==this._editor.getModel()||!R.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const u=c.getValueInRange(h.range),g=!!h.choice.options.find(p=>p.value===u),f=[];for(let p=0;p{s?.dispose(),r=!1},l=()=>{r||(s=this._languageFeaturesService.completionProvider.register({language:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.uri.scheme,exclusive:!0},i),this._snippetListener.add(s),r=!0)};this._choiceCompletions={provider:i,enable:l,disable:a}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){this._choiceCompletions?.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{v0e(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}get isInSnippetObservable(){return this._inSnippetObservable}};gs=Jf=J0e([Y1(1,Mt),Y1(2,he),Y1(3,Ie),Y1(4,ti)],gs);Xe(gs.ID,gs,4);const zk=Ki.bindToContribution(gs.get);re(new zk({id:"jumpToNextSnippetPlaceholder",precondition:q.and(gs.InSnippetMode,gs.HasNextTabstop),handler:o=>o.next(),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:2}}));re(new zk({id:"jumpToPrevSnippetPlaceholder",precondition:q.and(gs.InSnippetMode,gs.HasPrevTabstop),handler:o=>o.prev(),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:1026}}));re(new zk({id:"leaveSnippet",precondition:gs.InSnippetMode,handler:o=>o.cancel(!0),kbOpts:{weight:130,kbExpr:N.textInputFocus,primary:9,secondary:[1033]}}));re(new zk({id:"acceptSnippet",precondition:gs.InSnippetMode,handler:o=>o.finish()}));function Rv(o){return new eye(o)}class eye extends v${constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}}const tye=[];function iye(){return tye}function L8(o){return nye(o).map(t=>t.getEndPosition())}function nye(o){const e=D0.createSortPermutation(o,Bn(n=>n.range,L.compareRangesUsingStarts)),i=new ho(e.apply(o)).getNewRanges();return e.inverse().apply(i)}function sye(o,e){const t=Rv(e),i=e.getValue();return o.map(r=>t.getStringReplacement(r)).map(r=>r.removeCommonSuffixPrefix(i)).map(r=>t.getTextReplacement(r))}function oye(o,e){const t=De("result",[]),i=[];return e.add(xe(n=>{const s=o.read(n);Et(r=>{if(s.length!==i.length){i.length=s.length;for(let a=0;aa.set(s[l],r))})})),t}class rye{constructor(e){this._contextKeyService=e}bind(e,t){return tl(e,this._contextKeyService,t instanceof Function?t:i=>t.read(i))}}function k8(o,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},o);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class aye{constructor(e,t,i,n=lye){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=n,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}}function lye(o,e,t,i){return o===i?e+t:t*(-Math.pow(2,-10*o/i)+1)+e}function cye(o,e,t,i){return t*((o=o/i-1)*o*o+1)+e}class dye{constructor(e){this._value=De(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||Uk.instance.invalidateOnNextAnimationFrame(e),t.getValue()}}class Uk{constructor(){this._counter=pr(this),this._isScheduled=!1}static{this.instance=new Uk}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,_t().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}}class Mv{constructor(e,t){this.lineNumber=e,this.parts=t,_h(()=>rw(t,(i,n)=>i.column<=n.column))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new ho([...this.parts.map(s=>new Ni(L.fromPositions(new R(1,s.column)),s.lines.map(r=>r.line).join(` +`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class _x{constructor(e,t,i,n=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=n,this.lines=bo(this.text).map((s,r)=>({line:s,lineDecorations:ds.filter(this._inlineDecorations,r+1,1,s.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&ds.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}}class uM{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new _x(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=bo(this.text)}renderForScreenReader(e){return this.newLines.join(` +`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function D8(o,e){return jt(o,e,jG)}function jG(o,e){return o===e?!0:!o||!e?!1:o instanceof Mv&&e instanceof Mv||o instanceof uM&&e instanceof uM?o.equals(e):!1}function Mc(o,e,t){const i=t?o.range.intersectRanges(t):o.range;if(!i)return o;const n=o.text.replaceAll(`\r `,` -`),s=e.getValueInRange(i,1),r=pa(s,n),a=di.ofText(s.substring(0,r)).addToPosition(o.range.getStartPosition()),l=n.substring(r),c=D.fromPositions(a,o.range.getEndPosition());return new Fi(c,l)}function OY(o,e){return o.text.startsWith(e.text)&&Ixe(o.range,e.range)}function Ixe(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}function g6(o,e,t,i,n=0){let s=ed(o,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=Rt(r).length;if(s.range.startColumn-1<=a){const f=Rt(s.text).length,p=r.substring(s.range.startColumn-1,a),[_,b]=[s.range.getStartPosition(),s.range.getEndPosition()],C=_.column+p.length<=b.column?_.delta(0,p.length):b,w=D.fromPositions(C,b),v=s.text.startsWith(p)?s.text.substring(p.length):s.text.substring(f);s=new Fi(w,v)}const c=e.getValueInRange(s.range),d=Exe(c,s.text);if(!d)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=d.filter(p=>p.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==c.length)return}const g=s.text.length-n;for(const f of d){const p=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&p0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,b=Math.max(f.modifiedStart,Math.min(_,g)),C=s.text.substring(f.modifiedStart,b),w=s.text.substring(b,Math.max(f.modifiedStart,_));C.length>0&&u.push(new ux(p,C,!1)),w.length>0&&u.push(new ux(p,w,!0))}return new _w(h,u)}let jS;function Exe(o,e){if(jS?.originalValue===o&&jS?.newValue===e)return jS?.changes;{let t=p6(o,e,!0);if(t){const i=f6(t);if(i>0){const n=p6(o,e,!1);n&&f6(n)5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;hd&&(d=g)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let g=0,f=c.length;ga},{getElements:()=>l}).ComputeDiff(!1).changes}function Nxe(o,e){let t,i=!1;const n=new UU(new Zn(o,void 0,e.update),(s,r)=>{i||(t=e.initial instanceof Function?e.initial():e.initial,i=!0);const a=e.update(s,t,r);return t=a,a},e.changeTracker,()=>{i&&(e.disposeFinal?.(t),i=!1)},e.equalityComparer??lr,(s,r,a)=>{if(!i)throw new ve("Can only set when there is a listener! This is to prevent leaks.");Um(r,l=>{t=s,n.setValue(s,l,a)})},en.ofCaller());return n}var Txe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},m6=function(o,e){return function(t,i){e(t,i,o)}};class Rxe{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let x2=class extends Rxe{constructor(e,t){super(e,(i,n)=>{let s=!0;n&&D2 in n&&(s=!!n[D2]),s&&t.getDataChannel("editTelemetry").sendData({eventName:i,data:n??{}})})}};x2=Txe([m6(0,cs),m6(1,x3)],x2);const D2=Symbol("shouldForwardToChannel");function Mxe(o){return{[D2]:o}}function _6(o){if(!o)return!1;const e=o.toLowerCase();return e==="github.copilot"||e==="github.copilot-chat"}function Pxe(o){const e=o.map(i=>new Nn(fe.ofStartAndLength(i.rangeOffset,i.rangeLength),i.text));return e.reverse(),new Ga(e)}function Axe(o,e){o.publicLog2("inlineCompletion.endOfLife",e)}class X0{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class FY{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}const Oxe=3;class Fxe{computeDiff(e,t,i){const s=new Hxe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const l of s.changes){let c;l.originalEndLineNumber===0?c=new Ce(l.originalStartLineNumber+1,l.originalStartLineNumber+1):c=new Ce(l.originalStartLineNumber,l.originalEndLineNumber+1);let d;l.modifiedEndLineNumber===0?d=new Ce(l.modifiedStartLineNumber+1,l.modifiedStartLineNumber+1):d=new Ce(l.modifiedStartLineNumber,l.modifiedEndLineNumber+1);let h=new ar(c,d,l.charChanges?.map(u=>new Ms(new D(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new D(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new ar(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return Wh(()=>$w(r,(l,c)=>c.original.startLineNumber-l.original.endLineNumberExclusive===c.modified.startLineNumber-l.modified.endLineNumberExclusive&&l.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Em{constructor(e,t,i,n,s,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Em(n,s,r,a,l,c,d,h)}}function Bxe(o){if(o.length<=1)return o;const e=[o[0]];let t=e[0];for(let i=1,n=o.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const g=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),f=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(g.getElements().length>0&&f.getElements().length>0){let p=WY(g,f,s,!0).changes;a&&(p=Bxe(p)),u=[];for(let _=0,b=p.length;_1&&p>1;){const _=u.charCodeAt(f-2),b=g.charCodeAt(p-2);if(_!==b)break;f--,p--}(f>1||p>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,f,r+1,1,p)}{let f=I2(u,1),p=I2(g,1);const _=u.length+1,b=g.length+1;for(;f<_&&p!0;const e=Date.now();return()=>Date.now()-e0&&p>0&&r.get(f-1,p-1)===3&&(C+=a.get(f-1,p-1)),C+=n?n(f,p):1):C=-1;const w=Math.max(_,b,C);if(w===C){const v=f>0&&p>0?a.get(f-1,p-1):0;a.set(f,p,v+1),r.set(f,p,3)}else w===_?(a.set(f,p,0),r.set(f,p,1)):w===b&&(a.set(f,p,0),r.set(f,p,2));s.set(f,p,w)}const l=[];let c=e.length,d=t.length;function h(f,p){(f+1!==c||p+1!==d)&&l.push(new an(new fe(f+1,c),new fe(p+1,d))),c=f,d=p}let u=e.length-1,g=t.length-1;for(;u>=0&&g>=0;)r.get(u,g)===3?(h(u,g),u--,g--):r.get(u,g)===1?u--:g--;return h(-1,-1),l.reverse(),new cd(l,!1)}}class BY{compute(e,t,i=p1.instance){if(e.length===0||t.length===0)return cd.trivial(e,t);const n=e,s=t;function r(p,_){for(;pn.length||v>s.length)continue;const S=r(w,v);l.set(d,S);const L=w===b?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new v6(L,w,v,S-w):L),l.get(d)===n.length&&l.get(d)-d===s.length)break e}}let h=c.get(d);const u=[];let g=n.length,f=s.length;for(;;){const p=h?h.x+h.length:0,_=h?h.y+h.length:0;if((p!==g||_!==f)&&u.push(new an(new fe(p,g),new fe(_,f))),!h)break;g=h.x,f=h.y,h=h.prev}return u.reverse(),new cd(u,!1)}}class v6{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class zxe{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class Uxe{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class gx{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let s=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,s=s.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,s.length):s.length;for(let c=0;cString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=y6(e>0?this.elements[e-1]:-1),i=y6(es<=e),n=e-this.firstElementOffsetByLineIdx[i];return new R(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(n===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?D.fromPositions(i,i):D.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!mp(this.elements[e]))return;let t=e;for(;t>0&&mp(this.elements[t-1]);)t--;let i=e;for(;i=this.elements.length||!mp(this.elements[e]))return;let t=e;for(;t>0&&mp(this.elements[t-1])&&!w6(this.elements[t]);)t--;let i=e;for(;in<=e.start)??0,i=Nce(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new fe(t,i)}}function mp(o){return o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57}function w6(o){return o>=65&&o<=90}const $xe={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function S6(o){return $xe[o]}function y6(o){return o===10?8:o===13?7:BR(o)?6:o>=97&&o<=122?0:o>=65&&o<=90?1:o>=48&&o<=57?2:o===-1?3:o===44||o===59?5:4}function jxe(o,e,t,i,n,s){let{moves:r,excludedChanges:a}=Kxe(o,e,t,s);if(!s.isValid())return[];const l=o.filter(d=>!a.has(d)),c=Gxe(l,i,n,e,t,s);return rT(r,c),r=Zxe(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&qxe(h,g=>g.length>=2)>=2}),r=Yxe(o,r),r}function qxe(o,e){let t=0;for(const i of o)e(i)&&t++;return t}function Kxe(o,e,t,i){const n=[],s=o.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Yv(l.original,e,l)),r=new Set(o.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Yv(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,d;for(const h of r){const u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),n.push(new _s(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function Gxe(o,e,t,i,n,s){const r=[],a=new c$;for(const u of o)for(let g=u.original.startLineNumber;gu.modified.startLineNumber,Lo));for(const u of o){let g=[];for(let f=u.modified.startLineNumber;f{for(const v of g)if(v.originalLineRange.endLineNumberExclusive+1===C.endLineNumberExclusive&&v.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){v.originalLineRange=new Ce(v.originalLineRange.startLineNumber,C.endLineNumberExclusive),v.modifiedLineRange=new Ce(v.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),b.push(v);return}const w={modifiedLineRange:_,originalLineRange:C};l.push(w),b.push(w)}),g=b}if(!s.isValid())return[]}l.sort(BU(Kn(u=>u.modifiedLineRange.length,Lo)));const c=new Ir,d=new Ir;for(const u of l){const g=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,f=c.subtractFrom(u.modifiedLineRange),p=d.subtractFrom(u.originalLineRange).getWithDelta(g),_=f.getIntersection(p);for(const b of _.ranges){if(b.length<3)continue;const C=b,w=b.delta(-g);r.push(new _s(w,C)),c.addRange(C),d.addRange(w)}}r.sort(Kn(u=>u.original.startLineNumber,Lo));const h=new jD(o);for(let u=0;uL.original.startLineNumber<=g.original.startLineNumber),p=e_(o,L=>L.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-f.original.startLineNumber,g.modified.startLineNumber-p.modified.startLineNumber),b=h.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||x>n.length||c.contains(x)||d.contains(L)||!L6(i[L-1],n[x-1],s))break}v>0&&(d.addRange(new Ce(g.original.startLineNumber-v,g.original.startLineNumber)),c.addRange(new Ce(g.modified.startLineNumber-v,g.modified.startLineNumber)));let S;for(S=0;Si.length||x>n.length||c.contains(x)||d.contains(L)||!L6(i[L-1],n[x-1],s))break}S>0&&(d.addRange(new Ce(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+S)),c.addRange(new Ce(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+S))),(v>0||S>0)&&(r[u]=new _s(new Ce(g.original.startLineNumber-v,g.original.endLineNumberExclusive+S),new Ce(g.modified.startLineNumber-v,g.modified.endLineNumberExclusive+S)))}return r}function L6(o,e,t){if(o.trim()===e.trim())return!0;if(o.length>300&&e.length>300)return!1;const n=new BY().compute(new gx([o],new D(1,1,1,o.length),!1),new gx([e],new D(1,1,1,e.length),!1),t);let s=0;const r=an.invert(n.diffs,o.length);for(const d of r)d.seq1Range.forEach(h=>{BR(o.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;ue.length?o:e);return s/l>.6&&l>10}function Zxe(o){if(o.length===0)return o;o.sort(Kn(t=>t.original.startLineNumber,Lo));const e=[o[0]];for(let t=1;t=0&&r>=0&&s+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function Yxe(o,e){const t=new jD(o);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function Xxe(o,e,t){if(!o.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,s=t[i],r=i+1=i.start&&o.seq2Range.start-r>=n.start&&t.isStronglyEqual(o.seq2Range.start-r,o.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;o.seq1Range.start+ac&&(c=f,l=d)}return o.delta(l)}function Qxe(o,e,t){const i=[];for(const n of t){const s=i[i.length-1];if(!s){i.push(n);continue}n.seq1Range.start-s.seq1Range.endExclusive<=2||n.seq2Range.start-s.seq2Range.endExclusive<=2?i[i.length-1]=new an(s.seq1Range.join(n.seq1Range),s.seq2Range.join(n.seq2Range)):i.push(n)}return i}function I6(o,e,t,i,n=!1){const s=an.invert(t,o.length),r=[];let a=new Va(0,0);function l(d,h){if(d.offset10;){const C=s[0];if(!(C.seq1Range.intersects(f.seq1Range)||C.seq2Range.intersects(f.seq2Range)))break;const v=i(o,C.seq1Range.start),S=i(e,C.seq2Range.start),L=new an(v,S),x=L.intersect(C);if(_+=x.seq1Range.length,b+=x.seq2Range.length,f=f.join(L),f.seq1Range.endExclusive>=C.seq1Range.endExclusive)s.shift();else break}(n&&_+b0;){const d=s.shift();d.seq1Range.isEmpty||(l(d.getStarts(),d),l(d.getEndExclusives().delta(-1),d))}return Jxe(t,r)}function Jxe(o,e){const t=[];for(;o.length>0||e.length>0;){const i=o[0],n=e[0];let s;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=s.seq1Range.start?t[t.length-1]=t[t.length-1].join(s):t.push(s)}return t}function eDe(o,e,t){let i=t;if(i.length===0)return i;let n=0,s;do{s=!1;const r=[i[0]];for(let a=1;a5||g.seq1Range.length+g.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(s=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(n++<10&&s);return i}function tDe(o,e,t){let i=t;if(i.length===0)return i;let n=0,s;do{s=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const b=o.getText(p).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const C=o.countLinesIn(g.seq1Range),w=g.seq1Range.length,v=e.countLinesIn(g.seq2Range),S=g.seq2Range.length,L=o.countLinesIn(f.seq1Range),x=f.seq1Range.length,k=e.countLinesIn(f.seq2Range),I=f.seq2Range.length,T=130;function A(O){return Math.min(O,T)}return Math.pow(Math.pow(A(C*40+w),1.5)+Math.pow(A(v*40+S),1.5),1.5)+Math.pow(Math.pow(A(L*40+x),1.5)+Math.pow(A(k*40+I),1.5),1.5)>(T**1.5)**1.5*1.3};const c=i[l],d=a[a.length-1];h(d,c)?(s=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(n++<10&&s);const r=[];return mte(i,(a,l,c)=>{let d=l;function h(b){return b.length>0&&b.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const u=o.extendToFullLines(l.seq1Range),g=o.getText(new fe(u.start,l.seq1Range.start));h(g)&&(d=d.deltaStart(-g.length));const f=o.getText(new fe(l.seq1Range.endExclusive,u.endExclusive));h(f)&&(d=d.deltaEnd(f.length));const p=an.fromOffsetPairs(a?a.getEndExclusives():Va.zero,c?c.getStarts():Va.max),_=d.intersect(p);r.length>0&&_.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(_):r.push(_)}),r}class E6{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:N6(this.lines[e-1]),i=e===this.lines.length?0:N6(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function N6(o){let e=0;for(;ex===k))return new X0([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new X0([new ar(new Ce(1,e.length+1),new Ce(1,t.length+1),[new Ms(new D(1,1,e.length,e[e.length-1].length+1),new D(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?p1.instance:new tbe(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(x){let k=r.get(x);return k===void 0&&(k=r.size,r.set(x,k)),k}const l=e.map(x=>a(x.trim())),c=t.map(x=>a(x.trim())),d=new E6(l,e),h=new E6(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(x,k)=>e[x]===t[k]?t[k].length===0?.1:1+Math.log(1+t[k].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let g=u.diffs,f=u.hitTimeout;g=x6(d,h,g),g=eDe(d,h,g);const p=[],_=x=>{if(s)for(let k=0;kx.seq1Range.start-b===x.seq2Range.start-C);const k=x.seq1Range.start-b;_(k),b=x.seq1Range.endExclusive,C=x.seq2Range.endExclusive;const I=this.refineDiff(e,t,x,n,s,i);I.hitTimeout&&(f=!0);for(const T of I.mappings)p.push(T)}_(e.length-b);const w=new iS(e),v=new iS(t),S=_L(p,w,v);let L=[];return i.computeMoves&&(L=this.computeMoves(S,e,t,l,c,n,s,i)),Wh(()=>{function x(I,T){if(I.lineNumber<1||I.lineNumber>T.length)return!1;const A=T[I.lineNumber-1];return!(I.column<1||I.column>A.length+1)}function k(I,T){return!(I.startLineNumber<1||I.startLineNumber>T.length+1||I.endLineNumberExclusive<1||I.endLineNumberExclusive>T.length+1)}for(const I of S){if(!I.innerChanges)return!1;for(const T of I.innerChanges)if(!(x(T.modifiedRange.getStartPosition(),t)&&x(T.modifiedRange.getEndPosition(),t)&&x(T.originalRange.getStartPosition(),e)&&x(T.originalRange.getEndPosition(),e)))return!1;if(!k(I.modified,t)||!k(I.original,e))return!1}return!0}),new X0(S,L,f)}computeMoves(e,t,i,n,s,r,a,l){return jxe(e,t,i,n,s,r).map(h=>{const u=this.refineDiff(t,i,new an(h.original.toOffsetRange(),h.modified.toOffsetRange()),r,a,l),g=_L(u.mappings,new iS(t),new iS(i),!0);return new FY(h,g)})}refineDiff(e,t,i,n,s,r){const l=nDe(i).toRangeMapping2(e,t),c=new gx(e,l.originalRange,s),d=new gx(t,l.modifiedRange,s),h=c.length+d.length<500?this.dynamicProgrammingDiffing.compute(c,d,n):this.myersDiffingAlgorithm.compute(c,d,n);let u=h.diffs;return u=x6(c,d,u),u=I6(c,d,u,(f,p)=>f.findWordContaining(p)),r.extendToSubwords&&(u=I6(c,d,u,(f,p)=>f.findSubWordContaining(p),!0)),u=Qxe(c,d,u),u=tDe(c,d,u),{mappings:u.map(f=>new Ms(c.translateRange(f.seq1Range),d.translateRange(f.seq2Range))),hitTimeout:h.hitTimeout}}}function nDe(o){return new _s(new Ce(o.seq1Range.start+1,o.seq1Range.endExclusive+1),new Ce(o.seq2Range.start+1,o.seq2Range.endExclusive+1))}const E2={getLegacy:()=>new Fxe,getDefault:()=>new iDe};var N2;(function(o){function e(t,i){return!t.isInlineEdit&&!t.uri?HC.create(t,i):Nm.create(t,i)}o.create=e})(N2||(N2={}));class HY{constructor(e,t,i){this._data=e,this.identity=t,this.hint=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===Zs.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){return this.hint?.range&&!this.hint.jumpToEdit?this.hint?.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}}class Bk{constructor(){this._onDispose=Er(this),this._jumpedTo=Ee(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+Bk.idCounter++}static{this.idCounter=0}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,this._refCount===0&&this._onDispose.trigger(void 0)}setJumpTo(e){this._jumpedTo.set(!0,e)}}class bw{static create(e){return new bw(D.lift(e.range),e.content,e.style,e.jumpToEdit)}constructor(e,t,i,n){this.range=e,this.content=t,this.style=i,this.jumpToEdit=n}withEdit(e,t){const i=new fe(t.getOffset(this.range.getStartPosition()),t.getOffset(this.range.getEndPosition())),n=sq([i],e)[0];if(!n)return;const s=t.getRange(n);return new bw(s,this.content,this.style,this.jumpToEdit)}}class HC extends HY{static create(e,t){const i=new Bk,n=mw(t),s=e.insertText.replace(/\r\n|\r|\n/g,t.getEOL()),r=oDe(new Nn(n.getOffsetRange(e.range),s),t),a=r.removeCommonSuffixAndPrefix(t.getValue()),l=n.getTextReplacement(r),c=e.hint?bw.create(e.hint):void 0;return new HC(r,a,l,l.range,e.snippetInfo,e.additionalTextEdits,e,i,c)}constructor(e,t,i,n,s,r,a,l,c){super(a,l,c),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=n,this.snippetInfo=s,this.additionalTextEdits=r,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new HC(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,e,this.hint)}withEdit(e,t){const i=sq([this._edit.replaceRange],e);if(i.length===0)return;const n=new Nn(i[0],this._textEdit.text),s=mw(t),r=s.getTextReplacement(n);let a=this.hint;if(a&&(a=a.withEdit(e,s),!a))return;const l=n.removeCommonSuffixAndPrefix(t.getValue());return new HC(n,l,r,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,a)}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&di.ofRange(i).isGreaterThanOrEqualTo(di.ofRange(this._originalRange))}isVisible(e,t){const i=this.getSingleTextEdit();return VY(i,this._originalRange,e,t)}}function VY(o,e,t,i){const n=ed(o,t),s=o.range;if(!s||e&&!e.getStartPosition().equals(s.getStartPosition())||i.lineNumber!==n.range.startLineNumber||n.isEmpty)return!1;const r=t.getValueInRange(n.range,1),a=n.text,l=Math.max(0,i.column-n.range.startColumn);let c=a.substring(0,l),d=a.substring(l),h=r.substring(0,l),u=r.substring(l);const g=t.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=g&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),c=c.trimStart(),c.length===0&&(d=d.trimStart())),c.startsWith(h)&&!!Uq(u,d)}class Nm extends HY{static create(e,t){const i=sDe(t,e.range,e.insertText),n=new lf(t),s=yo.fromStringEdit(i,n),r=i.isEmpty()?new Fi(new D(1,1,1,1),""):s.toReplacement(n),a=new Bk,l=i.replacements.map(d=>{const h=D.fromPositions(t.getPositionAt(d.replaceRange.start),t.getPositionAt(d.replaceRange.endExclusive)),u=t.getValueInRange(h);return fx.create(d,u)}),c=e.hint?bw.create(e.hint):void 0;return new Nm(i,r,e.uri,e,a,l,c,!1,t.getVersionId())}constructor(e,t,i,n,s,r,a,l=!1,c){super(n,s,a),this._edit=e,this._textEdit=t,this.uri=i,this._edits=r,this._lastChangePartOfInlineEdit=l,this._inlineEditModelVersion=c,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new Nm(this._edit,this._textEdit,this.uri,this._data,e,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(e,t,i){if(t=t.map(h=>h.applyTextModelChanges(e)),t.some(h=>h.edit===void 0))return;const n=i.getVersionId();let s=this._inlineEditModelVersion;const r=t.some(h=>h.lastChangeUpdatedEdit);if(r&&(s=n??-1),n===null||s+20!h.edit.isEmpty),t.length===0))return;const a=new Ga(t.map(h=>h.edit)),l=mw(i),c=l.getTextEdit(a).toReplacement(new lf(i));let d=this.hint;if(!(d&&(d=d.withEdit(e,l),!d)))return new Nm(a,c,this.uri,this._data,this.identity,t,d,r,s)}}function sDe(o,e,t){const i=o.getEOL(),n=o.getValueInRange(e),s=t.replace(/\r\n|\r|\n/g,i),l=E2.getDefault().computeDiff(No(n),No(s),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(u=>u.innerChanges??[]);function c(u,g){const f=di.fromPosition(g.getStartPosition());return di.ofRange(g).createRange(f.addToPosition(u))}const d=new bh(s);return new Ga(l.map(u=>{const g=c(e.getStartPosition(),u.originalRange),f=mw(o).getOffsetRange(g),p=d.getValueOfRange(u.modifiedRange),_=new Nn(f,p),b=o.getValueInRange(g);return rDe(_,b,l.length,o)}))}class fx{static create(e,t){const i=pa(e.newText,t),n=md(e.newText,t),s=e.newText.substring(i,e.newText.length-n);return new fx(e,s,i,n)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,n,s=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=n,this._lastChangeUpdatedEdit=s}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new fx(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new ve("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);if(!t){this._edit=void 0;return}this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged}_applyChanges(e,t){let i=e.replaceRange.start,n=e.replaceRange.endExclusive,s=e.newText,r=!1;const a=this._prefixLength>0||this._suffixLength>0;for(let l=t.replacements.length-1;l>=0;l--){const c=t.replacements[l],d=c.newText.length>0&&c.replaceRange.isEmpty;if(d&&!a&&c.replaceRange.start===i&&s.startsWith(c.newText)){i+=c.newText.length,s=s.substring(c.newText.length),n=Math.max(i,n),r=!0;continue}if(d&&a&&c.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(c.newText)){n+=c.newText.length,r=!0,this._prefixLength+=c.newText.length,this._trimmedNewText=this._trimmedNewText.substring(c.newText.length);continue}if(c.newText.length===0&&c.replaceRange.length>0&&c.replaceRange.start>=i+this._prefixLength&&c.replaceRange.endExclusive<=n-this._suffixLength){n-=c.replaceRange.length,r=!0;continue}if(c.equals(e)){r=!0,i=c.replaceRange.endExclusive,s="";continue}if(!(c.replaceRange.start>n)){if(c.replaceRange.endExclusive1&&o.newText.endsWith(t)&&!o.newText.startsWith(t)?new Nn(o.replaceRange.delta(-1),t+o.newText.slice(0,-t.length)):o}function aDe(o,e){const t=new hq,i=new gq(t,c=>e.getLanguageConfiguration(c)),n=new uq(new lDe([o]),i),s=iR(n,[],void 0,!0);let r="";const a=o.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=vi(d,c.openingBracket.length),c.child&&(l(c.child,d),d=vi(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=vi(d,c.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=u}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,vi(d,c.length));else if(c.kind===4)for(const h of c.children)l(h,d),d=vi(d,h.length)}}return l(s,Fs),r}class lDe{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class D3{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(e,t){const i=new D3;for(const n of e)i._nodes.add(n);for(const n of e){const s=t(n);if(s.length>0){const r=new Set;for(const a of s)r.add(a);i._outgoingEdges.set(n,r)}}return i}removeCycles(){const e=[],t=new Set,i=new Set,n=[],s=r=>{t.add(r),i.add(r);const a=this._outgoingEdges.get(r);if(a)for(const l of a)t.has(l)?i.has(l)&&(e.push(l),n.push({from:r,to:l})):s(l);i.delete(r)};for(const r of this._nodes)t.has(r)||s(r);for(const{from:r,to:a}of n){const l=this._outgoingEdges.get(r);l&&l.delete(a)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}}var is;(function(o){o.Jump="jump",o.Accept="accept",o.Inactive="inactive"})(is||(is={}));var gt;(function(o){o.GhostText="ghostText",o.Custom="custom",o.SideBySide="sideBySide",o.Deletion="deletion",o.InsertionInline="insertionInline",o.InsertionMultiLine="insertionMultiLine",o.WordReplacements="wordReplacements",o.LineReplacement="lineReplacement",o.Collapsed="collapsed"})(gt||(gt={}));function cDe(o,e,t,i,n,s){const r=Dj("icr"),a=new Jt;let l;const c={...i,requestUuid:r},d=gDe(e,t),h=rge(o,b=>b.groupId),u=D3.from(o,b=>b.yieldsToGroupIds?.flatMap(C=>h.get(C)??[])??[]),{foundCycles:g}=u.removeCycles();g.length>0&&Bi(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${g.map(b=>b.toString?b.toString():""+b).join(" -> ")}`));let f=0;const p=new JN(async b=>{try{if(f++,a.token.isCancellationRequested)return;const C=u.getOutgoing(b);for(const k of C){const I=await p.get(k);if(I)for(const T of I.inlineSuggestions.items){if(T.isInlineEdit||typeof T.insertText!="string"&&T.insertText!==void 0)return;if(T.insertText!==void 0){const A=new Fi(D.lift(T.range)??d,T.insertText);if(VY(A,void 0,t,e))return}}}let w;const v=Date.now();try{w=await b.provideInlineCompletions(t,e,c,a.token)}catch(k){Bi(k);return}const S=Date.now();if(!w)return;const L=[],x=new uDe(w,L,b);if(x.addRef(),UY(a.token,()=>x.removeRef(l)),a.token.isCancellationRequested)return;for(const k of w.items)L.push(dDe(k,x,d,t,s,c,n,{startTime:v,endTime:S}));return x}finally{f--}}),_=on.fromPromisesResolveOrder(o.map(b=>p.get(b))).filter(Cn);return{contextWithUuid:c,get didAllProvidersReturn(){return f===0},lists:_,cancelAndDispose:b=>{l===void 0&&(l=b,a.dispose(!0))}}}function UY(o,e){if(o.isCancellationRequested)return e(),F.None;{const t=o.onCancellationRequested(()=>{t.dispose(),e()});return{dispose:()=>t.dispose()}}}function dDe(o,e,t,i,n,s,r,a){let l,c,d=o.range?D.lift(o.range):t;if(typeof o.insertText=="string"){if(l=o.insertText,n&&o.completeBracketPairs){l=T6(l,d.getStartPosition(),i,n);const h=l.length-o.insertText.length;h!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+h))}c=void 0}else if(o.insertText===void 0)l="",c=void 0,d=new D(1,1,1,1);else if("snippet"in o.insertText){const h=o.insertText.snippet.length;if(n&&o.completeBracketPairs){o.insertText.snippet=T6(o.insertText.snippet,d.getStartPosition(),i,n);const g=o.insertText.snippet.length-h;g!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+g))}const u=new df().parse(o.insertText.snippet);u.children.length===1&&u.children[0]instanceof Os?(l=u.children[0].value,c=void 0):(l=u.toString(),c={snippet:o.insertText.snippet,range:d})}else Uw(o.insertText);return new hDe(d,l,c,be.revive(o.uri),o.hint,o.additionalTextEdits||Cxe(),o,e,s,o.isInlineEdit??!1,r,a,o.correlationId)}class hDe{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){this.range=e,this.insertText=t,this.snippetInfo=i,this.uri=n,this.hint=s,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,this.context=c,this.isInlineEdit=d,this._requestInfo=h,this._providerRequestInfo=u,this._correlationId=g,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:h.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,n){if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=n,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const s=new Uv(n.lineCountModified,n.lineCountOriginal,n.characterCountModified,n.characterCountOriginal);this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions,this.sourceInlineCompletion,t,s),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:Jg.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===Jg.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(i=>i.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}setIsPreceeded(e){this._isPreceeded=!0,(this._partiallyAcceptedSinceOriginal.characters!==0||this._partiallyAcceptedSinceOriginal.ratio!==0||this._partiallyAcceptedSinceOriginal.count!==0)&&console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??=e}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===gt.Collapsed;!i&&this._showUncollapsedStartTime===void 0&&(this._showUncollapsedStartTime=t),i&&this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(this._showStartTime===void 0)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}var VC;(function(o){o.TextEditor="textEditor",o.DiffEditor="diffEditor",o.Notebook="notebook"})(VC||(VC={}));class uDe{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,this.refCount===0){for(const t of this.inlineSuggestionsData)t.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}}function gDe(o,e){const t=e.getWordAtPosition(o),i=e.getLineMaxColumn(o.lineNumber);return t?new D(o.lineNumber,t.startColumn,o.lineNumber,i):D.fromPositions(o,o.with(void 0,i))}function T6(o,e,t,i){const n=t.getLineContent(e.lineNumber),s=Nn.replace(new fe(e.column-1,n.length),o),a=t.tokenization.tokenizeLinesAt(e.lineNumber,[s.replace(n)])?.[0].sliceZeroCopy(s.getRangeAfterReplace());return a?aDe(a,i):o}var fDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nb=function(o,e){return function(t,i){e(t,i,o)}},T2;let R2=class extends F{static{T2=this}static{this._requestId=0}constructor(e,t,i,n,s,r,a,l,c){super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=n,this._languageConfigurationService=s,this._logService=r,this._configurationService=a,this._instantiationService=l,this._contextKeyService=c,this._updateOperation=this._register(new _t),this._state=Nxe(this,{initial:()=>({inlineCompletions:sa.createEmpty(),suggestWidgetInlineCompletions:sa.createEmpty()}),disposeFinal:h=>{h.inlineCompletions.dispose(),h.suggestWidgetInlineCompletions.dispose()},changeTracker:Xue(()=>({versionId:this._versionId})),update:(h,u,g)=>{const f=Ga.compose(g.changes.map(p=>p.change?Pxe(p.change.changes):Ga.empty).filter(Cn));if(f.isEmpty())return u;try{return{inlineCompletions:u.inlineCompletions.createStateWithAppliedEdit(f,this._textModel),suggestWidgetInlineCompletions:u.suggestWidgetInlineCompletions.createStateWithAppliedEdit(f,this._textModel)}}finally{u.inlineCompletions.dispose(),u.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,h=>h.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,h=>h.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=$(this,h=>{this._versionId.read(h),this._updateOperation.clear()}),this._loadingCount=Ee(this,0),this._loggingEnabled=HB("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=HB("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(cx.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const d=E0.defaultChatAgent?.completionsEnablementSetting??void 0;d&&(this._updateCompletionsEnablement(d),this._register(this._configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(d)&&this._updateCompletionsEnablement(d)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(e){const t=this._configurationService.getValue(e);Xi(t)?this._completionsEnabled=t:this._completionsEnabled=void 0}_log(e){this._loggingEnabled.get()&&this._logService.info(cxe(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,n,s,r,a){const l=this._cursorPosition.get(),c=new pDe(l,i,this._textModel.getVersionId(),new Set(e)),d=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if(this._updateOperation.value?.request.satisfies(c))return this._updateOperation.value.promise;if(d?.request?.satisfies(c))return Promise.resolve(!0);const h=!!this._updateOperation.value;this._updateOperation.clear();const u=new Jt,g=(async()=>{const p=new z;this._loadingCount.set(this._loadingCount.get()+1,void 0);let _=!1;const b=()=>{_||(_=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};p.add(new It(()=>b(),10*1e3)).schedule();const w=e.filter(S=>S.providerId),v=new mDe(i,a,w);try{const S=this._debounceValue.get(this._textModel),L=$j(e.map(Q=>Q.debounceDelayMs),vte(Lo))??S;if((h||s&&i.triggerKind===Zs.Automatic)&&await h6(L,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)return v.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const k=T2._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:k,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:i.selectedSuggestionInfo?!0:void 0},time:Date.now(),provider:t});const I=new Date,T=cDe(e,this._cursorPosition.get(),this._textModel,i,a,this._languageConfigurationService);UY(u.token,()=>T.cancelAndDispose({kind:"tokenCancellation"}));let A=!1,O=!1;const W=[];for await(const Q of T.lists)if(Q){Q.addRef(),p.add(ge(()=>Q.removeRef(Q.inlineSuggestionsData.length===0?{kind:"empty"}:{kind:"notTaken"})));for(const ne of Q.inlineSuggestionsData){if(O=!0,!i.includeInlineEdits&&(ne.isInlineEdit||ne.showInlineEditMenu)){ne.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!(ne.isInlineEdit||ne.showInlineEditMenu)){ne.setNotShownReason("notInlineCompletionRequested");continue}const ce=N2.create(ne,this._textModel);W.push(ce),!ce.isInlineEdit&&!ce.showInlineEditMenu&&i.triggerKind===Zs.Automatic&&ce.isVisible(this._textModel,this._cursorPosition.get())&&(A=!0)}if(A)break}if(T.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const Q=T.didAllProvidersReturn;let ne;(u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)&&(ne="canceled");const ce=W.map(De=>({range:De.editRange.toString(),text:De.insertText,hint:De.hint,isInlineEdit:De.isInlineEdit,showInlineEditMenu:De.showInlineEditMenu,providerId:De.source.provider.providerId?.toString()}));this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:k,durationMs:Date.now()-I.getTime(),error:ne,result:ce,time:Date.now(),didAllProvidersReturn:Q})}if(v.setRequestUuid(T.contextWithUuid.requestUuid),O)v.setHasProducedSuggestion(),W.length>0&&u.token.isCancellationRequested&&W.forEach(Q=>Q.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(u.token.isCancellationRequested)v.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const Q=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");v.setNoSuggestionReasonIfNotSet(Q?"completionsQuotaExceeded":"noSuggestion")}const U=i.earliestShownDateTime-Date.now();if(U>0&&await h6(U,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId||r.get()){const Q=u.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==c.versionId?"canceled:documentChanged":r.get()?"canceled:userJumped":"unknown";return W.forEach(ne=>ne.setNotShownReasonIfNotSet(Q)),!1}const q=new Date;this._debounceValue.update(this._textModel,q.getTime()-I.getTime());const ie=this._cursorPosition.get();this._updateOperation.clear(),At(Q=>{const ne=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:sa.createEmpty(),suggestWidgetInlineCompletions:ne.suggestWidgetInlineCompletions.createStateWithAppliedResults(W,c,this._textModel,ie,n)},Q):this._state.set({inlineCompletions:ne.inlineCompletions.createStateWithAppliedResults(W,c,this._textModel,ie,n),suggestWidgetInlineCompletions:sa.createEmpty()},Q),ne.inlineCompletions.dispose(),ne.suggestWidgetInlineCompletions.dispose()})}finally{p.dispose(),b(),this.sendInlineCompletionsRequestTelemetry(v)}return!0})(),f=new CDe(c,u,g);return this._updateOperation.value=f,g}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:sa.createEmpty(),suggestWidgetInlineCompletions:sa.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&At(i=>{if(!e||(t.request?.versionId??-1)>(e.request?.versionId??-1)){e?.dispose();const n=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:sa.createEmpty()},i),n.inlineCompletions.dispose(),n.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)})}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")||e.requestUuid===void 0||e.hasProducedSuggestion||!bDe(this._completionsEnabled,this._textModel.getLanguageId())||!e.providers.some(n=>_6(n.providerId?.extensionId)))return;const t={opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map(n=>n.providerId?.toString()).filter(Cn).join(","),...Mxe(e.providers.some(n=>_6(n.providerId?.extensionId))),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0},i=this._instantiationService.createInstance(x2);Axe(i,t)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}};R2=T2=fDe([Nb(4,ai),Nb(5,Ht),Nb(6,Oe),Nb(7,pe),Nb(8,Ne)],R2);class pDe{constructor(e,t,i,n){this.position=e,this.context=t,this.versionId=i,this.providers=n}satisfies(e){return this.position.equals(e.position)&&dg(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,v4())&&(e.context.triggerKind===Zs.Automatic||this.context.triggerKind===Zs.Explicit)&&this.versionId===e.versionId&&_De(e.providers,this.providers)}}class mDe{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??=e}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}function _De(o,e){return[...o].every(t=>e.has(t))}function bDe(o,e="*"){return o===void 0?!1:typeof o[e]<"u"?!!o[e]:!!o["*"]}class CDe{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class sa extends F{static createEmpty(){return new sa([],void 0)}constructor(e,t){for(const i of e)i.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const i of this.inlineCompletions)i.removeRef()}})}_findById(e){return this.inlineCompletions.find(t=>t.identity===e)}_findByHash(e){return this.inlineCompletions.find(t=>t.hash===e)}createStateWithAppliedEdit(e,t){const i=this.inlineCompletions.map(n=>n.withEdit(e,t)).filter(Cn);return new sa(i,this.request)}createStateWithAppliedResults(e,t,i,n,s){let r;if(s){const c=this._findById(s);if(c&&c.canBeReused(i,t.position)){r=c;const d=e.find(h=>h.hash===c.hash);d?e=wDe(d,e):e=[c,...e]}}const a=r?!r.isInlineEdit:e.some(c=>!c.isInlineEdit&&c.isVisible(i,n));let l=[];for(const c of e){const d=this._findByHash(c.hash);let h;d&&d!==c?(h=c.withIdentity(d.identity),c.setIsPreceeded(d),d.setEndOfLifeReason({kind:Jg.Ignored,userTypingDisagreed:!1,supersededBy:c.getSourceCompletion()})):h=c,a!==h.isInlineEdit&&l.push(h)}return l.sort(Kn(c=>c.showInlineEditMenu,WU)),l=vDe(l,c=>c.semanticId),new sa(l,t)}clone(){return new sa(this.inlineCompletions,this.request)}}function vDe(o,e){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function wDe(o,e){const t=e.indexOf(o);return t>-1?[o,...e.slice(0,t),...e.slice(t+1)]:e}class SDe{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}}var yDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},R6=function(o,e){return function(t,i){e(t,i,o)}};const Hk=Ve("IInlineCompletionsService"),$Y=new re("inlineCompletions.snoozed",!1,m(79,"Whether inline completions are currently snoozed"));let M2=class extends F{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new P),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new Io);const i=$Y.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new ve(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(e===0){this.cancelSnooze();return}const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new ve("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),n=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:n,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};M2=yDe([R6(0,Ne),R6(1,cs)],M2);Ge(Hk,M2,1);const LDe="editor.action.inlineSuggest.snooze",xDe="editor.action.inlineSuggest.cancelSnooze",M6="inlineCompletions.lastSnoozeDuration";class k3 extends yn{static{this.ID=LDe}constructor(){super({id:k3.ID,title:H(81,"Snooze Inline Suggestions"),precondition:K.true(),f1:!0})}async run(e,...t){const i=e.get(as),n=e.get(Hk),s=e.get(Ls);let r;t.length>0&&typeof t[0]=="number"&&(r=t[0]*6e4),r||(r=await this.getDurationFromUser(i,s)),r&&n.setSnoozeDuration(r)}async getDurationFromUser(e,t){const i=t.getNumber(M6,0,3e5),n=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],s=await e.pick(n,{placeHolder:m(80,"Select snooze duration for Inline Suggestions"),activeItem:n.find(r=>r.value===i)});if(s)return t.store(M6,s.value,0,0),s.value}}class I3 extends yn{static{this.ID=xDe}constructor(){super({id:I3.ID,title:H(82,"Cancel Snooze Inline Suggestions"),precondition:$Y,f1:!0})}async run(e){e.get(Hk).cancelSnooze()}}class Xd extends F{static{this.MAX_SESSION_GAP_MS=3e3}static{this.MIN_SESSION_DURATION_MS=1e3}static{this.SESSION_HISTORY_LIMIT=50}static{this.TYPING_SPEED_WINDOW_MS=3e5}static{this.MIN_CHARS_FOR_RELIABLE_SPEED=20}getTypingInterval(){return(this._cacheInvalidated||this._cachedTypingIntervalResult===null)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(t=>this._updateTypingSpeed(t)))}_updateTypingSpeed(e){const t=Date.now();if(!this._isUserTyping(e)){this._finalizeCurrentSession();return}this._currentSession&&t-this._lastChangeTime>Xd.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:t,endTime:t,characterCount:0}),this._currentSession.endTime=t,this._currentSession.characterCount+=this._getActualCharacterCount(e),this._lastChangeTime=t,this._cacheInvalidated=!0}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||e.detailedReasons.length===0)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;switch(e.metadata.source){case"cursor":{const t=e.metadata.kind;return t==="type"||t==="compositionType"||t==="compositionEnd"}default:return!1}}_finalizeCurrentSession(){if(!this._currentSession)return;this._currentSession.endTime-this._currentSession.startTime>=Xd.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>Xd.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null}_calculateTypingInterval(){if(this._currentSession){const e={...this._currentSession};if(e.endTime-e.startTime>=Xd.MIN_SESSION_DURATION_MS&&e.characterCount>0){const i=[...this._typingSessions,e];return this._calculateSpeedFromSessions(i)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(e){if(e.length===0)return{averageInterval:0,characterCount:0};const t=[...e].sort((d,h)=>h.endTime-d.endTime),i=Date.now()-Xd.TYPING_SPEED_WINDOW_MS,n=t.filter(d=>d.endTime>i),s=t.splice(n.length);let r=yy(n.map(d=>d.characterCount));for(let d=0;dd.endTime-d.startTime));if(a===0||r<=1)return{averageInterval:0,characterCount:r};const l=Math.max(1,r-1),c=a/l;return{averageInterval:Math.round(c),characterCount:r}}dispose(){this._finalizeCurrentSession(),super.dispose()}}var DDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xu=function(o,e){return function(t,i){e(t,i,o)}};let P2=class extends F{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=s,this._enabled=r,this._editor=a,this._instantiationService=l,this._commandService=c,this._languageConfigurationService=d,this._accessibilityService=h,this._languageFeaturesService=u,this._codeEditorService=g,this._inlineCompletionsService=f,this._isActive=Ee(this,!1),this._onlyRequestInlineEditsSignal=Er(this),this._forceUpdateExplicitlySignal=Er(this),this._noDelaySignal=Er(this),this._fetchSpecificProviderSignal=Er(this),this._selectedInlineCompletionId=Ee(this,void 0),this.primaryPosition=$(this,v=>this._positions.read(v)[0]??new R(1,1)),this.allPositions=$(this,v=>this._positions.read(v)),this._isAcceptingPartially=!1,this._appearedInsideViewport=$(this,v=>{const S=this.state.read(v);return!S||!S.inlineCompletion?!1:IDe(this._editor,S.inlineCompletion)}),this._onDidAccept=new P,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=S7({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(v,S)=>(S.didUndo=v.didChange(this._textModelVersionId)&&!!v.change?.isUndoing,!0)}},(v,S)=>{const L=this._textModelVersionId.read(v);return L!==null&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===L-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&S.didUndo?(this._lastAcceptedInlineCompletionInfo=void 0,!0):!1}),this._preserveCurrentCompletionReasons=new Set([Ac.Redo,Ac.Undo,Ac.AcceptWord]),this.dontRefetchSignal=Er(this),this._fetchInlineCompletionsPromise=S7({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Zs.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(v,S)=>{if(v.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(v.change))&&(S.preserveCurrentCompletion=!0);const L=v.change?.detailedReasons??[];S.changeReason=L.length>0?L[0].getType():"",S.textChange=!0}else v.didChange(this._forceUpdateExplicitlySignal)?(S.preserveCurrentCompletion=!0,S.inlineCompletionTriggerKind=Zs.Explicit):v.didChange(this.dontRefetchSignal)?S.dontRefetch=!0:v.didChange(this._onlyRequestInlineEditsSignal)?S.onlyRequestInlineEdits=!0:v.didChange(this._fetchSpecificProviderSignal)&&(S.provider=v.change);return!0}}},(v,S)=>{if(this._source.clearOperationOnTextModelChange.read(v),this._noDelaySignal.read(v),this.dontRefetchSignal.read(v),this._onlyRequestInlineEditsSignal.read(v),this._forceUpdateExplicitlySignal.read(v),this._fetchSpecificProviderSignal.read(v),!((this._enabled.read(v)&&this._selectedSuggestItem.read(v)||this._isActive.read(v))&&(!this._inlineCompletionsService.isSnoozing()||S.inlineCompletionTriggerKind===Zs.Explicit))){this._source.cancelUpdate();return}this._textModelVersionId.read(v);const x=this._source.suggestWidgetInlineCompletions.read(void 0);let k=this._selectedSuggestItem.read(v);if(this._shouldShowOnSuggestConflict.read(void 0)&&(k=void 0),x&&!k&&this._source.seedInlineCompletionsWithSuggestWidget(),S.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(v)&&S.inlineCompletionTriggerKind!==Zs.Explicit){At(ne=>{this._source.clear(ne)});return}let I="";S.provider?I+="providerOnDidChange":S.inlineCompletionTriggerKind===Zs.Explicit&&(I+="explicit"),S.changeReason&&(I+=I.length>0?`:${S.changeReason}`:S.changeReason);const T=this._typing.getTypingInterval(),A={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:I,typingInterval:T.averageInterval,typingIntervalCharacterCount:T.characterCount,availableProviders:[]};let O={triggerKind:S.inlineCompletionTriggerKind,selectedSuggestionInfo:k?.toSelectedSuggestionInfo(),includeInlineCompletions:!S.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(v),requestIssuedDateTime:A.startTime,earliestShownDateTime:A.startTime+(S.inlineCompletionTriggerKind===Zs.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};O.triggerKind===Zs.Automatic&&S.textChange&&this.textModel.getAlternativeVersionId()===this._lastShownInlineCompletionInfo?.alternateTextModelVersionId&&(O={...O,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const W=this.selectedInlineCompletion.read(void 0)??this._inlineCompletionItems.read(void 0)?.inlineEdit,U=S.preserveCurrentCompletion||W?.forwardStable?W:void 0,q=this._jumpedToId.map(ne=>!!ne&&ne===this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId),ie=S.provider?{providers:[S.provider],label:"single:"+S.provider.providerId?.toString()}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},Q=this.getAvailableProviders(ie.providers);return A.availableProviders=Q.map(ne=>ne.providerId).filter(Cn),this._source.fetch(Q,ie.label,O,U?.identity,S.shouldDebounce,q,A)}),this._inlineCompletionItems=Un({owner:this},v=>{const S=this._source.inlineCompletions.read(v);if(!S)return;const L=this.primaryPosition.read(v);let x;const k=[];for(const I of S.inlineCompletions)I.isInlineEdit?x=I:I.isVisible(this.textModel,L)&&k.push(I);return k.length!==0&&(x=void 0),{inlineCompletions:k,inlineEdit:x}}),this._filteredInlineCompletionItems=Un({owner:this,equalsFn:lv()},v=>this._inlineCompletionItems.read(v)?.inlineCompletions??[]),this.selectedInlineCompletionIndex=$(this,v=>{const S=this._selectedInlineCompletionId.read(v),L=this._filteredInlineCompletionItems.read(v),x=this._selectedInlineCompletionId===void 0?-1:L.findIndex(k=>k.semanticId===S);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=$(this,v=>{const S=this._filteredInlineCompletionItems.read(v),L=this.selectedInlineCompletionIndex.read(v);return S[L]}),this.activeCommands=Un({owner:this,equalsFn:lv()},v=>this.selectedInlineCompletion.read(v)?.source.inlineSuggestions.commands??[]),this.inlineCompletionsCount=$(this,v=>{if(this.lastTriggerKind.read(v)===Zs.Explicit)return this._filteredInlineCompletionItems.read(v).length}),this._hasVisiblePeekWidgets=$(this,v=>this._editorObs.openedPeekWidgets.read(v)>0),this._shouldShowOnSuggestConflict=$(this,v=>{const S=this._showOnSuggestConflict.read(v);if(S!=="never"&&!!this.selectedInlineCompletion.read(v)){const x=this._selectedSuggestItem.read(v);return x?S==="whenSuggestListIsIncomplete"?x.listIncomplete:!0:!1}return!1}),this.state=Un({owner:this,equalsFn:(v,S)=>!v||!S?v===S:v.kind==="ghostText"&&S.kind==="ghostText"?u6(v.ghostTexts,S.ghostTexts)&&v.inlineCompletion===S.inlineCompletion&&v.suggestItem===S.suggestItem:v.kind==="inlineEdit"&&S.kind==="inlineEdit"?v.inlineEdit.equals(S.inlineEdit):!1},v=>{const S=this.textModel;if(this._suppressInSnippetMode.read(v)&&this._isInSnippetMode.read(v))return;const L=this._inlineCompletionItems.read(v),x=L?.inlineEdit;if(x){if(this._hasVisiblePeekWidgets.read(v))return;let I=x.getSingleTextEdit();I=ed(I,S);const T=this.primaryPosition.map(ie=>Ce.fromRangeInclusive(x.targetRange).addMargin(1,1).contains(ie.lineNumber)),A=x.source.inlineSuggestions.commands,O=new SDe(I,A??[],x),W=x.updatedEdit,U=W?yo.fromStringEdit(W,new lf(this.textModel)).replacements:[I],q=(L.inlineEdit?.command?.id==="vscode.open"||L.inlineEdit?.command?.id==="_workbench.open")&&L.inlineEdit?.command.arguments?.length?be.from(L.inlineEdit?.command.arguments[0]):void 0;return{kind:"inlineEdit",inlineEdit:O,inlineCompletion:x,edits:U,cursorAtInlineEdit:T,nextEditUri:q}}const k=this._selectedSuggestItem.read(v);if(!this._shouldShowOnSuggestConflict.read(v)&&k){const I=ed(k.getSingleTextEdit(),S),T=this._computeAugmentation(I,v);if(!this._suggestPreviewEnabled.read(v)&&!T)return;const O=T?.edit??I,W=T?T.edit.text.length-I.text.length:0,U=this._suggestPreviewMode.read(v),q=this._positions.read(v),Q=[O,...oN(this.textModel,q,O)].map((We,st)=>({edit:We,ghostText:We?g6(We,S,U,q[st],W):void 0})).filter(({edit:We,ghostText:st})=>We!==void 0&&st!==void 0),ne=Q.map(({edit:We})=>We),ce=Q.map(({ghostText:We})=>We),De=ce[0]??new _w(O.range.endLineNumber,[]);return{kind:"ghostText",edits:ne,primaryGhostText:De,ghostTexts:ce,inlineCompletion:T?.completion,suggestItem:k}}else{if(!this._isActive.read(v))return;const I=this.selectedInlineCompletion.read(v);if(!I)return;const T=I.getSingleTextEdit(),A=this._inlineSuggestMode.read(v),O=this._positions.read(v),U=[T,...oN(this.textModel,O,T)].map((Q,ne)=>({edit:Q,ghostText:Q?g6(Q,S,A,O[ne],0):void 0})).filter(({edit:Q,ghostText:ne})=>Q!==void 0&&ne!==void 0),q=U.map(({edit:Q})=>Q),ie=U.map(({ghostText:Q})=>Q);return ie[0]?{kind:"ghostText",edits:q,primaryGhostText:ie[0],ghostTexts:ie,inlineCompletion:I,suggestItem:void 0}:void 0}}),this.inlineCompletionState=$(this,v=>{const S=this.state.read(v);if(!(!S||S.kind!=="ghostText")&&!this._editorObs.inComposition.read(v))return S}),this.inlineEditState=$(this,v=>{const S=this.state.read(v);if(!(!S||S.kind!=="inlineEdit"))return S}),this.inlineEditAvailable=$(this,v=>!!this.inlineEditState.read(v)),this.warning=$(this,v=>this.inlineCompletionState.read(v)?.inlineCompletion?.warning),this.ghostTexts=Un({owner:this,equalsFn:u6},v=>{const S=this.inlineCompletionState.read(v);if(S)return S.ghostTexts}),this.primaryGhostText=Un({owner:this,equalsFn:AY},v=>{const S=this.inlineCompletionState.read(v);if(S)return S?.primaryGhostText}),this.showCollapsed=$(this,v=>{const S=this.state.read(v);if(!S||S.kind!=="inlineEdit"||S.inlineCompletion.hint)return!1;const L=S.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(v);return(this._inlineEditsShowCollapsedEnabled.read(v)||!L)&&this._jumpedToId.read(v)!==S.inlineCompletion.semanticId&&!this._inAcceptFlow.read(v)}),this._tabShouldIndent=$(this,v=>{if(this._inAcceptFlow.read(v))return!1;function S(k){return k.startLineNumber!==k.endLineNumber}function L(k,I){const T=k.getLineIndentColumn(I),A=k.getLineLastNonWhitespaceColumn(I),O=Math.max(A,T);return new D(I,T,I,O)}return this._editorObs.selections.read(v)?.some(k=>k.isEmpty()?this.textModel.getLineLength(k.startLineNumber)===0:S(k)||k.containsRange(L(this.textModel,k.startLineNumber)))}),this.tabShouldJumpToInlineEdit=$(this,v=>{if(this._tabShouldIndent.read(v))return!1;const S=this.inlineEditState.read(v);return S?this.showCollapsed.read(v)?!0:this._inAcceptFlow.read(v)&&this._appearedInsideViewport.read(v)&&!S.inlineCompletion.hint?.jumpToEdit?!1:!S.cursorAtInlineEdit.read(v):!1}),this.tabShouldAcceptInlineEdit=$(this,v=>{const S=this.inlineEditState.read(v);return!S||this.showCollapsed.read(v)||this._tabShouldIndent.read(v)?!1:this._inAcceptFlow.read(v)&&this._appearedInsideViewport.read(v)&&!S.inlineCompletion.hint?.jumpToEdit||S.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(v)||this._jumpedToId.read(v)===S.inlineCompletion.semanticId?!0:S.cursorAtInlineEdit.read(v)}),this._jumpedToId=Ee(this,void 0),this._inAcceptFlow=Ee(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(R2,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,v=>v?.request?.context.triggerKind),this._editorObs=oi(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map(v=>v.preview),this._suggestPreviewMode=p.map(v=>v.previewMode);const _=this._editorObs.getOption(71);this._inlineSuggestMode=_.map(v=>v.mode),this._suppressedInlineCompletionGroupIds=_.map(v=>new Set(v.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=_.map(v=>!!v.edits.enabled),this._inlineEditsShowCollapsedEnabled=_.map(v=>v.edits.showCollapsed),this._triggerCommandOnProviderChange=_.map(v=>v.triggerCommandOnProviderChange),this._minShowDelay=_.map(v=>v.minShowDelay),this._showOnSuggestConflict=_.map(v=>v.experimental.showOnSuggestConflict),this._suppressInSnippetMode=_.map(v=>v.suppressInSnippetMode);const b=Ss.get(this._editor);this._isInSnippetMode=b?.isInSnippetObservable??Ot(!1),this._typing=this._register(new Xd(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(v=>{v&&this.stop()}));{const v=this.textModel.uri.scheme==="vscode-notebook-cell",[S]=this._codeEditorService.listDiffEditors().filter(L=>L.getOriginalEditor().getId()===this._editor.getId()||L.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!S,this.editorType=v?VC.Notebook:this.isInDiffEditor?VC.DiffEditor:VC.TextEditor}this._register($m(this.state,v=>{v&&v.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(v.inlineCompletion.requestUuid)})),this._register($m(this._fetchInlineCompletionsPromise)),this._register(ke(v=>{this._editorObs.versionId.read(v),this._inAcceptFlow.set(!1,void 0)})),this._register(ke(v=>{this.state.map((L,x)=>!L||L.kind==="inlineEdit"&&!L.cursorAtInlineEdit.read(x)).read(v)&&this._jumpedToId.set(void 0,void 0)}));const C=this.inlineEditState.map(v=>v?.inlineCompletion.semanticId);this._register(ke(v=>{C.read(v)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}));const w=pt(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(e));y4(this,w,(v,S)=>{v.onDidChangeInlineCompletions&&S.add(v.onDidChangeInlineCompletions(()=>{if(!this._enabled.get()||(this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get()){this.trigger(void 0,{onlyFetchInlineEdits:!0});return}const x=this.state.get();x&&(x.inlineCompletion||x.edits)&&x.inlineCompletion?.source.provider!==v||At(k=>{this._fetchSpecificProviderSignal.trigger(k,v),this.trigger(k)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const n=this?.primaryGhostText.read(e);if(this?._selectedSuggestItem&&n&&n.parts.length>0){const{column:s,lines:r}=n.parts[0],a=r[0].line,l=this.textModel.getLineIndentColumn(n.lineNumber);if(s<=l){let d=vs(a);d===-1&&(d=a.length-1),t=d>0;const h=this.textModel.getOptions().tabSize;i=hi.visibleColumnFromColumn(a,d+1,h)!(r.groupId&&t.has(r.groupId))),n=new Set;for(const r of i)r.excludesGroupIds?.forEach(a=>n.add(a));const s=[];for(const r of i)r.groupId&&n.has(r.groupId)||s.push(r);return s}async trigger(e,t={}){Um(e,i=>{t.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(i),t.noDelay&&this._noDelaySignal.trigger(i),this._isActive.set(!0,i),t.explicit&&(this._inAcceptFlow.set(!0,i),this._forceUpdateExplicitlySignal.trigger(i)),t.provider&&this._fetchSpecificProviderSignal.trigger(i,t.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){return this.trigger(e,{onlyFetchInlineEdits:t,explicit:!0})}stop(e="automatic",t){Um(t,i=>{if(e==="explicitCancel"){const n=this.state.get()?.inlineCompletion;n&&n.reportEndOfLife({kind:Jg.Rejected})}this._isActive.set(!1,i),this._source.clear(i)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),s=n?n.inlineCompletions.filter(a=>!a.isInlineEdit):[this.selectedInlineCompletion.read(t)].filter(Cn);return Rce(s,a=>{let l=a.getSingleTextEdit();return l=ed(l,i,D.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),OY(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?Jn.inlineCompletionPartialAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):Jn.inlineCompletionAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){if(e.getModel()!==this.textModel)throw new ve;let t,i=!1;const n=this.state.get();if(n?.kind==="ghostText"){if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;t=n.inlineCompletion}else if(n?.kind==="inlineEdit")t=n.inlineCompletion,i=!!n.nextEditUri;else return;t.addRef();try{if(e.pushUndoStop(),!i)if(t.snippetInfo){const s=Fi.delete(t.editRange),r=t.additionalTextEdits.map(l=>new Fi(D.lift(l.range),l.text??"")),a=yo.fromParallelReplacementsUnsorted([s,...r]);e.edit(a,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),Ss.get(e)?.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const s=n.edits;let r=s;n.kind==="ghostText"&&(r=wxe(s,this.textModel));const a=d6(r).map(d=>le.fromPositions(d)),l=t.additionalTextEdits.map(d=>new Fi(D.lift(d.range),d.text??"")),c=yo.fromParallelReplacementsUnsorted([...s,...l]);if(e.edit(c,this._getMetadata(t,this.textModel.getLanguageId())),t.hint===void 0&&e.setSelections(n.kind==="inlineEdit"?a.slice(-1):a,"inlineCompletionAccept"),n.kind==="inlineEdit"&&!this._accessibilityService.isMotionReduced()){const d=c.getNewRanges(),h=this._store.add(new kDe(e,d,()=>{this._store.delete(h)}))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,Bi),t.reportEndOfLife({kind:Jg.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),s=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),r=t.match(s);let a=0;r&&r.index!==void 0?r.index===0?a=r[0].length:a=r.index:a=t.length;const c=/\s+/g.exec(t);return c&&c.index!==void 0&&c.index+c[0].length{const i=t.match(/\n/);return i&&i.index!==void 0?i.index+1:t.length},1)}async _acceptNext(e,t,i,n){if(e.getModel()!==this.textModel)throw new ve;const s=this.inlineCompletionState.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const r=s.primaryGhostText,a=s.inlineCompletion;if(a.snippetInfo){await this.accept(e);return}const l=r.parts[0],c=new R(r.lineNumber,l.column),d=l.text,h=i(c,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const u=d.substring(0,h),g=this._positions.get(),f=g[0];a.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const C=D.fromPositions(f,c),w=e.getModel().getValueInRange(C)+u,v=new Fi(C,w),S=[v,...oN(this.textModel,g,v)].filter(Cn),L=d6(S).map(x=>le.fromPositions(x));e.edit(yo.fromParallelReplacementsUnsorted(S),this._getMetadata(a,t)),e.setSelections(L,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const p=D.fromPositions(a.editRange.getStartPosition(),di.ofText(u).addToPosition(c)),b=e.getModel().getValueInRange(p,1).length;a.reportPartialAccept(b,{kind:n,acceptedLength:b},{characters:h,ratio:h/d.length,count:1})}finally{a.removeRef()}}handleSuggestAccepted(e){const t=ed(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:s},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){const e=this.textModel.getValue(),t=this.state.get()?.inlineCompletion;return{documentValue:e,inlineCompletion:t?.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&At(t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,n=i.getStartPosition();if(this._editor.setPosition(n,"inlineCompletions.jump"),i.isSingleLine()&&(e.inlineCompletion.hint||!e.inlineCompletion.insertText.includes(` -`)))this._editor.revealPosition(n);else{const r=new D(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(r,1)}e.inlineCompletion.identity.setJumpTo(t),this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};P2=DDe([xu(7,pe),xu(8,Vt),xu(9,ai),xu(10,Mn),xu(11,ue),xu(12,at),xu(13,Hk)],P2);var Ac;(function(o){o[o.Undo=0]="Undo",o[o.Redo=1]="Redo",o[o.AcceptWord=2]="AcceptWord",o[o.Other=3]="Other"})(Ac||(Ac={}));function oN(o,e,t){if(e.length===1)return[];const i=new lf(o),n=i.getTransformer(),s=n.getOffset(e[0]),r=e.slice(1).map(u=>n.getOffset(u));t=t.removeCommonPrefixAndSuffix(i);const a=n.getStringReplacement(t),l=a.replaceRange.start-s,c=a.replaceRange.join(fe.emptyAt(s)),d=i.getValueOfOffsetRange(c);return r.map(u=>{const g=u+l,f=g+a.replaceRange.length,p=new fe(g,f),_=p.join(fe.emptyAt(u));if(i.getValueOfOffsetRange(_)!==d)return;const C=new Nn(p,a.newText);return n.getTextReplacement(C)}).filter(Cn)}class kDe extends F{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(oi(e).setDecorations(Ot(t.map(r=>({range:r,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const n=new Lxe(1,0,1e3,Dxe),s=new kxe(n);this._register(ke(r=>{const a=s.getValue(r);e.getContainerDomNode().style.setProperty("--animation-opacity",a.toString()),n.isFinished()&&this.dispose()}))}}function IDe(o,e){const t=e.targetRange,i=o.getVisibleRanges();return i.length<1?!1:new D(i[0].startLineNumber,i[0].startColumn,i[i.length-1].endLineNumber,i[i.length-1].endColumn).containsRange(t)}var EDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},P6=function(o,e){return function(t,i){e(t,i,o)}},Qb;class E3{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;sl&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:i_.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class TDe extends E3{constructor(){super("recentlyUsedByPrefix"),this._trie=vm.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:i_.fromString(i.type),this._trie.set(t,i)}}}let A2=class{static{Qb=this}static{this._strategyCtors=new Map([["recentlyUsedByPrefix",TDe],["recentlyUsed",NDe],["first",A6]])}static{this._storagePrefix="suggest/memories"}constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new z,this._persistSoon=new It(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Ph.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const n=Qb._strategyCtors.get(i)||A6;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,a=this._storageService.get(`${Qb._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${Qb._storagePrefix}/${this._strategy.name}`,i,t,1)}}};A2=Qb=EDe([P6(0,Ls),P6(1,Oe)],A2);const Vk=Ve("ISuggestMemories");Ge(Vk,A2,1);var RDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},MDe=function(o,e){return function(t,i){e(t,i,o)}},O2;let px=class{static{O2=this}static{this.AtEnd=new re("atEndOfWord",!1,{type:"boolean",description:m(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")})}constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=O2.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(139)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(139)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),s=i.getWordAtPosition(n.getStartPosition());if(!s){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(s.endColumn===n.getStartPosition().column&&n.getStartPosition().lineNumber===n.getEndPosition().lineNumber)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};px=O2=RDe([MDe(1,Ne)],px);var PDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ADe=function(o,e){return function(t,i){e(t,i,o)}},Jb;let b_=class{static{Jb=this}static{this.OtherSuggestions=new re("hasOtherSuggestions",!1)}constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=Jb.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(Jb._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(let s=t.items.length;s>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));s--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=Jb._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};b_=Jb=PDe([ADe(1,Ne)],b_);class ODe{constructor(e,t,i,n){this._disposables=new z,this._disposables.add(i.onDidSuggest(s=>{s.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(s=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(s=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&n(this._active.item)}}))}_onItem(e){if(!e||!ws(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new Ey;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class ta{async provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s);const r=new Map;await new Promise(a=>ta._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>ta._bracketsLeftYield(a,0,e,n,r,s))}return i}static{this._maxDuration=30}static{this._maxRounds=2}static _bracketsRightYield(e,t,i,n,s){const r=new Map,a=Date.now();for(;;){if(t>=ta._maxRounds){e();break}if(!n){e();break}const l=i.bracketPairs.findNextBracket(n);if(!l){e();break}if(Date.now()-a>ta._maxDuration){setTimeout(()=>ta._bracketsRightYield(e,t+1,i,n,s));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=s.get(d);u||(u=new bs,s.set(d,u)),u.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,s,r){const a=new Map,l=Date.now();for(;;){if(t>=ta._maxRounds&&s.size===0){e();break}if(!n){e();break}const c=i.bracketPairs.findPrevBracket(n);if(!c){e();break}if(Date.now()-l>ta._maxDuration){setTimeout(()=>ta._bracketsLeftYield(e,t+1,i,n,s,r));break}if(c.bracketInfo.isOpeningBracket){const h=c.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const g=s.get(h);if(g){const f=g.shift();g.size===0&&s.delete(h);const p=D.fromPositions(c.range.getEndPosition(),f.getStartPosition()),_=D.fromPositions(c.range.getStartPosition(),f.getEndPosition());r.push({range:p}),r.push({range:_}),ta._addBracketLeading(i,_,r)}}}else{const h=c.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}n=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(n);s!==0&&s!==t.startColumn&&(i.push({range:D.fromPositions(new R(n,s),t.getEndPosition())}),i.push({range:D.fromPositions(new R(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:D.fromPositions(new R(r,a),t.getEndPosition())}),i.push({range:D.fromPositions(new R(r,1),t.getEndPosition())}))}}}class Ll{static{this.None=new class extends Ll{distance(){return 0}}}static async create(e,t){if(!t.getOption(134).localityBonus||!t.hasModel())return Ll.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Ll.None;const[s]=await new ta().provideSelectionRanges(i,[n]);if(s.length===0)return Ll.None;const r=await e.computeWordRanges(i.uri,s[0].range);if(!r)return Ll.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends Ll{distance(l,c){if(!n.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,h=r[d];if(OU(h))return 2<<20;const u=vy(h,D.fromPositions(l),D.compareRangesUsingStarts),g=u>=0?h[u]:h[Math.max(0,~u-1)];let f=s.length;for(const p of s){if(!D.containsRange(p.range,g))break;f-=1}return f}}}}let O6=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class rh{constructor(e,t,i,n,s,r,a=qF.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=rh._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=rh._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=rh._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",s="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?rf:tpe;for(let c=0;c=g)d.score=ga.Default;else if(typeof d.completion.filterText=="string"){const p=l(n,s,f,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;eT(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=Xfe(n,s,f,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(n,s,f,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?oT(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return 1;if(t.completion.kind===28)return-1}return rh._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return-1;if(t.completion.kind===28)return 1}return rh._compareCompletionItems(e,t)}}var FDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Vd=function(o,e){return function(t,i){e(t,i,o)}},F2;class Du{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function WDe(o,e,t){if(!e.getContextKeyValue(Tt.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(Tt.suppressSuggestions.key);return i!==void 0?!i:!o.getOption(71).suppressSuggestions}function BDe(o,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(Tt.suppressSuggestions.key);return i!==void 0?!i:!o.getOption(71).suppressSuggestions}let mx=F2=class{constructor(e,t,i,n,s,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=s,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new z,this._triggerCharacterListener=new z,this._triggerQuickSuggest=new Io,this._triggerState=void 0,this._completionDisposables=new z,this._onDidCancel=new P,this._onDidTrigger=new P,this._onDidSuggest=new P,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new le(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){vt(this._triggerCharacterListener),vt([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let s=e.get(n);s||(s=new Set,e.set(n,s)),s.add(i)}const t=i=>{if(!BDe(this._editor,this._contextKeyService,this._configurationService)||Du.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";Bh(i.charCodeAt(i.length-1))?Zi(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const s=e.get(n);if(s){const r=new Map;if(this._completionModel)for(const[a,l]of this._completionModel.getItemsByProvider())s.has(a)||r.set(a,l);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){Zp.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&Ss.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!Du.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(102);if(!Zp.isAllOff(i)){if(!Zp.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),s=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Zp.valueFor(i,s)!=="on")return}WDe(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){rt(this._editor.hasModel()),rt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new Du(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new Du(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??0};e.triggerCharacter&&(n={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Jt;const s=this._editor.getOption(128);let r=1;switch(s){case"top":r=0;break;case"bottom":r=2;break}const{itemKind:a,showDeprecated:l}=F2.createSuggestFilter(this._editor),c=new R1(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,l),d=Ll.create(this._editorWorkerService,this._editor),h=S3(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,n,this._requestToken.token);Promise.all([h,d]).then(async([u,g])=>{if(this._requestToken?.dispose(),!this._editor.hasModel()){u.disposable.dispose();return}let f=e?.clipboardText;if(!f&&u.needsClipboard&&(f=await this._clipboardService.readText()),this._triggerState===void 0){u.disposable.dispose();return}const p=this._editor.getModel(),_=new Du(p,this._editor.getPosition(),e),b={...qF.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new rh(u.items,this._context.column,{leadingLineContent:_.leadingLineContent,characterCountDelta:_.column-this._context.column},g,this._editor.getOption(134),this._editor.getOption(128),b,f),this._completionDisposables.add(u.disposable),this._onNewContext(_),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const C of u.items)C.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${C.provider._debugDisplayName}`,C.completion)}).catch(Te)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(128)==="none"&&t.add(28);const n=e.getOption(134);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(28),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Rt(e.leadingLineContent)!==Rt(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(Du.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[n,s]of this._completionModel.getItemsByProvider())s.length>0&&s[0].container.incomplete?i.add(n):t.set(n,s);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const n=Du.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};mx=F2=FDe([Vd(1,uo),Vd(2,Mo),Vd(3,cs),Vd(4,Ht),Vd(5,Ne),Vd(6,Oe),Vd(7,ue),Vd(8,N5)],mx);class N3{static{this._maxSelectionLength=51200}constructor(e,t){this._disposables=new z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),n=i.length;let s=!1;for(let a=0;aN3._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rN=function(o,e){return function(t,i){e(t,i,o)}};let W2=class{constructor(e,t,i,n,s){this._menuId=t,this._menuService=n,this._contextKeyService=s,this._menuDisposables=new z,this.element=Y(e,ee(".suggest-status-bar"));const r=(a=>a instanceof sr?i.createInstance(m5,a,{useComma:!1}):void 0);this._leftActions=new no(this.element,{actionViewItemProvider:r}),this._rightActions=new no(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],n=[];for(const[s,r]of e.getActions())s==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};W2=HDe([rN(2,pe),rN(3,Ur),rN(4,Ne)],W2);var VDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},F6=function(o,e){return function(t,i){e(t,i,o)}};function T3(o){return!!o&&!!(o.completion.documentation||o.completion.detail&&o.completion.detail!==o.completion.label)}let B2=class{constructor(e,t,i){this._editor=e,this._themeService=t,this._markdownRendererService=i,this._onDidClose=new P,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new P,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new z,this._renderDisposeable=new z,this._size=new ut(330,0),this.domNode=ee(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=ee(".body"),this._scrollbar=new o1(this._body,{alwaysConsumeMouseWheel:!0}),Y(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Y(this._body,ee(".header")),this._close=Y(this._header,ee("span"+ye.asCSSSelector(Z.close))),this._close.title=m(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=Y(this._header,ee("p.type")),this._docs=Y(this._body,ee("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),n=e.get(135)||t.fontSize,s=e.get(136)||t.lineHeight,r=t.fontWeight,a=`${n}px`,l=`${s}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${s/n}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=qa(this._themeService.getColorTheme().type)?2:1,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=m(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let s="";s+=`score: ${e.score[0]} +`),s=e.getValueInRange(i,1),r=ta(s,n),a=si.ofText(s.substring(0,r)).addToPosition(o.range.getStartPosition()),l=n.substring(r),c=L.fromPositions(a,o.range.getEndPosition());return new Ni(c,l)}function qG(o,e){return o.text.startsWith(e.text)&&hye(o.range,e.range)}function hye(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}function I8(o,e,t,i,n=0){let s=Mc(o,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=Dt(r).length;if(s.range.startColumn-1<=a){const f=Dt(s.text).length,p=r.substring(s.range.startColumn-1,a),[_,b]=[s.range.getStartPosition(),s.range.getEndPosition()],C=_.column+p.length<=b.column?_.delta(0,p.length):b,w=L.fromPositions(C,b),v=s.text.startsWith(p)?s.text.substring(p.length):s.text.substring(f);s=new Ni(w,v)}const c=e.getValueInRange(s.range),d=uye(c,s.text);if(!d)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=d.filter(p=>p.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==c.length)return}const g=s.text.length-n;for(const f of d){const p=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&p0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,b=Math.max(f.modifiedStart,Math.min(_,g)),C=s.text.substring(f.modifiedStart,b),w=s.text.substring(b,Math.max(f.modifiedStart,_));C.length>0&&u.push(new _x(p,C,!1)),w.length>0&&u.push(new _x(p,w,!0))}return new Mv(h,u)}let X1;function uye(o,e){if(X1?.originalValue===o&&X1?.newValue===e)return X1?.changes;{let t=N8(o,e,!0);if(t){const i=E8(t);if(i>0){const n=N8(o,e,!1);n&&E8(n)5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;hd&&(d=g)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let g=0,f=c.length;ga},{getElements:()=>l}).ComputeDiff(!1).changes}function gye(o,e){let t,i=!1;const n=new sz(new Vn(o,void 0,e.update),(s,r)=>{i||(t=e.initial instanceof Function?e.initial():e.initial,i=!0);const a=e.update(s,t,r);return t=a,a},e.changeTracker,()=>{i&&(e.disposeFinal?.(t),i=!1)},e.equalityComparer??Go,(s,r,a)=>{if(!i)throw new Ce("Can only set when there is a listener! This is to prevent leaks.");gm(r,l=>{t=s,n.setValue(s,l,a)})},qi.ofCaller());return n}var fye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},T8=function(o,e){return function(t,i){e(t,i,o)}};class pye{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let gM=class extends pye{constructor(e,t){super(e,(i,n)=>{let s=!0;n&&fM in n&&(s=!!n[fM]),s&&t.getDataChannel("editTelemetry").sendData({eventName:i,data:n??{}})})}};gM=fye([T8(0,ts),T8(1,g5)],gM);const fM=Symbol("shouldForwardToChannel");function mye(o){return{[fM]:o}}function R8(o){if(!o)return!1;const e=o.toLowerCase();return e==="github.copilot"||e==="github.copilot-chat"}function _ye(o){const e=o.map(i=>new yn(ge.ofStartAndLength(i.rangeOffset,i.rangeLength),i.text));return e.reverse(),new Ra(e)}function bye(o,e){o.publicLog2("inlineCompletion.endOfLife",e)}class i0{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class KG{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}const Cye=3;class vye{computeDiff(e,t,i){const s=new yye(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),r=[];let a=null;for(const l of s.changes){let c;l.originalEndLineNumber===0?c=new be(l.originalStartLineNumber+1,l.originalStartLineNumber+1):c=new be(l.originalStartLineNumber,l.originalEndLineNumber+1);let d;l.modifiedEndLineNumber===0?d=new be(l.modifiedStartLineNumber+1,l.modifiedStartLineNumber+1):d=new be(l.modifiedStartLineNumber,l.modifiedEndLineNumber+1);let h=new Ko(c,d,l.charChanges?.map(u=>new ys(new L(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new L(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Ko(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),r.pop()),r.push(h),a=h}return _h(()=>rw(r,(l,c)=>c.original.startLineNumber-l.original.endLineNumberExclusive===c.modified.startLineNumber-l.modified.endLineNumberExclusive&&l.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class Jp{constructor(e,t,i,n,s,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Jp(n,s,r,a,l,c,d,h)}}function Sye(o){if(o.length<=1)return o;const e=[o[0]];let t=e[0];for(let i=1,n=o.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const g=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),f=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(g.getElements().length>0&&f.getElements().length>0){let p=GG(g,f,s,!0).changes;a&&(p=Sye(p)),u=[];for(let _=0,b=p.length;_1&&p>1;){const _=u.charCodeAt(f-2),b=g.charCodeAt(p-2);if(_!==b)break;f--,p--}(f>1||p>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,f,r+1,1,p)}{let f=mM(u,1),p=mM(g,1);const _=u.length+1,b=g.length+1;for(;f<_&&p!0;const e=Date.now();return()=>Date.now()-e0&&p>0&&r.get(f-1,p-1)===3&&(C+=a.get(f-1,p-1)),C+=n?n(f,p):1):C=-1;const w=Math.max(_,b,C);if(w===C){const v=f>0&&p>0?a.get(f-1,p-1):0;a.set(f,p,v+1),r.set(f,p,3)}else w===_?(a.set(f,p,0),r.set(f,p,1)):w===b&&(a.set(f,p,0),r.set(f,p,2));s.set(f,p,w)}const l=[];let c=e.length,d=t.length;function h(f,p){(f+1!==c||p+1!==d)&&l.push(new Qi(new ge(f+1,c),new ge(p+1,d))),c=f,d=p}let u=e.length-1,g=t.length-1;for(;u>=0&&g>=0;)r.get(u,g)===3?(h(u,g),u--,g--):r.get(u,g)===1?u--:g--;return h(-1,-1),l.reverse(),new zc(l,!1)}}class ZG{compute(e,t,i=Tw.instance){if(e.length===0||t.length===0)return zc.trivial(e,t);const n=e,s=t;function r(p,_){for(;pn.length||v>s.length)continue;const S=r(w,v);l.set(d,S);const x=w===b?c.get(d+1):c.get(d-1);if(c.set(d,S!==w?new A8(x,w,v,S-w):x),l.get(d)===n.length&&l.get(d)-d===s.length)break e}}let h=c.get(d);const u=[];let g=n.length,f=s.length;for(;;){const p=h?h.x+h.length:0,_=h?h.y+h.length:0;if((p!==g||_!==f)&&u.push(new Qi(new ge(p,g),new ge(_,f))),!h)break;g=h.x,f=h.y,h=h.prev}return u.reverse(),new zc(u,!1)}}class A8{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class Lye{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class kye{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class bx{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let s=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,s=s.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,s.length):s.length;for(let c=0;cString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=W8(e>0?this.elements[e-1]:-1),i=W8(es<=e),n=e-this.firstElementOffsetByLineIdx[i];return new R(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(n===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?L.fromPositions(i,i):L.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!Hf(this.elements[e]))return;let t=e;for(;t>0&&Hf(this.elements[t-1]);)t--;let i=e;for(;i=this.elements.length||!Hf(this.elements[e]))return;let t=e;for(;t>0&&Hf(this.elements[t-1])&&!O8(this.elements[t]);)t--;let i=e;for(;in<=e.start)??0,i=Pae(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new ge(t,i)}}function Hf(o){return o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57}function O8(o){return o>=65&&o<=90}const Dye={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function F8(o){return Dye[o]}function W8(o){return o===10?8:o===13?7:DT(o)?6:o>=97&&o<=122?0:o>=65&&o<=90?1:o>=48&&o<=57?2:o===-1?3:o===44||o===59?5:4}function Iye(o,e,t,i,n,s){let{moves:r,excludedChanges:a}=Nye(o,e,t,s);if(!s.isValid())return[];const l=o.filter(d=>!a.has(d)),c=Tye(l,i,n,e,t,s);return YE(r,c),r=Rye(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&Eye(h,g=>g.length>=2)>=2}),r=Mye(o,r),r}function Eye(o,e){let t=0;for(const i of o)e(i)&&t++;return t}function Nye(o,e,t,i){const n=[],s=o.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new uv(l.original,e,l)),r=new Set(o.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new uv(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,d;for(const h of r){const u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),n.push(new ls(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function Tye(o,e,t,i,n,s){const r=[],a=new xz;for(const u of o)for(let g=u.original.startLineNumber;gu.modified.startLineNumber,uo));for(const u of o){let g=[];for(let f=u.modified.startLineNumber;f{for(const v of g)if(v.originalLineRange.endLineNumberExclusive+1===C.endLineNumberExclusive&&v.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){v.originalLineRange=new be(v.originalLineRange.startLineNumber,C.endLineNumberExclusive),v.modifiedLineRange=new be(v.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),b.push(v);return}const w={modifiedLineRange:_,originalLineRange:C};l.push(w),b.push(w)}),g=b}if(!s.isValid())return[]}l.sort(ez(Bn(u=>u.modifiedLineRange.length,uo)));const c=new fr,d=new fr;for(const u of l){const g=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,f=c.subtractFrom(u.modifiedLineRange),p=d.subtractFrom(u.originalLineRange).getWithDelta(g),_=f.getIntersection(p);for(const b of _.ranges){if(b.length<3)continue;const C=b,w=b.delta(-g);r.push(new ls(w,C)),c.addRange(C),d.addRange(w)}}r.sort(Bn(u=>u.original.startLineNumber,uo));const h=new YL(o);for(let u=0;ux.original.startLineNumber<=g.original.startLineNumber),p=xm(o,x=>x.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-f.original.startLineNumber,g.modified.startLineNumber-p.modified.startLineNumber),b=h.findLastMonotonous(x=>x.original.startLineNumberx.modified.startLineNumberi.length||k>n.length||c.contains(k)||d.contains(x)||!B8(i[x-1],n[k-1],s))break}v>0&&(d.addRange(new be(g.original.startLineNumber-v,g.original.startLineNumber)),c.addRange(new be(g.modified.startLineNumber-v,g.modified.startLineNumber)));let S;for(S=0;Si.length||k>n.length||c.contains(k)||d.contains(x)||!B8(i[x-1],n[k-1],s))break}S>0&&(d.addRange(new be(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+S)),c.addRange(new be(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+S))),(v>0||S>0)&&(r[u]=new ls(new be(g.original.startLineNumber-v,g.original.endLineNumberExclusive+S),new be(g.modified.startLineNumber-v,g.modified.endLineNumberExclusive+S)))}return r}function B8(o,e,t){if(o.trim()===e.trim())return!0;if(o.length>300&&e.length>300)return!1;const n=new ZG().compute(new bx([o],new L(1,1,1,o.length),!1),new bx([e],new L(1,1,1,e.length),!1),t);let s=0;const r=Qi.invert(n.diffs,o.length);for(const d of r)d.seq1Range.forEach(h=>{DT(o.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;ue.length?o:e);return s/l>.6&&l>10}function Rye(o){if(o.length===0)return o;o.sort(Bn(t=>t.original.startLineNumber,uo));const e=[o[0]];for(let t=1;t=0&&r>=0&&s+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function Mye(o,e){const t=new YL(o);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function Pye(o,e,t){if(!o.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,s=t[i],r=i+1=i.start&&o.seq2Range.start-r>=n.start&&t.isStronglyEqual(o.seq2Range.start-r,o.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;o.seq1Range.start+ac&&(c=f,l=d)}return o.delta(l)}function Aye(o,e,t){const i=[];for(const n of t){const s=i[i.length-1];if(!s){i.push(n);continue}n.seq1Range.start-s.seq1Range.endExclusive<=2||n.seq2Range.start-s.seq2Range.endExclusive<=2?i[i.length-1]=new Qi(s.seq1Range.join(n.seq1Range),s.seq2Range.join(n.seq2Range)):i.push(n)}return i}function U8(o,e,t,i,n=!1){const s=Qi.invert(t,o.length),r=[];let a=new La(0,0);function l(d,h){if(d.offset10;){const C=s[0];if(!(C.seq1Range.intersects(f.seq1Range)||C.seq2Range.intersects(f.seq2Range)))break;const v=i(o,C.seq1Range.start),S=i(e,C.seq2Range.start),x=new Qi(v,S),k=x.intersect(C);if(_+=k.seq1Range.length,b+=k.seq2Range.length,f=f.join(x),f.seq1Range.endExclusive>=C.seq1Range.endExclusive)s.shift();else break}(n&&_+b0;){const d=s.shift();d.seq1Range.isEmpty||(l(d.getStarts(),d),l(d.getEndExclusives().delta(-1),d))}return Oye(t,r)}function Oye(o,e){const t=[];for(;o.length>0||e.length>0;){const i=o[0],n=e[0];let s;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=s.seq1Range.start?t[t.length-1]=t[t.length-1].join(s):t.push(s)}return t}function Fye(o,e,t){let i=t;if(i.length===0)return i;let n=0,s;do{s=!1;const r=[i[0]];for(let a=1;a5||g.seq1Range.length+g.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(s=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(n++<10&&s);return i}function Wye(o,e,t){let i=t;if(i.length===0)return i;let n=0,s;do{s=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const b=o.getText(p).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const C=o.countLinesIn(g.seq1Range),w=g.seq1Range.length,v=e.countLinesIn(g.seq2Range),S=g.seq2Range.length,x=o.countLinesIn(f.seq1Range),k=f.seq1Range.length,D=e.countLinesIn(f.seq2Range),I=f.seq2Range.length,T=130;function F(O){return Math.min(O,T)}return Math.pow(Math.pow(F(C*40+w),1.5)+Math.pow(F(v*40+S),1.5),1.5)+Math.pow(Math.pow(F(x*40+k),1.5)+Math.pow(F(D*40+I),1.5),1.5)>(T**1.5)**1.5*1.3};const c=i[l],d=a[a.length-1];h(d,c)?(s=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(n++<10&&s);const r=[];return vJ(i,(a,l,c)=>{let d=l;function h(b){return b.length>0&&b.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const u=o.extendToFullLines(l.seq1Range),g=o.getText(new ge(u.start,l.seq1Range.start));h(g)&&(d=d.deltaStart(-g.length));const f=o.getText(new ge(l.seq1Range.endExclusive,u.endExclusive));h(f)&&(d=d.deltaEnd(f.length));const p=Qi.fromOffsetPairs(a?a.getEndExclusives():La.zero,c?c.getStarts():La.max),_=d.intersect(p);r.length>0&&_.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(_):r.push(_)}),r}class $8{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:j8(this.lines[e-1]),i=e===this.lines.length?0:j8(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function j8(o){let e=0;for(;ek===D))return new i0([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new i0([new Ko(new be(1,e.length+1),new be(1,t.length+1),[new ys(new L(1,1,e.length,e[e.length-1].length+1),new L(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?Tw.instance:new Wpe(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(k){let D=r.get(k);return D===void 0&&(D=r.size,r.set(k,D)),D}const l=e.map(k=>a(k.trim())),c=t.map(k=>a(k.trim())),d=new $8(l,e),h=new $8(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(k,D)=>e[k]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let g=u.diffs,f=u.hitTimeout;g=H8(d,h,g),g=Fye(d,h,g);const p=[],_=k=>{if(s)for(let D=0;Dk.seq1Range.start-b===k.seq2Range.start-C);const D=k.seq1Range.start-b;_(D),b=k.seq1Range.endExclusive,C=k.seq2Range.endExclusive;const I=this.refineDiff(e,t,k,n,s,i);I.hitTimeout&&(f=!0);for(const T of I.mappings)p.push(T)}_(e.length-b);const w=new d1(e),v=new d1(t),S=Sy(p,w,v);let x=[];return i.computeMoves&&(x=this.computeMoves(S,e,t,l,c,n,s,i)),_h(()=>{function k(I,T){if(I.lineNumber<1||I.lineNumber>T.length)return!1;const F=T[I.lineNumber-1];return!(I.column<1||I.column>F.length+1)}function D(I,T){return!(I.startLineNumber<1||I.startLineNumber>T.length+1||I.endLineNumberExclusive<1||I.endLineNumberExclusive>T.length+1)}for(const I of S){if(!I.innerChanges)return!1;for(const T of I.innerChanges)if(!(k(T.modifiedRange.getStartPosition(),t)&&k(T.modifiedRange.getEndPosition(),t)&&k(T.originalRange.getStartPosition(),e)&&k(T.originalRange.getEndPosition(),e)))return!1;if(!D(I.modified,t)||!D(I.original,e))return!1}return!0}),new i0(S,x,f)}computeMoves(e,t,i,n,s,r,a,l){return Iye(e,t,i,n,s,r).map(h=>{const u=this.refineDiff(t,i,new Qi(h.original.toOffsetRange(),h.modified.toOffsetRange()),r,a,l),g=Sy(u.mappings,new d1(t),new d1(i),!0);return new KG(h,g)})}refineDiff(e,t,i,n,s,r){const l=Hye(i).toRangeMapping2(e,t),c=new bx(e,l.originalRange,s),d=new bx(t,l.modifiedRange,s),h=c.length+d.length<500?this.dynamicProgrammingDiffing.compute(c,d,n):this.myersDiffingAlgorithm.compute(c,d,n);let u=h.diffs;return u=H8(c,d,u),u=U8(c,d,u,(f,p)=>f.findWordContaining(p)),r.extendToSubwords&&(u=U8(c,d,u,(f,p)=>f.findSubWordContaining(p),!0)),u=Aye(c,d,u),u=Wye(c,d,u),{mappings:u.map(f=>new ys(c.translateRange(f.seq1Range),d.translateRange(f.seq2Range))),hitTimeout:h.hitTimeout}}}function Hye(o){return new ls(new be(o.seq1Range.start+1,o.seq1Range.endExclusive+1),new be(o.seq2Range.start+1,o.seq2Range.endExclusive+1))}const _M={getLegacy:()=>new vye,getDefault:()=>new Bye};var bM;(function(o){function e(t,i){return!t.isInlineEdit&&!t.uri?iC.create(t,i):em.create(t,i)}o.create=e})(bM||(bM={}));class YG{constructor(e,t,i){this._data=e,this.identity=t,this.hint=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===Ws.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){return this.hint?.range&&!this.hint.jumpToEdit?this.hint?.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}}class $k{constructor(){this._onDispose=pr(this),this._jumpedTo=De(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+$k.idCounter++}static{this.idCounter=0}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,this._refCount===0&&this._onDispose.trigger(void 0)}setJumpTo(e){this._jumpedTo.set(!0,e)}}class Pv{static create(e){return new Pv(L.lift(e.range),e.content,e.style,e.jumpToEdit)}constructor(e,t,i,n){this.range=e,this.content=t,this.style=i,this.jumpToEdit=n}withEdit(e,t){const i=new ge(t.getOffset(this.range.getStartPosition()),t.getOffset(this.range.getEndPosition())),n=C$([i],e)[0];if(!n)return;const s=t.getRange(n);return new Pv(s,this.content,this.style,this.jumpToEdit)}}class iC extends YG{static create(e,t){const i=new $k,n=Rv(t),s=e.insertText.replace(/\r\n|\r|\n/g,t.getEOL()),r=zye(new yn(n.getOffsetRange(e.range),s),t),a=r.removeCommonSuffixAndPrefix(t.getValue()),l=n.getTextReplacement(r),c=e.hint?Pv.create(e.hint):void 0;return new iC(r,a,l,l.range,e.snippetInfo,e.additionalTextEdits,e,i,c)}constructor(e,t,i,n,s,r,a,l,c){super(a,l,c),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=n,this.snippetInfo=s,this.additionalTextEdits=r,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new iC(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,e,this.hint)}withEdit(e,t){const i=C$([this._edit.replaceRange],e);if(i.length===0)return;const n=new yn(i[0],this._textEdit.text),s=Rv(t),r=s.getTextReplacement(n);let a=this.hint;if(a&&(a=a.withEdit(e,s),!a))return;const l=n.removeCommonSuffixAndPrefix(t.getValue());return new iC(n,l,r,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,a)}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&si.ofRange(i).isGreaterThanOrEqualTo(si.ofRange(this._originalRange))}isVisible(e,t){const i=this.getSingleTextEdit();return XG(i,this._originalRange,e,t)}}function XG(o,e,t,i){const n=Mc(o,t),s=o.range;if(!s||e&&!e.getStartPosition().equals(s.getStartPosition())||i.lineNumber!==n.range.startLineNumber||n.isEmpty)return!1;const r=t.getValueInRange(n.range,1),a=n.text,l=Math.max(0,i.column-n.range.startColumn);let c=a.substring(0,l),d=a.substring(l),h=r.substring(0,l),u=r.substring(l);const g=t.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=g&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),c=c.trimStart(),c.length===0&&(d=d.trimStart())),c.startsWith(h)&&!!sj(u,d)}class em extends YG{static create(e,t){const i=Vye(t,e.range,e.insertText),n=new Wg(t),s=ho.fromStringEdit(i,n),r=i.isEmpty()?new Ni(new L(1,1,1,1),""):s.toReplacement(n),a=new $k,l=i.replacements.map(d=>{const h=L.fromPositions(t.getPositionAt(d.replaceRange.start),t.getPositionAt(d.replaceRange.endExclusive)),u=t.getValueInRange(h);return Cx.create(d,u)}),c=e.hint?Pv.create(e.hint):void 0;return new em(i,r,e.uri,e,a,l,c,!1,t.getVersionId())}constructor(e,t,i,n,s,r,a,l=!1,c){super(n,s,a),this._edit=e,this._textEdit=t,this.uri=i,this._edits=r,this._lastChangePartOfInlineEdit=l,this._inlineEditModelVersion=c,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new em(this._edit,this._textEdit,this.uri,this._data,e,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(e,t,i){if(t=t.map(h=>h.applyTextModelChanges(e)),t.some(h=>h.edit===void 0))return;const n=i.getVersionId();let s=this._inlineEditModelVersion;const r=t.some(h=>h.lastChangeUpdatedEdit);if(r&&(s=n??-1),n===null||s+20!h.edit.isEmpty),t.length===0))return;const a=new Ra(t.map(h=>h.edit)),l=Rv(i),c=l.getTextEdit(a).toReplacement(new Wg(i));let d=this.hint;if(!(d&&(d=d.withEdit(e,l),!d)))return new em(a,c,this.uri,this._data,this.identity,t,d,r,s)}}function Vye(o,e,t){const i=o.getEOL(),n=o.getValueInRange(e),s=t.replace(/\r\n|\r|\n/g,i),l=_M.getDefault().computeDiff(bo(n),bo(s),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(u=>u.innerChanges??[]);function c(u,g){const f=si.fromPosition(g.getStartPosition());return si.ofRange(g).createRange(f.addToPosition(u))}const d=new Xd(s);return new Ra(l.map(u=>{const g=c(e.getStartPosition(),u.originalRange),f=Rv(o).getOffsetRange(g),p=d.getValueOfRange(u.modifiedRange),_=new yn(f,p),b=o.getValueInRange(g);return Uye(_,b,l.length,o)}))}class Cx{static create(e,t){const i=ta(e.newText,t),n=Zc(e.newText,t),s=e.newText.substring(i,e.newText.length-n);return new Cx(e,s,i,n)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,n,s=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=n,this._lastChangeUpdatedEdit=s}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new Cx(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new Ce("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);if(!t){this._edit=void 0;return}this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged}_applyChanges(e,t){let i=e.replaceRange.start,n=e.replaceRange.endExclusive,s=e.newText,r=!1;const a=this._prefixLength>0||this._suffixLength>0;for(let l=t.replacements.length-1;l>=0;l--){const c=t.replacements[l],d=c.newText.length>0&&c.replaceRange.isEmpty;if(d&&!a&&c.replaceRange.start===i&&s.startsWith(c.newText)){i+=c.newText.length,s=s.substring(c.newText.length),n=Math.max(i,n),r=!0;continue}if(d&&a&&c.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(c.newText)){n+=c.newText.length,r=!0,this._prefixLength+=c.newText.length,this._trimmedNewText=this._trimmedNewText.substring(c.newText.length);continue}if(c.newText.length===0&&c.replaceRange.length>0&&c.replaceRange.start>=i+this._prefixLength&&c.replaceRange.endExclusive<=n-this._suffixLength){n-=c.replaceRange.length,r=!0;continue}if(c.equals(e)){r=!0,i=c.replaceRange.endExclusive,s="";continue}if(!(c.replaceRange.start>n)){if(c.replaceRange.endExclusive1&&o.newText.endsWith(t)&&!o.newText.startsWith(t)?new yn(o.replaceRange.delta(-1),t+o.newText.slice(0,-t.length)):o}function $ye(o,e){const t=new k$,i=new I$(t,c=>e.getLanguageConfiguration(c)),n=new D$(new jye([o]),i),s=qN(n,[],void 0,!0);let r="";const a=o.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=fi(d,c.openingBracket.length),c.child&&(l(c.child,d),d=fi(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=fi(d,c.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=u}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,fi(d,c.length));else if(c.kind===4)for(const h of c.children)l(h,d),d=fi(d,h.length)}}return l(s,Ds),r}class jye{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class f5{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(e,t){const i=new f5;for(const n of e)i._nodes.add(n);for(const n of e){const s=t(n);if(s.length>0){const r=new Set;for(const a of s)r.add(a);i._outgoingEdges.set(n,r)}}return i}removeCycles(){const e=[],t=new Set,i=new Set,n=[],s=r=>{t.add(r),i.add(r);const a=this._outgoingEdges.get(r);if(a)for(const l of a)t.has(l)?i.has(l)&&(e.push(l),n.push({from:r,to:l})):s(l);i.delete(r)};for(const r of this._nodes)t.has(r)||s(r);for(const{from:r,to:a}of n){const l=this._outgoingEdges.get(r);l&&l.delete(a)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}}var Gn;(function(o){o.Jump="jump",o.Accept="accept",o.Inactive="inactive"})(Gn||(Gn={}));var lt;(function(o){o.GhostText="ghostText",o.Custom="custom",o.SideBySide="sideBySide",o.Deletion="deletion",o.InsertionInline="insertionInline",o.InsertionMultiLine="insertionMultiLine",o.WordReplacements="wordReplacements",o.LineReplacement="lineReplacement",o.Collapsed="collapsed"})(lt||(lt={}));function qye(o,e,t,i,n,s){const r=VU("icr"),a=new qt;let l;const c={...i,requestUuid:r},d=Yye(e,t),h=dhe(o,b=>b.groupId),u=f5.from(o,b=>b.yieldsToGroupIds?.flatMap(C=>h.get(C)??[])??[]),{foundCycles:g}=u.removeCycles();g.length>0&&Ri(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${g.map(b=>b.toString?b.toString():""+b).join(" -> ")}`));let f=0;const p=new UE(async b=>{try{if(f++,a.token.isCancellationRequested)return;const C=u.getOutgoing(b);for(const D of C){const I=await p.get(D);if(I)for(const T of I.inlineSuggestions.items){if(T.isInlineEdit||typeof T.insertText!="string"&&T.insertText!==void 0)return;if(T.insertText!==void 0){const F=new Ni(L.lift(T.range)??d,T.insertText);if(XG(F,void 0,t,e))return}}}let w;const v=Date.now();try{w=await b.provideInlineCompletions(t,e,c,a.token)}catch(D){Ri(D);return}const S=Date.now();if(!w)return;const x=[],k=new Zye(w,x,b);if(k.addRef(),JG(a.token,()=>k.removeRef(l)),a.token.isCancellationRequested)return;for(const D of w.items)x.push(Kye(D,k,d,t,s,c,n,{startTime:v,endTime:S}));return k}finally{f--}}),_=Yi.fromPromisesResolveOrder(o.map(b=>p.get(b))).filter(hn);return{contextWithUuid:c,get didAllProvidersReturn(){return f===0},lists:_,cancelAndDispose:b=>{l===void 0&&(l=b,a.dispose(!0))}}}function JG(o,e){if(o.isCancellationRequested)return e(),A.None;{const t=o.onCancellationRequested(()=>{t.dispose(),e()});return{dispose:()=>t.dispose()}}}function Kye(o,e,t,i,n,s,r,a){let l,c,d=o.range?L.lift(o.range):t;if(typeof o.insertText=="string"){if(l=o.insertText,n&&o.completeBracketPairs){l=q8(l,d.getStartPosition(),i,n);const h=l.length-o.insertText.length;h!==0&&(d=new L(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+h))}c=void 0}else if(o.insertText===void 0)l="",c=void 0,d=new L(1,1,1,1);else if("snippet"in o.insertText){const h=o.insertText.snippet.length;if(n&&o.completeBracketPairs){o.insertText.snippet=q8(o.insertText.snippet,d.getStartPosition(),i,n);const g=o.insertText.snippet.length-h;g!==0&&(d=new L(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+g))}const u=new Hg().parse(o.insertText.snippet);u.children.length===1&&u.children[0]instanceof ks?(l=u.children[0].value,c=void 0):(l=u.toString(),c={snippet:o.insertText.snippet,range:d})}else ow(o.insertText);return new Gye(d,l,c,_e.revive(o.uri),o.hint,o.additionalTextEdits||iye(),o,e,s,o.isInlineEdit??!1,r,a,o.correlationId)}class Gye{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){this.range=e,this.insertText=t,this.snippetInfo=i,this.uri=n,this.hint=s,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,this.context=c,this.isInlineEdit=d,this._requestInfo=h,this._providerRequestInfo=u,this._correlationId=g,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:h.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,n){if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=n,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const s=new ov(n.lineCountModified,n.lineCountOriginal,n.characterCountModified,n.characterCountOriginal);this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions,this.sourceInlineCompletion,t,s),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:Ng.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===Ng.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(i=>i.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}setIsPreceeded(e){this._isPreceeded=!0,(this._partiallyAcceptedSinceOriginal.characters!==0||this._partiallyAcceptedSinceOriginal.ratio!==0||this._partiallyAcceptedSinceOriginal.count!==0)&&console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??=e}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===lt.Collapsed;!i&&this._showUncollapsedStartTime===void 0&&(this._showUncollapsedStartTime=t),i&&this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(this._showStartTime===void 0)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}var nC;(function(o){o.TextEditor="textEditor",o.DiffEditor="diffEditor",o.Notebook="notebook"})(nC||(nC={}));class Zye{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,this.refCount===0){for(const t of this.inlineSuggestionsData)t.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}}function Yye(o,e){const t=e.getWordAtPosition(o),i=e.getLineMaxColumn(o.lineNumber);return t?new L(o.lineNumber,t.startColumn,o.lineNumber,i):L.fromPositions(o,o.with(void 0,i))}function q8(o,e,t,i){const n=t.getLineContent(e.lineNumber),s=yn.replace(new ge(e.column-1,n.length),o),a=t.tokenization.tokenizeLinesAt(e.lineNumber,[s.replace(n)])?.[0].sliceZeroCopy(s.getRangeAfterReplace());return a?$ye(a,i):o}var Xye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},q_=function(o,e){return function(t,i){e(t,i,o)}},CM;let vM=class extends A{static{CM=this}static{this._requestId=0}constructor(e,t,i,n,s,r,a,l,c){super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=n,this._languageConfigurationService=s,this._logService=r,this._configurationService=a,this._instantiationService=l,this._contextKeyService=c,this._updateOperation=this._register(new ut),this._state=gye(this,{initial:()=>({inlineCompletions:$r.createEmpty(),suggestWidgetInlineCompletions:$r.createEmpty()}),disposeFinal:h=>{h.inlineCompletions.dispose(),h.suggestWidgetInlineCompletions.dispose()},changeTracker:the(()=>({versionId:this._versionId})),update:(h,u,g)=>{const f=Ra.compose(g.changes.map(p=>p.change?_ye(p.change.changes):Ra.empty).filter(hn));if(f.isEmpty())return u;try{return{inlineCompletions:u.inlineCompletions.createStateWithAppliedEdit(f,this._textModel),suggestWidgetInlineCompletions:u.suggestWidgetInlineCompletions.createStateWithAppliedEdit(f,this._textModel)}}finally{u.inlineCompletions.dispose(),u.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,h=>h.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,h=>h.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=$(this,h=>{this._versionId.read(h),this._updateOperation.clear()}),this._loadingCount=De(this,0),this._loggingEnabled=c9("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=c9("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(fx.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const d=AS.defaultChatAgent?.completionsEnablementSetting??void 0;d&&(this._updateCompletionsEnablement(d),this._register(this._configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(d)&&this._updateCompletionsEnablement(d)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(e){const t=this._configurationService.getValue(e);Ui(t)?this._completionsEnabled=t:this._completionsEnabled=void 0}_log(e){this._loggingEnabled.get()&&this._logService.info(q0e(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,n,s,r,a){const l=this._cursorPosition.get(),c=new Qye(l,i,this._textModel.getVersionId(),new Set(e)),d=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if(this._updateOperation.value?.request.satisfies(c))return this._updateOperation.value.promise;if(d?.request?.satisfies(c))return Promise.resolve(!0);const h=!!this._updateOperation.value;this._updateOperation.clear();const u=new qt,g=(async()=>{const p=new z;this._loadingCount.set(this._loadingCount.get()+1,void 0);let _=!1;const b=()=>{_||(_=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};p.add(new St(()=>b(),10*1e3)).schedule();const w=e.filter(S=>S.providerId),v=new Jye(i,a,w);try{const S=this._debounceValue.get(this._textModel),x=o$(e.map(X=>X.debounceDelayMs),xJ(uo))??S;if((h||s&&i.triggerKind===Ws.Automatic)&&await k8(x,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)return v.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const D=CM._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:D,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:i.selectedSuggestionInfo?!0:void 0},time:Date.now(),provider:t});const I=new Date,T=qye(e,this._cursorPosition.get(),this._textModel,i,a,this._languageConfigurationService);JG(u.token,()=>T.cancelAndDispose({kind:"tokenCancellation"}));let F=!1,O=!1;const B=[];for await(const X of T.lists)if(X){X.addRef(),p.add(ue(()=>X.removeRef(X.inlineSuggestionsData.length===0?{kind:"empty"}:{kind:"notTaken"})));for(const ne of X.inlineSuggestionsData){if(O=!0,!i.includeInlineEdits&&(ne.isInlineEdit||ne.showInlineEditMenu)){ne.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!(ne.isInlineEdit||ne.showInlineEditMenu)){ne.setNotShownReason("notInlineCompletionRequested");continue}const ce=bM.create(ne,this._textModel);B.push(ce),!ce.isInlineEdit&&!ce.showInlineEditMenu&&i.triggerKind===Ws.Automatic&&ce.isVisible(this._textModel,this._cursorPosition.get())&&(F=!0)}if(F)break}if(T.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const X=T.didAllProvidersReturn;let ne;(u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)&&(ne="canceled");const ce=B.map(ke=>({range:ke.editRange.toString(),text:ke.insertText,hint:ke.hint,isInlineEdit:ke.isInlineEdit,showInlineEditMenu:ke.showInlineEditMenu,providerId:ke.source.provider.providerId?.toString()}));this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:D,durationMs:Date.now()-I.getTime(),error:ne,result:ce,time:Date.now(),didAllProvidersReturn:X})}if(v.setRequestUuid(T.contextWithUuid.requestUuid),O)v.setHasProducedSuggestion(),B.length>0&&u.token.isCancellationRequested&&B.forEach(X=>X.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(u.token.isCancellationRequested)v.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const X=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");v.setNoSuggestionReasonIfNotSet(X?"completionsQuotaExceeded":"noSuggestion")}const U=i.earliestShownDateTime-Date.now();if(U>0&&await k8(U,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId||r.get()){const X=u.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==c.versionId?"canceled:documentChanged":r.get()?"canceled:userJumped":"unknown";return B.forEach(ne=>ne.setNotShownReasonIfNotSet(X)),!1}const K=new Date;this._debounceValue.update(this._textModel,K.getTime()-I.getTime());const ie=this._cursorPosition.get();this._updateOperation.clear(),Et(X=>{const ne=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:$r.createEmpty(),suggestWidgetInlineCompletions:ne.suggestWidgetInlineCompletions.createStateWithAppliedResults(B,c,this._textModel,ie,n)},X):this._state.set({inlineCompletions:ne.inlineCompletions.createStateWithAppliedResults(B,c,this._textModel,ie,n),suggestWidgetInlineCompletions:$r.createEmpty()},X),ne.inlineCompletions.dispose(),ne.suggestWidgetInlineCompletions.dispose()})}finally{p.dispose(),b(),this.sendInlineCompletionsRequestTelemetry(v)}return!0})(),f=new ixe(c,u,g);return this._updateOperation.value=f,g}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:$r.createEmpty(),suggestWidgetInlineCompletions:$r.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&Et(i=>{if(!e||(t.request?.versionId??-1)>(e.request?.versionId??-1)){e?.dispose();const n=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:$r.createEmpty()},i),n.inlineCompletions.dispose(),n.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)})}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")||e.requestUuid===void 0||e.hasProducedSuggestion||!txe(this._completionsEnabled,this._textModel.getLanguageId())||!e.providers.some(n=>R8(n.providerId?.extensionId)))return;const t={opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map(n=>n.providerId?.toString()).filter(hn).join(","),...mye(e.providers.some(n=>R8(n.providerId?.extensionId))),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0},i=this._instantiationService.createInstance(gM);bye(i,t)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}};vM=CM=Xye([q_(4,ti),q_(5,Mt),q_(6,Pe),q_(7,fe),q_(8,Ie)],vM);class Qye{constructor(e,t,i,n){this.position=e,this.context=t,this.versionId=i,this.providers=n}satisfies(e){return this.position.equals(e.position)&&Vu(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,lO())&&(e.context.triggerKind===Ws.Automatic||this.context.triggerKind===Ws.Explicit)&&this.versionId===e.versionId&&exe(e.providers,this.providers)}}class Jye{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??=e}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}function exe(o,e){return[...o].every(t=>e.has(t))}function txe(o,e="*"){return o===void 0?!1:typeof o[e]<"u"?!!o[e]:!!o["*"]}class ixe{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class $r extends A{static createEmpty(){return new $r([],void 0)}constructor(e,t){for(const i of e)i.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const i of this.inlineCompletions)i.removeRef()}})}_findById(e){return this.inlineCompletions.find(t=>t.identity===e)}_findByHash(e){return this.inlineCompletions.find(t=>t.hash===e)}createStateWithAppliedEdit(e,t){const i=this.inlineCompletions.map(n=>n.withEdit(e,t)).filter(hn);return new $r(i,this.request)}createStateWithAppliedResults(e,t,i,n,s){let r;if(s){const c=this._findById(s);if(c&&c.canBeReused(i,t.position)){r=c;const d=e.find(h=>h.hash===c.hash);d?e=sxe(d,e):e=[c,...e]}}const a=r?!r.isInlineEdit:e.some(c=>!c.isInlineEdit&&c.isVisible(i,n));let l=[];for(const c of e){const d=this._findByHash(c.hash);let h;d&&d!==c?(h=c.withIdentity(d.identity),c.setIsPreceeded(d),d.setEndOfLifeReason({kind:Ng.Ignored,userTypingDisagreed:!1,supersededBy:c.getSourceCompletion()})):h=c,a!==h.isInlineEdit&&l.push(h)}return l.sort(Bn(c=>c.showInlineEditMenu,JV)),l=nxe(l,c=>c.semanticId),new $r(l,t)}clone(){return new $r(this.inlineCompletions,this.request)}}function nxe(o,e){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function sxe(o,e){const t=e.indexOf(o);return t>-1?[o,...e.slice(0,t),...e.slice(t+1)]:e}class oxe{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}}var rxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},K8=function(o,e){return function(t,i){e(t,i,o)}};const jk=We("IInlineCompletionsService"),eZ=new oe("inlineCompletions.snoozed",!1,m(79,"Whether inline completions are currently snoozed"));let wM=class extends A{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new P),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new mo);const i=eZ.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new Ce(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(e===0){this.cancelSnooze();return}const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new Ce("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),n=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:n,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};wM=rxe([K8(0,Ie),K8(1,ts)],wM);$e(jk,wM,1);const axe="editor.action.inlineSuggest.snooze",lxe="editor.action.inlineSuggest.cancelSnooze",G8="inlineCompletions.lastSnoozeDuration";class p5 extends pn{static{this.ID=axe}constructor(){super({id:p5.ID,title:H(81,"Snooze Inline Suggestions"),precondition:q.true(),f1:!0})}async run(e,...t){const i=e.get(Jn),n=e.get(jk),s=e.get(ps);let r;t.length>0&&typeof t[0]=="number"&&(r=t[0]*6e4),r||(r=await this.getDurationFromUser(i,s)),r&&n.setSnoozeDuration(r)}async getDurationFromUser(e,t){const i=t.getNumber(G8,0,3e5),n=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],s=await e.pick(n,{placeHolder:m(80,"Select snooze duration for Inline Suggestions"),activeItem:n.find(r=>r.value===i)});if(s)return t.store(G8,s.value,0,0),s.value}}class m5 extends pn{static{this.ID=lxe}constructor(){super({id:m5.ID,title:H(82,"Cancel Snooze Inline Suggestions"),precondition:eZ,f1:!0})}async run(e){e.get(jk).cancelSnooze()}}class Nd extends A{static{this.MAX_SESSION_GAP_MS=3e3}static{this.MIN_SESSION_DURATION_MS=1e3}static{this.SESSION_HISTORY_LIMIT=50}static{this.TYPING_SPEED_WINDOW_MS=3e5}static{this.MIN_CHARS_FOR_RELIABLE_SPEED=20}getTypingInterval(){return(this._cacheInvalidated||this._cachedTypingIntervalResult===null)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(t=>this._updateTypingSpeed(t)))}_updateTypingSpeed(e){const t=Date.now();if(!this._isUserTyping(e)){this._finalizeCurrentSession();return}this._currentSession&&t-this._lastChangeTime>Nd.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:t,endTime:t,characterCount:0}),this._currentSession.endTime=t,this._currentSession.characterCount+=this._getActualCharacterCount(e),this._lastChangeTime=t,this._cacheInvalidated=!0}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||e.detailedReasons.length===0)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;switch(e.metadata.source){case"cursor":{const t=e.metadata.kind;return t==="type"||t==="compositionType"||t==="compositionEnd"}default:return!1}}_finalizeCurrentSession(){if(!this._currentSession)return;this._currentSession.endTime-this._currentSession.startTime>=Nd.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>Nd.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null}_calculateTypingInterval(){if(this._currentSession){const e={...this._currentSession};if(e.endTime-e.startTime>=Nd.MIN_SESSION_DURATION_MS&&e.characterCount>0){const i=[...this._typingSessions,e];return this._calculateSpeedFromSessions(i)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(e){if(e.length===0)return{averageInterval:0,characterCount:0};const t=[...e].sort((d,h)=>h.endTime-d.endTime),i=Date.now()-Nd.TYPING_SPEED_WINDOW_MS,n=t.filter(d=>d.endTime>i),s=t.splice(n.length);let r=I0(n.map(d=>d.characterCount));for(let d=0;dd.endTime-d.startTime));if(a===0||r<=1)return{averageInterval:0,characterCount:r};const l=Math.max(1,r-1),c=a/l;return{averageInterval:Math.round(c),characterCount:r}}dispose(){this._finalizeCurrentSession(),super.dispose()}}var cxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iu=function(o,e){return function(t,i){e(t,i,o)}};let SM=class extends A{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=s,this._enabled=r,this._editor=a,this._instantiationService=l,this._commandService=c,this._languageConfigurationService=d,this._accessibilityService=h,this._languageFeaturesService=u,this._codeEditorService=g,this._inlineCompletionsService=f,this._isActive=De(this,!1),this._onlyRequestInlineEditsSignal=pr(this),this._forceUpdateExplicitlySignal=pr(this),this._noDelaySignal=pr(this),this._fetchSpecificProviderSignal=pr(this),this._selectedInlineCompletionId=De(this,void 0),this.primaryPosition=$(this,v=>this._positions.read(v)[0]??new R(1,1)),this.allPositions=$(this,v=>this._positions.read(v)),this._isAcceptingPartially=!1,this._appearedInsideViewport=$(this,v=>{const S=this.state.read(v);return!S||!S.inlineCompletion?!1:hxe(this._editor,S.inlineCompletion)}),this._onDidAccept=new P,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=j3({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(v,S)=>(S.didUndo=v.didChange(this._textModelVersionId)&&!!v.change?.isUndoing,!0)}},(v,S)=>{const x=this._textModelVersionId.read(v);return x!==null&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===x-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&S.didUndo?(this._lastAcceptedInlineCompletionInfo=void 0,!0):!1}),this._preserveCurrentCompletionReasons=new Set([fc.Redo,fc.Undo,fc.AcceptWord]),this.dontRefetchSignal=pr(this),this._fetchInlineCompletionsPromise=j3({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ws.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(v,S)=>{if(v.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(v.change))&&(S.preserveCurrentCompletion=!0);const x=v.change?.detailedReasons??[];S.changeReason=x.length>0?x[0].getType():"",S.textChange=!0}else v.didChange(this._forceUpdateExplicitlySignal)?(S.preserveCurrentCompletion=!0,S.inlineCompletionTriggerKind=Ws.Explicit):v.didChange(this.dontRefetchSignal)?S.dontRefetch=!0:v.didChange(this._onlyRequestInlineEditsSignal)?S.onlyRequestInlineEdits=!0:v.didChange(this._fetchSpecificProviderSignal)&&(S.provider=v.change);return!0}}},(v,S)=>{if(this._source.clearOperationOnTextModelChange.read(v),this._noDelaySignal.read(v),this.dontRefetchSignal.read(v),this._onlyRequestInlineEditsSignal.read(v),this._forceUpdateExplicitlySignal.read(v),this._fetchSpecificProviderSignal.read(v),!((this._enabled.read(v)&&this._selectedSuggestItem.read(v)||this._isActive.read(v))&&(!this._inlineCompletionsService.isSnoozing()||S.inlineCompletionTriggerKind===Ws.Explicit))){this._source.cancelUpdate();return}this._textModelVersionId.read(v);const k=this._source.suggestWidgetInlineCompletions.read(void 0);let D=this._selectedSuggestItem.read(v);if(this._shouldShowOnSuggestConflict.read(void 0)&&(D=void 0),k&&!D&&this._source.seedInlineCompletionsWithSuggestWidget(),S.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(v)&&S.inlineCompletionTriggerKind!==Ws.Explicit){Et(ne=>{this._source.clear(ne)});return}let I="";S.provider?I+="providerOnDidChange":S.inlineCompletionTriggerKind===Ws.Explicit&&(I+="explicit"),S.changeReason&&(I+=I.length>0?`:${S.changeReason}`:S.changeReason);const T=this._typing.getTypingInterval(),F={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:I,typingInterval:T.averageInterval,typingIntervalCharacterCount:T.characterCount,availableProviders:[]};let O={triggerKind:S.inlineCompletionTriggerKind,selectedSuggestionInfo:D?.toSelectedSuggestionInfo(),includeInlineCompletions:!S.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(v),requestIssuedDateTime:F.startTime,earliestShownDateTime:F.startTime+(S.inlineCompletionTriggerKind===Ws.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};O.triggerKind===Ws.Automatic&&S.textChange&&this.textModel.getAlternativeVersionId()===this._lastShownInlineCompletionInfo?.alternateTextModelVersionId&&(O={...O,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const B=this.selectedInlineCompletion.read(void 0)??this._inlineCompletionItems.read(void 0)?.inlineEdit,U=S.preserveCurrentCompletion||B?.forwardStable?B:void 0,K=this._jumpedToId.map(ne=>!!ne&&ne===this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId),ie=S.provider?{providers:[S.provider],label:"single:"+S.provider.providerId?.toString()}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},X=this.getAvailableProviders(ie.providers);return F.availableProviders=X.map(ne=>ne.providerId).filter(hn),this._source.fetch(X,ie.label,O,U?.identity,S.shouldDebounce,K,F)}),this._inlineCompletionItems=An({owner:this},v=>{const S=this._source.inlineCompletions.read(v);if(!S)return;const x=this.primaryPosition.read(v);let k;const D=[];for(const I of S.inlineCompletions)I.isInlineEdit?k=I:I.isVisible(this.textModel,x)&&D.push(I);return D.length!==0&&(k=void 0),{inlineCompletions:D,inlineEdit:k}}),this._filteredInlineCompletionItems=An({owner:this,equalsFn:xC()},v=>this._inlineCompletionItems.read(v)?.inlineCompletions??[]),this.selectedInlineCompletionIndex=$(this,v=>{const S=this._selectedInlineCompletionId.read(v),x=this._filteredInlineCompletionItems.read(v),k=this._selectedInlineCompletionId===void 0?-1:x.findIndex(D=>D.semanticId===S);return k===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):k}),this.selectedInlineCompletion=$(this,v=>{const S=this._filteredInlineCompletionItems.read(v),x=this.selectedInlineCompletionIndex.read(v);return S[x]}),this.activeCommands=An({owner:this,equalsFn:xC()},v=>this.selectedInlineCompletion.read(v)?.source.inlineSuggestions.commands??[]),this.inlineCompletionsCount=$(this,v=>{if(this.lastTriggerKind.read(v)===Ws.Explicit)return this._filteredInlineCompletionItems.read(v).length}),this._hasVisiblePeekWidgets=$(this,v=>this._editorObs.openedPeekWidgets.read(v)>0),this._shouldShowOnSuggestConflict=$(this,v=>{const S=this._showOnSuggestConflict.read(v);if(S!=="never"&&!!this.selectedInlineCompletion.read(v)){const k=this._selectedSuggestItem.read(v);return k?S==="whenSuggestListIsIncomplete"?k.listIncomplete:!0:!1}return!1}),this.state=An({owner:this,equalsFn:(v,S)=>!v||!S?v===S:v.kind==="ghostText"&&S.kind==="ghostText"?D8(v.ghostTexts,S.ghostTexts)&&v.inlineCompletion===S.inlineCompletion&&v.suggestItem===S.suggestItem:v.kind==="inlineEdit"&&S.kind==="inlineEdit"?v.inlineEdit.equals(S.inlineEdit):!1},v=>{const S=this.textModel;if(this._suppressInSnippetMode.read(v)&&this._isInSnippetMode.read(v))return;const x=this._inlineCompletionItems.read(v),k=x?.inlineEdit;if(k){if(this._hasVisiblePeekWidgets.read(v))return;let I=k.getSingleTextEdit();I=Mc(I,S);const T=this.primaryPosition.map(ie=>be.fromRangeInclusive(k.targetRange).addMargin(1,1).contains(ie.lineNumber)),F=k.source.inlineSuggestions.commands,O=new oxe(I,F??[],k),B=k.updatedEdit,U=B?ho.fromStringEdit(B,new Wg(this.textModel)).replacements:[I],K=(x.inlineEdit?.command?.id==="vscode.open"||x.inlineEdit?.command?.id==="_workbench.open")&&x.inlineEdit?.command.arguments?.length?_e.from(x.inlineEdit?.command.arguments[0]):void 0;return{kind:"inlineEdit",inlineEdit:O,inlineCompletion:k,edits:U,cursorAtInlineEdit:T,nextEditUri:K}}const D=this._selectedSuggestItem.read(v);if(!this._shouldShowOnSuggestConflict.read(v)&&D){const I=Mc(D.getSingleTextEdit(),S),T=this._computeAugmentation(I,v);if(!this._suggestPreviewEnabled.read(v)&&!T)return;const O=T?.edit??I,B=T?T.edit.text.length-I.text.length:0,U=this._suggestPreviewMode.read(v),K=this._positions.read(v),X=[O,...ZI(this.textModel,K,O)].map((it,ot)=>({edit:it,ghostText:it?I8(it,S,U,K[ot],B):void 0})).filter(({edit:it,ghostText:ot})=>it!==void 0&&ot!==void 0),ne=X.map(({edit:it})=>it),ce=X.map(({ghostText:it})=>it),ke=ce[0]??new Mv(O.range.endLineNumber,[]);return{kind:"ghostText",edits:ne,primaryGhostText:ke,ghostTexts:ce,inlineCompletion:T?.completion,suggestItem:D}}else{if(!this._isActive.read(v))return;const I=this.selectedInlineCompletion.read(v);if(!I)return;const T=I.getSingleTextEdit(),F=this._inlineSuggestMode.read(v),O=this._positions.read(v),U=[T,...ZI(this.textModel,O,T)].map((X,ne)=>({edit:X,ghostText:X?I8(X,S,F,O[ne],0):void 0})).filter(({edit:X,ghostText:ne})=>X!==void 0&&ne!==void 0),K=U.map(({edit:X})=>X),ie=U.map(({ghostText:X})=>X);return ie[0]?{kind:"ghostText",edits:K,primaryGhostText:ie[0],ghostTexts:ie,inlineCompletion:I,suggestItem:void 0}:void 0}}),this.inlineCompletionState=$(this,v=>{const S=this.state.read(v);if(!(!S||S.kind!=="ghostText")&&!this._editorObs.inComposition.read(v))return S}),this.inlineEditState=$(this,v=>{const S=this.state.read(v);if(!(!S||S.kind!=="inlineEdit"))return S}),this.inlineEditAvailable=$(this,v=>!!this.inlineEditState.read(v)),this.warning=$(this,v=>this.inlineCompletionState.read(v)?.inlineCompletion?.warning),this.ghostTexts=An({owner:this,equalsFn:D8},v=>{const S=this.inlineCompletionState.read(v);if(S)return S.ghostTexts}),this.primaryGhostText=An({owner:this,equalsFn:jG},v=>{const S=this.inlineCompletionState.read(v);if(S)return S?.primaryGhostText}),this.showCollapsed=$(this,v=>{const S=this.state.read(v);if(!S||S.kind!=="inlineEdit"||S.inlineCompletion.hint)return!1;const x=S.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(v);return(this._inlineEditsShowCollapsedEnabled.read(v)||!x)&&this._jumpedToId.read(v)!==S.inlineCompletion.semanticId&&!this._inAcceptFlow.read(v)}),this._tabShouldIndent=$(this,v=>{if(this._inAcceptFlow.read(v))return!1;function S(D){return D.startLineNumber!==D.endLineNumber}function x(D,I){const T=D.getLineIndentColumn(I),F=D.getLineLastNonWhitespaceColumn(I),O=Math.max(F,T);return new L(I,T,I,O)}return this._editorObs.selections.read(v)?.some(D=>D.isEmpty()?this.textModel.getLineLength(D.startLineNumber)===0:S(D)||D.containsRange(x(this.textModel,D.startLineNumber)))}),this.tabShouldJumpToInlineEdit=$(this,v=>{if(this._tabShouldIndent.read(v))return!1;const S=this.inlineEditState.read(v);return S?this.showCollapsed.read(v)?!0:this._inAcceptFlow.read(v)&&this._appearedInsideViewport.read(v)&&!S.inlineCompletion.hint?.jumpToEdit?!1:!S.cursorAtInlineEdit.read(v):!1}),this.tabShouldAcceptInlineEdit=$(this,v=>{const S=this.inlineEditState.read(v);return!S||this.showCollapsed.read(v)||this._tabShouldIndent.read(v)?!1:this._inAcceptFlow.read(v)&&this._appearedInsideViewport.read(v)&&!S.inlineCompletion.hint?.jumpToEdit||S.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(v)||this._jumpedToId.read(v)===S.inlineCompletion.semanticId?!0:S.cursorAtInlineEdit.read(v)}),this._jumpedToId=De(this,void 0),this._inAcceptFlow=De(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(vM,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,v=>v?.request?.context.triggerKind),this._editorObs=Jt(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map(v=>v.preview),this._suggestPreviewMode=p.map(v=>v.previewMode);const _=this._editorObs.getOption(71);this._inlineSuggestMode=_.map(v=>v.mode),this._suppressedInlineCompletionGroupIds=_.map(v=>new Set(v.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=_.map(v=>!!v.edits.enabled),this._inlineEditsShowCollapsedEnabled=_.map(v=>v.edits.showCollapsed),this._triggerCommandOnProviderChange=_.map(v=>v.triggerCommandOnProviderChange),this._minShowDelay=_.map(v=>v.minShowDelay),this._showOnSuggestConflict=_.map(v=>v.experimental.showOnSuggestConflict),this._suppressInSnippetMode=_.map(v=>v.suppressInSnippetMode);const b=gs.get(this._editor);this._isInSnippetMode=b?.isInSnippetObservable??Nt(!1),this._typing=this._register(new Nd(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(v=>{v&&this.stop()}));{const v=this.textModel.uri.scheme==="vscode-notebook-cell",[S]=this._codeEditorService.listDiffEditors().filter(x=>x.getOriginalEditor().getId()===this._editor.getId()||x.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!S,this.editorType=v?nC.Notebook:this.isInDiffEditor?nC.DiffEditor:nC.TextEditor}this._register(fm(this.state,v=>{v&&v.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(v.inlineCompletion.requestUuid)})),this._register(fm(this._fetchInlineCompletionsPromise)),this._register(xe(v=>{this._editorObs.versionId.read(v),this._inAcceptFlow.set(!1,void 0)})),this._register(xe(v=>{this.state.map((x,k)=>!x||x.kind==="inlineEdit"&&!x.cursorAtInlineEdit.read(k)).read(v)&&this._jumpedToId.set(void 0,void 0)}));const C=this.inlineEditState.map(v=>v?.inlineCompletion.semanticId);this._register(xe(v=>{C.read(v)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}));const w=dt(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(e));hO(this,w,(v,S)=>{v.onDidChangeInlineCompletions&&S.add(v.onDidChangeInlineCompletions(()=>{if(!this._enabled.get()||(this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get()){this.trigger(void 0,{onlyFetchInlineEdits:!0});return}const k=this.state.get();k&&(k.inlineCompletion||k.edits)&&k.inlineCompletion?.source.provider!==v||Et(D=>{this._fetchSpecificProviderSignal.trigger(D,v),this.trigger(D)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const n=this?.primaryGhostText.read(e);if(this?._selectedSuggestItem&&n&&n.parts.length>0){const{column:s,lines:r}=n.parts[0],a=r[0].line,l=this.textModel.getLineIndentColumn(n.lineNumber);if(s<=l){let d=hs(a);d===-1&&(d=a.length-1),t=d>0;const h=this.textModel.getOptions().tabSize;i=oi.visibleColumnFromColumn(a,d+1,h)!(r.groupId&&t.has(r.groupId))),n=new Set;for(const r of i)r.excludesGroupIds?.forEach(a=>n.add(a));const s=[];for(const r of i)r.groupId&&n.has(r.groupId)||s.push(r);return s}async trigger(e,t={}){gm(e,i=>{t.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(i),t.noDelay&&this._noDelaySignal.trigger(i),this._isActive.set(!0,i),t.explicit&&(this._inAcceptFlow.set(!0,i),this._forceUpdateExplicitlySignal.trigger(i)),t.provider&&this._fetchSpecificProviderSignal.trigger(i,t.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){return this.trigger(e,{onlyFetchInlineEdits:t,explicit:!0})}stop(e="automatic",t){gm(t,i=>{if(e==="explicitCancel"){const n=this.state.get()?.inlineCompletion;n&&n.reportEndOfLife({kind:Ng.Rejected})}this._isActive.set(!1,i),this._source.clear(i)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),s=n?n.inlineCompletions.filter(a=>!a.isInlineEdit):[this.selectedInlineCompletion.read(t)].filter(hn);return Oae(s,a=>{let l=a.getSingleTextEdit();return l=Mc(l,i,L.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),qG(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?jn.inlineCompletionPartialAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):jn.inlineCompletionAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){if(e.getModel()!==this.textModel)throw new Ce;let t,i=!1;const n=this.state.get();if(n?.kind==="ghostText"){if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;t=n.inlineCompletion}else if(n?.kind==="inlineEdit")t=n.inlineCompletion,i=!!n.nextEditUri;else return;t.addRef();try{if(e.pushUndoStop(),!i)if(t.snippetInfo){const s=Ni.delete(t.editRange),r=t.additionalTextEdits.map(l=>new Ni(L.lift(l.range),l.text??"")),a=ho.fromParallelReplacementsUnsorted([s,...r]);e.edit(a,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),gs.get(e)?.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const s=n.edits;let r=s;n.kind==="ghostText"&&(r=sye(s,this.textModel));const a=L8(r).map(d=>ae.fromPositions(d)),l=t.additionalTextEdits.map(d=>new Ni(L.lift(d.range),d.text??"")),c=ho.fromParallelReplacementsUnsorted([...s,...l]);if(e.edit(c,this._getMetadata(t,this.textModel.getLanguageId())),t.hint===void 0&&e.setSelections(n.kind==="inlineEdit"?a.slice(-1):a,"inlineCompletionAccept"),n.kind==="inlineEdit"&&!this._accessibilityService.isMotionReduced()){const d=c.getNewRanges(),h=this._store.add(new dxe(e,d,()=>{this._store.delete(h)}))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,Ri),t.reportEndOfLife({kind:Ng.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),s=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),r=t.match(s);let a=0;r&&r.index!==void 0?r.index===0?a=r[0].length:a=r.index:a=t.length;const c=/\s+/g.exec(t);return c&&c.index!==void 0&&c.index+c[0].length{const i=t.match(/\n/);return i&&i.index!==void 0?i.index+1:t.length},1)}async _acceptNext(e,t,i,n){if(e.getModel()!==this.textModel)throw new Ce;const s=this.inlineCompletionState.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const r=s.primaryGhostText,a=s.inlineCompletion;if(a.snippetInfo){await this.accept(e);return}const l=r.parts[0],c=new R(r.lineNumber,l.column),d=l.text,h=i(c,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const u=d.substring(0,h),g=this._positions.get(),f=g[0];a.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const C=L.fromPositions(f,c),w=e.getModel().getValueInRange(C)+u,v=new Ni(C,w),S=[v,...ZI(this.textModel,g,v)].filter(hn),x=L8(S).map(k=>ae.fromPositions(k));e.edit(ho.fromParallelReplacementsUnsorted(S),this._getMetadata(a,t)),e.setSelections(x,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const p=L.fromPositions(a.editRange.getStartPosition(),si.ofText(u).addToPosition(c)),b=e.getModel().getValueInRange(p,1).length;a.reportPartialAccept(b,{kind:n,acceptedLength:b},{characters:h,ratio:h/d.length,count:1})}finally{a.removeRef()}}handleSuggestAccepted(e){const t=Mc(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:s},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){const e=this.textModel.getValue(),t=this.state.get()?.inlineCompletion;return{documentValue:e,inlineCompletion:t?.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&Et(t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,n=i.getStartPosition();if(this._editor.setPosition(n,"inlineCompletions.jump"),i.isSingleLine()&&(e.inlineCompletion.hint||!e.inlineCompletion.insertText.includes(` +`)))this._editor.revealPosition(n);else{const r=new L(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(r,1)}e.inlineCompletion.identity.setJumpTo(t),this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};SM=cxe([iu(7,fe),iu(8,Pt),iu(9,ti),iu(10,kn),iu(11,he),iu(12,et),iu(13,jk)],SM);var fc;(function(o){o[o.Undo=0]="Undo",o[o.Redo=1]="Redo",o[o.AcceptWord=2]="AcceptWord",o[o.Other=3]="Other"})(fc||(fc={}));function ZI(o,e,t){if(e.length===1)return[];const i=new Wg(o),n=i.getTransformer(),s=n.getOffset(e[0]),r=e.slice(1).map(u=>n.getOffset(u));t=t.removeCommonPrefixAndSuffix(i);const a=n.getStringReplacement(t),l=a.replaceRange.start-s,c=a.replaceRange.join(ge.emptyAt(s)),d=i.getValueOfOffsetRange(c);return r.map(u=>{const g=u+l,f=g+a.replaceRange.length,p=new ge(g,f),_=p.join(ge.emptyAt(u));if(i.getValueOfOffsetRange(_)!==d)return;const C=new yn(p,a.newText);return n.getTextReplacement(C)}).filter(hn)}class dxe extends A{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(Jt(e).setDecorations(Nt(t.map(r=>({range:r,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const n=new aye(1,0,1e3,cye),s=new dye(n);this._register(xe(r=>{const a=s.getValue(r);e.getContainerDomNode().style.setProperty("--animation-opacity",a.toString()),n.isFinished()&&this.dispose()}))}}function hxe(o,e){const t=e.targetRange,i=o.getVisibleRanges();return i.length<1?!1:new L(i[0].startLineNumber,i[0].startColumn,i[i.length-1].endLineNumber,i[i.length-1].endColumn).containsRange(t)}var uxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z8=function(o,e){return function(t,i){e(t,i,o)}},fb;class _5{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;sl&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:km.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class fxe extends _5{constructor(){super("recentlyUsedByPrefix"),this._trie=$p.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:km.fromString(i.type),this._trie.set(t,i)}}}let yM=class{static{fb=this}static{this._strategyCtors=new Map([["recentlyUsedByPrefix",fxe],["recentlyUsed",gxe],["first",Y8]])}static{this._storagePrefix="suggest/memories"}constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new z,this._persistSoon=new St(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===gh.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState();const n=fb._strategyCtors.get(i)||Y8;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,a=this._storageService.get(`${fb._storagePrefix}/${i}`,r);a&&this._strategy.fromJSON(JSON.parse(a))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${fb._storagePrefix}/${this._strategy.name}`,i,t,1)}}};yM=fb=uxe([Z8(0,ps),Z8(1,Pe)],yM);const qk=We("ISuggestMemories");$e(qk,yM,1);var pxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mxe=function(o,e){return function(t,i){e(t,i,o)}},xM;let vx=class{static{xM=this}static{this.AtEnd=new oe("atEndOfWord",!1,{type:"boolean",description:m(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")})}constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=xM.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(139)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(139)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),n=this._editor.getSelection(),s=i.getWordAtPosition(n.getStartPosition());if(!s){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(s.endColumn===n.getStartPosition().column&&n.getStartPosition().lineNumber===n.getEndPosition().lineNumber)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};vx=xM=pxe([mxe(1,Ie)],vx);var _xe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bxe=function(o,e){return function(t,i){e(t,i,o)}},pb;let zm=class{static{pb=this}static{this.OtherSuggestions=new oe("hasOtherSuggestions",!1)}constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=pb.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(pb._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let n=i;for(let s=t.items.length;s>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));s--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=pb._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};zm=pb=_xe([bxe(1,Ie)],zm);class Cxe{constructor(e,t,i,n){this._disposables=new z,this._disposables.add(i.onDidSuggest(s=>{s.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(s=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(s=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&n(this._active.item)}}))}_onItem(e){if(!e||!us(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new P0;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Vr{async provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s);const r=new Map;await new Promise(a=>Vr._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>Vr._bracketsLeftYield(a,0,e,n,r,s))}return i}static{this._maxDuration=30}static{this._maxRounds=2}static _bracketsRightYield(e,t,i,n,s){const r=new Map,a=Date.now();for(;;){if(t>=Vr._maxRounds){e();break}if(!n){e();break}const l=i.bracketPairs.findNextBracket(n);if(!l){e();break}if(Date.now()-a>Vr._maxDuration){setTimeout(()=>Vr._bracketsRightYield(e,t+1,i,n,s));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=s.get(d);u||(u=new cs,s.set(d,u)),u.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,s,r){const a=new Map,l=Date.now();for(;;){if(t>=Vr._maxRounds&&s.size===0){e();break}if(!n){e();break}const c=i.bracketPairs.findPrevBracket(n);if(!c){e();break}if(Date.now()-l>Vr._maxDuration){setTimeout(()=>Vr._bracketsLeftYield(e,t+1,i,n,s,r));break}if(c.bracketInfo.isOpeningBracket){const h=c.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const g=s.get(h);if(g){const f=g.shift();g.size===0&&s.delete(h);const p=L.fromPositions(c.range.getEndPosition(),f.getStartPosition()),_=L.fromPositions(c.range.getStartPosition(),f.getEndPosition());r.push({range:p}),r.push({range:_}),Vr._addBracketLeading(i,_,r)}}}else{const h=c.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}n=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(n);s!==0&&s!==t.startColumn&&(i.push({range:L.fromPositions(new R(n,s),t.getEndPosition())}),i.push({range:L.fromPositions(new R(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:L.fromPositions(new R(r,a),t.getEndPosition())}),i.push({range:L.fromPositions(new R(r,1),t.getEndPosition())}))}}}class al{static{this.None=new class extends al{distance(){return 0}}}static async create(e,t){if(!t.getOption(134).localityBonus||!t.hasModel())return al.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return al.None;const[s]=await new Vr().provideSelectionRanges(i,[n]);if(s.length===0)return al.None;const r=await e.computeWordRanges(i.uri,s[0].range);if(!r)return al.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends al{distance(l,c){if(!n.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,h=r[d];if(XV(h))return 2<<20;const u=L0(h,L.fromPositions(l),L.compareRangesUsingStarts),g=u>=0?h[u]:h[Math.max(0,~u-1)];let f=s.length;for(const p of s){if(!L.containsRange(p.range,g))break;f-=1}return f}}}}let X8=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Bd{constructor(e,t,i,n,s,r,a=P4.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Bd._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Bd._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Bd._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",s="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?Og:oge;for(let c=0;c=g)d.score=Jr.Default;else if(typeof d.completion.filterText=="string"){const p=l(n,s,f,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;$E(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=tge(n,s,f,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(n,s,f,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?ZE(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return 1;if(t.completion.kind===28)return-1}return Bd._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return-1;if(t.completion.kind===28)return 1}return Bd._compareCompletionItems(e,t)}}var vxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vd=function(o,e){return function(t,i){e(t,i,o)}},LM;class nu{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function wxe(o,e,t){if(!e.getContextKeyValue(kt.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(kt.suppressSuggestions.key);return i!==void 0?!i:!o.getOption(71).suppressSuggestions}function Sxe(o,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(kt.suppressSuggestions.key);return i!==void 0?!i:!o.getOption(71).suppressSuggestions}let wx=LM=class{constructor(e,t,i,n,s,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=s,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new z,this._triggerCharacterListener=new z,this._triggerQuickSuggest=new mo,this._triggerState=void 0,this._completionDisposables=new z,this._onDidCancel=new P,this._onDidTrigger=new P,this._onDidSuggest=new P,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new ae(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){pt(this._triggerCharacterListener),pt([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let s=e.get(n);s||(s=new Set,e.set(n,s)),s.add(i)}const t=i=>{if(!Sxe(this._editor,this._contextKeyService,this._configurationService)||nu.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";bh(i.charCodeAt(i.length-1))?Vi(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const s=e.get(n);if(s){const r=new Map;if(this._completionModel)for(const[a,l]of this._completionModel.getItemsByProvider())s.has(a)||r.set(a,l);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:r}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){Cp.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&gs.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!nu.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(102);if(!Cp.isAllOff(i)){if(!Cp.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),s=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Cp.valueFor(i,s)!=="on")return}wxe(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){Je(this._editor.hasModel()),Je(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new nu(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new nu(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??0};e.triggerCharacter&&(n={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new qt;const s=this._editor.getOption(128);let r=1;switch(s){case"top":r=0;break;case"bottom":r=2;break}const{itemKind:a,showDeprecated:l}=LM.createSuggestFilter(this._editor),c=new Gw(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,l),d=al.create(this._editorWorkerService,this._editor),h=d5(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,n,this._requestToken.token);Promise.all([h,d]).then(async([u,g])=>{if(this._requestToken?.dispose(),!this._editor.hasModel()){u.disposable.dispose();return}let f=e?.clipboardText;if(!f&&u.needsClipboard&&(f=await this._clipboardService.readText()),this._triggerState===void 0){u.disposable.dispose();return}const p=this._editor.getModel(),_=new nu(p,this._editor.getPosition(),e),b={...P4.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new Bd(u.items,this._context.column,{leadingLineContent:_.leadingLineContent,characterCountDelta:_.column-this._context.column},g,this._editor.getOption(134),this._editor.getOption(128),b,f),this._completionDisposables.add(u.disposable),this._onNewContext(_),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const C of u.items)C.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${C.provider._debugDisplayName}`,C.completion)}).catch(Ee)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(128)==="none"&&t.add(28);const n=e.getOption(134);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(28),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Dt(e.leadingLineContent)!==Dt(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(nu.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[n,s]of this._completionModel.getItemsByProvider())s.length>0&&s[0].container.incomplete?i.add(n):t.set(n,s);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const n=nu.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};wx=LM=vxe([vd(1,eo),vd(2,Co),vd(3,ts),vd(4,Mt),vd(5,Ie),vd(6,Pe),vd(7,he),vd(8,bF)],wx);class b5{static{this._maxSelectionLength=51200}constructor(e,t){this._disposables=new z,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),n=i.length;let s=!1;for(let a=0;ab5._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},YI=function(o,e){return function(t,i){e(t,i,o)}};let kM=class{constructor(e,t,i,n,s){this._menuId=t,this._menuService=n,this._contextKeyService=s,this._menuDisposables=new z,this.element=Z(e,J(".suggest-status-bar"));const r=(a=>a instanceof $o?i.createInstance(sF,a,{useComma:!1}):void 0);this._leftActions=new qs(this.element,{actionViewItemProvider:r}),this._rightActions=new qs(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],n=[];for(const[s,r]of e.getActions())s==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};kM=yxe([YI(2,fe),YI(3,Er),YI(4,Ie)],kM);var xxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Q8=function(o,e){return function(t,i){e(t,i,o)}};function C5(o){return!!o&&!!(o.completion.documentation||o.completion.detail&&o.completion.detail!==o.completion.label)}let DM=class{constructor(e,t,i){this._editor=e,this._themeService=t,this._markdownRendererService=i,this._onDidClose=new P,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new P,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new z,this._renderDisposeable=new z,this._size=new at(330,0),this.domNode=J(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=J(".body"),this._scrollbar=new ww(this._body,{alwaysConsumeMouseWheel:!0}),Z(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Z(this._body,J(".header")),this._close=Z(this._header,J("span"+Se.asCSSSelector(G.close))),this._close.title=m(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=Z(this._header,J("p.type")),this._docs=Z(this._body,J("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),n=e.get(135)||t.fontSize,s=e.get(136)||t.lineHeight,r=t.fontWeight,a=`${n}px`,l=`${s}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${s/n}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=Na(this._themeService.getColorTheme().type)?2:1,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=m(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let s="";s+=`score: ${e.score[0]} `,s+=`prefix: ${e.word??"(no prefix)"} `,s+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,s+=`distance: ${e.distance} (localityBonus-setting) `,s+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,s+=`commit_chars: ${e.completion.commitCharacters?.join("")} -`,n=new ts().appendCodeblock("empty",s),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!T3(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const s=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=s,this._type.title=s,Co(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(s))}else Tn(this._type),this._type.title="",Rs(this._type),this.domNode.classList.add("no-type");if(Tn(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Tn(this._docs);const s=this._markdownRendererService.render(n,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(s.element),this._renderDisposeable.add(s)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!n),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},this._close.onclick=s=>{s.preventDefault(),s.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new ut(e,t);ut.equals(i,this._size)||(this._size=i,Zte(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}};B2=VDe([F6(1,pi),F6(2,Sa)],B2);class zDe{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new M5,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=Hh(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new ut(220,2*s.lineHeight),a=e.top,l=(function(){const S=n.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),L=-s.borderWidth+e.left+e.width,x=new ut(S,n.height-e.top-s.borderHeight-s.verticalPadding),k=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:k,minSize:r.with(Math.min(S,r.width))}})(),c=(function(){const S=e.left-s.borderWidth-s.horizontalPadding,L=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),x=new ut(S,n.height-e.top-s.borderHeight-s.verticalPadding),k=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:k,minSize:r.with(Math.min(S,r.width))}})(),d=(function(){const S=e.left,L=-s.borderWidth+e.top+e.height,x=new ut(e.width-s.borderHeight,n.height-e.top-e.height-s.verticalPadding);return{top:L,left:S,fit:x.height-t.height,maxSizeBottom:x,maxSizeTop:x,minSize:r.with(x.width)}})(),h=[l,c,d],u=h.find(S=>S.fit>=0)??h.sort((S,L)=>L.fit-S.fit)[0],g=e.top+e.height-s.borderHeight;let f,p=t.height;const _=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);p>_&&(p=_);let b;i?p<=u.maxSizeTop.height?(f=!0,b=u.maxSizeTop):(f=!1,b=u.maxSizeBottom):p<=u.maxSizeBottom.height?(f=!1,b=u.maxSizeBottom):(f=!0,b=u.maxSizeTop);let{top:C,left:w}=u;!f&&p>e.height&&(C=g-p);const v=this._editor.getDomNode();if(v){const S=v.getBoundingClientRect();C-=S.top,w-=S.left}this._applyTopLeft({left:w,top:C}),this._resizable.enableSashes(!f,u===l,f,u!==l),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(p,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const W6=Ve("fileService");var Wl;(function(o){o[o.FILE=0]="FILE",o[o.FOLDER=1]="FOLDER",o[o.ROOT_FOLDER=2]="ROOT_FOLDER"})(Wl||(Wl={}));const UDe=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function qS(o,e,t,i,n){if(ye.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(be.isUri(n))return[];const s=i===Wl.ROOT_FOLDER?["rootfolder-icon"]:i===Wl.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===Ie.data)r=Uh.parseMetaData(t).get(Uh.META_DATA_LABEL);else{const a=t.path.match(UDe);a?(r=KS(a[2].toLowerCase()),a[1]&&s.push(`${KS(a[1].toLowerCase())}-name-dir-icon`)):r=KS(t.authority.toLowerCase())}if(i===Wl.ROOT_FOLDER)s.push(`${r}-root-name-folder-icon`);else if(i===Wl.FOLDER)s.push(`${r}-name-folder-icon`);else{if(r){if(s.push(`${r}-name-file-icon`),s.push("name-file-icon"),r.length<=255){const l=r.split(".");for(let c=1;c=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aN=function(o,e){return function(t,i){e(t,i,o)}};const qDe=Kt("suggest-more-info",Z.chevronRight,m(1492,"Icon for more information in the suggest widget.")),KDe=new class eC{static{this._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/}static{this._regexStrict=new RegExp(`^${eC._regexRelaxed.source}$`,"i")}extract(e,t){if(e.textLabel.match(eC._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(eC._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,n=eC._regexRelaxed.exec(i);if(n&&(n.index===0||n.index+n[0].length===i.length))return t[0]=n[0],!0}return!1}};let H2=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new P,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new z,i=e;i.classList.add("show-file-icons");const n=Y(e,ee(".icon")),s=Y(n,ee("span.colorspan")),r=Y(e,ee(".contents")),a=Y(r,ee(".main")),l=Y(a,ee(".icon-label.codicon")),c=Y(a,ee("span.left")),d=Y(a,ee("span.right")),h=new hw(c,{supportHighlights:!0,supportIcons:!0});t.add(h);const u=Y(c,ee("span.signature-label")),g=Y(c,ee("span.qualifier-label")),f=Y(d,ee("span.details-label")),p=Y(d,ee("span.readMore"+ye.asCSSSelector(qDe)));return p.title=m(1493,"Read More"),{root:i,left:c,right:d,icon:n,colorspan:s,iconLabel:h,iconContainer:l,parametersLabel:u,qualifierLabel:g,detailsLabel:f,readMore:p,disposables:t,configureFont:()=>{const b=this._editor.getOptions(),C=b.get(59),w=C.getMassagedFontFamily(),v=C.fontFeatureSettings,S=C.fontVariationSettings,L=b.get(135)||C.fontSize,x=b.get(136)||C.lineHeight,k=C.fontWeight,I=C.letterSpacing,T=`${L}px`,A=`${x}px`,O=`${I}px`;i.style.fontSize=T,i.style.fontWeight=k,i.style.letterSpacing=O,a.style.fontFamily=w,a.style.fontFeatureSettings=v,a.style.fontVariationSettings=S,a.style.lineHeight=A,n.style.height=A,n.style.width=A,p.style.height=A,p.style.width=A}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:c1(e.score)},r=[];if(n.kind===19&&KDe.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=qS(this._modelService,this._languageService,be.from({scheme:"fake",path:e.textLabel}),Wl.FILE),l=qS(this._modelService,this._languageService,be.from({scheme:"fake",path:n.detail}),Wl.FILE);s.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",s.extraClasses=[qS(this._modelService,this._languageService,be.from({scheme:"fake",path:e.textLabel}),Wl.FOLDER),qS(this._modelService,this._languageService,be.from({scheme:"fake",path:n.detail}),Wl.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...ye.asClassNameArray(i_.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,s),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=lN(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=lN(n.label.detail||""),i.detailsLabel.textContent=lN(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?Co(i.detailsLabel):Rs(i.detailsLabel),T3(e)?(i.right.classList.add("can-expand-details"),Co(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Rs(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};H2=jDe([aN(1,ri),aN(2,yi),aN(3,pi)],H2);function lN(o){return o.replace(/\r\n|\r|\n/g,"")}var GDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GS=function(o,e){return function(t,i){e(t,i,o)}},Np;E("editorSuggestWidget.background",tr,m(1473,"Background color of the suggest widget."));E("editorSuggestWidget.border",G4,m(1474,"Border color of the suggest widget."));const ZDe=E("editorSuggestWidget.foreground",nc,m(1475,"Foreground color of the suggest widget."));E("editorSuggestWidget.selectedForeground",xv,m(1476,"Foreground color of the selected entry in the suggest widget."));E("editorSuggestWidget.selectedIconForeground",oF,m(1477,"Icon foreground color of the selected entry in the suggest widget."));const YDe=E("editorSuggestWidget.selectedBackground",Dv,m(1478,"Background color of the selected entry in the suggest widget."));E("editorSuggestWidget.highlightForeground",Wp,m(1479,"Color of the match highlights in the suggest widget."));E("editorSuggestWidget.focusHighlightForeground",rae,m(1480,"Color of the match highlights in the suggest widget when an item is focused."));E("editorSuggestWidgetStatus.foreground",Pe(ZDe,.5),m(1481,"Foreground color of the suggest widget status."));class XDe{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof kd}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(ut.is(t))return ut.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let V2=class{static{Np=this}static{this.LOADING_MESSAGE=m(1482,"Loading...")}static{this.NO_SUGGESTIONS_MESSAGE=m(1483,"No suggestions.")}constructor(e,t,i,n,s){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new _t,this._pendingShowDetails=new _t,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Io,this._disposables=new z,this._onDidSelect=new Kg,this._onDidFocus=new Kg,this._onDidHide=new P,this._onDidShow=new P,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new P,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new M5,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new QDe(this,e),this._persistedSize=new XDe(t,e);class r{constructor(g,f,p=!1,_=!1){this.persistedSize=g,this.currentSize=f,this.persistHeight=p,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:g,defaultSize:f}=this.getLayoutInfo(),p=Math.round(g/2);let{width:_,height:b}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-b)<=p)&&(b=a.persistedSize?.height??f.height),(!a.persistWidth||Math.abs(a.currentSize.width-_)<=p)&&(_=a.persistedSize?.width??f.width),this._persistedSize.store(new ut(_,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Y(this.element.domNode,ee(".message")),this._listElement=Y(this.element.domNode,ee(".tree"));const l=this._disposables.add(s.createInstance(B2,this.editor));l.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new zDe(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);c();const d=s.createInstance(H2,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new ur("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>Rn?"listitem":"option",getWidgetAriaLabel:()=>m(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let g=u.textLabel;const f=i_.toLabel(u.completion.kind);if(typeof u.completion.label!="string"){const{detail:C,description:w}=u.completion.label;C&&w?g=m(1485,"{0} {1}, {2}, {3}",g,C,w,f):C?g=m(1486,"{0} {1}, {2}",g,C,f):w&&(g=m(1487,"{0}, {1}, {2}",g,w,f))}else g=m(1488,"{0}, {1}",g,f);if(!u.isResolved||!this._isDetailsVisible())return g;const{documentation:p,detail:_}=u.completion,b=Gg("{0}{1}",_||"",p?typeof p=="string"?p:p.value:"");return m(1489,"{0}, docs: {1}",g,b)}}}),this._list.style(Of({listInactiveFocusBackground:YDe,listInactiveFocusOutline:ti})),this._status=s.createInstance(W2,this.element.domNode,Fh);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);h(),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(134)&&(h(),c()),this._completionModel&&(u.hasChanged(59)||u.hasChanged(135)||u.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=ze.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=ze.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=ze.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=ze.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ti(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onListFocus(e){if(this._ignoreFocusEvents)return;if(this._state===5&&this._setState(3),!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Qi(async n=>{const s=pd(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),r=n.onCancellationRequested(()=>s.dispose());try{return await t.resolve(n)}finally{s.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))}).catch(Te)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Rs(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=Np.LOADING_MESSAGE,Rs(this._listElement,this._status.element),Co(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ya(Np.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=Np.NO_SUGGESTIONS_MESSAGE,Rs(this._listElement,this._status.element),Co(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ya(Np.NO_SUGGESTIONS_MESSAGE);break;case 3:Rs(this._messageElement),Co(this._listElement,this._status.element),this._show();break;case 4:Rs(this._messageElement),Co(this._listElement,this._status.element),this._show();break;case 5:Rs(this._messageElement),Co(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=pd(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,s){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(n?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,t===0?0:this.getLayoutInfo().itemHeight*.33),this._list.setFocus(s?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Ly(me(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._list.setFocus(this._list.getFocus()),this._setState(3)):this._state===3&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(T3(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=Ly(me(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(s=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:s,l=i.statusBarHeight+this._list.contentHeight+i.borderHeight,c=i.itemHeight+i.statusBarHeight,d=wi(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,g=Math.min(t.height-u-i.verticalPadding,l),f=d.top+h.top-i.verticalPadding,p=Math.min(f,l);let _=Math.min(Math.max(p,g)+i.borderHeight,l);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),n_&&(n=_),n>g&&p>g||this._forceRenderingAbove&&f>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),_=p):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),_=g),this.element.preferredSize=new ut(a,i.defaultSize.height),this.element.maxSize=new ut(r,_),this.element.minSize=new ut(220,c),this._cappedHeight=n===l?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(s,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(t-s,e),this._listElement.style.height=`${t-s}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===2)}getLayoutInfo(){const e=this.editor.getOption(59),t=Ts(this.editor.getOption(136)||e.lineHeight,8,1e3),i=!this.editor.getOption(134).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.getLayoutInfo().borderWidth,s=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:s,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new ut(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};V2=Np=GDe([GS(1,Ls),GS(2,Ne),GS(3,pi),GS(4,pe)],V2);class QDe{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new ut(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var JDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_p=function(o,e){return function(t,i){e(t,i,o)}},z2;class eke{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Me.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),s=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(D.fromPositions(t,s),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let za=class{static{z2=this}static{this.ID="editor.contrib.suggestController"}static get(e){return e.getContribution(z2.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,n,s,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=s,this._logService=r,this._telemetryService=a,this._lineSuffix=new _t,this._toDispose=new z,this._selectors=new tke(h=>h.priority),this._onWillInsertSuggestItem=new P,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=s.createInstance(mx,this.editor),this._selectors.register({priority:0,select:(h,u,g)=>this._memoryService.select(h,u,g)});const l=ze.InsertMode.bindTo(n);l.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(134).insertMode))),this.widget=this._toDispose.add(new TI(me(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(V2,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(_=>this._insertSuggestion(_,0),this));const u=new ODe(this.editor,h,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(u);const g=ze.MakesTextEdit.bindTo(this._contextKeyService),f=ze.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=ze.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(ge(()=>{g.reset(),f.reset(),p.reset()})),this._toDispose.add(h.onDidFocus(({item:_})=>{const b=this.editor.getPosition(),C=_.editStart.column,w=b.column;let v=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&w-C===_.completion.insertText.length&&(v=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:C,endLineNumber:b.lineNumber,endColumn:w})!==_.completion.insertText),g.set(v),f.set(!R.equals(_.editInsertEnd,_.editReplaceEnd)),p.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new fd(!0,!1,!1,!1,33))||je&&_.toKeyCodeChord().equals(new fd(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&h.forceRenderingAbove(),h})),this._overtypingCapturer=this._toDispose.add(new TI(me(e.getDomNode()),()=>this._toDispose.add(new N3(this.editor,this.model)))),this._alternatives=this._toDispose.add(new TI(me(e.getDomNode()),()=>this._toDispose.add(new b_(this.editor,this._contextKeyService)))),this._toDispose.add(s.createInstance(px,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new eke(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const f of this._selectors.itemsOrderedByPriorityDesc)if(u=f.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===0)return;let g=!1;if(h.triggerOptions.auto){const f=this.editor.getOption(134);f.selectionMode==="never"||f.selectionMode==="always"?g=f.selectionMode==="never":f.selectionMode==="whenTriggerCharacter"?g=h.triggerOptions.triggerKind!==1:f.selectionMode==="whenQuickSuggestion"&&(g=h.triggerOptions.triggerKind===1&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,g)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=ze.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const h=this.editor.getOption(1);c.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Ss.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),s=n.getAlternativeVersionId(),{item:r}=e,a=[],l=new Jt;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(n,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const f=el.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(p=>{let _=D.lift(p.range);if(_.startLineNumber===r.position.lineNumber&&_.startColumn>r.position.column){const b=this.editor.getPosition().column-r.position.column,C=b,w=D.spansMultipleLines(_)?0:b;_=new D(_.startLineNumber,_.startColumn+C,_.endLineNumber,_.endColumn+w)}return Ci.replaceMove(_,p.text)})),f.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const f=new fn;let p;const _=n.onDidChangeContent(v=>{if(v.isFlush){l.cancel(),_.dispose();return}for(const S of v.changes){const L=D.getEndPosition(S.range);(!p||R.isBefore(L,p))&&(p=L)}}),b=t;t|=2;let C=!1;const w=this.editor.onWillType(()=>{w.dispose(),C=!0,b&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&r.completion.additionalTextEdits.some(S=>R.isBefore(p,D.getStartPosition(S.range))))return!1;C&&this.editor.pushUndoStop();const v=el.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(S=>Ci.replaceMove(D.lift(S.range),S.text))),v.restoreRelativeVerticalPositionOfCursor(this.editor),(C||!(b&2))&&this.editor.pushUndoStop(),!0}).then(v=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",f.elapsed(),v),u=v===!0?1:v===!1?0:-2}).finally(()=>{_.dispose(),w.dispose()}))}let{insertText:g}=r.completion;if(r.completion.insertTextRules&4||(g=df.escape(g)),this.model.cancel(),i.insert(g,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:Jn.suggest({providerId:ZD.fromExtensionId(r.extensionId?.value)})}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===zk.id)this.model.trigger({auto:!0,retrigger:!0});else{const f=new fn;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(p=>{r.completion.extensionId?Bi(p):Te(p)}).finally(()=>{h=f.elapsed()}))}t&4&&this._alternatives.value.set(e,f=>{for(l.cancel();n.canUndo();){s!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(f,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,d,h,u,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,s,r,a){if(Math.random()>1e-4)return;const l=new Map;for(let u=0;u1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Yw(Br(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Uie(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:s,index:r,firstIndex:h})}getOverwriteInfo(e,t){rt(this.editor.hasModel());let i=this.editor.getOption(134).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,s=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+r,overwriteAfter:s+a}}_alertCompletionItem(e){if(ws(e.completion.additionalTextEdits)){const t=m(1463,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Ws(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=s=>{if(s.completion.insertTextRules&4||s.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=s.editStart.column,l=r.column;return l-a!==s.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==s.completion.insertText};se.once(this.model.onDidTrigger)(s=>{const r=[];se.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{vt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(vt(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!n(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}};za=z2=JDe([_p(1,Vk),_p(2,Vt),_p(3,Ne),_p(4,pe),_p(5,Ht),_p(6,cs)],za);class tke{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class zk extends de{static{this.id="editor.action.triggerSuggest"}constructor(){super({id:zk.id,label:H(1471,"Trigger Suggest"),precondition:K.and(N.writable,N.hasCompletionItemProvider,ze.Visible.toNegated()),kbOpts:{kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=za.get(t);if(!n)return;let s;i&&typeof i=="object"&&i.auto===!0&&(s=!0),n.triggerSuggest(void 0,s,void 0)}}nt(za.ID,za,2);oe(zk);const dr=190,$s=tn.bindToContribution(za.get);ae(new $s({id:"acceptSelectedSuggestion",precondition:K.and(ze.Visible,ze.HasFocusedSuggestion),handler(o){o.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:K.and(ze.Visible,N.textInputFocus),weight:dr},{primary:3,kbExpr:K.and(ze.Visible,N.textInputFocus,ze.AcceptSuggestionsOnEnter,ze.MakesTextEdit),weight:dr}],menuOpts:[{menuId:Fh,title:m(1464,"Insert"),group:"left",order:1,when:ze.HasInsertAndReplaceRange.toNegated()},{menuId:Fh,title:m(1465,"Insert"),group:"left",order:1,when:K.and(ze.HasInsertAndReplaceRange,ze.InsertMode.isEqualTo("insert"))},{menuId:Fh,title:m(1466,"Replace"),group:"left",order:1,when:K.and(ze.HasInsertAndReplaceRange,ze.InsertMode.isEqualTo("replace"))}]}));ae(new $s({id:"acceptAlternativeSelectedSuggestion",precondition:K.and(ze.Visible,N.textInputFocus,ze.HasFocusedSuggestion),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:1027,secondary:[1026]},handler(o){o.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Fh,group:"left",order:2,when:K.and(ze.HasInsertAndReplaceRange,ze.InsertMode.isEqualTo("insert")),title:m(1467,"Replace")},{menuId:Fh,group:"left",order:2,when:K.and(ze.HasInsertAndReplaceRange,ze.InsertMode.isEqualTo("replace")),title:m(1468,"Insert")}]}));it.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");ae(new $s({id:"hideSuggestWidget",precondition:ze.Visible,handler:o=>o.cancelSuggestWidget(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:9,secondary:[1033]}}));ae(new $s({id:"selectNextSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectNextSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));ae(new $s({id:"selectNextPageSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectNextPageSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:12,secondary:[2060]}}));ae(new $s({id:"selectLastSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectLastSuggestion()}));ae(new $s({id:"selectPrevSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectPrevSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));ae(new $s({id:"selectPrevPageSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectPrevPageSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:11,secondary:[2059]}}));ae(new $s({id:"selectFirstSuggestion",precondition:K.and(ze.Visible,K.or(ze.MultipleSuggestions,ze.HasFocusedSuggestion.negate())),handler:o=>o.selectFirstSuggestion()}));ae(new $s({id:"focusSuggestion",precondition:K.and(ze.Visible,ze.HasFocusedSuggestion.negate()),handler:o=>o.focusSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));ae(new $s({id:"focusAndAcceptSuggestion",precondition:K.and(ze.Visible,ze.HasFocusedSuggestion.negate()),handler:o=>{o.focusSuggestion(),o.acceptSelectedSuggestion(!0,!1)}}));ae(new $s({id:"toggleSuggestionDetails",precondition:K.and(ze.Visible,ze.HasFocusedSuggestion),handler:o=>o.toggleSuggestionDetails(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Fh,group:"right",order:1,when:K.and(ze.DetailsVisible,ze.CanResolve),title:m(1469,"Show Less")},{menuId:Fh,group:"right",order:1,when:K.and(ze.DetailsVisible.toNegated(),ze.CanResolve),title:m(1470,"Show More")}]}));ae(new $s({id:"toggleExplainMode",precondition:ze.Visible,handler:o=>o.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));ae(new $s({id:"toggleSuggestionFocus",precondition:ze.Visible,handler:o=>o.toggleSuggestionFocus(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:2570,mac:{primary:778}}}));ae(new $s({id:"insertBestCompletion",precondition:K.and(N.textInputFocus,K.equals("config.editor.tabCompletion","on"),px.AtEnd,ze.Visible.toNegated(),b_.OtherSuggestions.toNegated(),Ss.InSnippetMode.toNegated()),handler:(o,e)=>{o.triggerSuggestAndAcceptBest(Xi(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:dr,primary:2}}));ae(new $s({id:"insertNextSuggestion",precondition:K.and(N.textInputFocus,K.equals("config.editor.tabCompletion","on"),b_.OtherSuggestions,ze.Visible.toNegated(),Ss.InSnippetMode.toNegated()),handler:o=>o.acceptNextSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:2}}));ae(new $s({id:"insertPrevSuggestion",precondition:K.and(N.textInputFocus,K.equals("config.editor.tabCompletion","on"),b_.OtherSuggestions,ze.Visible.toNegated(),Ss.InSnippetMode.toNegated()),handler:o=>o.acceptPrevSuggestion(),kbOpts:{weight:dr,kbExpr:N.textInputFocus,primary:1026}}));oe(class extends de{constructor(){super({id:"editor.action.resetSuggestSize",label:H(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(o,e){za.get(e)?.resetWidgetSize()}});class ike extends F{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new P),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=za.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,l,c)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?ed(h,d):void 0;if(!u)return-1;const g=R.lift(l),f=c.map((_,b)=>{const C=zC.fromSuggestion(n,d,g,_,this.isShiftKeyPressed),w=ed(C.getSingleTextEdit(),d),v=OY(u,w);return{index:b,valid:v,prefixLength:w.text.length,suggestItem:_}}).filter(_=>_&&_.valid&&_.prefixLength>0),p=hF(f,Kn(_=>_.prefixLength,Lo));return p?p.index:-1}}));let s=!1;const r=()=>{s||(s=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(se.once(n.model.onDidTrigger)(a=>{r()})),this._register(n.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const d=zC.fromSuggestion(n,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!nke(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=za.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return zC.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){za.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){za.get(this.editor)?.forceRenderingAbove()}}class zC{static fromSuggestion(e,t,i,n,s){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&4){const c=new df().parse(r);c.children.length<100&&hx.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(n,s);return new zC(D.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,n.completion.kind,a,n.container.incomplete??!1)}constructor(e,t,i,n,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n,this.listIncomplete=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Gj(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new Fi(this.range,this.insertText)}}function nke(o,e){return o===e?!0:!o||!e?!1:o.equals(e)}class ske extends F{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new ike(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),n=>this._editorObs.forceUpdate(s=>{this._handleSuggestAccepted(n)}))),this.selectedItem=pt(this,n=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(s=>n(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class oke{constructor(e,t){this.lineNumber=e,this.columnRange=t}}class B6{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new ve(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new D(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new fe(this.startColumn-1,this.endColumnExclusive-1)}}class Lg{static fromLineTokens(e){const t=[];for(let i=0;i({text:i.text,metadata:i.metadata})),e)}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=new fe(i,i+n.text.length);t.push(e(s,n)),i+=n.text.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=i,r=s+n.text.length;if(r>e.start){if(s>=e.endExclusive)break;const a=Math.max(0,e.start-s),l=Math.max(0,r-e.endExclusive);t.push(new H6(n.text.slice(a,n.text.length-l),n.metadata))}i+=n.text.length}return Lg.create(t)}append(e){const t=this._tokenInfo.concat(e._tokenInfo);return Lg.create(t)}}class H6{constructor(e,t){this.text=e,this.metadata=t}}var rke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ake=function(o,e){return function(t,i){e(t,i,o)}};const jY="ghost-text";let Cw=class extends F{static{this.hot=nk(this)}constructor(e,t,i,n,s,r){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=n,this._isClickable=s,this._languageService=r,this._isDisposed=Ee(this,!1),this._editorObs=oi(this._editor),this._warningState=$(a=>{const l=this._model.ghostText.read(a);if(!l)return;const c=this._model.warning.read(a);if(c)return{lineNumber:l.lineNumber,position:new R(l.lineNumber,l.parts[0].column),icon:c.icon}}),this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(a=>a.syntaxHighlightingEnabled),this._extraClassNames=$(this,a=>{const l=[...this._options.read(a).extraClasses??[]];return this._useSyntaxHighlighting.read(a)&&l.push("syntax-highlighted"),this._warningState.read(a)&&l.push("warning"),l.map(d=>` ${d}`).join("")}),this.uiState=$(this,a=>{if(this._isDisposed.read(a))return;const l=this._editorObs.model.read(a);if(l!==this._model.targetTextModel.read(a))return;const c=this._model.ghostText.read(a);if(!c)return;const d=c instanceof L2?c.columnRange:void 0,h=this._useSyntaxHighlighting.read(a),u=this._extraClassNames.read(a),{inlineTexts:g,additionalLines:f,hiddenRange:p,additionalLinesOriginalSuffix:_}=lke(c,l,jY+u),b=l.getLineContent(c.lineNumber),C=new Ga(g.map(A=>Nn.insert(A.column-1,A.text))),w=h?l.tokenization.tokenizeLinesAt(c.lineNumber,[C.apply(b),...f.map(A=>A.content)]):void 0,v=C.getNewRanges(),S=g.map((A,O)=>({...A,tokens:w?.[0]?.getTokensInRange(v[O])})),L=f.map((A,O)=>{let W=w?.[O+1]??Xt.createEmpty(A.content,this._languageService.languageIdCodec);if(O===f.length-1&&_){const q=Lg.fromLineTokens(l.tokenization.getLineTokens(_.lineNumber)).slice(_.columnRange.toZeroBasedOffsetRange());W=Lg.fromLineTokens(W).append(q).toLineTokens(W.languageIdCodec)}return{content:W,decorations:A.decorations}}),x=this._editor.getSelection()?.getStartPosition().column,k=S.filter(A=>A.text!==""),I=k.length!==0,T={cursorColumnDistance:(I?k[0].column:1)-x,cursorLineDistance:I?0:f.findIndex(A=>A.content!=="")+1,lineCountOriginal:I?1:0,lineCountModified:f.length+(I?1:0),characterCountOriginal:0,characterCountModified:yy(k.map(A=>A.text.length))+yy(L.map(A=>A.content.getTextLength())),disjointReplacements:k.length+(f.length>0?1:0),sameShapeReplacements:k.length>1&&L.length===0?k.every(A=>A.text===k[0].text):void 0};return this._model.handleInlineCompletionShown.read(a)?.(T),{replacedRange:d,inlineTexts:S,additionalLines:L,hiddenRange:p,lineNumber:c.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(a),targetTextModel:l,syntaxHighlightingEnabled:h}}),this.decorations=$(this,a=>{const l=this.uiState.read(a);if(!l)return[];const c=[],d=this._extraClassNames.read(a);l.replacedRange&&c.push({range:l.replacedRange.toRange(l.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+d,description:"GhostTextReplacement"}}),l.hiddenRange&&c.push({range:l.hiddenRange.toRange(l.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const h of l.inlineTexts)c.push({range:D.fromPositions(new R(l.lineNumber,h.column)),options:{description:"ghost-text-decoration",after:{content:h.text,tokens:h.tokens,inlineClassName:(h.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+d+h.lineDecorations.map(u=>" "+u.className).join(" "),cursorStops:Lr.Left,attachedData:new cN(this)},showIfCollapsed:!0}});return c}),this._additionalLinesWidget=this._register(new cke(this._editor,$(a=>{const l=this.uiState.read(a);return l?{lineNumber:l.lineNumber,additionalLines:l.additionalLines,minReservedLineCount:l.additionalReservedLineCount,targetTextModel:l.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(a=>a.target.type===6&&a.target.detail.injectedText?.options.attachedData instanceof cN&&a.target.detail.injectedText.options.attachedData.owner===this,this._store),this.isHovered=$(this,a=>this._isDisposed.read(a)?!1:this._isInlineTextHovered.read(a)||this._additionalLinesWidget.isHovered.read(a)),this.height=$(this,a=>this._editorObs.getOption(75).read(a)+(this._additionalLinesWidget.viewZoneHeight.read(a)??0)),this._register(ge(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(a=>this._onDidClick.fire(a))),this._register(this._editor.onMouseUp(a=>{if(a.target.type!==6)return;const l=a.target.detail.injectedText?.options.attachedData;l instanceof cN&&l.owner===this&&this._onDidClick.fire(a.event)}))),this._register(os((a,l)=>{}))}static getWarningWidgetContext(e){const t=e.ghostTextViewWarningWidgetData;if(t)return t;if(e.parentElement)return this.getWarningWidgetContext(e.parentElement)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}};Cw=rke([ake(5,yi)],Cw);class cN{constructor(e){this.owner=e}}function lke(o,e,t){const i=[],n=[];function s(h,u){if(n.length>0){const g=n[n.length-1];u&&g.decorations.push(new Cs(g.content.length+1,g.content.length+1+h[0].line.length,u,0)),g.content+=h[0].line,h=h.slice(1)}for(const g of h)n.push({content:g.line,decorations:u?[new Cs(1,g.line.length+1,u,0),...g.lineDecorations]:[...g.lineDecorations]})}const r=e.getLineContent(o.lineNumber);let a,l=0;for(const h of o.parts){let u=h.lines;a===void 0?(i.push({column:h.column,text:u[0].line,preview:h.preview,lineDecorations:u[0].lineDecorations}),u=u.slice(1)):s([{line:r.substring(l,h.column-1),lineDecorations:[]}],void 0),u.length>0&&(s(u,t),a===void 0&&h.column<=r.length&&(a=h.column)),l=h.column-1}let c;a!==void 0&&(c=new oke(o.lineNumber,new B6(l+1,r.length+1)));const d=a!==void 0?new B6(a,r.length+1):void 0;return{inlineTexts:i,additionalLines:n,hiddenRange:d,additionalLinesOriginalSuffix:c}}class cke extends F{get viewZoneId(){return this._viewZoneInfo?.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,n){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=n,this._viewZoneHeight=Ee("viewZoneHeight",void 0),this.editorOptionsChanged=vo("editorOptionChanged",se.filter(this._editor.onDidChangeConfiguration,s=>s.hasChanged(40)||s.hasChanged(133)||s.hasChanged(113)||s.hasChanged(108)||s.hasChanged(60)||s.hasChanged(59)||s.hasChanged(75))),this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new _t),this.isHovered=oi(this._editor).isTargetHovered(s=>V6(s.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof sf&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(s=>this.hasBeenAccepted=s.source==="inlineSuggestion.accept")),this._register(ke(s=>{const r=this._lines.read(s);this.editorOptionsChanged.read(s),r?(this.hasBeenAccepted=!1,this.updateLines(r.lineNumber,r.additionalLines,r.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(e=>{this.removeActiveViewZone(e)})}updateLines(e,t,i){const n=this._editor.getModel();if(!n)return;const{tabSize:s}=n.getOptions();this._editor.changeViewZones(r=>{const a=new z;this.removeActiveViewZone(r);const l=Math.max(t.length,i);if(l>0){const c=document.createElement("div");dke(c,s,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(a.add(B(c,"mousedown",d=>{d.preventDefault()})),a.add(B(c,"click",d=>{V6(d.target)&&this._onDidClick.fire(new qn(me(d),d))}))),this.addViewZone(r,e,l,c)}this._viewZoneListener.value=a})}addViewZone(e,t,i,n){const s=e.addZone({afterLineNumber:t,heightInLines:i,domNode:n,afterColumnAffinity:1,onComputedHeight:r=>{this._viewZoneHeight.set(r,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:s,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){if(!this._shouldKeepCursorStable)return;const i=this._editor.getSelection()?.getStartPosition()?.lineNumber;i!==void 0&&e`);for(let _=0,b=t.length;_');const v=w.getLineContent(),S=Zw(v),L=zm(v);V_(new Nd(d.isMonospace&&!s,d.canUseHalfwidthRightwardsArrow,v,!1,S,L,0,w,C.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==Dr.OFF,null,null,0),g),g.appendString("")}g.appendString(""),wn(o,d);const f=g.build(),p=z6?z6.createHTML(f):f;o.innerHTML=p}const z6=sc("editorGhostText",{createHTML:o=>o});class R3{static{this.empty=new R3([])}constructor(e){this.replacements=e,nv($w(e,(t,i)=>t.lineRange.endLineNumberExclusive<=i.lineRange.startLineNumber))}toString(){return this.replacements.map(e=>e.toString()).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(Ce.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}}class _x{static fromSingleTextEdit(e,t){const i=No(e.text);let n=e.range.startLineNumber;const s=t.getValueOfRange(D.fromPositions(new R(e.range.startLineNumber,1),e.range.getStartPosition()));i[0]=s+i[0];let r=e.range.endLineNumber+1;const a=t.getTransformer().getLineLength(e.range.endLineNumber)+1,l=t.getValueOfRange(D.fromPositions(e.range.getEndPosition(),new R(e.range.endLineNumber,a)));i[i.length-1]=i[i.length-1]+l;const c=e.range.startColumn===t.getTransformer().getLineLength(e.range.startLineNumber)+1,d=e.range.endColumn===1;return c&&i[0].length===s.length&&(n++,i.shift()),i.length>0&&n${JSON.stringify(this.newLines)}`}toLineEdit(){return new R3([this])}}class qY{get lineEdit(){return this.edit.replacements.length===0?new _x(new Ce(1,1),[]):_x.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(Ce.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,n,s,r){this.originalText=e,this.edit=t,this.cursorPosition=i,this.multiCursorPositions=n,this.commands=s,this.inlineCompletion=r}}class KY{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??m(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}}class hke{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class uke{constructor(e,t,i,n){this.lineRange=i;const s=oi(e),r=$(this,a=>s.isFocused.read(a)&&n.showInlineEditMenu?is.Accept:is.Inactive);this.model=new KY(t,new qY(new bh(""),new yo([n.getSingleTextEdit()]),t.primaryPosition.get(),t.allPositions.get(),n.source.inlineSuggestions.commands??[],n),r)}}class Nt{static fromPoints(e,t){return new Nt(e.x,e.y,t.x,t.y)}static fromPointSize(e,t){return new Nt(e.x,e.y,e.x+t.x,e.y+t.y)}static fromLeftTopRightBottom(e,t,i,n){return new Nt(e,t,i,n)}static fromLeftTopWidthHeight(e,t,i,n){return new Nt(e,t,e+i,t+n)}static fromRanges(e,t){return new Nt(e.start,t.start,e.endExclusive,t.endExclusive)}static hull(e){let t=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const r of e)t=Math.min(t,r.left),i=Math.min(i,r.top),n=Math.max(n,r.right),s=Math.max(s,r.bottom);return new Nt(t,i,n,s)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,n){if(this.left=e,this.top=t,this.right=i,this.bottom=n,e>i)throw new ve("Invalid arguments: Horizontally offset by "+(e-i));if(t>n)throw new ve("Invalid arguments: Vertically offset by "+(t-n))}withMargin(e,t,i,n){let s,r,a,l;return t===void 0&&i===void 0&&n===void 0?s=r=a=l=e:i===void 0&&n===void 0?(s=r=t,a=l=e):(s=n,r=t,a=e,l=i),new Nt(this.left-s,this.top-a,this.right+r,this.bottom+l)}intersectVertical(e){const t=Math.max(this.top,e.start),i=Math.min(this.bottom,e.endExclusive);return new Nt(this.left,t,this.right,Math.max(t,i))}intersectHorizontal(e){const t=Math.max(this.left,e.start),i=Math.min(this.right,e.endExclusive);return new Nt(t,this.top,Math.max(t,i),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(e){const t=Math.max(this.left,e.left),i=Math.min(this.right,e.right),n=Math.max(this.top,e.top),s=Math.min(this.bottom,e.bottom);if(!(t>i||n>s))return new Nt(t,n,i,s)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(e){const t=this.width,i=this.height;let n=this.left,s=this.top;return ne.right&&(n=e.right-t),se.bottom&&(s=e.bottom-i),new Nt(n,s,n+t,s+i)}withWidth(e){return new Nt(this.left,this.top,this.left+e,this.bottom)}withHeight(e){return new Nt(this.left,this.top,this.right,this.top+e)}withTop(e){return new Nt(this.left,e,this.right,this.bottom)}withLeft(e){return new Nt(e,this.top,this.right,this.bottom)}translateX(e){return new Nt(this.left+e,this.top,this.right+e,this.bottom)}translateY(e){return new Nt(this.left,this.top+e,this.right,this.bottom+e)}getLeftBottom(){return new dn(this.left,this.bottom)}getRightBottom(){return new dn(this.right,this.bottom)}getRightTop(){return new dn(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}class UC{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Qt(this.startLineNumbers,e.startLineNumbers)&&Qt(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new UC([],[],0)}}const U6=sc("stickyScrollViewLayer",{createHTML:o=>o}),dN="data-sticky-line-index",$6="data-sticky-is-line",gke="data-sticky-is-line-number",j6="data-sticky-is-folding-icon";class fke extends F{get height(){return this._height}constructor(e){super(),this._foldingIconStore=this._register(new z),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new P),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof kd),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(131)&&t(),i.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const n=!this._state&&!e,s=this._state&&this._state.equals(e);if(i===void 0&&(n||s))return;const r=this._findRenderingData(e),a=this._lineNumbers;this._lineNumbers=r.lineNumbers,this._lastLineRelativePosition=r.lastLineRelativePosition;const l=this._findIndexToRebuildFrom(a,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,l),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];e.showEndForLine!==null&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let n=0;n!e.includes(s));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i,n){const s=this._editor._getViewModel();if(!s){this._clearWidget();return}if(e.length===0){this._clearWidget();return}const r=[],a=e[e.length-1];let l=0;for(let d=0;dd.scrollWidth))+c.verticalScrollbarWidth,this._renderedStickyLines=r,this._setHeight(l+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(B(this._lineNumbersDomNode,te.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n,s,r,a){const l=e.coordinatesConverter.convertModelPositionToViewPosition(new R(i,1)).lineNumber,c=e.getViewLineRenderingData(l),d=this._editor.getOption(76),h=this._editor.getOption(117).verticalScrollbarSize;let u;try{u=Cs.filter(c.inlineDecorations,l,c.minColumn,c.maxColumn)}catch{u=[]}const g=this._editor.getLineHeightForPosition(new R(i,1)),f=e.getTextDirection(i),p=new Nd(!0,!0,c.content,c.continuesWithWrappedLine,c.isBasicASCII,c.containsRTL,0,c.tokens,u,c.tabSize,c.startVisibleColumn,1,1,1,500,"none",!0,!0,null,f,h),_=new su(2e3),b=V_(p,_);let C;U6?C=U6.createHTML(_.build()):C=_.build();const w=document.createElement("span");w.setAttribute(dN,String(t)),w.setAttribute($6,""),w.setAttribute("role","listitem"),w.tabIndex=0,w.className="sticky-line-content",w.classList.add(`stickyLine${i}`),w.style.lineHeight=`${g}px`,w.innerHTML=C;const v=document.createElement("span");v.setAttribute(dN,String(t)),v.setAttribute(gke,""),v.className="sticky-line-number",v.style.lineHeight=`${g}px`;const S=a.contentLeft;v.style.width=`${S}px`;const L=document.createElement("span");d.renderType===1||d.renderType===3&&i%10===0?L.innerText=i.toString():d.renderType===2&&(L.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),L.className="sticky-line-number-inner",L.style.width=`${a.lineNumbersWidth}px`,L.style.paddingLeft=`${a.lineNumbersLeft}px`,v.appendChild(L);const x=this._renderFoldingIconForLine(r,i);x&&(v.appendChild(x.domNode),x.domNode.style.left=`${a.lineNumbersWidth+a.lineNumbersLeft}px`,x.domNode.style.lineHeight=`${g}px`),this._editor.applyFontInfo(w),this._editor.applyFontInfo(v),v.style.lineHeight=`${g}px`,w.style.lineHeight=`${g}px`,v.style.height=`${g}px`,w.style.height=`${g}px`;const k=new pke(t,i,w,v,x,b.characterMapping,w.scrollWidth,g);return this._updatePosition(k,n,s)}_updatePosition(e,t,i){const n=e.lineDomNode,s=e.lineNumberDomNode;if(i){n.style.zIndex="0",s.style.zIndex="0";const a=`${t+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`;n.style.top=a,s.style.top=a}else n.style.zIndex="1",s.style.zIndex="1",n.style.top=`${t}px`,s.style.top=`${t}px`;return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),r=n.getStartLineNumber(s);if(!(t===r))return;const l=n.isCollapsed(s),c=new mke(l,r,n.getEndLineNumber(s),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(j6,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=Ym(t.characterMapping,e,0);return new R(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,dN);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,$6)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,j6)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class pke{constructor(e,t,i,n,s,r,a,l){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=r,this.scrollWidth=a,this.height=l}}class mke{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${n}px`,this.domNode.style.lineHeight=`${n}px`,this.domNode.className=ye.asClassName(e?ox:sx)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class $C{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class bx{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class GY{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var Uk=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vw=function(o,e){return function(t,i){e(t,i,o)}},jC;(function(o){o.OUTLINE_MODEL="outlineModel",o.FOLDING_PROVIDER_MODEL="foldingProviderModel",o.INDENTATION_MODEL="indentationModel"})(jC||(jC={}));var Dh;(function(o){o[o.VALID=0]="VALID",o[o.INVALID=1]="INVALID",o[o.CANCELED=2]="CANCELED"})(Dh||(Dh={}));let U2=class extends F{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Fr(300)),this._updateOperation=this._register(new z),this._editor.getOption(131).defaultModel){case jC.OUTLINE_MODEL:this._modelProviders.push(new $2(this._editor,n));case jC.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new q2(this._editor,t,n));case jC.INDENTATION_MODEL:this._modelProviders.push(new j2(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const s=await i;if(this._modelPromise!==n)return null;switch(s){case Dh.CANCELED:return this._updateOperation.clear(),null;case Dh.VALID:return t.stickyModel}}return null}).catch(t=>(Te(t),null))}};U2=Uk([vw(2,pe),vw(3,ue)],U2);class ZY extends F{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Dh.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Qi(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?Dh.CANCELED:(this._stickyModel=this.createStickyModel(e,i),Dh.VALID):this._invalid()).then(void 0,i=>(Te(i),Dh.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let $2=class extends ZY{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Hc.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),s=this._editor.getModel();return new GY(s.uri,s.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Je.first(e.children.values())instanceof DY){const a=Je.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[h,u]of e.children.entries()){const g=this._findSumOfRangesOfGroup(u);g>c&&(d=u,c=g,l=u.id)}t=l,i=d.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((a,l)=>{const c=new $C(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new $C(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of s)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new bx(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const r of s.children.values())i.push(this._stickyModelFromOutlineElement(r,s.symbol.selectionRange.startLineNumber));i.sort((s,r)=>this._comparator(s.range,r.range));const n=new $C(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new bx(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof b2?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};$2=Uk([vw(1,ue)],$2);class YY extends ZY{constructor(e){super(e),this._foldingLimitReporter=this._register(new vY(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new GY(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new bx(void 0,[],void 0);for(let s=0;s{this._updateProvider(e,t)})),this._updateProvider(e,t)}_updateProvider(e,t){const i=Qh.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());i.length!==0&&(this.provider.value=new w3(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider.value?.compute(e)??null}};q2=Uk([vw(2,ue)],q2);var _ke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},q6=function(o,e){return function(t,i){e(t,i,o)}};class bke{constructor(e,t,i,n){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=n}}let K2=class extends F{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new P),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new z),this._updateSoon=this._register(new It(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(ge(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new U2(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new Jt,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s,r){const a=this._editor.getModel();if(!a||t.children.length===0)return;let l=r;const c=[];for(let u=0;uu-g)),h=this.updateIndex(vy(c,e.endLineNumber,(u,g)=>u-g));for(let u=d;u<=h;u++){const g=t.children[u];if(!g||!g.range)continue;const{startLineNumber:f,endLineNumber:p}=g.range;if(p>f+1&&e.startLineNumber<=p+1&&f-1<=e.endLineNumber&&f!==l&&a.isValidRange(new D(f,1,p,1))){l=f;const _=this._editor.getLineHeightForPosition(new R(f,1));i.push(new bke(f,p-1,s,_)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,g,i,n+1,s+_,f)}}}filterHiddenRanges(e){const t=this._editor._getViewModel()?.getHiddenAreas();return t?e.filter(i=>!t.some(n=>i.startLineNumber>=n.startLineNumber&&i.endLineNumber<=n.endLineNumber+1)):e}updateIndex(e){return e===-1?0:e<0?-e-2:e}};K2=_ke([q6(1,ue),q6(2,ai)],K2);var Cke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bp=function(o,e){return function(t,i){e(t,i,o)}},G2;let _a=class extends F{static{G2=this}static{this.ID="store.contrib.stickyScrollController"}constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new z,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new P),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new fke(this._editor),this._stickyLineCandidateProvider=new K2(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=UC.Empty;const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeFont(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(B(l,te.CONTEXT_MENU,async d=>{this._onContextMenu(me(l),d)})),this._stickyScrollFocusedContextKey=N.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=N.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(Wr(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(B(l,te.MOUSE_DOWN,d=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(d=>{this._onDidChangeStickyScrollHeight.fire(d)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(G2.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(D.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new z),t=this._register(new Ck(this._editor,{extractLineNumberFromMouseEvent:s=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return r?r.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const r=s.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new D(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Ti(n,te.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(c===null)return;const d=new R(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(c===null)return;l=new R(c,1)}this._revealPosition(l)})),this._register(B(kt,te.MOUSE_MOVE,s=>{this._mouseTarget=s.target,this._onMouseMoveOrKeyDown(s)})),this._register(B(kt,te.KEY_DOWN,s=>{this._onMouseMoveOrKeyDown(s)})),this._register(B(kt,te.KEY_UP,()=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,r])=>{const a=i(s);if(!a||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new Jt;e.add(ge(()=>d.dispose(!0)));let h;k1(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new R(l.startLineNumber,l.startColumn+1),!1,d.token).then((u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const g=c;h!==g?(e.clear(),h=g,h.style.textDecoration="underline",e.add(ge(()=>{h.style.textDecoration="none"}))):h||(h=g,h.style.textDecoration="underline",e.add(ge(()=>{h.style.textDecoration="none"})))}else e.clear()}))})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(sY,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new qn(e,t);this._contextMenuService.showContextMenu({menuId:M.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey||!this._mouseTarget||!Si(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);t===null||this._showEndForLine===t||(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;_3(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(76).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(t*.25),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await Qh.get(this._editor)?.getFoldingModel()??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=UC.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const n=[],s=[],r=this._editor.getVisibleRanges();if(r.length!==0){const a=new $C(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const c of l){const d=c.startLineNumber,h=c.endLineNumber,u=c.top,g=u+c.height,f=this._editor.getTopForLineNumber(d)-t,p=this._editor.getBottomForLineNumber(h)-t;if(u>f&&u<=p&&(n.push(d),s.push(h+1),g>p&&(i=p-g)),n.length===e)break}}return this._endLineNumbers=s,new UC(n,s,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};_a=G2=Cke([bp(1,gr),bp(2,ue),bp(3,pe),bp(4,ai),bp(5,qr),bp(6,Ne)],_a);const qC=E("inlineEdit.originalBackground",Pe(mh,.2),m(1220,"Background color for the original text in inline edits."),!0),XY=E("inlineEdit.modifiedBackground",Pe(fg,.3),m(1221,"Background color for the modified text in inline edits."),!0);E("inlineEdit.originalChangedLineBackground",Pe(mh,.8),m(1222,"Background color for the changed lines in the original text of inline edits."),!0);const vke=E("inlineEdit.originalChangedTextBackground",Pe(mh,.8),m(1223,"Overlay color for the changed text in the original text of inline edits."),!0),wke=E("inlineEdit.modifiedChangedLineBackground",{light:Pe(J1,.7),dark:Pe(J1,.7),hcDark:J1,hcLight:J1},m(1224,"Background color for the changed lines in the modified text of inline edits."),!0),Ske=E("inlineEdit.modifiedChangedTextBackground",Pe(fg,.7),m(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),yke=E("inlineEdit.gutterIndicator.primaryForeground",OD,m(1226,"Foreground color for the primary inline edit gutter indicator.")),Yp=E("inlineEdit.gutterIndicator.primaryBorder",pg,m(1227,"Border color for the primary inline edit gutter indicator.")),QY=E("inlineEdit.gutterIndicator.primaryBackground",{light:Pe(Yp,.5),dark:Pe(Yp,.4),hcDark:Pe(Yp,.4),hcLight:Pe(Yp,.5)},m(1228,"Background color for the primary inline edit gutter indicator.")),Lke=E("inlineEdit.gutterIndicator.secondaryForeground",aj,m(1229,"Foreground color for the secondary inline edit gutter indicator.")),JY=E("inlineEdit.gutterIndicator.secondaryBorder",jy,m(1230,"Border color for the secondary inline edit gutter indicator.")),eX=E("inlineEdit.gutterIndicator.secondaryBackground",JY,m(1231,"Background color for the secondary inline edit gutter indicator.")),xke=E("inlineEdit.gutterIndicator.successfulForeground",OD,m(1232,"Foreground color for the successful inline edit gutter indicator.")),tX=E("inlineEdit.gutterIndicator.successfulBorder",pg,m(1233,"Border color for the successful inline edit gutter indicator.")),iX=E("inlineEdit.gutterIndicator.successfulBackground",tX,m(1234,"Background color for the successful inline edit gutter indicator.")),Dke=E("inlineEdit.gutterIndicator.background",{hcDark:Pe("tab.inactiveBackground",.5),hcLight:Pe("tab.inactiveBackground",.5),dark:Pe("tab.inactiveBackground",.5),light:"#5f5f5f18"},m(1235,"Background color for the inline edit gutter indicator.")),tC=E("inlineEdit.originalBorder",{light:mh,dark:mh,hcDark:mh,hcLight:mh},m(1236,"Border color for the original text in inline edits.")),iC=E("inlineEdit.modifiedBorder",{light:to(fg,.6),dark:fg,hcDark:fg,hcLight:fg},m(1237,"Border color for the modified text in inline edits.")),kke=E("inlineEdit.tabWillAcceptModifiedBorder",{light:to(iC,0),dark:to(iC,0),hcDark:to(iC,0),hcLight:to(iC,0)},m(1238,"Modified border color for the inline edits widget when tab will accept it.")),Ike=E("inlineEdit.tabWillAcceptOriginalBorder",{light:to(tC,0),dark:to(tC,0),hcDark:to(tC,0),hcLight:to(tC,0)},m(1239,"Original border color for the inline edits widget over the original text when tab will accept it."));function ww(o){return o.map(e=>e===is.Accept?kke:iC)}function $k(o){return o.map(e=>e===is.Accept?Ike:tC)}function mr(o,e){let t;typeof o=="string"?t=hN(o,e):t=o.map((n,s)=>hN(n,e).read(s));const i=hN(Ri,e);return t.map((n,s)=>n.makeOpaque(i.read(s)))}function hN(o,e){return $U({owner:{observeColor:o},equalsFn:(t,i)=>t.equals(i),debugName:()=>`observeColor(${o})`},e.onDidColorThemeChange,()=>{const t=e.getColorTheme().getColor(o);if(!t)throw new ve(`Missing color: ${o}`);return t})}function kh(o,e,t){o.layoutInfo.read(t),o.value.read(t);const i=o.model.read(t);if(!i)return 0;let n=0;o.scrollTop.read(t);for(let r=e.startLineNumber;ri.getLineContent(r));return n<5&&s.some(r=>r.length>0)&&i.uri.scheme!=="file"&&console.error("unexpected width"),n}function Eke(o,e,t){return o.layoutInfo.read(t),o.value.read(t),o.model.read(t)?(o.scrollTop.read(t),o.editor.getOffsetForColumn(e.lineNumber,e.column)):0}function M3(o,e,t,i,n=void 0){const s=i.getModel();if(!s)return{prefixTrim:0,prefixLeftOffset:0};const r=o.map(u=>u.isSingleLine()?u.startColumn-1:0),a=e.mapToLineArray(u=>gR(s.getLineContent(u))),l=t.filter(u=>u!=="").map(u=>gR(u)),c=Math.min(...r,...a,...l);let d;if(s.getLineIndentColumn(e.startLineNumber)>=c+1)oi(i).scrollTop.read(n),d=i.getOffsetForColumn(e.startLineNumber,c+1);else if(t.length>0)d=P3(t[0].slice(0,c),i,s);else return{prefixTrim:0,prefixLeftOffset:0};return{prefixTrim:c,prefixLeftOffset:d}}function P3(o,e,t){const i=e.getOption(59).typicalHalfwidthCharacterWidth,n=t.getOptions().tabSize*i,s=o.split(" ").length-1;return(o.length-s)*i+s*n}function A3(o){const e=o.layoutInfoContentLeft,t=$({name:"editor.validOverlay.width"},n=>{const s=o.layoutInfoMinimap.read(n).minimapLeft!==0,r=o.layoutInfoWidth.read(n)-e.read(n);if(s){const a=o.layoutInfoMinimap.read(n).minimapWidth+o.layoutInfoVerticalScrollbarWidth.read(n);return r-a}return r}),i=$({name:"editor.validOverlay.height"},n=>o.layoutInfoHeight.read(n)+o.contentHeight.read(n));return $({name:"editor.validOverlay"},n=>Nt.fromLeftTopWidthHeight(e.read(n),0,t.read(n),i.read(n)))}function Nke(o,e){const t=[];for(const i of o){const n=e.mapRange(i.modifiedRange);t.push(new Ms(i.originalRange,n))}return t}function uN(...o){return o.filter(e=>typeof e=="string").join(" ")}function Tke(o,e){return new D(e.lineNumber,e.column+o.start,e.lineNumber,e.column+o.endExclusive)}function Rke(o,e){let t=0;e:for(let i=0,n=o.length;iRke(i[r-1],t)),Lo);return e.forEach(r=>{const a=Mke(i[r-1],s,t);n.push(new Fi(Tke(new fe(0,a),new R(r,1)),""))}),new yo(n)}class Z2{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}}function tc(o){const e=Ed(void 0,(t,i)=>o.read(t)||i);return Un({debugName:()=>`${o.debugName}.mapOutFalsy`},t=>{if(e.read(t),!!o.read(t))return e})}function Nr(o,e=en.ofCaller()){return{left:$({name:"editor.validOverlay.left"},t=>o(t).left,e),top:$({name:"editor.validOverlay.top"},t=>o(t).top,e),width:$({name:"editor.validOverlay.width"},t=>o(t).right-o(t).left,e),height:$({name:"editor.validOverlay.height"},t=>o(t).bottom-o(t).top,e)}}var Ake=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gN=function(o,e){return function(t,i){e(t,i,o)}};let Y2=class{constructor(e,t,i,n,s,r){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=n,this._keybindingService=s,this._commandService=r,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(a=>a.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=Ee("active",void 0),t=u=>({title:u.title,icon:u.icon,keybinding:typeof u.commandId=="string"?this._getKeybinding(u.commandArgs?void 0:u.commandId):$(this,g=>typeof u.commandId=="string"?void 0:this._getKeybinding(u.commandArgs?void 0:u.commandId.read(g)).read(g)),isActive:e.map(g=>g===u.id),onHoverChange:g=>e.set(g?u.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand(typeof u.commandId=="string"?u.commandId:u.commandId.get(),...u.commandArgs??[]))}),i=Fke(this._model.displayName),n=ku(t({id:"gotoAndAccept",title:`${m(1212,"Go To")} / ${m(1213,"Accept")}`,icon:Z.check,commandId:rw})),s=ku(t({id:"reject",title:m(1214,"Reject"),icon:Z.close,commandId:$G})),r=this._model.extensionCommands.map((u,g)=>ku(t({id:u.command.id+"_"+g,title:u.command.title,icon:u.icon??Z.symbolEvent,commandId:u.command.id,commandArgs:u.command.arguments}))),a=this._inlineEditsShowCollapsed.map(u=>ku(t(u?{id:"showExpanded",title:m(1215,"Show Expanded"),icon:Z.expandAll,commandId:wM}:{id:"showCollapsed",title:m(1216,"Show Collapsed"),icon:Z.collapseAll,commandId:wM}))),l=ku(t({id:"snooze",title:m(1217,"Snooze"),icon:Z.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),c=ku(t({id:"settings",title:m(1218,"Settings"),icon:Z.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),d=this._model.action?[this._model.action]:[],h=d.length>0?Wke(d.map(u=>({id:u.id,label:u.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(u.id,...u.arguments??[]),class:void 0,tooltip:u.tooltip??u.title})),{hoverDelegate:Jbe}):void 0;return Oke([i,n,s,a,r.length?K6():void 0,l,c,...r,h?K6():void 0,h])}_getKeybinding(e){return e?pt(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(e)):Ot(void 0)}};Y2=Ake([gN(3,Ne),gN(4,dt),gN(5,Vt)],Y2);function Oke(o){return Fe.div({class:"content",style:{margin:4,minWidth:180}},o)}function Fke(o){return Fe.div({class:"header",style:{color:J(Q$),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[o])}function ku(o){return $({name:"inlineEdits.option"},e=>Fe.div({class:["monaco-menu-option",o.isActive?.map(t=>t&&"active")],onmouseenter:()=>o.onHoverChange?.(!0),onmouseleave:()=>o.onHoverChange?.(!1),onclick:o.onAction,onkeydown:t=>{t.key==="Enter"&&o.onAction?.()},tabIndex:0,style:{borderRadius:3}},[Fe.elem("span",{style:{fontSize:16,display:"flex"}},[ye.isThemeIcon(o.icon)?tl(o.icon):o.icon.map(t=>tl(t))]),Fe.elem("span",{},[o.title]),Fe.div({style:{marginLeft:"auto"},ref:t=>{const i=e.store.add(new Z_(t,wo,{disableTitle:!0,...UK,keybindingLabelShadow:void 0,keybindingLabelForeground:J(Q$),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));e.store.add(ke(n=>{i.set(o.keybinding.read(n))}))}})]))}function Wke(o,e){return $({name:"inlineEdits.actionBar"},t=>Fe.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[Fe.div({ref:i=>{t.store.add(new no(i,e)).push(o,{icon:!1,label:!0})}})]))}function K6(){return Fe.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:J(fae),padding:"2px 0"}},Fe.div({style:{borderBottom:`1px solid ${J(Y4)}`}}))}var Bke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ZS=function(o,e){return function(t,i){e(t,i,o)}};let X2=class extends F{get model(){const e=this._model.get();if(!e)throw new ve("Inline Edit Model not available");return e}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=n,this._isHoveringOverInlineEdit=s,this._focusIsInMenu=r,this._hoverService=a,this._instantiationService=l,this._accessibilityService=c,this._tabAction=$(this,h=>{const u=this._model.read(h);return u?u.tabAction.read(h):is.Inactive}),this._hoverVisible=Ee(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Ee(this,!1),this._isHoveredOverIconDebounced=L7(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=L7(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(h,u)=>{switch(h){case is.Inactive:return{background:mr(eX,d).read(u).toString(),foreground:mr(Lke,d).read(u).toString(),border:mr(JY,d).read(u).toString()};case is.Jump:return{background:mr(QY,d).read(u).toString(),foreground:mr(yke,d).read(u).toString(),border:mr(Yp,d).read(u).toString()};case is.Accept:return{background:mr(iX,d).read(u).toString(),foreground:mr(xke,d).read(u).toString(),border:mr(tX,d).read(u).toString()};default:Uw()}}),this._originalRangeObs=tc(this._originalRange),this._state=$(this,h=>{const u=this._originalRangeObs.read(h);if(u)return{range:u,lineOffsetRange:this._editorObs.observeLineOffsetRange(u,h.store)}}),this._stickyScrollController=_a.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?pt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Ot(0),this._lineNumberToRender=$(this,h=>{if(this._verticalOffset.read(h)!==0)return"";const u=this._originalRange.read(h)?.startLineNumber,g=this._editorObs.getOption(76).read(h);if(u===void 0||g.renderType===0)return"";if(g.renderType===3){const f=this._editorObs.cursorPosition.read(h);return u%10===0||f&&f.lineNumber===u?u.toString():""}if(g.renderType===2){const f=this._editorObs.cursorPosition.read(h);if(!f)return"";const p=Math.abs(u-f.lineNumber);return p===0?u.toString():p.toString()}return g.renderType===4?g.renderFn?g.renderFn(u):"":u.toString()}),this._availableWidthForIcon=$(this,h=>{const u=this._editorObs.editor.getModel(),g=this._editorObs.editor,f=this._editorObs.layoutInfo.read(h),p=f.decorationsLeft+f.decorationsWidth-f.glyphMarginLeft;if(!u||p<=0)return()=>0;if(f.lineNumbersLeft===0)return()=>p;const _=this._editorObs.getOption(76).read(h);if(_.renderType===2||_.renderType===0)return()=>p;const b=g.getOption(59).typicalHalfwidthCharacterWidth,C=f.lineNumbersLeft+f.lineNumbersWidth,v=(u.getLineCount()+1).toString().length,S=[];for(let L=1;L<=v;L++){const x=10**(L-1),k=g.getTopForLineNumber(x),I=L*b,T=Math.min(p,Math.max(0,C-I-f.glyphMarginLeft));S.push({firstLineNumberWithDigitCount:x,topOfLineNumber:k,usableWidthLeftOfLineNumber:T})}return L=>{for(let x=S.length-1;x>=0;x--)if(L>=S[x].topOfLineNumber)return S[x].usableWidthLeftOfLineNumber;throw new ve("Could not find avilable width for icon")}}),this._layout=$(this,h=>{const u=this._state.read(h);if(!u)return;const g=this._editorObs.layoutInfo.read(h),f=this._editorObs.observeLineHeightForLine(u.range.map(st=>st.startLineNumber)).read(h),p=2,_=g.decorationsLeft+g.decorationsWidth-g.glyphMarginLeft-2*p,b=g.height-2*p,C=Nt.fromLeftTopWidthHeight(p,p,_,b),w=C.withTop(this._stickyScrollHeight.read(h)),v=C.withTop(w.top+p),S=u.lineOffsetRange.read(h),L=Nt.fromRanges(fe.fromTo(v.left,v.right),S),x=f,k=this._verticalOffset.read(h),I=L.withHeight(x).translateY(k),T=w.containsRect(I),A=this._tabAction.map(st=>st===is.Accept?Z.keyboardTab:Z.arrowRight),O=$(this,st=>{if(this._isHoveredOverIconDebounced.read(st)||this._isHoveredOverInlineEditDebounced.read(st))return Z.check;if(this._tabAction.read(st)===is.Accept)return Z.keyboardTab;const Ye=this._editorObs.cursorLineNumber.read(st)??0,Ft=u.range.read(st).startLineNumber;return Ye<=Ft?Z.keyboardTabAbove:Z.keyboardTabBelow}),W=22,U=16,q=st=>{const Ye=this._availableWidthForIcon.read(void 0)(st.bottom+this._editorObs.editor.getScrollTop())-p;return Math.max(Math.min(Ye,W),U)};if(T){const st=I;let Ye;g.lineNumbersWidth===0?Ye=Math.min(Math.max(g.lineNumbersLeft-C.left,0),st.width-W):Ye=Math.max(g.lineNumbersLeft+g.lineNumbersWidth-C.left,0);const Ft=st.withWidth(Ye),yt=Math.max(Math.min(g.decorationsWidth,W),U),nn=st.withWidth(yt).translateX(Ye);return{gutterEditArea:L,icon:O,iconDirection:"right",iconRect:nn,pillRect:st,lineNumberRect:Ft}}const ie=C.intersect(L);if(ie&&ie.height>=x){const st=I.moveToBeContainedIn(v).moveToBeContainedIn(ie),Ye=st.withWidth(q(st));return{gutterEditArea:L,icon:O,iconDirection:"right",iconRect:Ye,pillRect:Ye}}const ne=I.moveToBeContainedIn(C),ce=ne.withWidth(q(ne)),De=ce,We=ce.top!!h),this._indicator=Fe.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const u=this._layout.get()?.icon.get()===Z.check;this._editorObs.editor.focus(),u?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},tc(this._layout).map(h=>h?[Fe.div({style:{position:"absolute",background:J(Dke),borderRadius:"4px",...Nr(u=>h.read(u).gutterEditArea)}}),Fe.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(u=>u.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(u=>u.foreground),border:this._gutterIndicatorStyles.map(u=>`1px solid ${u.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...Nr(u=>h.read(u).pillRect)}},[Fe.div({className:"line-number",style:{lineHeight:h.map(u=>u.lineNumberRect?u.lineNumberRect.height:0),display:h.map(u=>u.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:h.map(u=>u.lineNumberRect?u.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(u=>u.foreground)}},this._lineNumberToRender),Fe.div({style:{rotate:h.map(u=>`${Hke(u.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:h.map(u=>u.pillRect.width-u.iconRect.width-(u.lineNumberRect?.width??0)),width:h.map(u=>u.iconRect.width)}},[h.map((u,g)=>tl(u.icon.read(g)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:Ot(0)})),this._register(this._editorObs.editor.onMouseMove(h=>{if(this._state.get()===void 0)return;const f=this._iconRef.element.getBoundingClientRect(),p=Nt.fromLeftTopWidthHeight(f.left,f.top,f.width,f.height),_=new dn(h.event.posx,h.event.posy);this._isHoveredOverIcon.set(p.containsPoint(_),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(Ka(this._isHoveredOverInlineEditDebounced,h=>{h&&this.triggerAnimation()})),this._register(ke(h=>{this._indicator.readEffect(h),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(t=>t.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const e=new z,t=e.add(this._instantiationService.createInstance(Y2,this.model,s=>{s&&this._editorObs.editor.focus(),n?.dispose()},this._editorObs).toDisposableLiveElement()),i=e.add(Wr(t.element));e.add(i.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),e.add(i.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),e.add(ge(()=>this._focusIsInMenu.set(!1,void 0)));const n=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});n?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange(()=>n.dispose())),e.add(n.onDispose(()=>{this._hoverVisible.set(!1,void 0),e.dispose()}))):e.dispose()}};X2=Bke([ZS(6,Us),ZS(7,pe),ZS(8,Mn),ZS(9,pi)],X2);function Hke(o){switch(o){case"top":return 90;case"bottom":return-90;case"right":return 0}}var Vke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G6=function(o,e){return function(t,i){e(t,i,o)}},Uo;(function(o){o.FirstTime="firstTime",o.SecondTime="secondTime",o.Active="active"})(Uo||(Uo={}));let Q2=class extends F{constructor(e,t,i,n,s,r){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=n,this._storageService=s,this._configurationService=r,this._disposables=this._register(new _t),this._setupDone=Ee({name:"setupDone"},!1),this._activeCompletionId=$(a=>{const l=this._model.read(a);if(!l||!this._setupDone.read(a))return;const c=this._indicator.read(a);if(!(!c||!c.isVisible.read(a)))return l.inlineEdit.inlineCompletion.identity.id}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===Uo.Active)return;const e=new z;let t=!1,i=!1,n=0,s=0;return e.add(Ode(this._activeCompletionId,async(r,a,l,c)=>{if(r===void 0)return;let d=this.getNewUserType();switch(d){case Uo.FirstTime:{(n++>=5||t)&&(d=Uo.SecondTime,this.setNewUserType(d));break}case Uo.SecondTime:{s++>=3&&i&&(d=Uo.Active,this.setNewUserType(d));break}}switch(d){case Uo.FirstTime:{for(let h=0;h<3&&!c.isCancellationRequested;h++)await this._indicator.get()?.triggerAnimation(),await ql(500);break}case Uo.SecondTime:{this._indicator.get()?.triggerAnimation();break}}})),e.add(ke(r=>{this._collapsedView.isVisible.read(r)&&this.getNewUserType()!==Uo.Active&&this._collapsedView.triggerAnimation()})),e.add(os((r,a)=>{const l=this._indicator.read(r);l&&a.add(Ka(l.isHoveredOverIcon,async c=>{c&&(t=!0)}))})),e.add(os((r,a)=>{const l=this._host.read(r);l&&a.add(l.onDidAccept(()=>{i=!0}))})),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,Uo.FirstTime)}setNewUserType(e){switch(e){case Uo.FirstTime:throw new ve("UserKind should not be set to first time");case Uo.SecondTime:break;case Uo.Active:this._disposables.clear();break}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}};Q2=Vke([G6(4,Ls),G6(5,Oe)],Q2);var zke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Uke=function(o,e){return function(t,i){e(t,i,o)}};let J2=class extends F{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._iconRef=Fe.ref(),this.isHovered=Ot(!1),this._editorObs=oi(this._editor);const s=this._edit.map(c=>c?.edit.replacements[0]??null).map(c=>c?ed(c,this._editor.getModel()).range.getStartPosition():null),r=this._editorObs.observePosition(s,this._store),a=$(c=>{const d=r.read(c);if(!d)return null;const h=this._editorObs.layoutInfoContentLeft.read(c),u=this._editorObs.scrollLeft.read(c);return new dn(h+d.x-u,d.y)}),l=Fe.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(a)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:l,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:Ot(0)})),this.isVisible=this._edit.map((c,d)=>!!c&&a.read(d)!==null)}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map((s,r)=>s?s.deltaX(-t.read(r)):null),n=this.createIconPath(i);return Fe.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...Nr(s=>A3(this._editorObs).read(s)),overflow:"hidden",pointerEvents:"none"}},[Fe.svgElem("path",{class:"collapsedViewPath",d:n,fill:J(Yp)})])}createIconPath(e){return e.map(s=>{if(!s)return new Z2().build();const r=s.deltaX(-6/2).deltaY(-1),a=r.deltaX(6),l=r.deltaY(1),c=a.deltaY(1),d=l.deltaX(6/2).deltaY(3);return new Z2().moveTo(r).lineTo(a).lineTo(c).lineTo(d).lineTo(l).lineTo(r).build()})}};J2=zke([Uke(2,Mn)],J2);var $ke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z6=function(o,e){return function(t,i){e(t,i,o)}};const YS=14,fN=0,vc=4,XS=4,Y6=2;let eP=class extends F{constructor(e,t,i,n,s){super(),this._editor=e,this._languageService=s,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._isHovered=Ee(this,!1),this.isHovered=this._isHovered,this._viewRef=Fe.ref(),this._editorObs=oi(this._editor);const r=i.map((d,h)=>{let u;switch(d){case is.Inactive:u=eX;break;case is.Jump:u=QY;break;case is.Accept:u=iX;break}return{border:mr(u,n).read(h).toString(),background:J(Ri)}}),a=t.map(d=>d?this.getState(d):void 0),l=a.map(d=>d?this.getRendering(d,r):void 0);this.minEditorScrollHeight=$(this,d=>{const h=a.read(d);return h?h.rect.read(d).bottom+this._editor.getScrollTop():0});const c=Fe.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[l]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:c.element,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:Ed(this,(d,h)=>{const u=a.read(d);if(!u)return h??0;const g=u.rect.map(f=>f.right).read(d)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(d)+vc-this._editorObs.layoutInfoContentLeft.read(d);return Math.max(h??0,g)}).recomputeInitiallyAndOnChange(this._store)})),this._register(ke(d=>{if(!l.read(d)){this._isHovered.set(!1,void 0);return}this._isHovered.set(c.isHovered.read(d),void 0)}))}fitsInsideViewport(e,t,i){const n=this._editorObs.layoutInfoWidth.read(i),s=this._editorObs.layoutInfoContentLeft.read(i),r=this._editor.getLayoutInfo().verticalScrollbarWidth,a=this._editorObs.layoutInfoMinimap.read(i).minimapLeft!==0?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0,l=kh(this._editorObs,e,void 0),c=P3(t,this._editor,this._editor.getModel()),d=vc+YS;return l+c+d{const l=e.range.startLineNumber,c=e.range.endLineNumber,d=e.range.startColumn,h=e.range.endColumn,u=this._editor.getModel()?.getLineCount()??0,g=kh(this._editorObs,new Ce(l,l+1),a),f=l+1<=u?kh(this._editorObs,new Ce(l+1,l+2),a):void 0,p=l-1>=1?kh(this._editorObs,new Ce(l-1,l),a):void 0,_=this._editor.getOffsetForColumn(l,d),b=this._editor.getOffsetForColumn(c,h);return{lineWidth:g,lineWidthBelow:f,lineWidthAbove:p,startContentLeftOffset:_,endContentLeftOffset:b}}),i=e.range.startLineNumber,n=e.range.endLineNumber,s=this.fitsInsideViewport(new Ce(i,n+1),e.content,void 0);return{rect:$(this,a=>{const l=this._editorObs.getOption(59).read(a).typicalHalfwidthCharacterWidth,{lineWidth:c,lineWidthBelow:d,lineWidthAbove:h,startContentLeftOffset:u,endContentLeftOffset:g}=t.read(a),f=this._editorObs.layoutInfoContentLeft.read(a),p=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(a.store).read(a),_=this._editorObs.scrollTop.read(a),b=this._editorObs.scrollLeft.read(a);let C;i===n&&g+5*l>=c&&s?C="end":d!==void 0&&d+YS-XS-vcl.withMargin(0,vc));return Fe.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...Nr(l=>a.read(l)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map(l=>`1px solid ${l.border}`),borderRadius:"4px",backgroundColor:t.map(l=>l.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:l=>{l.preventDefault()},onclick:l=>{this._onDidClick.fire(new qn(me(l),l))}},[i])}};eP=$ke([Z6(3,pi),Z6(4,yi)],eP);const jke=0,qke=0,pN=1,Kke=1,Gke=3,mN=4;class Zke extends F{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=n,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._display=$(this,a=>this._uiState.read(a)?"block":"none"),this._editorMaxContentWidthInRange=$(this,a=>{const l=this._originalDisplayRange.read(a);return l?(this._editorObs.versionId.read(a),Ed(this,(c,d)=>{const h=kh(this._editorObs,l,c);return Math.max(h,d??0)})):Ot(0)}).map((a,l)=>a.read(l)),this._maxPrefixTrim=$(this,a=>{const l=this._uiState.read(a);return l?M3(l.deletions,l.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=$(this,a=>{const l=this._edit.read(a);if(!l||!this._uiState.read(a))return null;const d=this._editorObs.layoutInfo.read(a),h=this._editorObs.scrollLeft.read(a),u=this._editorObs.getOption(59).map(w=>w.typicalHalfwidthCharacterWidth).read(a),g=d.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(a),u)-h,f=l.originalLineRange,p=this._originalVerticalStartPosition.read(a)??this._editor.getTopForLineNumber(f.startLineNumber)-this._editorObs.scrollTop.read(a),_=this._originalVerticalEndPosition.read(a)??this._editor.getTopForLineNumber(f.endLineNumberExclusive)-this._editorObs.scrollTop.read(a),b=d.contentLeft+this._maxPrefixTrim.read(a).prefixLeftOffset-h;return g<=b?null:{codeRect:Nt.fromLeftTopRightBottom(b,p,g,_).withMargin(qke,jke),contentLeft:d.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=Fe.div({style:{pointerEvents:"none"}},$(this,a=>{const l=tc(this._editorLayoutInfo).read(a);if(!l)return;const c=l.map(g=>Nt.fromLeftTopRightBottom(g.contentLeft-mN-pN,g.codeRect.top,g.contentLeft,g.codeRect.bottom)),d=$(this,g=>{const f=l.read(g).codeRect,p=c.read(g);return f.intersectHorizontal(new fe(p.left,Number.MAX_SAFE_INTEGER))}),h=this._uiState.map(g=>g?.inDiffEditor?Gke:Kke).read(a),u=d.map(g=>g.withMargin(h,h));return[Fe.div({class:"originalSeparatorDeletion",style:{...u.read(a).toStyles(),borderRadius:`${mN}px`,border:`${pN+h}px solid ${J(Ri)}`,boxSizing:"border-box"}}),Fe.div({class:"originalOverlayDeletion",style:{...d.read(a).toStyles(),borderRadius:`${mN}px`,border:$k(this._tabAction).map(g=>`${pN}px solid ${J(g)}`),boxSizing:"border-box",backgroundColor:J(qC)}}),Fe.div({class:"originalOverlayHiderDeletion",style:{...c.read(a).toStyles(),backgroundColor:J(Ri)}})]})).keepUpdated(this._store),this._nonOverflowView=Fe.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=Ot(!1),this._editorObs=oi(this._editor);const s=$(this,a=>{const l=this._edit.read(a);return l?new R(l.originalLineRange.startLineNumber,1):null}),r=$(this,a=>{const l=this._edit.read(a);return l?new R(l.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(a=>a?.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(s,this._store).map(a=>a?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(r,this._store).map(a=>a?.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,a=>{const l=this._editorLayoutInfo.read(a);return l===null?0:l.codeRect.width})}))}}var Yke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},X6=function(o,e){return function(t,i){e(t,i,o)}};const Tb=1,Xke=1,Qke=3,_N=4;let tP=class extends F{constructor(e,t,i,n,s){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=s,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._state=$(this,r=>{const a=this._input.read(r);if(!a)return;const l=this._editor.getModel(),c=l.getEOL();if(a.startColumn===1&&a.lineNumber>1&&l.getLineLength(a.lineNumber)!==0&&a.text.endsWith(c)&&!a.text.startsWith(c)){const d=l.getLineLength(a.lineNumber-1)+1;return{lineNumber:a.lineNumber-1,column:d,text:c+a.text.slice(0,-c.length)}}return{lineNumber:a.lineNumber,column:a.startColumn,text:a.text}}),this._trimVertically=$(this,r=>{const a=this._state.read(r),l=a?.text;if(!l||l.trim()==="")return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const c=this._editor.getLineHeightForPosition(new R(a.lineNumber,1)),d=this._editor.getModel().getEOL();let h=0,u=0,g=0;for(;gg&&l.endsWith(d,f);f-=d.length)u+=1;return{topOffset:h*c,bottomOffset:u*c,linesTop:h,linesBottom:u}}),this._maxPrefixTrim=$(this,r=>{const a=this._state.read(r);if(!a)return{prefixLeftOffset:0,prefixTrim:0};const l=this._editor.getModel(),c=l.getEOL(),d=this._trimVertically.read(r),h=a.text.split(c),u=h.slice(d.linesTop,h.length-d.linesBottom);d.linesTop===0&&(u[0]=l.getLineContent(a.lineNumber)+u[0]);const g=new Ce(a.lineNumber,a.lineNumber+(d.linesTop>0?0:1));return M3([],g,u,this._editor)}),this._ghostText=$(r=>{const a=this._state.read(r),l=this._maxPrefixTrim.read(r);if(!a)return;const d=this._editor.getModel().getEOL(),u=a.text.split(d).map((g,f)=>new Ag(new D(f+1,f===0?1:l.prefixTrim+1,f+1,g.length+1),"modified-background",0));return new _w(a.lineNumber,[new ux(a.column,a.text,!1,u)])}),this._display=$(this,r=>this._state.read(r)?"block":"none"),this._editorMaxContentWidthInRange=$(this,r=>{const a=this._state.read(r);if(!a)return 0;this._editorObs.versionId.read(r);const l=this._editor.getModel(),c=l.getEOL(),d=a.text.startsWith(c)?"":l.getValueInRange(new D(a.lineNumber,1,a.lineNumber,a.column)),h=l.getValueInRange(new D(a.lineNumber,a.column,a.lineNumber,l.getLineLength(a.lineNumber)+1)),g=(d+a.text+h).split(c),f=dd.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p=g.map(_=>{const b=l.tokenization.tokenizeLinesAt(a.lineNumber,[_])?.[0];let C;return b?C=rd.fromLineTokens(b).toLineTokens(_,this._languageService.languageIdCodec):C=Xt.createEmpty(_,this._languageService.languageIdCodec),m1(new _1([C]),f,[],ee("div"),!0).minWidthInPx});return Math.max(...p)}),this.startLineOffset=this._trimVertically.map(r=>r.topOffset),this.originalLines=this._state.map(r=>r?new Ce(r.lineNumber,Math.min(r.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=$(this,r=>{this._ghostText.read(r);const a=this._state.read(r);if(!a)return null;this._editorObs.observePosition(Ee(this,new R(a.lineNumber,a.column)),r.store).read(r);const l=this._editorObs.layoutInfo.read(r),c=this._editorObs.scrollLeft.read(r),d=this._editorObs.layoutInfoVerticalScrollbarWidth.read(r),h=l.contentLeft+this._editorMaxContentWidthInRange.read(r)-c,u=this._maxPrefixTrim.read(r).prefixLeftOffset??0,g=l.contentLeft+u-c;if(h<=g)return null;const{topOffset:f,bottomOffset:p}=this._trimVertically.read(r),_=this._editorObs.scrollTop.read(r),b=this._ghostTextView.height.read(r)-f-p,C=this._editor.getTopForLineNumber(a.lineNumber)-_+f,w=C+b,v=new Nt(g,C,h,w);return{overlay:v,startsAtContentLeft:u===0,contentLeft:l.contentLeft,minContentWidthRequired:u+v.width+d}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=Fe.div({style:{pointerEvents:"none"}},$(this,r=>{const a=tc(this._overlayLayout).read(r);if(!a)return;const l=a.map(u=>Nt.fromLeftTopRightBottom(u.contentLeft-_N-Tb,u.overlay.top,u.contentLeft,u.overlay.bottom)).read(r),c=this._input.map(u=>u?.inDiffEditor?Qke:Xke).read(r),d=a.map(u=>u.overlay.withMargin(0,Tb,0,u.startsAtContentLeft?0:Tb).intersectHorizontal(new fe(l.left,Number.MAX_SAFE_INTEGER))),h=d.map(u=>u.withMargin(c,c));return[Fe.div({class:"originalUnderlayInsertion",style:{...h.read(r).toStyles(),borderRadius:_N,border:`${Tb+c}px solid ${J(Ri)}`,boxSizing:"border-box"}}),Fe.div({class:"originalOverlayInsertion",style:{...d.read(r).toStyles(),borderRadius:_N,border:ww(this._tabAction).map(u=>`${Tb}px solid ${J(u)}`),boxSizing:"border-box",backgroundColor:J(XY)}}),Fe.div({class:"originalOverlayHiderInsertion",style:{...l.toStyles(),backgroundColor:J(Ri)}})]})).keepUpdated(this._store),this._view=Fe.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=oi(this._editor),this._ghostTextView=this._register(n.createInstance(Cw,this._editor,{ghostText:this._ghostText,minReservedLineCount:Ot(0),targetTextModel:this._editorObs.model.map(r=>r??void 0),warning:Ot(void 0),handleInlineCompletionShown:Ot(()=>{})},Ee(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(r=>{this._onDidClick.fire(r)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,r=>{const a=this._overlayLayout.read(r);return a===null?0:a.minContentWidthRequired})}))}};tP=Yke([X6(3,pe),X6(4,yi)],tP);var Jke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Q6=function(o,e){return function(t,i){e(t,i,o)}};let iP=class extends F{constructor(e,t,i,n,s,r){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=n,this._languageService=s,this._themeService=r,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((a,l)=>a?M3(a.replacements.flatMap(c=>[c.originalRange,c.modifiedRange]),a.originalRange,a.modifiedLines,this._editor.editor,l):void 0),this._modifiedLineElements=$(this,a=>{const l=[];let c=0;const d=this._maxPrefixTrim.read(a),h=this._edit.read(a);if(!h||!d)return;const u=d.prefixTrim,g=eIe(h.replacements.map(_=>_.modifiedRange)).map(_=>new D(_.startLineNumber,_.startColumn-u,_.endLineNumber,_.endColumn-u)),f=this._editor.model.get(),p=h.modifiedRange.startLineNumber;for(let _=0;_I.startLineNumber===C)){const I=Math.min(k.endColumn,w.length+1);L.push(new Ag(new D(1,k.startColumn,1,I),"inlineCompletions-modified-bubble",0))}const x=m1(new _1([S]),dd.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),L,b,!0);this._editor.getOption(59).read(a),c=Math.max(c,x.minWidthInPx),l.push(b)}return{lines:l,requiredWidth:c}}),this._layout=$(this,a=>{const l=this._modifiedLineElements.read(a),c=this._maxPrefixTrim.read(a),d=this._edit.read(a);if(!l||!c||!d)return;const{prefixLeftOffset:h}=c,{requiredWidth:u}=l,g=this._editor.observeLineHeightsForLineRange(d.originalRange).read(a),f=(()=>{const ie=g.slice(0,d.modifiedRange.length);for(;ie.lengththis._editor.editor.getOffsetForColumn(ie,v.getLineMaxColumn(ie))-h),L=Math.max(...S,u),x=d.originalRange.startLineNumber,k=d.originalRange.endLineNumberExclusive-1,I=this._editor.editor.getTopForLineNumber(x)-C,T=this._editor.editor.getBottomForLineNumber(k)-C,A=Nt.fromLeftTopWidthHeight(w+h,I,L,T-I),O=Nt.fromLeftTopWidthHeight(A.left,A.bottom,A.width,f.reduce((ie,Q)=>ie+Q,0)),W=Nt.hull([A,O]),U=W.intersectVertical(new fe(A.bottom,Number.MAX_SAFE_INTEGER)),q=new Nt(U.left,U.top,U.right,U.bottom);return{originalLinesOverlay:A,modifiedLinesOverlay:O,background:W,lowerBackground:U,lowerText:q,modifiedLineHeights:f,minContentWidthRequired:h+L+_}}),this._viewZoneInfo=$(a=>{if(!this._editor.getOption(71).map(g=>g.edits.allowCodeShifting==="always").read(a))return;const c=this._layout.read(a),d=this._edit.read(a);if(!c||!d)return;const h=c.lowerBackground.height,u=d.originalRange.endLineNumberExclusive;return{height:h,lineNumber:u}}),this.minEditorScrollHeight=$(this,a=>{const l=tc(this._layout).read(a);return!l||this._viewZoneInfo.read(a)!==void 0?0:l.read(a).lowerText.bottom+this._editor.editor.getScrollTop()}),this._div=Fe.div({class:"line-replacement"},[$(this,a=>{const l=tc(this._layout).read(a),c=this._modifiedLineElements.read(a);if(!l||!c)return[];const d=l.read(a),h=this._editor.layoutInfoContentLeft.read(a),u=this._isInDiffEditor.read(a)?3:1;c.lines.forEach((p,_)=>{p.style.width=`${d.lowerText.width}px`,p.style.height=`${d.modifiedLineHeights[_]}px`,p.style.position="relative"});const g=ww(this._tabAction).read(a),f=$k(this._tabAction).read(a);return[Fe.div({style:{position:"absolute",...Nr(p=>A3(this._editor).read(p)),overflow:"hidden",pointerEvents:"none"}},[Fe.div({class:"borderAroundLineReplacement",style:{position:"absolute",...Nr(p=>l.read(p).background.translateX(-h).withMargin(u)),borderRadius:"4px",border:`${u+1}px solid ${J(Ri)}`,boxSizing:"border-box",pointerEvents:"none"}}),Fe.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...Nr(p=>l.read(p).background.translateX(-h)),borderRadius:"4px",border:mr(f,this._themeService).map(p=>`1px solid ${p.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:J(qC)}}),Fe.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...Nr(p=>l.read(p).lowerBackground.translateX(-h)),borderRadius:"0 0 4px 4px",background:J(Ri),boxShadow:`${J(TD)} 0 6px 6px -6px`,border:`1px solid ${J(g)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:p=>{p.preventDefault()},onclick:p=>this._onDidClick.fire(new qn(me(p),p))},[Fe.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:J(wke)}})]),Fe.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...Nr(p=>l.read(p).lowerText.translateX(-h)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...c.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(a=>this._isMouseOverWidget(a),this._store),this._previousViewZoneInfo=void 0,this._register(ge(()=>this._editor.editor.changeViewZones(a=>this.removePreviousViewZone(a)))),this._register(Rte(this._viewZoneInfo,({lastValue:a,newValue:l})=>{a===l||a?.height===l?.height&&a?.lineNumber===l?.lineNumber||this._editor.editor.changeViewZones(c=>{this.removePreviousViewZone(c),l&&this.addViewZone(l,c)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:$(this,a=>this._layout.read(a)?.minContentWidthRequired??0),position:Ot({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!t||!(e.event instanceof wd)?!1:t.lowerBackground.containsPoint(new dn(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();t!==null&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:ee("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const n=this._editor.cursorLineNumber.get();n!==null&&n>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}};iP=Jke([Q6(4,yi),Q6(5,pi)],iP);function eIe(o){const e=[];for(;o.length;){let t=o.shift();t.startLineNumber!==t.endLineNumber&&(o.push(new D(t.startLineNumber+1,1,t.endLineNumber,t.endColumn)),t=new D(t.startLineNumber,t.startColumn,t.startLineNumber,Number.MAX_SAFE_INTEGER)),e.push(t)}return e}var tIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},J6=function(o,e){return function(t,i){e(t,i,o)}};const Cp=0,Rb=0,La=1,iIe=1,nIe=3,wc=4,bN=20,eV=12;let Cx=class extends F{static fitsInsideViewport(e,t,i,n){const s=oi(e),r=s.layoutInfoWidth.read(n),a=s.layoutInfoContentLeft.read(n),l=e.getLayoutInfo().verticalScrollbarWidth,c=s.layoutInfoMinimap.read(n).minimapLeft!==0?s.layoutInfoMinimap.read(n).minimapWidth:0,d=kh(s,i.displayRange,void 0),h=i.lineEdit.newLines.reduce((f,p)=>Math.max(f,P3(p,e,t)),0),u=bN,g=eV+2*La;return d+h+u+gthis._uiState.read(c)?"block":"none"),this.previewRef=Fe.ref();const l=this._uiState.map(c=>c?.isInDiffEditor?nIe:iIe);this._editorContainer=Fe.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new qn(me(c),c))}},[Fe.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(kd,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[Tt.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=oi(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=$(this,c=>{this._editorContainer.readEffect(c),this._previewEditorObs.model.read(c),this._display.read(c),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(c));const d=this._uiState.read(c),h=this._edit.read(c);if(!d||!h)return;const u=h.originalLineRange,g=[];u.startLineNumber>1&&g.push(new D(1,1,u.startLineNumber-1,1)),u.startLineNumber+d.newTextLineCount{f.forEach(b=>_.removeZone(b)),p>0&&this._activeViewZones.push(_.addZone({afterLineNumber:u.startLineNumber+d.newTextLineCount-1,heightInLines:p,showInHiddenAreas:!0,domNode:ee("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=$(this,c=>{const d=this._edit.read(c);return d?(this._updatePreviewEditor.read(c),kh(this._previewEditorObs,d.modifiedLineRange,c)):0}),this._cursorPosIfTouchesEdit=$(this,c=>{const d=this._editorObs.cursorPosition.read(c),h=this._edit.read(c);if(!(!h||!d))return h.modifiedLineRange.contains(d.lineNumber)?d:void 0}),this._originalStartPosition=$(this,c=>{const d=this._edit.read(c);return d?new R(d.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=$(this,c=>{const d=this._edit.read(c);return d?new R(d.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(c=>c?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(c=>c?.y),this._originalDisplayRange=this._edit.map(c=>c?.displayRange),this._editorMaxContentWidthInRange=$(this,c=>{const d=this._originalDisplayRange.read(c);return d?(this._editorObs.versionId.read(c),Ed(this,(h,u)=>{const g=kh(this._editorObs,d,h);return Math.max(g,u??0)})):Ot(0)}).map((c,d)=>c.read(d)),this._previewEditorLayoutInfo=$(this,c=>{const d=this._edit.read(c);if(!d||!this._uiState.read(c))return null;const u=d.originalLineRange,g=this._editorObs.scrollLeft.read(c),f=this._editorMaxContentWidthInRange.read(c),p=this._editorObs.layoutInfo.read(c),_=this._previewEditorWidth.read(c),b=p.contentWidth-p.verticalScrollbarWidth,C=this._editor.getContainerDomNode().getBoundingClientRect(),w=p.contentLeft+p.contentWidth+C.left,v=me(this._editor.getContainerDomNode()).innerWidth-w,S=me(this._editor.getContainerDomNode()).innerWidth-C.right,L=Math.min(p.contentWidth*.3,_,100),x=0,k=x+v,I=this._cursorPosIfTouchesEdit.read(c),T=Math.max(b+g-x-Math.max(0,L-k),Math.min(I?Eke(this._editorObs,I,c)+50:0,b+g)),A=Math.min(f+bN,T),O=f+bN+_+70,W=T-A;let U,q;A>g?(U=0,q=p.contentLeft+A-g):(U=g-A,q=p.contentLeft);const ie=this._originalVerticalStartPosition.read(c)??this._editor.getTopForLineNumber(u.startLineNumber)-this._editorObs.scrollTop.read(c),Q=this._originalVerticalEndPosition.read(c)??this._editor.getBottomForLineNumber(u.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(c),ne=p.contentLeft-g;let ce=Nt.fromLeftTopRightBottom(ne,ie,q,Q);const De=ce.height===0;De||(ce=ce.withMargin(Rb,Cp));const st=this._previewEditorObs.observeLineHeightsForLineRange(d.modifiedLineRange).read(c).reduce((tb,O1)=>tb+O1,0),Ye=Q-ie,Ft=Math.max(Ye,st),yt=W===0,nn=0,Pi=Math.min(_+eV,S+p.width-p.contentLeft-nn);let xs=Nt.fromLeftTopWidthHeight(ce.right+nn,ie,Pi,Ft);return De?xs=xs.withMargin(Rb,Cp).translateY(Rb):xs=xs.withMargin(Rb,Cp).translateX(Cp+La),{codeRect:ce,editRect:xs,codeScrollLeft:g,contentLeft:p.contentLeft,isInsertion:De,maxContentWidth:O,shouldShowShadow:yt,desiredPreviewEditorScrollLeft:U,previewEditorWidth:Pi}}),this._stickyScrollController=_a.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?pt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Ot(0),this._shouldOverflow=$(this,c=>!1),this._originalBackgroundColor=pt(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(qC)??V.transparent),this._backgroundSvg=Fe.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[Fe.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:$(this,c=>{const d=this._previewEditorLayoutInfo.read(c);if(!(!d||this._originalBackgroundColor.read(c).isTransparent()))return new Z2().moveTo(d.codeRect.getRightTop()).lineTo(d.codeRect.getRightTop().deltaX(1e3)).lineTo(d.codeRect.getRightBottom().deltaX(1e3)).lineTo(d.codeRect.getRightBottom()).build()}),style:{fill:G$(Ri,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=Fe.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(c=>c?.isInsertion?"none":"block")}},$(this,c=>{const d=tc(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=l.read(c),u=$k(this._tabAction).map(L=>`${La}px solid ${J(L)}`),g=`${La+h}px solid ${J(Ri)}`,f=d.read(c).codeScrollLeft!==0,p=d.map(L=>L.codeRect.bottomNt.fromLeftTopRightBottom(L.contentLeft-wc-La,L.codeRect.top,L.contentLeft,L.codeRect.bottom+_)).read(c),C=new fe(b.left,Number.MAX_SAFE_INTEGER),w=d.map(L=>L.codeRect.intersectHorizontal(C)),v=w.map(L=>L.withMargin(h,0,h,h).intersectHorizontal(C)),S=w.map(L=>Nt.fromLeftTopWidthHeight(L.right-_+La,L.bottom-La,_,_).intersectHorizontal(C));return[Fe.div({class:"originalSeparatorSideBySide",style:{...v.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${wc}px 0 0 ${wc}px`,borderTop:g,borderBottom:g,borderLeft:f?"none":g}}),Fe.div({class:"originalOverlaySideBySide",style:{...w.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${wc}px 0 0 ${wc}px`,borderTop:u,borderBottom:u,borderLeft:f?"none":u,backgroundColor:J(qC)}}),Fe.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:p.map(L=>L?"block":"none"),...S.read(c).toStyles()}},[Fe.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:mr(qC,this._themeService).map(L=>L.toString())}}),Fe.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:u,borderRight:u,borderRadius:"0 100% 0 0",backgroundColor:J(Ri)}})]),Fe.div({class:"originalOverlaySideBySideHider",style:{...b.toStyles(),backgroundColor:J(Ri)}})]})).keepUpdated(this._store),this._modifiedOverlay=Fe.div({style:{pointerEvents:"none"}},$(this,c=>{const d=tc(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=d.map(w=>w.codeRect.bottom`0 ${wc}px ${wc}px ${w?wc:0}px`),f=mr(ww(this._tabAction),this._themeService).map(w=>`1px solid ${w.toString()}`),p=`${La+u}px solid ${J(Ri)}`,_=d.map(w=>w.editRect.withMargin(0,La)),b=_.map(w=>w.withMargin(u,u,u,0)),C=$(this,w=>{const v=_.read(w),S=d.read(w);return!S.isInsertion||S.contentLeft>=v.left?Nt.fromLeftTopWidthHeight(v.left,v.top,0,0):new Nt(S.contentLeft,v.top,v.left,v.top+La*2)});return[Fe.div({class:"modifiedInsertionSideBySide",style:{...C.read(c).toStyles(),backgroundColor:ww(this._tabAction).map(w=>J(w))}}),Fe.div({class:"modifiedSeparatorSideBySide",style:{...b.read(c).toStyles(),borderRadius:g,borderTop:p,borderBottom:p,borderRight:p,boxSizing:"border-box"}}),Fe.div({class:"modifiedOverlaySideBySide",style:{..._.read(c).toStyles(),borderRadius:g,border:f,boxSizing:"border-box",backgroundColor:J(XY)}})]})).keepUpdated(this._store),this._nonOverflowView=Fe.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,$(this,c=>this._shouldOverflow.read(c)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Ot(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,c=>{const d=this._previewEditorLayoutInfo.read(c)?.maxContentWidth;return d===void 0?0:d})})),this.previewEditor.setModel(this._previewTextModel),this._register(ke(c=>{const d=this._previewEditorLayoutInfo.read(c);if(!d)return;const h=d.editRect.withMargin(-Rb,-Cp);this.previewEditor.layout({height:h.height,width:d.previewEditorWidth+15}),this._editorContainer.element.style.top=`${h.top}px`,this._editorContainer.element.style.left=`${h.left}px`,this._editorContainer.element.style.width=`${d.previewEditorWidth+Cp}px`})),this._register(ke(c=>{const d=this._previewEditorLayoutInfo.read(c);d&&this._previewEditorObs.editor.setScrollLeft(d.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};Cx=tIe([J6(5,pe),J6(6,pi)],Cx);var sIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oIe=function(o,e){return function(t,i){e(t,i,o)}};const Sc=1;let Xp=class extends F{static{this.MAX_LENGTH=100}constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=n,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(Ot(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(Ot(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Ee(this,null),this.isHovered=this._hoverableElement.map((r,a)=>r?.didMouseMoveDuringHover.read(a)??!1),this._renderTextEffect=$(this,r=>{const a=this._editor.model.get(),l=a.getLineContent(this._edit.range.startLineNumber),c=Nn.replace(new fe(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),d=c.replace(l),h=a.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[d])?.[0];let u;h?u=rd.fromLineTokens(h).slice(c.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):u=Xt.createEmpty(this._edit.text,this._languageService.languageIdCodec);const g=m1(new _1([u]),dd.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${g.minWidthInPx}px`});const s=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=$(this,r=>{this._renderTextEffect.read(r);const a=this._start.read(r),l=this._end.read(r);if(!a||!l||a.x>l.x||a.y>l.y)return;const c=s.read(r),d=this._editor.scrollLeft.read(r),h=this._editor.getOption(59).read(r).typicalHalfwidthCharacterWidth,u=3*h,g=4,f=new dn(u,g),p=Nt.fromPoints(a,l).withHeight(c).translateX(-d),_=Nt.fromPointSize(p.getLeftBottom().add(f),new dn(this._edit.text.length*h,p.height)),b=_.withLeft(p.left);return{originalLine:p,modifiedLine:_,lowerBackground:b,lineHeight:c}}),this.minEditorScrollHeight=$(this,r=>{const a=tc(this._layout).read(r);return a?a.read(r).modifiedLine.bottom+Sc+this._editor.editor.getScrollTop():0}),this._root=Fe.div({class:"word-replacement"},[$(this,r=>{const a=tc(this._layout).read(r);if(!a)return[];const l=$k(this._tabAction).map(d=>J(d)).read(r),c=ww(this._tabAction).map(d=>J(d)).read(r);return[Fe.div({style:{position:"absolute",...Nr(d=>A3(this._editor).read(d)),overflow:"hidden",pointerEvents:"none"}},[Fe.div({style:{position:"absolute",...Nr(d=>a.read(d).lowerBackground.withMargin(Sc,2*Sc,Sc,0)),background:J(Ri),cursor:"pointer",pointerEvents:"auto"},onmousedown:d=>{d.preventDefault()},onmouseup:d=>this._onDidClick.fire(new qn(me(d),d)),obsRef:d=>{this._hoverableElement.set(d,void 0)}}),Fe.div({style:{position:"absolute",...Nr(d=>a.read(d).modifiedLine.withMargin(Sc,2*Sc)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`${Sc}px solid ${c}`,background:J(Ske),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${J(Ri)}`}},[this._line]),Fe.div({style:{position:"absolute",...Nr(d=>a.read(d).originalLine.withMargin(Sc)),boxSizing:"border-box",borderRadius:"4px",border:`${Sc}px solid ${l}`,background:J(vke),pointerEvents:"none"}},[]),Fe.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:a.map(d=>d.modifiedLine.left-16),top:a.map(d=>d.modifiedLine.top+Math.round((d.lineHeight-14-5)/2))}},[Fe.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:J(u9)}),Fe.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:J(u9)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:Ot(0),position:Ot({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}};Xp=sIe([oIe(3,yi)],Xp);class rIe extends F{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this.isHovered=oi(this._originalEditor).isTargetHovered(s=>s.target.type===6&&s.target.detail.injectedText?.options.attachedData instanceof CN&&s.target.detail.injectedText.options.attachedData.owner===this,this._store),this._tokenizationFinished=cIe(this._modifiedTextModel),this._decorations=$(this,s=>{const r=this._state.read(s);if(!r)return;const a=r.modifiedText,l=r.mode==="insertionInline",c=r.diff.length===1&&r.diff[0].innerChanges?.length===1,d=!0,h=[],u=[],g=Me.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),f=Me.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),p=Me.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),_=Me.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),b=Me.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),C=Me.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),w=Me.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),v=r.mode!=="sideBySide"&&r.mode!=="deletion"&&r.mode!=="insertionInline"&&r.mode!=="lineReplacement",S=r.mode==="lineReplacement";for(const L of r.diff)if(v&&(L.original.isEmpty||h.push({range:L.original.toInclusiveRange(),options:f}),L.modified.isEmpty||u.push({range:L.modified.toInclusiveRange(),options:g})),L.modified.isEmpty||L.original.isEmpty)L.original.isEmpty||h.push({range:L.original.toInclusiveRange(),options:p}),L.modified.isEmpty||u.push({range:L.modified.toInclusiveRange(),options:_});else{const x=l&&aIe(L);for(const k of L.innerChanges||[]){if(L.original.contains(k.originalRange.startLineNumber)&&!(S&&k.originalRange.isEmpty())){const I=this._originalEditor.getModel()?.getValueInRange(k.originalRange,1);h.push({range:k.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:uN("inlineCompletions-char-delete",k.originalRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",k.originalRange.isEmpty()&&"empty",(k.originalRange.isEmpty()&&c||r.mode==="deletion"&&I===` -`)&&d&&!x&&"diff-range-empty"),inlineClassName:x?uN("strike-through","inlineCompletions"):null,zIndex:1}})}if(L.modified.contains(k.modifiedRange.startLineNumber)&&u.push({range:k.modifiedRange,options:k.modifiedRange.isEmpty()&&d&&!x&&c?C:b}),x){const I=a.getValueOfRange(k.modifiedRange),T=I.length>3?[{text:I.slice(0,1),extraClasses:["start"],offsetRange:new fe(k.modifiedRange.startColumn-1,k.modifiedRange.startColumn)},{text:I.slice(1,-1),extraClasses:[],offsetRange:new fe(k.modifiedRange.startColumn,k.modifiedRange.endColumn-2)},{text:I.slice(-1),extraClasses:["end"],offsetRange:new fe(k.modifiedRange.endColumn-2,k.modifiedRange.endColumn-1)}]:[{text:I,extraClasses:["start","end"],offsetRange:new fe(k.modifiedRange.startColumn-1,k.modifiedRange.endColumn)}];this._tokenizationFinished.read(s);const A=this._modifiedTextModel.tokenization.getLineTokens(k.modifiedRange.startLineNumber);for(const{text:O,extraClasses:W,offsetRange:U}of T)h.push({range:D.fromPositions(k.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:A.getTokensInRange(U),content:O,inlineClassName:uN("inlineCompletions-char-insert",k.modifiedRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",...W),cursorStops:Lr.None,attachedData:new CN(this)},zIndex:2,showIfCollapsed:!0}})}}}if(r.isInDiffEditor)for(const L of r.diff)L.original.isEmpty||h.push({range:L.original.toExclusiveRange(),options:w});return{originalDecorations:h,modifiedDecorations:u}}),this._register(oi(this._originalEditor).setDecorations(this._decorations.map(s=>s?.originalDecorations??[])));const n=this._state.map(s=>s?.modifiedCodeEditor);this._register(os((s,r)=>{const a=n.read(s);a&&r.add(oi(a).setDecorations(this._decorations.map(l=>l?.modifiedDecorations??[])))})),this._register(this._originalEditor.onMouseUp(s=>{if(s.target.type!==6)return;const r=s.target.detail.injectedText?.options.attachedData;r instanceof CN&&r.owner===this&&this._onDidClick.fire(s.event)}))}}class CN{constructor(e){this.owner=e}}function aIe(o){return o.innerChanges?o.innerChanges.every(e=>bL(e.modifiedRange)&&bL(e.originalRange)):!1}let lIe=0;function cIe(o){return pt(o.onDidChangeTokens,()=>lIe++)}var dIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hIe=function(o,e){return function(t,i){e(t,i,o)}};let nP=class extends F{constructor(e,t,i,n,s,r){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=n,this._focusIsInMenu=s,this._instantiationService=r,this._editorObs=oi(this._editor),this._tabAction=$(d=>this._model.read(d)?.tabAction.read(d)??is.Inactive),this._constructorDone=Ee(this,!1),this._uiState=$(this,d=>{const h=this._model.read(d);if(!h||!this._constructorDone.read(d))return;const u=h.inlineEdit;let g=Ms.fromEdit(u.edit),f=u.edit.apply(u.originalText),p=_L(g,u.originalText,new bh(f)),_=this.determineRenderState(h,d,p,new bh(f));if(!_){Te(new Error(`unable to determine view: tried to render ${this._previousView?.view}`));return}if(_.kind===gt.SideBySide){const C=Pke(f,u.modifiedLineRange,l.getOptions().tabSize);f=C.applyToString(f),g=Nke(g,C),p=_L(g,u.originalText,new bh(f))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==f&&this._previewTextModel.setValue(f),h.showCollapsed.read(d)&&!this._indicator.read(d)?.isHoverVisible.read(d)&&(_={kind:gt.Collapsed,viewData:_.viewData}),h.handleInlineEditShown(_.kind,_.viewData),{state:_,diff:p,edit:u,newText:f,newTextLineCount:u.modifiedLineRange.length,isInDiffEditor:h.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(nf,"",this._editor.getModel().getLanguageId(),{...nf.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Ee(this,!1),this._indicator=$(this,d=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(d))return;const h=Un({owner:this,equalsFn:dg(v4())},g=>{const f=this._ghostTextIndicator.read(g);if(f)return f.lineRange;const p=this._uiState.read(g);if(p){if(p.state?.kind==="custom"){const _=p.state.displayLocation?.range;if(!_)throw new ve("custom view should have a range");return new Ce(_.startLineNumber,_.endLineNumber)}return p.state?.kind==="insertionMultiLine"?this._insertion.originalLines.read(g):p.edit.displayRange}}),u=$(this,g=>{const f=this._model.read(g);if(f)return f;const p=this._ghostTextIndicator.read(g);return p?p.model:f});return d.store.add(this._instantiationService.createInstance(X2,this._editorObs,h,this._gutterIndicatorOffset,u,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=$(this,d=>this._sideBySide.isHovered.read(d)||this._wordReplacementViews.read(d).some(h=>h.isHovered.read(d))||this._deletion.isHovered.read(d)||this._inlineDiffView.isHovered.read(d)||this._lineReplacementView.isHovered.read(d)||this._insertion.isHovered.read(d)||this._customView.isHovered.read(d)),this._gutterIndicatorOffset=$(this,d=>{if(this._uiState.read(d)?.state?.kind==="insertionMultiLine")return this._insertion.startLineOffset.read(d);const h=this._ghostTextIndicator.read(d);return h?fIe(h,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(Cx,this._editor,this._model.map(d=>d?.inlineEdit),this._previewTextModel,this._uiState.map(d=>d&&d.state?.kind===gt.SideBySide?{newTextLineCount:d.newTextLineCount,isInDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(Zke,this._editor,this._model.map(d=>d?.inlineEdit),this._uiState.map(d=>d&&d.state?.kind===gt.Deletion?{originalRange:d.state.originalRange,deletions:d.state.deletions,inDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(tP,this._editor,this._uiState.map(d=>d&&d.state?.kind===gt.InsertionMultiLine?{lineNumber:d.state.lineNumber,startColumn:d.state.column,text:d.state.text,inDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._inlineDiffViewState=$(this,d=>{const h=this._uiState.read(d);if(!(!h||!h.state)&&!(h.state.kind==="wordReplacements"||h.state.kind==="insertionMultiLine"||h.state.kind==="collapsed"||h.state.kind==="custom"))return{modifiedText:new bh(h.newText),diff:h.diff,mode:h.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:h.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(J2,this._editor,this._model.map((d,h)=>this._uiState.read(h)?.state?.kind==="collapsed"?d?.inlineEdit:void 0))),this._customView=this._register(this._instantiationService.createInstance(eP,this._editor,this._model.map((d,h)=>this._uiState.read(h)?.state?.kind==="custom"?d?.displayLocation:void 0),this._tabAction)),this._inlineDiffView=this._register(new rIe(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=y4(this,this._uiState.map(d=>d?.state?.kind==="wordReplacements"?d.state.replacements:[]),(d,h)=>h.add(this._instantiationService.createInstance(Xp,this._editorObs,d,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance(iP,this._editorObs,this._uiState.map(d=>d?.state?.kind===gt.LineReplacement?{originalRange:d.state.originalRange,modifiedRange:d.state.modifiedRange,modifiedLines:d.state.modifiedLines,replacements:d.state.replacements}:void 0),this._uiState.map(d=>d?.isInDiffEditor??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(d=>d.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(d=>d.edits.renderSideBySide),this._register(os((d,h)=>{const u=this._model.read(d);u&&h.add(se.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(d).map(g=>g.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(g=>{this._viewHasBeenShownLongerThan(350)&&(g.preventDefault(),u.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(Q2,this._host,this._model,this._indicator,this._inlineCollapsedView));const a=$(this,d=>Math.max(...this._wordReplacementViews.read(d).map(h=>h.minEditorScrollHeight.read(d)),this._lineReplacementView.minEditorScrollHeight.read(d),this._customView.minEditorScrollHeight.read(d))).recomputeInitiallyAndOnChange(this._store),l=this._editor.getModel();let c;this._register(ke(d=>{const h=a.read(d);this._editor.changeViewZones(u=>{const g=this._editor.getScrollHeight(),f=h-g+1;f!==0&&c&&(u.removeZone(c),c=void 0),!(f<=0)&&(c=u.addZone({afterLineNumber:l.getLineCount(),heightInPx:f,domNode:ee("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,n){const s=e.inlineEdit,r=this._previousView?.id===this.getCacheId(e)&&!e.displayLocation?.jumpToEdit,a=this._previousView?.editorWidth!==this._editorObs.layoutInfoWidth.read(t)&&(this._previousView?.view===gt.SideBySide||this._previousView?.view===gt.LineReplacement);if(r&&!a)return this._previousView.view;if(e.inlineEdit.inlineCompletion instanceof Nm&&e.inlineEdit.inlineCompletion.uri||e.displayLocation&&!e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))return gt.Custom;const l=s.originalLineRange.length,c=s.modifiedLineRange.length,d=i.flatMap(u=>u.innerChanges??[]),h=d.length===1;if(!e.isInDiffEditor){if(h&&this._useCodeShifting.read(t)!=="never"&&nX(i))return uIe(i,s.cursorPosition)?gt.InsertionInline:gt.LineReplacement;if(iV(d,s,n))return gt.Deletion;if(tV(i)&&this._useCodeShifting.read(t)==="always")return gt.InsertionMultiLine;if(d.every(g=>di.ofRange(g.originalRange).columnCountn.getValueOfRange(p.modifiedRange)),f=d.map(p=>e.inlineEdit.originalText.getValueOfRange(p.originalRange));if(!g.some(p=>p.includes(" "))&&!f.some(p=>p.includes(" "))&&(!d.some(p=>p.originalRange.isEmpty())||!nV(d.map(p=>new Fi(p.originalRange,"")),s.originalText).some(p=>p.range.isEmpty()&&di.ofRange(p.range).columnCount0&&c>0)return l===1&&c===1&&!e.isInDiffEditor?gt.LineReplacement:this._renderSideBySide.read(t)!=="never"&&Cx.fitsInsideViewport(this._editor,this._previewTextModel,s,t)?gt.SideBySide:gt.LineReplacement;if(e.isInDiffEditor){if(iV(d,s,n))return gt.Deletion;if(tV(i)&&this._useCodeShifting.read(t)==="always")return gt.InsertionMultiLine}return gt.SideBySide}determineRenderState(e,t,i,n){const s=e.inlineEdit;let r=this.determineView(e,t,i,n);if(this._willRenderAboveCursor(t,s,r))switch(r){case gt.LineReplacement:case gt.WordReplacements:r=gt.SideBySide;break}this._previousView={id:this.getCacheId(e),view:r,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const a=i.flatMap(f=>f.innerChanges??[]),l=this._editor.getModel(),c=a.map(f=>({originalRange:f.originalRange,modifiedRange:f.modifiedRange,original:l.getValueInRange(f.originalRange),modified:n.getValueOfRange(f.modifiedRange)})),d=s.cursorPosition,h=c.length===0?!1:c[0].modified.startsWith(l.getEOL()),u={cursorColumnDistance:s.edit.replacements.length===0?0:s.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:s.lineEdit.lineRange.startLineNumber-d.lineNumber+(h&&s.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:s.lineEdit.lineRange.length,lineCountModified:s.lineEdit.newLines.length,characterCountOriginal:c.reduce((f,p)=>f+p.original.length,0),characterCountModified:c.reduce((f,p)=>f+p.modified.length,0),disjointReplacements:c.length,sameShapeReplacements:c.every(f=>f.original===c[0].original&&f.modified===c[0].modified)};switch(r){case gt.InsertionInline:return{kind:gt.InsertionInline,viewData:u};case gt.SideBySide:return{kind:gt.SideBySide,viewData:u};case gt.Collapsed:return{kind:gt.Collapsed,viewData:u};case gt.Custom:return{kind:gt.Custom,displayLocation:e.displayLocation,viewData:u}}if(r===gt.Deletion)return{kind:gt.Deletion,originalRange:s.originalLineRange,deletions:a.map(f=>f.originalRange),viewData:u};if(r===gt.InsertionMultiLine){const f=a[0];return{kind:gt.InsertionMultiLine,lineNumber:f.originalRange.startLineNumber,column:f.originalRange.startColumn,text:n.getValueOfRange(f.modifiedRange),viewData:u}}const g=c.map(f=>new Fi(f.originalRange,f.modified));if(g.length!==0){if(r===gt.WordReplacements){let f=gIe(g,s.originalText);return f.some(p=>p.range.isEmpty())&&(f=nV(g,s.originalText)),{kind:gt.WordReplacements,replacements:f,viewData:u}}if(r===gt.LineReplacement)return{kind:gt.LineReplacement,originalRange:s.originalLineRange,modifiedRange:s.modifiedLineRange,modifiedLines:s.modifiedLineRange.mapToLineArray(f=>n.getLineAt(f)),replacements:a.map(f=>({originalRange:f.originalRange,modifiedRange:f.modifiedRange})),viewData:u}}}_willRenderAboveCursor(e,t,i){if(this._useCodeShifting.read(e)==="always")return!1;for(const s of t.multiCursorPositions)if(i===gt.WordReplacements&&s.lineNumber===t.originalLineRange.startLineNumber+1||i===gt.LineReplacement&&s.lineNumber>=t.originalLineRange.endLineNumberExclusive&&s.lineNumber=e}};nP=dIe([hIe(5,pe)],nP);function nX(o){return o.every(t=>t.innerChanges.every(i=>e(i)));function e(t){return!(!t.originalRange.isEmpty()||!(t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber))}}function uIe(o,e){if(!e||!nX(o))return!1;const t=e;return o.every(n=>n.innerChanges.every(s=>i(s)));function i(n){const s=n.originalRange.getStartPosition();return!!(t.isBeforeOrEqual(s)||s.lineNumberi.innerChanges??[]);if(e.length!==1)return!1;const t=e[0];return!(!t.originalRange.isEmpty()||t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber)}function iV(o,e,t){return o.map(n=>({original:e.originalText.getValueOfRange(n.originalRange),modified:t.getValueOfRange(n.modifiedRange)})).every(({original:n,modified:s})=>s.trim()===""&&n.length>0&&(n.length>s.length||n.trim()!==""))}function gIe(o,e){return sX(o,e,t=>/^[a-zA-Z]$/.test(t))}function nV(o,e){return sX(o,e,t=>!/^\s$/.test(t))}function sX(o,e,t){const i=[];o.sort((s,r)=>D.compareRangesUsingStarts(s.range,r.range));for(const s of o){let r=s.range.startColumn-1,a=s.range.endColumn-2,l="",c="";const d=e.getLineAt(s.range.startLineNumber),h=e.getLineAt(s.range.endLineNumber);if(n(d[r]))for(;n(d[r-1]);)l=d[r-1]+l,r--;if(n(h[a])||a0&&D.areIntersectingOrTouching(i[i.length-1].range,u.range)&&(u=Fi.joinReplacements([i.pop(),u],e)),i.push(u)}function n(s){return s===void 0?!1:t(s)}return i}function fIe(o,e){const t=o.model.inlineEdit.edit.replacements;if(t.length!==1)return 0;const i=e.getModel();if(!i)return 0;const n=i.getEOL(),s=t[0];if(s.range.isEmpty()&&s.text.startsWith(n)){const r=e.getLineHeightForPosition(s.range.getStartPosition());return pIe(s.text,n)*r}return 0}function pIe(o,e){if(!e.length)return 0;let t=0,i=0;for(;o.startsWith(e,i);)t++,i+=e.length;return t}var mIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_Ie=function(o,e){return function(t,i){e(t,i,o)}};let sP=class extends F{static{this.hot=nk(this)}constructor(e,t,i,n,s){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=n,this._inlineEdit=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._edit.read(r);if(!l)return;const c=this._editor.getModel();if(!c)return;const d=a.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;if(!d)return;const h=d.replacements.map(f=>{const p=D.fromPositions(c.getPositionAt(f.replaceRange.start),c.getPositionAt(f.replaceRange.endExclusive));return new Fi(p,f.newText)}),u=new yo(h),g=new lf(c);return new qY(g,u,a.primaryPosition.read(void 0),a.allPositions.read(void 0),l.commands,l.inlineCompletion)}),this._inlineEditModel=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._inlineEdit.read(r);if(!l)return;const c=$(this,d=>{if(this._editorObs.isFocused.read(d)){if(a.tabShouldJumpToInlineEdit.read(d))return is.Jump;if(a.tabShouldAcceptInlineEdit.read(d))return is.Accept}return is.Inactive});return new KY(a,l,c)}),this._inlineEditHost=$(this,r=>{const a=this._model.read(r);if(a)return new hke(a)}),this._ghostTextIndicator=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=a.inlineCompletionState.read(r);if(!l)return;const c=l.inlineCompletion;if(!c||!c.showInlineEditMenu)return;const d=Ce.ofLength(l.primaryGhostText.lineNumber,1);return new uke(this._editor,a,d,c)}),this._editorObs=oi(this._editor),this._register(s.createInstance(nP,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}};sP=mIe([_Ie(4,pe)],sP);var bIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CIe=function(o,e){return function(t,i){e(t,i,o)}};let oP=class extends F{constructor(e,t,i,n){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=n,this._ghostTexts=$(this,s=>this._model.read(s)?.ghostTexts.read(s)??[]),this._stablizedGhostTexts=Sxe(this._ghostTexts,this._store),this._editorObs=oi(this._editor),this._ghostTextWidgets=y4(this,this._stablizedGhostTexts,(s,r)=>br(a=>this._instantiationService.createInstance(Cw.hot.read(a),this._editor,{ghostText:s,warning:this._model.map((l,c)=>{const d=l?.warning?.read(c);return d?{icon:d.icon}:void 0}),minReservedLineCount:Ot(0),targetTextModel:this._model.map(l=>l?.textModel),handleInlineCompletionShown:this._model.map((l,c)=>{const d=l?.inlineCompletionState.read(c)?.inlineCompletion;return d?h=>l.handleInlineSuggestionShown(d,gt.GhostText,h):()=>{}})},this._editorObs.getOption(71).map(l=>({syntaxHighlightingEnabled:l.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(r)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=$(this,s=>this._model.read(s)?.inlineEditState.read(s)?.inlineEdit),this._everHadInlineEdit=Ed(this,(s,r)=>r||!!this._inlineEdit.read(s)||!!this._model.read(s)?.inlineCompletionState.read(s)?.inlineCompletion?.showInlineEditMenu),this._inlineEditWidget=br(s=>{if(this._everHadInlineEdit.read(s))return this._instantiationService.createInstance(sP.hot.read(s),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(s=>s.fontFamily),this._register(Hoe($(s=>` +`,n=new Kn().appendCodeblock("empty",s),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!C5(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const s=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=s,this._type.title=s,ro(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(s))}else xn(this._type),this._type.title="",Ss(this._type),this.domNode.classList.add("no-type");if(xn(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),xn(this._docs);const s=this._markdownRendererService.render(n,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(s.element),this._renderDisposeable.add(s)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!n),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},this._close.onclick=s=>{s.preventDefault(),s.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new at(e,t);at.equals(i,this._size)||(this._size=i,JJ(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}};DM=xxe([Q8(1,ci),Q8(2,aa)],DM);class Lxe{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new z,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new wF,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=Ch(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new at(220,2*s.lineHeight),a=e.top,l=(function(){const S=n.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),x=-s.borderWidth+e.left+e.width,k=new at(S,n.height-e.top-s.borderHeight-s.verticalPadding),D=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:x,fit:S-t.width,maxSizeTop:k,maxSizeBottom:D,minSize:r.with(Math.min(S,r.width))}})(),c=(function(){const S=e.left-s.borderWidth-s.horizontalPadding,x=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),k=new at(S,n.height-e.top-s.borderHeight-s.verticalPadding),D=k.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:x,fit:S-t.width,maxSizeTop:k,maxSizeBottom:D,minSize:r.with(Math.min(S,r.width))}})(),d=(function(){const S=e.left,x=-s.borderWidth+e.top+e.height,k=new at(e.width-s.borderHeight,n.height-e.top-e.height-s.verticalPadding);return{top:x,left:S,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}})(),h=[l,c,d],u=h.find(S=>S.fit>=0)??h.sort((S,x)=>x.fit-S.fit)[0],g=e.top+e.height-s.borderHeight;let f,p=t.height;const _=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);p>_&&(p=_);let b;i?p<=u.maxSizeTop.height?(f=!0,b=u.maxSizeTop):(f=!1,b=u.maxSizeBottom):p<=u.maxSizeBottom.height?(f=!1,b=u.maxSizeBottom):(f=!0,b=u.maxSizeTop);let{top:C,left:w}=u;!f&&p>e.height&&(C=g-p);const v=this._editor.getDomNode();if(v){const S=v.getBoundingClientRect();C-=S.top,w-=S.left}this._applyTopLeft({left:w,top:C}),this._resizable.enableSashes(!f,u===l,f,u!==l),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(p,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const J8=We("fileService");var wl;(function(o){o[o.FILE=0]="FILE",o[o.FOLDER=1]="FOLDER",o[o.ROOT_FOLDER=2]="ROOT_FOLDER"})(wl||(wl={}));const kxe=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Q1(o,e,t,i,n){if(Se.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(_e.isUri(n))return[];const s=i===wl.ROOT_FOLDER?["rootfolder-icon"]:i===wl.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===Le.data)r=Sh.parseMetaData(t).get(Sh.META_DATA_LABEL);else{const a=t.path.match(kxe);a?(r=J1(a[2].toLowerCase()),a[1]&&s.push(`${J1(a[1].toLowerCase())}-name-dir-icon`)):r=J1(t.authority.toLowerCase())}if(i===wl.ROOT_FOLDER)s.push(`${r}-root-name-folder-icon`);else if(i===wl.FOLDER)s.push(`${r}-name-folder-icon`);else{if(r){if(s.push(`${r}-name-file-icon`),s.push("name-file-icon"),r.length<=255){const l=r.split(".");for(let c=1;c=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XI=function(o,e){return function(t,i){e(t,i,o)}};const Exe=Ht("suggest-more-info",G.chevronRight,m(1492,"Icon for more information in the suggest widget.")),Nxe=new class mb{static{this._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/}static{this._regexStrict=new RegExp(`^${mb._regexRelaxed.source}$`,"i")}extract(e,t){if(e.textLabel.match(mb._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(mb._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,n=mb._regexRelaxed.exec(i);if(n&&(n.index===0||n.index+n[0].length===i.length))return t[0]=n[0],!0}return!1}};let IM=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new P,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new z,i=e;i.classList.add("show-file-icons");const n=Z(e,J(".icon")),s=Z(n,J("span.colorspan")),r=Z(e,J(".contents")),a=Z(r,J(".main")),l=Z(a,J(".icon-label.codicon")),c=Z(a,J("span.left")),d=Z(a,J("span.right")),h=new Dv(c,{supportHighlights:!0,supportIcons:!0});t.add(h);const u=Z(c,J("span.signature-label")),g=Z(c,J("span.qualifier-label")),f=Z(d,J("span.details-label")),p=Z(d,J("span.readMore"+Se.asCSSSelector(Exe)));return p.title=m(1493,"Read More"),{root:i,left:c,right:d,icon:n,colorspan:s,iconLabel:h,iconContainer:l,parametersLabel:u,qualifierLabel:g,detailsLabel:f,readMore:p,disposables:t,configureFont:()=>{const b=this._editor.getOptions(),C=b.get(59),w=C.getMassagedFontFamily(),v=C.fontFeatureSettings,S=C.fontVariationSettings,x=b.get(135)||C.fontSize,k=b.get(136)||C.lineHeight,D=C.fontWeight,I=C.letterSpacing,T=`${x}px`,F=`${k}px`,O=`${I}px`;i.style.fontSize=T,i.style.fontWeight=D,i.style.letterSpacing=O,a.style.fontFamily=w,a.style.fontFeatureSettings=v,a.style.fontVariationSettings=S,a.style.lineHeight=F,n.style.height=F,n.style.width=F,p.style.height=F,p.style.width=F}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:Lw(e.score)},r=[];if(n.kind===19&&Nxe.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Q1(this._modelService,this._languageService,_e.from({scheme:"fake",path:e.textLabel}),wl.FILE),l=Q1(this._modelService,this._languageService,_e.from({scheme:"fake",path:n.detail}),wl.FILE);s.extraClasses=a.length>l.length?a:l}else n.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",s.extraClasses=[Q1(this._modelService,this._languageService,_e.from({scheme:"fake",path:e.textLabel}),wl.FOLDER),Q1(this._modelService,this._languageService,_e.from({scheme:"fake",path:n.detail}),wl.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Se.asClassNameArray(km.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,s),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=QI(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=QI(n.label.detail||""),i.detailsLabel.textContent=QI(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?ro(i.detailsLabel):Ss(i.detailsLabel),C5(e)?(i.right.classList.add("can-expand-details"),ro(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Ss(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};IM=Ixe([XI(1,ei),XI(2,_i),XI(3,ci)],IM);function QI(o){return o.replace(/\r\n|\r|\n/g,"")}var Txe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eS=function(o,e){return function(t,i){e(t,i,o)}},ep;E("editorSuggestWidget.background",Vo,m(1473,"Background color of the suggest widget."));E("editorSuggestWidget.border",OO,m(1474,"Border color of the suggest widget."));const Rxe=E("editorSuggestWidget.foreground",Hl,m(1475,"Foreground color of the suggest widget."));E("editorSuggestWidget.selectedForeground",VC,m(1476,"Foreground color of the selected entry in the suggest widget."));E("editorSuggestWidget.selectedIconForeground",KO,m(1477,"Icon foreground color of the selected entry in the suggest widget."));const Mxe=E("editorSuggestWidget.selectedBackground",zC,m(1478,"Background color of the selected entry in the suggest widget."));E("editorSuggestWidget.highlightForeground",lp,m(1479,"Color of the match highlights in the suggest widget."));E("editorSuggestWidget.focusHighlightForeground",doe,m(1480,"Color of the match highlights in the suggest widget when an item is focused."));E("editorSuggestWidgetStatus.foreground",Re(Rxe,.5),m(1481,"Foreground color of the suggest widget status."));class Pxe{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof rd}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(at.is(t))return at.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let EM=class{static{ep=this}static{this.LOADING_MESSAGE=m(1482,"Loading...")}static{this.NO_SUGGESTIONS_MESSAGE=m(1483,"No suggestions.")}constructor(e,t,i,n,s){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new ut,this._pendingShowDetails=new ut,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new mo,this._disposables=new z,this._onDidSelect=new xg,this._onDidFocus=new xg,this._onDidHide=new P,this._onDidShow=new P,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new P,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new wF,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Axe(this,e),this._persistedSize=new Pxe(t,e);class r{constructor(g,f,p=!1,_=!1){this.persistedSize=g,this.currentSize=f,this.persistHeight=p,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:g,defaultSize:f}=this.getLayoutInfo(),p=Math.round(g/2);let{width:_,height:b}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-b)<=p)&&(b=a.persistedSize?.height??f.height),(!a.persistWidth||Math.abs(a.currentSize.width-_)<=p)&&(_=a.persistedSize?.width??f.width),this._persistedSize.store(new at(_,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Z(this.element.domNode,J(".message")),this._listElement=Z(this.element.domNode,J(".tree"));const l=this._disposables.add(s.createInstance(DM,this.editor));l.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new Lxe(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);c();const d=s.createInstance(IM,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Qo("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>Ln?"listitem":"option",getWidgetAriaLabel:()=>m(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let g=u.textLabel;const f=km.toLabel(u.completion.kind);if(typeof u.completion.label!="string"){const{detail:C,description:w}=u.completion.label;C&&w?g=m(1485,"{0} {1}, {2}, {3}",g,C,w,f):C?g=m(1486,"{0} {1}, {2}",g,C,f):w&&(g=m(1487,"{0}, {1}, {2}",g,w,f))}else g=m(1488,"{0}, {1}",g,f);if(!u.isResolved||!this._isDetailsVisible())return g;const{documentation:p,detail:_}=u.completion,b=Lg("{0}{1}",_||"",p?typeof p=="string"?p:p.value:"");return m(1489,"{0}, docs: {1}",g,b)}}}),this._list.style(gf({listInactiveFocusBackground:Mxe,listInactiveFocusOutline:Gt})),this._status=s.createInstance(kM,this.element.domNode,mh);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);h(),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(134)&&(h(),c()),this._completionModel&&(u.hasChanged(59)||u.hasChanged(135)||u.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Be.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Be.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Be.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Be.HasFocusedSuggestion.bindTo(i),this._disposables.add(Li(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onListFocus(e){if(this._ignoreFocusEvents)return;if(this._state===5&&this._setState(3),!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=$i(async n=>{const s=Gc(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),r=n.onCancellationRequested(()=>s.dispose());try{return await t.resolve(n)}finally{s.dispose(),r.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))}).catch(Ee)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Ss(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=ep.LOADING_MESSAGE,Ss(this._listElement,this._status.element),ro(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Pa(ep.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=ep.NO_SUGGESTIONS_MESSAGE,Ss(this._listElement,this._status.element),ro(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Pa(ep.NO_SUGGESTIONS_MESSAGE);break;case 3:Ss(this._messageElement),ro(this._listElement,this._status.element),this._show();break;case 4:Ss(this._messageElement),ro(this._listElement,this._status.element),this._show();break;case 5:Ss(this._messageElement),ro(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Gc(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,s){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(n?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,t===0?0:this.getLayoutInfo().itemHeight*.33),this._list.setFocus(s?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=E0(pe(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._list.setFocus(this._list.getFocus()),this._setState(3)):this._state===3&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(C5(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=E0(pe(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightr&&(s=r);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:s,l=i.statusBarHeight+this._list.contentHeight+i.borderHeight,c=i.itemHeight+i.statusBarHeight,d=pi(this.editor.getDomNode()),h=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),u=d.top+h.top+h.height,g=Math.min(t.height-u-i.verticalPadding,l),f=d.top+h.top-i.verticalPadding,p=Math.min(f,l);let _=Math.min(Math.max(p,g)+i.borderHeight,l);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),n_&&(n=_),n>g&&p>g||this._forceRenderingAbove&&f>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),_=p):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),_=g),this.element.preferredSize=new at(a,i.defaultSize.height),this.element.maxSize=new at(r,_),this.element.minSize=new at(220,c),this._cappedHeight=n===l?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(s,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(t-s,e),this._listElement.style.height=`${t-s}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,this._contentWidget.getPosition()?.preference[0]===2)}getLayoutInfo(){const e=this.editor.getOption(59),t=ws(this.editor.getOption(136)||e.lineHeight,8,1e3),i=!this.editor.getOption(134).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.getLayoutInfo().borderWidth,s=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:s,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new at(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};EM=ep=Txe([eS(1,ps),eS(2,Ie),eS(3,ci),eS(4,fe)],EM);class Axe{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new at(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var Oxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Vf=function(o,e){return function(t,i){e(t,i,o)}},NM;class Fxe{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Te.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),s=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(L.fromPositions(t,s),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let ka=class{static{NM=this}static{this.ID="editor.contrib.suggestController"}static get(e){return e.getContribution(NM.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,n,s,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=s,this._logService=r,this._telemetryService=a,this._lineSuffix=new ut,this._toDispose=new z,this._selectors=new Wxe(h=>h.priority),this._onWillInsertSuggestItem=new P,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=s.createInstance(wx,this.editor),this._selectors.register({priority:0,select:(h,u,g)=>this._memoryService.select(h,u,g)});const l=Be.InsertMode.bindTo(n);l.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(134).insertMode))),this.widget=this._toDispose.add(new DD(pe(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(EM,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(_=>this._insertSuggestion(_,0),this));const u=new Cxe(this.editor,h,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(u);const g=Be.MakesTextEdit.bindTo(this._contextKeyService),f=Be.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=Be.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(ue(()=>{g.reset(),f.reset(),p.reset()})),this._toDispose.add(h.onDidFocus(({item:_})=>{const b=this.editor.getPosition(),C=_.editStart.column,w=b.column;let v=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&w-C===_.completion.insertText.length&&(v=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:C,endLineNumber:b.lineNumber,endColumn:w})!==_.completion.insertText),g.set(v),f.set(!R.equals(_.editInsertEnd,_.editReplaceEnd)),p.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Kc(!0,!1,!1,!1,33))||ze&&_.toKeyCodeChord().equals(new Kc(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&h.forceRenderingAbove(),h})),this._overtypingCapturer=this._toDispose.add(new DD(pe(e.getDomNode()),()=>this._toDispose.add(new b5(this.editor,this.model)))),this._alternatives=this._toDispose.add(new DD(pe(e.getDomNode()),()=>this._toDispose.add(new zm(this.editor,this._contextKeyService)))),this._toDispose.add(s.createInstance(vx,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new Fxe(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const f of this._selectors.itemsOrderedByPriorityDesc)if(u=f.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===0)return;let g=!1;if(h.triggerOptions.auto){const f=this.editor.getOption(134);f.selectionMode==="never"||f.selectionMode==="always"?g=f.selectionMode==="never":f.selectionMode==="whenTriggerCharacter"?g=h.triggerOptions.triggerKind!==1:f.selectionMode==="whenQuickSuggestion"&&(g=h.triggerOptions.triggerKind===1&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,g)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=Be.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const h=this.editor.getOption(1);c.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=gs.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),s=n.getAlternativeVersionId(),{item:r}=e,a=[],l=new qt;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(n,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const f=Wa.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(p=>{let _=L.lift(p.range);if(_.startLineNumber===r.position.lineNumber&&_.startColumn>r.position.column){const b=this.editor.getPosition().column-r.position.column,C=b,w=L.spansMultipleLines(_)?0:b;_=new L(_.startLineNumber,_.startColumn+C,_.endLineNumber,_.endColumn+w)}return gi.replaceMove(_,p.text)})),f.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const f=new rn;let p;const _=n.onDidChangeContent(v=>{if(v.isFlush){l.cancel(),_.dispose();return}for(const S of v.changes){const x=L.getEndPosition(S.range);(!p||R.isBefore(x,p))&&(p=x)}}),b=t;t|=2;let C=!1;const w=this.editor.onWillType(()=>{w.dispose(),C=!0,b&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&r.completion.additionalTextEdits.some(S=>R.isBefore(p,L.getStartPosition(S.range))))return!1;C&&this.editor.pushUndoStop();const v=Wa.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(S=>gi.replaceMove(L.lift(S.range),S.text))),v.restoreRelativeVerticalPositionOfCursor(this.editor),(C||!(b&2))&&this.editor.pushUndoStop(),!0}).then(v=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",f.elapsed(),v),u=v===!0?1:v===!1?0:-2}).finally(()=>{_.dispose(),w.dispose()}))}let{insertText:g}=r.completion;if(r.completion.insertTextRules&4||(g=Hg.escape(g)),this.model.cancel(),i.insert(g,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:jn.suggest({providerId:ek.fromExtensionId(r.extensionId?.value)})}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===Kk.id)this.model.trigger({auto:!0,retrigger:!0});else{const f=new rn;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(p=>{r.completion.extensionId?Ri(p):Ee(p)}).finally(()=>{h=f.elapsed()}))}t&4&&this._alternatives.value.set(e,f=>{for(l.cancel();n.canUndo();){s!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(f,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,d,h,u,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,s,r,a){if(Math.random()>1e-4)return;const l=new Map;for(let u=0;u1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:uw(Lr(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Kee(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:s,index:r,firstIndex:h})}getOverwriteInfo(e,t){Je(this.editor.hasModel());let i=this.editor.getOption(134).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,s=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+r,overwriteAfter:s+a}}_alertCompletionItem(e){if(us(e.completion.additionalTextEdits)){const t=m(1463,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Is(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=s=>{if(s.completion.insertTextRules&4||s.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=s.editStart.column,l=r.column;return l-a!==s.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==s.completion.insertText};te.once(this.model.onDidTrigger)(s=>{const r=[];te.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{pt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(pt(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!n(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}};ka=NM=Oxe([Vf(1,qk),Vf(2,Pt),Vf(3,Ie),Vf(4,fe),Vf(5,Mt),Vf(6,ts)],ka);class Wxe{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class Kk extends le{static{this.id="editor.action.triggerSuggest"}constructor(){super({id:Kk.id,label:H(1471,"Trigger Suggest"),precondition:q.and(N.writable,N.hasCompletionItemProvider,Be.Visible.toNegated()),kbOpts:{kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=ka.get(t);if(!n)return;let s;i&&typeof i=="object"&&i.auto===!0&&(s=!0),n.triggerSuggest(void 0,s,void 0)}}Xe(ka.ID,ka,2);se(Kk);const Yo=190,Ps=Ki.bindToContribution(ka.get);re(new Ps({id:"acceptSelectedSuggestion",precondition:q.and(Be.Visible,Be.HasFocusedSuggestion),handler(o){o.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:q.and(Be.Visible,N.textInputFocus),weight:Yo},{primary:3,kbExpr:q.and(Be.Visible,N.textInputFocus,Be.AcceptSuggestionsOnEnter,Be.MakesTextEdit),weight:Yo}],menuOpts:[{menuId:mh,title:m(1464,"Insert"),group:"left",order:1,when:Be.HasInsertAndReplaceRange.toNegated()},{menuId:mh,title:m(1465,"Insert"),group:"left",order:1,when:q.and(Be.HasInsertAndReplaceRange,Be.InsertMode.isEqualTo("insert"))},{menuId:mh,title:m(1466,"Replace"),group:"left",order:1,when:q.and(Be.HasInsertAndReplaceRange,Be.InsertMode.isEqualTo("replace"))}]}));re(new Ps({id:"acceptAlternativeSelectedSuggestion",precondition:q.and(Be.Visible,N.textInputFocus,Be.HasFocusedSuggestion),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:1027,secondary:[1026]},handler(o){o.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:mh,group:"left",order:2,when:q.and(Be.HasInsertAndReplaceRange,Be.InsertMode.isEqualTo("insert")),title:m(1467,"Replace")},{menuId:mh,group:"left",order:2,when:q.and(Be.HasInsertAndReplaceRange,Be.InsertMode.isEqualTo("replace")),title:m(1468,"Insert")}]}));Ye.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");re(new Ps({id:"hideSuggestWidget",precondition:Be.Visible,handler:o=>o.cancelSuggestWidget(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:9,secondary:[1033]}}));re(new Ps({id:"selectNextSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectNextSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));re(new Ps({id:"selectNextPageSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectNextPageSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:12,secondary:[2060]}}));re(new Ps({id:"selectLastSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectLastSuggestion()}));re(new Ps({id:"selectPrevSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectPrevSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));re(new Ps({id:"selectPrevPageSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectPrevPageSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:11,secondary:[2059]}}));re(new Ps({id:"selectFirstSuggestion",precondition:q.and(Be.Visible,q.or(Be.MultipleSuggestions,Be.HasFocusedSuggestion.negate())),handler:o=>o.selectFirstSuggestion()}));re(new Ps({id:"focusSuggestion",precondition:q.and(Be.Visible,Be.HasFocusedSuggestion.negate()),handler:o=>o.focusSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));re(new Ps({id:"focusAndAcceptSuggestion",precondition:q.and(Be.Visible,Be.HasFocusedSuggestion.negate()),handler:o=>{o.focusSuggestion(),o.acceptSelectedSuggestion(!0,!1)}}));re(new Ps({id:"toggleSuggestionDetails",precondition:q.and(Be.Visible,Be.HasFocusedSuggestion),handler:o=>o.toggleSuggestionDetails(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:mh,group:"right",order:1,when:q.and(Be.DetailsVisible,Be.CanResolve),title:m(1469,"Show Less")},{menuId:mh,group:"right",order:1,when:q.and(Be.DetailsVisible.toNegated(),Be.CanResolve),title:m(1470,"Show More")}]}));re(new Ps({id:"toggleExplainMode",precondition:Be.Visible,handler:o=>o.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));re(new Ps({id:"toggleSuggestionFocus",precondition:Be.Visible,handler:o=>o.toggleSuggestionFocus(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:2570,mac:{primary:778}}}));re(new Ps({id:"insertBestCompletion",precondition:q.and(N.textInputFocus,q.equals("config.editor.tabCompletion","on"),vx.AtEnd,Be.Visible.toNegated(),zm.OtherSuggestions.toNegated(),gs.InSnippetMode.toNegated()),handler:(o,e)=>{o.triggerSuggestAndAcceptBest(Ui(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:Yo,primary:2}}));re(new Ps({id:"insertNextSuggestion",precondition:q.and(N.textInputFocus,q.equals("config.editor.tabCompletion","on"),zm.OtherSuggestions,Be.Visible.toNegated(),gs.InSnippetMode.toNegated()),handler:o=>o.acceptNextSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:2}}));re(new Ps({id:"insertPrevSuggestion",precondition:q.and(N.textInputFocus,q.equals("config.editor.tabCompletion","on"),zm.OtherSuggestions,Be.Visible.toNegated(),gs.InSnippetMode.toNegated()),handler:o=>o.acceptPrevSuggestion(),kbOpts:{weight:Yo,kbExpr:N.textInputFocus,primary:1026}}));se(class extends le{constructor(){super({id:"editor.action.resetSuggestSize",label:H(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(o,e){ka.get(e)?.resetWidgetSize()}});class Bxe extends A{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new P),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=ka.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,l,c)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?Mc(h,d):void 0;if(!u)return-1;const g=R.lift(l),f=c.map((_,b)=>{const C=sC.fromSuggestion(n,d,g,_,this.isShiftKeyPressed),w=Mc(C.getSingleTextEdit(),d),v=qG(u,w);return{index:b,valid:v,prefixLength:w.text.length,suggestItem:_}}).filter(_=>_&&_.valid&&_.prefixLength>0),p=JO(f,Bn(_=>_.prefixLength,uo));return p?p.index:-1}}));let s=!1;const r=()=>{s||(s=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(te.once(n.model.onDidTrigger)(a=>{r()})),this._register(n.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const d=sC.fromSuggestion(n,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Hxe(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=ka.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return sC.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){ka.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){ka.get(this.editor)?.forceRenderingAbove()}}class sC{static fromSuggestion(e,t,i,n,s){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&4){const c=new Hg().parse(r);c.children.length<100&&mx.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(n,s);return new sC(L.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,n.completion.kind,a,n.container.incomplete??!1)}constructor(e,t,i,n,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n,this.listIncomplete=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new c$(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new Ni(this.range,this.insertText)}}function Hxe(o,e){return o===e?!0:!o||!e?!1:o.equals(e)}class Vxe extends A{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new Bxe(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),n=>this._editorObs.forceUpdate(s=>{this._handleSuggestAccepted(n)}))),this.selectedItem=dt(this,n=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(s=>n(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class zxe{constructor(e,t){this.lineNumber=e,this.columnRange=t}}class eH{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ce(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new L(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new ge(this.startColumn-1,this.endColumnExclusive-1)}}class tg{static fromLineTokens(e){const t=[];for(let i=0;i({text:i.text,metadata:i.metadata})),e)}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=new ge(i,i+n.text.length);t.push(e(s,n)),i+=n.text.length}return t}slice(e){const t=[];let i=0;for(const n of this._tokenInfo){const s=i,r=s+n.text.length;if(r>e.start){if(s>=e.endExclusive)break;const a=Math.max(0,e.start-s),l=Math.max(0,r-e.endExclusive);t.push(new tH(n.text.slice(a,n.text.length-l),n.metadata))}i+=n.text.length}return tg.create(t)}append(e){const t=this._tokenInfo.concat(e._tokenInfo);return tg.create(t)}}class tH{constructor(e,t){this.text=e,this.metadata=t}}var Uxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$xe=function(o,e){return function(t,i){e(t,i,o)}};const tZ="ghost-text";let Av=class extends A{static{this.hot=lk(this)}constructor(e,t,i,n,s,r){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=n,this._isClickable=s,this._languageService=r,this._isDisposed=De(this,!1),this._editorObs=Jt(this._editor),this._warningState=$(a=>{const l=this._model.ghostText.read(a);if(!l)return;const c=this._model.warning.read(a);if(c)return{lineNumber:l.lineNumber,position:new R(l.lineNumber,l.parts[0].column),icon:c.icon}}),this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(a=>a.syntaxHighlightingEnabled),this._extraClassNames=$(this,a=>{const l=[...this._options.read(a).extraClasses??[]];return this._useSyntaxHighlighting.read(a)&&l.push("syntax-highlighted"),this._warningState.read(a)&&l.push("warning"),l.map(d=>` ${d}`).join("")}),this.uiState=$(this,a=>{if(this._isDisposed.read(a))return;const l=this._editorObs.model.read(a);if(l!==this._model.targetTextModel.read(a))return;const c=this._model.ghostText.read(a);if(!c)return;const d=c instanceof uM?c.columnRange:void 0,h=this._useSyntaxHighlighting.read(a),u=this._extraClassNames.read(a),{inlineTexts:g,additionalLines:f,hiddenRange:p,additionalLinesOriginalSuffix:_}=jxe(c,l,tZ+u),b=l.getLineContent(c.lineNumber),C=new Ra(g.map(F=>yn.insert(F.column-1,F.text))),w=h?l.tokenization.tokenizeLinesAt(c.lineNumber,[C.apply(b),...f.map(F=>F.content)]):void 0,v=C.getNewRanges(),S=g.map((F,O)=>({...F,tokens:w?.[0]?.getTokensInRange(v[O])})),x=f.map((F,O)=>{let B=w?.[O+1]??$t.createEmpty(F.content,this._languageService.languageIdCodec);if(O===f.length-1&&_){const K=tg.fromLineTokens(l.tokenization.getLineTokens(_.lineNumber)).slice(_.columnRange.toZeroBasedOffsetRange());B=tg.fromLineTokens(B).append(K).toLineTokens(B.languageIdCodec)}return{content:B,decorations:F.decorations}}),k=this._editor.getSelection()?.getStartPosition().column,D=S.filter(F=>F.text!==""),I=D.length!==0,T={cursorColumnDistance:(I?D[0].column:1)-k,cursorLineDistance:I?0:f.findIndex(F=>F.content!=="")+1,lineCountOriginal:I?1:0,lineCountModified:f.length+(I?1:0),characterCountOriginal:0,characterCountModified:I0(D.map(F=>F.text.length))+I0(x.map(F=>F.content.getTextLength())),disjointReplacements:D.length+(f.length>0?1:0),sameShapeReplacements:D.length>1&&x.length===0?D.every(F=>F.text===D[0].text):void 0};return this._model.handleInlineCompletionShown.read(a)?.(T),{replacedRange:d,inlineTexts:S,additionalLines:x,hiddenRange:p,lineNumber:c.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(a),targetTextModel:l,syntaxHighlightingEnabled:h}}),this.decorations=$(this,a=>{const l=this.uiState.read(a);if(!l)return[];const c=[],d=this._extraClassNames.read(a);l.replacedRange&&c.push({range:l.replacedRange.toRange(l.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+d,description:"GhostTextReplacement"}}),l.hiddenRange&&c.push({range:l.hiddenRange.toRange(l.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const h of l.inlineTexts)c.push({range:L.fromPositions(new R(l.lineNumber,h.column)),options:{description:"ghost-text-decoration",after:{content:h.text,tokens:h.tokens,inlineClassName:(h.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+d+h.lineDecorations.map(u=>" "+u.className).join(" "),cursorStops:dr.Left,attachedData:new JI(this)},showIfCollapsed:!0}});return c}),this._additionalLinesWidget=this._register(new qxe(this._editor,$(a=>{const l=this.uiState.read(a);return l?{lineNumber:l.lineNumber,additionalLines:l.additionalLines,minReservedLineCount:l.additionalReservedLineCount,targetTextModel:l.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(a=>a.target.type===6&&a.target.detail.injectedText?.options.attachedData instanceof JI&&a.target.detail.injectedText.options.attachedData.owner===this,this._store),this.isHovered=$(this,a=>this._isDisposed.read(a)?!1:this._isInlineTextHovered.read(a)||this._additionalLinesWidget.isHovered.read(a)),this.height=$(this,a=>this._editorObs.getOption(75).read(a)+(this._additionalLinesWidget.viewZoneHeight.read(a)??0)),this._register(ue(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(a=>this._onDidClick.fire(a))),this._register(this._editor.onMouseUp(a=>{if(a.target.type!==6)return;const l=a.target.detail.injectedText?.options.attachedData;l instanceof JI&&l.owner===this&&this._onDidClick.fire(a.event)}))),this._register(Xn((a,l)=>{}))}static getWarningWidgetContext(e){const t=e.ghostTextViewWarningWidgetData;if(t)return t;if(e.parentElement)return this.getWarningWidgetContext(e.parentElement)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}};Av=Uxe([$xe(5,_i)],Av);class JI{constructor(e){this.owner=e}}function jxe(o,e,t){const i=[],n=[];function s(h,u){if(n.length>0){const g=n[n.length-1];u&&g.decorations.push(new ds(g.content.length+1,g.content.length+1+h[0].line.length,u,0)),g.content+=h[0].line,h=h.slice(1)}for(const g of h)n.push({content:g.line,decorations:u?[new ds(1,g.line.length+1,u,0),...g.lineDecorations]:[...g.lineDecorations]})}const r=e.getLineContent(o.lineNumber);let a,l=0;for(const h of o.parts){let u=h.lines;a===void 0?(i.push({column:h.column,text:u[0].line,preview:h.preview,lineDecorations:u[0].lineDecorations}),u=u.slice(1)):s([{line:r.substring(l,h.column-1),lineDecorations:[]}],void 0),u.length>0&&(s(u,t),a===void 0&&h.column<=r.length&&(a=h.column)),l=h.column-1}let c;a!==void 0&&(c=new zxe(o.lineNumber,new eH(l+1,r.length+1)));const d=a!==void 0?new eH(a,r.length+1):void 0;return{inlineTexts:i,additionalLines:n,hiddenRange:d,additionalLinesOriginalSuffix:c}}class qxe extends A{get viewZoneId(){return this._viewZoneInfo?.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,n){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=n,this._viewZoneHeight=De("viewZoneHeight",void 0),this.editorOptionsChanged=ao("editorOptionChanged",te.filter(this._editor.onDidChangeConfiguration,s=>s.hasChanged(40)||s.hasChanged(133)||s.hasChanged(113)||s.hasChanged(108)||s.hasChanged(60)||s.hasChanged(59)||s.hasChanged(75))),this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new ut),this.isHovered=Jt(this._editor).isTargetHovered(s=>iH(s.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof Pg&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(s=>this.hasBeenAccepted=s.source==="inlineSuggestion.accept")),this._register(xe(s=>{const r=this._lines.read(s);this.editorOptionsChanged.read(s),r?(this.hasBeenAccepted=!1,this.updateLines(r.lineNumber,r.additionalLines,r.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(e=>{this.removeActiveViewZone(e)})}updateLines(e,t,i){const n=this._editor.getModel();if(!n)return;const{tabSize:s}=n.getOptions();this._editor.changeViewZones(r=>{const a=new z;this.removeActiveViewZone(r);const l=Math.max(t.length,i);if(l>0){const c=document.createElement("div");Kxe(c,s,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(a.add(W(c,"mousedown",d=>{d.preventDefault()})),a.add(W(c,"click",d=>{iH(d.target)&&this._onDidClick.fire(new Wn(pe(d),d))}))),this.addViewZone(r,e,l,c)}this._viewZoneListener.value=a})}addViewZone(e,t,i,n){const s=e.addZone({afterLineNumber:t,heightInLines:i,domNode:n,afterColumnAffinity:1,onComputedHeight:r=>{this._viewZoneHeight.set(r,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:s,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){if(!this._shouldKeepCursorStable)return;const i=this._editor.getSelection()?.getStartPosition()?.lineNumber;i!==void 0&&e`);for(let _=0,b=t.length;_');const v=w.getLineContent(),S=hw(v),x=um(v);h_(new cd(d.isMonospace&&!s,d.canUseHalfwidthRightwardsArrow,v,!1,S,x,0,w,C.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==ur.OFF,null,null,0),g),g.appendString("")}g.appendString(""),gn(o,d);const f=g.build(),p=nH?nH.createHTML(f):f;o.innerHTML=p}const nH=Vl("editorGhostText",{createHTML:o=>o});class v5{static{this.empty=new v5([])}constructor(e){this.replacements=e,CC(rw(e,(t,i)=>t.lineRange.endLineNumberExclusive<=i.lineRange.startLineNumber))}toString(){return this.replacements.map(e=>e.toString()).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(be.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}}class Sx{static fromSingleTextEdit(e,t){const i=bo(e.text);let n=e.range.startLineNumber;const s=t.getValueOfRange(L.fromPositions(new R(e.range.startLineNumber,1),e.range.getStartPosition()));i[0]=s+i[0];let r=e.range.endLineNumber+1;const a=t.getTransformer().getLineLength(e.range.endLineNumber)+1,l=t.getValueOfRange(L.fromPositions(e.range.getEndPosition(),new R(e.range.endLineNumber,a)));i[i.length-1]=i[i.length-1]+l;const c=e.range.startColumn===t.getTransformer().getLineLength(e.range.startLineNumber)+1,d=e.range.endColumn===1;return c&&i[0].length===s.length&&(n++,i.shift()),i.length>0&&n${JSON.stringify(this.newLines)}`}toLineEdit(){return new v5([this])}}class iZ{get lineEdit(){return this.edit.replacements.length===0?new Sx(new be(1,1),[]):Sx.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(be.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,n,s,r){this.originalText=e,this.edit=t,this.cursorPosition=i,this.multiCursorPositions=n,this.commands=s,this.inlineCompletion=r}}class nZ{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??m(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}}class Gxe{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class Zxe{constructor(e,t,i,n){this.lineRange=i;const s=Jt(e),r=$(this,a=>s.isFocused.read(a)&&n.showInlineEditMenu?Gn.Accept:Gn.Inactive);this.model=new nZ(t,new iZ(new Xd(""),new ho([n.getSingleTextEdit()]),t.primaryPosition.get(),t.allPositions.get(),n.source.inlineSuggestions.commands??[],n),r)}}class xt{static fromPoints(e,t){return new xt(e.x,e.y,t.x,t.y)}static fromPointSize(e,t){return new xt(e.x,e.y,e.x+t.x,e.y+t.y)}static fromLeftTopRightBottom(e,t,i,n){return new xt(e,t,i,n)}static fromLeftTopWidthHeight(e,t,i,n){return new xt(e,t,e+i,t+n)}static fromRanges(e,t){return new xt(e.start,t.start,e.endExclusive,t.endExclusive)}static hull(e){let t=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const r of e)t=Math.min(t,r.left),i=Math.min(i,r.top),n=Math.max(n,r.right),s=Math.max(s,r.bottom);return new xt(t,i,n,s)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,n){if(this.left=e,this.top=t,this.right=i,this.bottom=n,e>i)throw new Ce("Invalid arguments: Horizontally offset by "+(e-i));if(t>n)throw new Ce("Invalid arguments: Vertically offset by "+(t-n))}withMargin(e,t,i,n){let s,r,a,l;return t===void 0&&i===void 0&&n===void 0?s=r=a=l=e:i===void 0&&n===void 0?(s=r=t,a=l=e):(s=n,r=t,a=e,l=i),new xt(this.left-s,this.top-a,this.right+r,this.bottom+l)}intersectVertical(e){const t=Math.max(this.top,e.start),i=Math.min(this.bottom,e.endExclusive);return new xt(this.left,t,this.right,Math.max(t,i))}intersectHorizontal(e){const t=Math.max(this.left,e.start),i=Math.min(this.right,e.endExclusive);return new xt(t,this.top,Math.max(t,i),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(e){const t=Math.max(this.left,e.left),i=Math.min(this.right,e.right),n=Math.max(this.top,e.top),s=Math.min(this.bottom,e.bottom);if(!(t>i||n>s))return new xt(t,n,i,s)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(e){const t=this.width,i=this.height;let n=this.left,s=this.top;return ne.right&&(n=e.right-t),se.bottom&&(s=e.bottom-i),new xt(n,s,n+t,s+i)}withWidth(e){return new xt(this.left,this.top,this.left+e,this.bottom)}withHeight(e){return new xt(this.left,this.top,this.right,this.top+e)}withTop(e){return new xt(this.left,e,this.right,this.bottom)}withLeft(e){return new xt(e,this.top,this.right,this.bottom)}translateX(e){return new xt(this.left+e,this.top,this.right+e,this.bottom)}translateY(e){return new xt(this.left,this.top+e,this.right,this.bottom+e)}getLeftBottom(){return new tn(this.left,this.bottom)}getRightBottom(){return new tn(this.right,this.bottom)}getRightTop(){return new tn(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}class oC{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&jt(this.startLineNumbers,e.startLineNumbers)&&jt(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new oC([],[],0)}}const sH=Vl("stickyScrollViewLayer",{createHTML:o=>o}),eE="data-sticky-line-index",oH="data-sticky-is-line",Yxe="data-sticky-is-line-number",rH="data-sticky-is-folding-icon";class Xxe extends A{get height(){return this._height}constructor(e){super(),this._foldingIconStore=this._register(new z),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new P),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof rd),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(131)&&t(),i.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const n=!this._state&&!e,s=this._state&&this._state.equals(e);if(i===void 0&&(n||s))return;const r=this._findRenderingData(e),a=this._lineNumbers;this._lineNumbers=r.lineNumbers,this._lastLineRelativePosition=r.lastLineRelativePosition;const l=this._findIndexToRebuildFrom(a,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,l),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];e.showEndForLine!==null&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let n=0;n!e.includes(s));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i,n){const s=this._editor._getViewModel();if(!s){this._clearWidget();return}if(e.length===0){this._clearWidget();return}const r=[],a=e[e.length-1];let l=0;for(let d=0;dd.scrollWidth))+c.verticalScrollbarWidth,this._renderedStickyLines=r,this._setHeight(l+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(W(this._lineNumbersDomNode,ee.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n,s,r,a){const l=e.coordinatesConverter.convertModelPositionToViewPosition(new R(i,1)).lineNumber,c=e.getViewLineRenderingData(l),d=this._editor.getOption(76),h=this._editor.getOption(117).verticalScrollbarSize;let u;try{u=ds.filter(c.inlineDecorations,l,c.minColumn,c.maxColumn)}catch{u=[]}const g=this._editor.getLineHeightForPosition(new R(i,1)),f=e.getTextDirection(i),p=new cd(!0,!0,c.content,c.continuesWithWrappedLine,c.isBasicASCII,c.containsRTL,0,c.tokens,u,c.tabSize,c.startVisibleColumn,1,1,1,500,"none",!0,!0,null,f,h),_=new Fh(2e3),b=h_(p,_);let C;sH?C=sH.createHTML(_.build()):C=_.build();const w=document.createElement("span");w.setAttribute(eE,String(t)),w.setAttribute(oH,""),w.setAttribute("role","listitem"),w.tabIndex=0,w.className="sticky-line-content",w.classList.add(`stickyLine${i}`),w.style.lineHeight=`${g}px`,w.innerHTML=C;const v=document.createElement("span");v.setAttribute(eE,String(t)),v.setAttribute(Yxe,""),v.className="sticky-line-number",v.style.lineHeight=`${g}px`;const S=a.contentLeft;v.style.width=`${S}px`;const x=document.createElement("span");d.renderType===1||d.renderType===3&&i%10===0?x.innerText=i.toString():d.renderType===2&&(x.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),x.className="sticky-line-number-inner",x.style.width=`${a.lineNumbersWidth}px`,x.style.paddingLeft=`${a.lineNumbersLeft}px`,v.appendChild(x);const k=this._renderFoldingIconForLine(r,i);k&&(v.appendChild(k.domNode),k.domNode.style.left=`${a.lineNumbersWidth+a.lineNumbersLeft}px`,k.domNode.style.lineHeight=`${g}px`),this._editor.applyFontInfo(w),this._editor.applyFontInfo(v),v.style.lineHeight=`${g}px`,w.style.lineHeight=`${g}px`,v.style.height=`${g}px`,w.style.height=`${g}px`;const D=new Qxe(t,i,w,v,k,b.characterMapping,w.scrollWidth,g);return this._updatePosition(D,n,s)}_updatePosition(e,t,i){const n=e.lineDomNode,s=e.lineNumberDomNode;if(i){n.style.zIndex="0",s.style.zIndex="0";const a=`${t+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`;n.style.top=a,s.style.top=a}else n.style.zIndex="1",s.style.zIndex="1",n.style.top=`${t}px`,s.style.top=`${t}px`;return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),r=n.getStartLineNumber(s);if(!(t===r))return;const l=n.isCollapsed(s),c=new Jxe(l,r,n.getEndLineNumber(s),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(rH,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=vm(t.characterMapping,e,0);return new R(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,eE);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,oH)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,rH)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Qxe{constructor(e,t,i,n,s,r,a,l){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=r,this.scrollWidth=a,this.height=l}}class Jxe{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${n}px`,this.domNode.style.lineHeight=`${n}px`,this.domNode.className=Se.asClassName(e?dx:cx)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class rC{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class yx{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class sZ{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var Gk=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ov=function(o,e){return function(t,i){e(t,i,o)}},aC;(function(o){o.OUTLINE_MODEL="outlineModel",o.FOLDING_PROVIDER_MODEL="foldingProviderModel",o.INDENTATION_MODEL="indentationModel"})(aC||(aC={}));var oh;(function(o){o[o.VALID=0]="VALID",o[o.INVALID=1]="INVALID",o[o.CANCELED=2]="CANCELED"})(oh||(oh={}));let TM=class extends A{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new yr(300)),this._updateOperation=this._register(new z),this._editor.getOption(131).defaultModel){case aC.OUTLINE_MODEL:this._modelProviders.push(new RM(this._editor,n));case aC.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new PM(this._editor,t,n));case aC.INDENTATION_MODEL:this._modelProviders.push(new MM(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const s=await i;if(this._modelPromise!==n)return null;switch(s){case oh.CANCELED:return this._updateOperation.clear(),null;case oh.VALID:return t.stickyModel}}return null}).catch(t=>(Ee(t),null))}};TM=Gk([Ov(2,fe),Ov(3,he)],TM);class oZ extends A{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,oh.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=$i(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?oh.CANCELED:(this._stickyModel=this.createStickyModel(e,i),oh.VALID):this._invalid()).then(void 0,i=>(Ee(i),oh.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let RM=class extends oZ{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Cc.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),s=this._editor.getModel();return new sZ(s.uri,s.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Ke.first(e.children.values())instanceof OG){const a=Ke.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[h,u]of e.children.entries()){const g=this._findSumOfRangesOfGroup(u);g>c&&(d=u,c=g,l=u.id)}t=l,i=d.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((a,l)=>{const c=new rC(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new rC(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of s)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new yx(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const r of s.children.values())i.push(this._stickyModelFromOutlineElement(r,s.symbol.selectionRange.startLineNumber));i.sort((s,r)=>this._comparator(s.range,r.range));const n=new rC(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new yx(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof rM?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};RM=Gk([Ov(1,he)],RM);class rZ extends oZ{constructor(e){super(e),this._foldingLimitReporter=this._register(new NG(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new sZ(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new yx(void 0,[],void 0);for(let s=0;s{this._updateProvider(e,t)})),this._updateProvider(e,t)}_updateProvider(e,t){const i=Th.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());i.length!==0&&(this.provider.value=new c5(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider.value?.compute(e)??null}};PM=Gk([Ov(2,he)],PM);var eLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},aH=function(o,e){return function(t,i){e(t,i,o)}};class tLe{constructor(e,t,i,n){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=n}}let AM=class extends A{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new P),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new z),this._updateSoon=this._register(new St(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(ue(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new TM(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new qt,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s,r){const a=this._editor.getModel();if(!a||t.children.length===0)return;let l=r;const c=[];for(let u=0;uu-g)),h=this.updateIndex(L0(c,e.endLineNumber,(u,g)=>u-g));for(let u=d;u<=h;u++){const g=t.children[u];if(!g||!g.range)continue;const{startLineNumber:f,endLineNumber:p}=g.range;if(p>f+1&&e.startLineNumber<=p+1&&f-1<=e.endLineNumber&&f!==l&&a.isValidRange(new L(f,1,p,1))){l=f;const _=this._editor.getLineHeightForPosition(new R(f,1));i.push(new tLe(f,p-1,s,_)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,g,i,n+1,s+_,f)}}}filterHiddenRanges(e){const t=this._editor._getViewModel()?.getHiddenAreas();return t?e.filter(i=>!t.some(n=>i.startLineNumber>=n.startLineNumber&&i.endLineNumber<=n.endLineNumber+1)):e}updateIndex(e){return e===-1?0:e<0?-e-2:e}};AM=eLe([aH(1,he),aH(2,ti)],AM);var iLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zf=function(o,e){return function(t,i){e(t,i,o)}},OM;let ia=class extends A{static{OM=this}static{this.ID="store.contrib.stickyScrollController"}constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new z,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new P),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new Xxe(this._editor),this._stickyLineCandidateProvider=new AM(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=oC.Empty;const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeFont(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(W(l,ee.CONTEXT_MENU,async d=>{this._onContextMenu(pe(l),d)})),this._stickyScrollFocusedContextKey=N.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=N.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(xr(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(W(l,ee.MOUSE_DOWN,d=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(d=>{this._onDidChangeStickyScrollHeight.fire(d)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(OM.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new z,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(L.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new z),t=this._register(new xk(this._editor,{extractLineNumberFromMouseEvent:s=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return r?r.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const r=s.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new L(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Li(n,ee.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(c===null)return;const d=new R(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(c===null)return;l=new R(c,1)}this._revealPosition(l)})),this._register(W(wt,ee.MOUSE_MOVE,s=>{this._mouseTarget=s.target,this._onMouseMoveOrKeyDown(s)})),this._register(W(wt,ee.KEY_DOWN,s=>{this._onMouseMoveOrKeyDown(s)})),this._register(W(wt,ee.KEY_UP,()=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,r])=>{const a=i(s);if(!a||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new qt;e.add(ue(()=>d.dispose(!0)));let h;Uw(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new R(l.startLineNumber,l.startColumn+1),!1,d.token).then((u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const g=c;h!==g?(e.clear(),h=g,h.style.textDecoration="underline",e.add(ue(()=>{h.style.textDecoration="none"}))):h||(h=g,h.style.textDecoration="underline",e.add(ue(()=>{h.style.textDecoration="none"})))}else e.clear()}))})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(fG,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Wn(e,t);this._contextMenuService.showContextMenu({menuId:M.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey||!this._mouseTarget||!mi(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);t===null||this._showEndForLine===t||(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;o5(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(76).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(t*.25),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await Th.get(this._editor)?.getFoldingModel()??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=oC.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const n=[],s=[],r=this._editor.getVisibleRanges();if(r.length!==0){const a=new rC(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const c of l){const d=c.startLineNumber,h=c.endLineNumber,u=c.top,g=u+c.height,f=this._editor.getTopForLineNumber(d)-t,p=this._editor.getBottomForLineNumber(h)-t;if(u>f&&u<=p&&(n.push(d),s.push(h+1),g>p&&(i=p-g)),n.length===e)break}}return this._endLineNumbers=s,new oC(n,s,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};ia=OM=iLe([zf(1,Jo),zf(2,he),zf(3,fe),zf(4,ti),zf(5,Rr),zf(6,Ie)],ia);const lC=E("inlineEdit.originalBackground",Re(Zd,.2),m(1220,"Background color for the original text in inline edits."),!0),aZ=E("inlineEdit.modifiedBackground",Re(ju,.3),m(1221,"Background color for the modified text in inline edits."),!0);E("inlineEdit.originalChangedLineBackground",Re(Zd,.8),m(1222,"Background color for the changed lines in the original text of inline edits."),!0);const nLe=E("inlineEdit.originalChangedTextBackground",Re(Zd,.8),m(1223,"Overlay color for the changed text in the original text of inline edits."),!0),sLe=E("inlineEdit.modifiedChangedLineBackground",{light:Re(a1,.7),dark:Re(a1,.7),hcDark:a1,hcLight:a1},m(1224,"Background color for the changed lines in the modified text of inline edits."),!0),oLe=E("inlineEdit.modifiedChangedTextBackground",Re(ju,.7),m(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),rLe=E("inlineEdit.gutterIndicator.primaryForeground",VL,m(1226,"Foreground color for the primary inline edit gutter indicator.")),vp=E("inlineEdit.gutterIndicator.primaryBorder",qu,m(1227,"Border color for the primary inline edit gutter indicator.")),lZ=E("inlineEdit.gutterIndicator.primaryBackground",{light:Re(vp,.5),dark:Re(vp,.4),hcDark:Re(vp,.4),hcLight:Re(vp,.5)},m(1228,"Background color for the primary inline edit gutter indicator.")),aLe=E("inlineEdit.gutterIndicator.secondaryForeground",SU,m(1229,"Foreground color for the secondary inline edit gutter indicator.")),cZ=E("inlineEdit.gutterIndicator.secondaryBorder",Y0,m(1230,"Border color for the secondary inline edit gutter indicator.")),dZ=E("inlineEdit.gutterIndicator.secondaryBackground",cZ,m(1231,"Background color for the secondary inline edit gutter indicator.")),lLe=E("inlineEdit.gutterIndicator.successfulForeground",VL,m(1232,"Foreground color for the successful inline edit gutter indicator.")),hZ=E("inlineEdit.gutterIndicator.successfulBorder",qu,m(1233,"Border color for the successful inline edit gutter indicator.")),uZ=E("inlineEdit.gutterIndicator.successfulBackground",hZ,m(1234,"Background color for the successful inline edit gutter indicator.")),cLe=E("inlineEdit.gutterIndicator.background",{hcDark:Re("tab.inactiveBackground",.5),hcLight:Re("tab.inactiveBackground",.5),dark:Re("tab.inactiveBackground",.5),light:"#5f5f5f18"},m(1235,"Background color for the inline edit gutter indicator.")),_b=E("inlineEdit.originalBorder",{light:Zd,dark:Zd,hcDark:Zd,hcLight:Zd},m(1236,"Border color for the original text in inline edits.")),bb=E("inlineEdit.modifiedBorder",{light:$s(ju,.6),dark:ju,hcDark:ju,hcLight:ju},m(1237,"Border color for the modified text in inline edits.")),dLe=E("inlineEdit.tabWillAcceptModifiedBorder",{light:$s(bb,0),dark:$s(bb,0),hcDark:$s(bb,0),hcLight:$s(bb,0)},m(1238,"Modified border color for the inline edits widget when tab will accept it.")),hLe=E("inlineEdit.tabWillAcceptOriginalBorder",{light:$s(_b,0),dark:$s(_b,0),hcDark:$s(_b,0),hcLight:$s(_b,0)},m(1239,"Original border color for the inline edits widget over the original text when tab will accept it."));function Fv(o){return o.map(e=>e===Gn.Accept?dLe:bb)}function Zk(o){return o.map(e=>e===Gn.Accept?hLe:_b)}function ir(o,e){let t;typeof o=="string"?t=tE(o,e):t=o.map((n,s)=>tE(n,e).read(s));const i=tE(ki,e);return t.map((n,s)=>n.makeOpaque(i.read(s)))}function tE(o,e){return oz({owner:{observeColor:o},equalsFn:(t,i)=>t.equals(i),debugName:()=>`observeColor(${o})`},e.onDidColorThemeChange,()=>{const t=e.getColorTheme().getColor(o);if(!t)throw new Ce(`Missing color: ${o}`);return t})}function rh(o,e,t){o.layoutInfo.read(t),o.value.read(t);const i=o.model.read(t);if(!i)return 0;let n=0;o.scrollTop.read(t);for(let r=e.startLineNumber;ri.getLineContent(r));return n<5&&s.some(r=>r.length>0)&&i.uri.scheme!=="file"&&console.error("unexpected width"),n}function uLe(o,e,t){return o.layoutInfo.read(t),o.value.read(t),o.model.read(t)?(o.scrollTop.read(t),o.editor.getOffsetForColumn(e.lineNumber,e.column)):0}function w5(o,e,t,i,n=void 0){const s=i.getModel();if(!s)return{prefixTrim:0,prefixLeftOffset:0};const r=o.map(u=>u.isSingleLine()?u.startColumn-1:0),a=e.mapToLineArray(u=>nT(s.getLineContent(u))),l=t.filter(u=>u!=="").map(u=>nT(u)),c=Math.min(...r,...a,...l);let d;if(s.getLineIndentColumn(e.startLineNumber)>=c+1)Jt(i).scrollTop.read(n),d=i.getOffsetForColumn(e.startLineNumber,c+1);else if(t.length>0)d=S5(t[0].slice(0,c),i,s);else return{prefixTrim:0,prefixLeftOffset:0};return{prefixTrim:c,prefixLeftOffset:d}}function S5(o,e,t){const i=e.getOption(59).typicalHalfwidthCharacterWidth,n=t.getOptions().tabSize*i,s=o.split(" ").length-1;return(o.length-s)*i+s*n}function y5(o){const e=o.layoutInfoContentLeft,t=$({name:"editor.validOverlay.width"},n=>{const s=o.layoutInfoMinimap.read(n).minimapLeft!==0,r=o.layoutInfoWidth.read(n)-e.read(n);if(s){const a=o.layoutInfoMinimap.read(n).minimapWidth+o.layoutInfoVerticalScrollbarWidth.read(n);return r-a}return r}),i=$({name:"editor.validOverlay.height"},n=>o.layoutInfoHeight.read(n)+o.contentHeight.read(n));return $({name:"editor.validOverlay"},n=>xt.fromLeftTopWidthHeight(e.read(n),0,t.read(n),i.read(n)))}function gLe(o,e){const t=[];for(const i of o){const n=e.mapRange(i.modifiedRange);t.push(new ys(i.originalRange,n))}return t}function iE(...o){return o.filter(e=>typeof e=="string").join(" ")}function fLe(o,e){return new L(e.lineNumber,e.column+o.start,e.lineNumber,e.column+o.endExclusive)}function pLe(o,e){let t=0;e:for(let i=0,n=o.length;ipLe(i[r-1],t)),uo);return e.forEach(r=>{const a=mLe(i[r-1],s,t);n.push(new Ni(fLe(new ge(0,a),new R(r,1)),""))}),new ho(n)}class FM{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}}function Wl(o){const e=ld(void 0,(t,i)=>o.read(t)||i);return An({debugName:()=>`${o.debugName}.mapOutFalsy`},t=>{if(e.read(t),!!o.read(t))return e})}function mr(o,e=qi.ofCaller()){return{left:$({name:"editor.validOverlay.left"},t=>o(t).left,e),top:$({name:"editor.validOverlay.top"},t=>o(t).top,e),width:$({name:"editor.validOverlay.width"},t=>o(t).right-o(t).left,e),height:$({name:"editor.validOverlay.height"},t=>o(t).bottom-o(t).top,e)}}var bLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nE=function(o,e){return function(t,i){e(t,i,o)}};let WM=class{constructor(e,t,i,n,s,r){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=n,this._keybindingService=s,this._commandService=r,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(a=>a.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=De("active",void 0),t=u=>({title:u.title,icon:u.icon,keybinding:typeof u.commandId=="string"?this._getKeybinding(u.commandArgs?void 0:u.commandId):$(this,g=>typeof u.commandId=="string"?void 0:this._getKeybinding(u.commandArgs?void 0:u.commandId.read(g)).read(g)),isActive:e.map(g=>g===u.id),onHoverChange:g=>e.set(g?u.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand(typeof u.commandId=="string"?u.commandId:u.commandId.get(),...u.commandArgs??[]))}),i=vLe(this._model.displayName),n=su(t({id:"gotoAndAccept",title:`${m(1212,"Go To")} / ${m(1213,"Accept")}`,icon:G.check,commandId:Sv})),s=su(t({id:"reject",title:m(1214,"Reject"),icon:G.close,commandId:eK})),r=this._model.extensionCommands.map((u,g)=>su(t({id:u.command.id+"_"+g,title:u.command.title,icon:u.icon??G.symbolEvent,commandId:u.command.id,commandArgs:u.command.arguments}))),a=this._inlineEditsShowCollapsed.map(u=>su(t(u?{id:"showExpanded",title:m(1215,"Show Expanded"),icon:G.expandAll,commandId:cR}:{id:"showCollapsed",title:m(1216,"Show Collapsed"),icon:G.collapseAll,commandId:cR}))),l=su(t({id:"snooze",title:m(1217,"Snooze"),icon:G.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),c=su(t({id:"settings",title:m(1218,"Settings"),icon:G.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),d=this._model.action?[this._model.action]:[],h=d.length>0?wLe(d.map(u=>({id:u.id,label:u.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(u.id,...u.arguments??[]),class:void 0,tooltip:u.tooltip??u.title})),{hoverDelegate:Ome}):void 0;return CLe([i,n,s,a,r.length?lH():void 0,l,c,...r,h?lH():void 0,h])}_getKeybinding(e){return e?dt(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(e)):Nt(void 0)}};WM=bLe([nE(3,Ie),nE(4,st),nE(5,Pt)],WM);function CLe(o){return Ae.div({class:"content",style:{margin:4,minWidth:180}},o)}function vLe(o){return Ae.div({class:"header",style:{color:Q(gU),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[o])}function su(o){return $({name:"inlineEdits.option"},e=>Ae.div({class:["monaco-menu-option",o.isActive?.map(t=>t&&"active")],onmouseenter:()=>o.onHoverChange?.(!0),onmouseleave:()=>o.onHoverChange?.(!1),onclick:o.onAction,onkeydown:t=>{t.key==="Enter"&&o.onAction?.()},tabIndex:0,style:{borderRadius:3}},[Ae.elem("span",{style:{fontSize:16,display:"flex"}},[Se.isThemeIcon(o.icon)?Ba(o.icon):o.icon.map(t=>Ba(t))]),Ae.elem("span",{},[o.title]),Ae.div({style:{marginLeft:"auto"},ref:t=>{const i=e.store.add(new C_(t,lo,{disableTitle:!0,...Jj,keybindingLabelShadow:void 0,keybindingLabelForeground:Q(gU),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));e.store.add(xe(n=>{i.set(o.keybinding.read(n))}))}})]))}function wLe(o,e){return $({name:"inlineEdits.actionBar"},t=>Ae.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[Ae.div({ref:i=>{t.store.add(new qs(i,e)).push(o,{icon:!1,label:!0})}})]))}function lH(){return Ae.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:Q(boe),padding:"2px 0"}},Ae.div({style:{borderBottom:`1px solid ${Q(WO)}`}}))}var SLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tS=function(o,e){return function(t,i){e(t,i,o)}};let BM=class extends A{get model(){const e=this._model.get();if(!e)throw new Ce("Inline Edit Model not available");return e}constructor(e,t,i,n,s,r,a,l,c,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=n,this._isHoveringOverInlineEdit=s,this._focusIsInMenu=r,this._hoverService=a,this._instantiationService=l,this._accessibilityService=c,this._tabAction=$(this,h=>{const u=this._model.read(h);return u?u.tabAction.read(h):Gn.Inactive}),this._hoverVisible=De(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=De(this,!1),this._isHoveredOverIconDebounced=K3(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=K3(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(h,u)=>{switch(h){case Gn.Inactive:return{background:ir(dZ,d).read(u).toString(),foreground:ir(aLe,d).read(u).toString(),border:ir(cZ,d).read(u).toString()};case Gn.Jump:return{background:ir(lZ,d).read(u).toString(),foreground:ir(rLe,d).read(u).toString(),border:ir(vp,d).read(u).toString()};case Gn.Accept:return{background:ir(uZ,d).read(u).toString(),foreground:ir(lLe,d).read(u).toString(),border:ir(hZ,d).read(u).toString()};default:ow()}}),this._originalRangeObs=Wl(this._originalRange),this._state=$(this,h=>{const u=this._originalRangeObs.read(h);if(u)return{range:u,lineOffsetRange:this._editorObs.observeLineOffsetRange(u,h.store)}}),this._stickyScrollController=ia.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?dt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Nt(0),this._lineNumberToRender=$(this,h=>{if(this._verticalOffset.read(h)!==0)return"";const u=this._originalRange.read(h)?.startLineNumber,g=this._editorObs.getOption(76).read(h);if(u===void 0||g.renderType===0)return"";if(g.renderType===3){const f=this._editorObs.cursorPosition.read(h);return u%10===0||f&&f.lineNumber===u?u.toString():""}if(g.renderType===2){const f=this._editorObs.cursorPosition.read(h);if(!f)return"";const p=Math.abs(u-f.lineNumber);return p===0?u.toString():p.toString()}return g.renderType===4?g.renderFn?g.renderFn(u):"":u.toString()}),this._availableWidthForIcon=$(this,h=>{const u=this._editorObs.editor.getModel(),g=this._editorObs.editor,f=this._editorObs.layoutInfo.read(h),p=f.decorationsLeft+f.decorationsWidth-f.glyphMarginLeft;if(!u||p<=0)return()=>0;if(f.lineNumbersLeft===0)return()=>p;const _=this._editorObs.getOption(76).read(h);if(_.renderType===2||_.renderType===0)return()=>p;const b=g.getOption(59).typicalHalfwidthCharacterWidth,C=f.lineNumbersLeft+f.lineNumbersWidth,v=(u.getLineCount()+1).toString().length,S=[];for(let x=1;x<=v;x++){const k=10**(x-1),D=g.getTopForLineNumber(k),I=x*b,T=Math.min(p,Math.max(0,C-I-f.glyphMarginLeft));S.push({firstLineNumberWithDigitCount:k,topOfLineNumber:D,usableWidthLeftOfLineNumber:T})}return x=>{for(let k=S.length-1;k>=0;k--)if(x>=S[k].topOfLineNumber)return S[k].usableWidthLeftOfLineNumber;throw new Ce("Could not find avilable width for icon")}}),this._layout=$(this,h=>{const u=this._state.read(h);if(!u)return;const g=this._editorObs.layoutInfo.read(h),f=this._editorObs.observeLineHeightForLine(u.range.map(ot=>ot.startLineNumber)).read(h),p=2,_=g.decorationsLeft+g.decorationsWidth-g.glyphMarginLeft-2*p,b=g.height-2*p,C=xt.fromLeftTopWidthHeight(p,p,_,b),w=C.withTop(this._stickyScrollHeight.read(h)),v=C.withTop(w.top+p),S=u.lineOffsetRange.read(h),x=xt.fromRanges(ge.fromTo(v.left,v.right),S),k=f,D=this._verticalOffset.read(h),I=x.withHeight(k).translateY(D),T=w.containsRect(I),F=this._tabAction.map(ot=>ot===Gn.Accept?G.keyboardTab:G.arrowRight),O=$(this,ot=>{if(this._isHoveredOverIconDebounced.read(ot)||this._isHoveredOverInlineEditDebounced.read(ot))return G.check;if(this._tabAction.read(ot)===Gn.Accept)return G.keyboardTab;const Lt=this._editorObs.cursorLineNumber.read(ot)??0,Zt=u.range.read(ot).startLineNumber;return Lt<=Zt?G.keyboardTabAbove:G.keyboardTabBelow}),B=22,U=16,K=ot=>{const Lt=this._availableWidthForIcon.read(void 0)(ot.bottom+this._editorObs.editor.getScrollTop())-p;return Math.max(Math.min(Lt,B),U)};if(T){const ot=I;let Lt;g.lineNumbersWidth===0?Lt=Math.min(Math.max(g.lineNumbersLeft-C.left,0),ot.width-B):Lt=Math.max(g.lineNumbersLeft+g.lineNumbersWidth-C.left,0);const Zt=ot.withWidth(Lt),mn=Math.max(Math.min(g.decorationsWidth,B),U),ms=ot.withWidth(mn).translateX(Lt);return{gutterEditArea:x,icon:O,iconDirection:"right",iconRect:ms,pillRect:ot,lineNumberRect:Zt}}const ie=C.intersect(x);if(ie&&ie.height>=k){const ot=I.moveToBeContainedIn(v).moveToBeContainedIn(ie),Lt=ot.withWidth(K(ot));return{gutterEditArea:x,icon:O,iconDirection:"right",iconRect:Lt,pillRect:Lt}}const ne=I.moveToBeContainedIn(C),ce=ne.withWidth(K(ne)),ke=ce,it=ce.top!!h),this._indicator=Ae.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const u=this._layout.get()?.icon.get()===G.check;this._editorObs.editor.focus(),u?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},Wl(this._layout).map(h=>h?[Ae.div({style:{position:"absolute",background:Q(cLe),borderRadius:"4px",...mr(u=>h.read(u).gutterEditArea)}}),Ae.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(u=>u.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(u=>u.foreground),border:this._gutterIndicatorStyles.map(u=>`1px solid ${u.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...mr(u=>h.read(u).pillRect)}},[Ae.div({className:"line-number",style:{lineHeight:h.map(u=>u.lineNumberRect?u.lineNumberRect.height:0),display:h.map(u=>u.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:h.map(u=>u.lineNumberRect?u.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(u=>u.foreground)}},this._lineNumberToRender),Ae.div({style:{rotate:h.map(u=>`${yLe(u.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:h.map(u=>u.pillRect.width-u.iconRect.width-(u.lineNumberRect?.width??0)),width:h.map(u=>u.iconRect.width)}},[h.map((u,g)=>Ba(u.icon.read(g)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:Nt(0)})),this._register(this._editorObs.editor.onMouseMove(h=>{if(this._state.get()===void 0)return;const f=this._iconRef.element.getBoundingClientRect(),p=xt.fromLeftTopWidthHeight(f.left,f.top,f.width,f.height),_=new tn(h.event.posx,h.event.posy);this._isHoveredOverIcon.set(p.containsPoint(_),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(Ta(this._isHoveredOverInlineEditDebounced,h=>{h&&this.triggerAnimation()})),this._register(xe(h=>{this._indicator.readEffect(h),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(t=>t.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const e=new z,t=e.add(this._instantiationService.createInstance(WM,this.model,s=>{s&&this._editorObs.editor.focus(),n?.dispose()},this._editorObs).toDisposableLiveElement()),i=e.add(xr(t.element));e.add(i.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),e.add(i.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),e.add(ue(()=>this._focusIsInMenu.set(!1,void 0)));const n=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});n?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange(()=>n.dispose())),e.add(n.onDispose(()=>{this._hoverVisible.set(!1,void 0),e.dispose()}))):e.dispose()}};BM=SLe([tS(6,Ms),tS(7,fe),tS(8,kn),tS(9,ci)],BM);function yLe(o){switch(o){case"top":return 90;case"bottom":return-90;case"right":return 0}}var xLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cH=function(o,e){return function(t,i){e(t,i,o)}},Eo;(function(o){o.FirstTime="firstTime",o.SecondTime="secondTime",o.Active="active"})(Eo||(Eo={}));let HM=class extends A{constructor(e,t,i,n,s,r){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=n,this._storageService=s,this._configurationService=r,this._disposables=this._register(new ut),this._setupDone=De({name:"setupDone"},!1),this._activeCompletionId=$(a=>{const l=this._model.read(a);if(!l||!this._setupDone.read(a))return;const c=this._indicator.read(a);if(!(!c||!c.isVisible.read(a)))return l.inlineEdit.inlineCompletion.identity.id}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===Eo.Active)return;const e=new z;let t=!1,i=!1,n=0,s=0;return e.add(Hle(this._activeCompletionId,async(r,a,l,c)=>{if(r===void 0)return;let d=this.getNewUserType();switch(d){case Eo.FirstTime:{(n++>=5||t)&&(d=Eo.SecondTime,this.setNewUserType(d));break}case Eo.SecondTime:{s++>=3&&i&&(d=Eo.Active,this.setNewUserType(d));break}}switch(d){case Eo.FirstTime:{for(let h=0;h<3&&!c.isCancellationRequested;h++)await this._indicator.get()?.triggerAnimation(),await El(500);break}case Eo.SecondTime:{this._indicator.get()?.triggerAnimation();break}}})),e.add(xe(r=>{this._collapsedView.isVisible.read(r)&&this.getNewUserType()!==Eo.Active&&this._collapsedView.triggerAnimation()})),e.add(Xn((r,a)=>{const l=this._indicator.read(r);l&&a.add(Ta(l.isHoveredOverIcon,async c=>{c&&(t=!0)}))})),e.add(Xn((r,a)=>{const l=this._host.read(r);l&&a.add(l.onDidAccept(()=>{i=!0}))})),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,Eo.FirstTime)}setNewUserType(e){switch(e){case Eo.FirstTime:throw new Ce("UserKind should not be set to first time");case Eo.SecondTime:break;case Eo.Active:this._disposables.clear();break}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}};HM=xLe([cH(4,ps),cH(5,Pe)],HM);var LLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kLe=function(o,e){return function(t,i){e(t,i,o)}};let VM=class extends A{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._iconRef=Ae.ref(),this.isHovered=Nt(!1),this._editorObs=Jt(this._editor);const s=this._edit.map(c=>c?.edit.replacements[0]??null).map(c=>c?Mc(c,this._editor.getModel()).range.getStartPosition():null),r=this._editorObs.observePosition(s,this._store),a=$(c=>{const d=r.read(c);if(!d)return null;const h=this._editorObs.layoutInfoContentLeft.read(c),u=this._editorObs.scrollLeft.read(c);return new tn(h+d.x-u,d.y)}),l=Ae.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(a)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:l,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:Nt(0)})),this.isVisible=this._edit.map((c,d)=>!!c&&a.read(d)!==null)}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map((s,r)=>s?s.deltaX(-t.read(r)):null),n=this.createIconPath(i);return Ae.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...mr(s=>y5(this._editorObs).read(s)),overflow:"hidden",pointerEvents:"none"}},[Ae.svgElem("path",{class:"collapsedViewPath",d:n,fill:Q(vp)})])}createIconPath(e){return e.map(s=>{if(!s)return new FM().build();const r=s.deltaX(-6/2).deltaY(-1),a=r.deltaX(6),l=r.deltaY(1),c=a.deltaY(1),d=l.deltaX(6/2).deltaY(3);return new FM().moveTo(r).lineTo(a).lineTo(c).lineTo(d).lineTo(l).lineTo(r).build()})}};VM=LLe([kLe(2,kn)],VM);var DLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dH=function(o,e){return function(t,i){e(t,i,o)}};const iS=14,sE=0,ec=4,nS=4,hH=2;let zM=class extends A{constructor(e,t,i,n,s){super(),this._editor=e,this._languageService=s,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._isHovered=De(this,!1),this.isHovered=this._isHovered,this._viewRef=Ae.ref(),this._editorObs=Jt(this._editor);const r=i.map((d,h)=>{let u;switch(d){case Gn.Inactive:u=dZ;break;case Gn.Jump:u=lZ;break;case Gn.Accept:u=uZ;break}return{border:ir(u,n).read(h).toString(),background:Q(ki)}}),a=t.map(d=>d?this.getState(d):void 0),l=a.map(d=>d?this.getRendering(d,r):void 0);this.minEditorScrollHeight=$(this,d=>{const h=a.read(d);return h?h.rect.read(d).bottom+this._editor.getScrollTop():0});const c=Ae.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[l]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:c.element,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:ld(this,(d,h)=>{const u=a.read(d);if(!u)return h??0;const g=u.rect.map(f=>f.right).read(d)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(d)+ec-this._editorObs.layoutInfoContentLeft.read(d);return Math.max(h??0,g)}).recomputeInitiallyAndOnChange(this._store)})),this._register(xe(d=>{if(!l.read(d)){this._isHovered.set(!1,void 0);return}this._isHovered.set(c.isHovered.read(d),void 0)}))}fitsInsideViewport(e,t,i){const n=this._editorObs.layoutInfoWidth.read(i),s=this._editorObs.layoutInfoContentLeft.read(i),r=this._editor.getLayoutInfo().verticalScrollbarWidth,a=this._editorObs.layoutInfoMinimap.read(i).minimapLeft!==0?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0,l=rh(this._editorObs,e,void 0),c=S5(t,this._editor,this._editor.getModel()),d=ec+iS;return l+c+d{const l=e.range.startLineNumber,c=e.range.endLineNumber,d=e.range.startColumn,h=e.range.endColumn,u=this._editor.getModel()?.getLineCount()??0,g=rh(this._editorObs,new be(l,l+1),a),f=l+1<=u?rh(this._editorObs,new be(l+1,l+2),a):void 0,p=l-1>=1?rh(this._editorObs,new be(l-1,l),a):void 0,_=this._editor.getOffsetForColumn(l,d),b=this._editor.getOffsetForColumn(c,h);return{lineWidth:g,lineWidthBelow:f,lineWidthAbove:p,startContentLeftOffset:_,endContentLeftOffset:b}}),i=e.range.startLineNumber,n=e.range.endLineNumber,s=this.fitsInsideViewport(new be(i,n+1),e.content,void 0);return{rect:$(this,a=>{const l=this._editorObs.getOption(59).read(a).typicalHalfwidthCharacterWidth,{lineWidth:c,lineWidthBelow:d,lineWidthAbove:h,startContentLeftOffset:u,endContentLeftOffset:g}=t.read(a),f=this._editorObs.layoutInfoContentLeft.read(a),p=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(a.store).read(a),_=this._editorObs.scrollTop.read(a),b=this._editorObs.scrollLeft.read(a);let C;i===n&&g+5*l>=c&&s?C="end":d!==void 0&&d+iS-nS-ecl.withMargin(0,ec));return Ae.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...mr(l=>a.read(l)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map(l=>`1px solid ${l.border}`),borderRadius:"4px",backgroundColor:t.map(l=>l.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:l=>{l.preventDefault()},onclick:l=>{this._onDidClick.fire(new Wn(pe(l),l))}},[i])}};zM=DLe([dH(3,ci),dH(4,_i)],zM);const ILe=0,ELe=0,oE=1,NLe=1,TLe=3,rE=4;class RLe extends A{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=n,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._display=$(this,a=>this._uiState.read(a)?"block":"none"),this._editorMaxContentWidthInRange=$(this,a=>{const l=this._originalDisplayRange.read(a);return l?(this._editorObs.versionId.read(a),ld(this,(c,d)=>{const h=rh(this._editorObs,l,c);return Math.max(h,d??0)})):Nt(0)}).map((a,l)=>a.read(l)),this._maxPrefixTrim=$(this,a=>{const l=this._uiState.read(a);return l?w5(l.deletions,l.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=$(this,a=>{const l=this._edit.read(a);if(!l||!this._uiState.read(a))return null;const d=this._editorObs.layoutInfo.read(a),h=this._editorObs.scrollLeft.read(a),u=this._editorObs.getOption(59).map(w=>w.typicalHalfwidthCharacterWidth).read(a),g=d.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(a),u)-h,f=l.originalLineRange,p=this._originalVerticalStartPosition.read(a)??this._editor.getTopForLineNumber(f.startLineNumber)-this._editorObs.scrollTop.read(a),_=this._originalVerticalEndPosition.read(a)??this._editor.getTopForLineNumber(f.endLineNumberExclusive)-this._editorObs.scrollTop.read(a),b=d.contentLeft+this._maxPrefixTrim.read(a).prefixLeftOffset-h;return g<=b?null:{codeRect:xt.fromLeftTopRightBottom(b,p,g,_).withMargin(ELe,ILe),contentLeft:d.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=Ae.div({style:{pointerEvents:"none"}},$(this,a=>{const l=Wl(this._editorLayoutInfo).read(a);if(!l)return;const c=l.map(g=>xt.fromLeftTopRightBottom(g.contentLeft-rE-oE,g.codeRect.top,g.contentLeft,g.codeRect.bottom)),d=$(this,g=>{const f=l.read(g).codeRect,p=c.read(g);return f.intersectHorizontal(new ge(p.left,Number.MAX_SAFE_INTEGER))}),h=this._uiState.map(g=>g?.inDiffEditor?TLe:NLe).read(a),u=d.map(g=>g.withMargin(h,h));return[Ae.div({class:"originalSeparatorDeletion",style:{...u.read(a).toStyles(),borderRadius:`${rE}px`,border:`${oE+h}px solid ${Q(ki)}`,boxSizing:"border-box"}}),Ae.div({class:"originalOverlayDeletion",style:{...d.read(a).toStyles(),borderRadius:`${rE}px`,border:Zk(this._tabAction).map(g=>`${oE}px solid ${Q(g)}`),boxSizing:"border-box",backgroundColor:Q(lC)}}),Ae.div({class:"originalOverlayHiderDeletion",style:{...c.read(a).toStyles(),backgroundColor:Q(ki)}})]})).keepUpdated(this._store),this._nonOverflowView=Ae.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=Nt(!1),this._editorObs=Jt(this._editor);const s=$(this,a=>{const l=this._edit.read(a);return l?new R(l.originalLineRange.startLineNumber,1):null}),r=$(this,a=>{const l=this._edit.read(a);return l?new R(l.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(a=>a?.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(s,this._store).map(a=>a?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(r,this._store).map(a=>a?.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,a=>{const l=this._editorLayoutInfo.read(a);return l===null?0:l.codeRect.width})}))}}var MLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uH=function(o,e){return function(t,i){e(t,i,o)}};const K_=1,PLe=1,ALe=3,aE=4;let UM=class extends A{constructor(e,t,i,n,s){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=s,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._state=$(this,r=>{const a=this._input.read(r);if(!a)return;const l=this._editor.getModel(),c=l.getEOL();if(a.startColumn===1&&a.lineNumber>1&&l.getLineLength(a.lineNumber)!==0&&a.text.endsWith(c)&&!a.text.startsWith(c)){const d=l.getLineLength(a.lineNumber-1)+1;return{lineNumber:a.lineNumber-1,column:d,text:c+a.text.slice(0,-c.length)}}return{lineNumber:a.lineNumber,column:a.startColumn,text:a.text}}),this._trimVertically=$(this,r=>{const a=this._state.read(r),l=a?.text;if(!l||l.trim()==="")return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const c=this._editor.getLineHeightForPosition(new R(a.lineNumber,1)),d=this._editor.getModel().getEOL();let h=0,u=0,g=0;for(;gg&&l.endsWith(d,f);f-=d.length)u+=1;return{topOffset:h*c,bottomOffset:u*c,linesTop:h,linesBottom:u}}),this._maxPrefixTrim=$(this,r=>{const a=this._state.read(r);if(!a)return{prefixLeftOffset:0,prefixTrim:0};const l=this._editor.getModel(),c=l.getEOL(),d=this._trimVertically.read(r),h=a.text.split(c),u=h.slice(d.linesTop,h.length-d.linesBottom);d.linesTop===0&&(u[0]=l.getLineContent(a.lineNumber)+u[0]);const g=new be(a.lineNumber,a.lineNumber+(d.linesTop>0?0:1));return w5([],g,u,this._editor)}),this._ghostText=$(r=>{const a=this._state.read(r),l=this._maxPrefixTrim.read(r);if(!a)return;const d=this._editor.getModel().getEOL(),u=a.text.split(d).map((g,f)=>new ug(new L(f+1,f===0?1:l.prefixTrim+1,f+1,g.length+1),"modified-background",0));return new Mv(a.lineNumber,[new _x(a.column,a.text,!1,u)])}),this._display=$(this,r=>this._state.read(r)?"block":"none"),this._editorMaxContentWidthInRange=$(this,r=>{const a=this._state.read(r);if(!a)return 0;this._editorObs.versionId.read(r);const l=this._editor.getModel(),c=l.getEOL(),d=a.text.startsWith(c)?"":l.getValueInRange(new L(a.lineNumber,1,a.lineNumber,a.column)),h=l.getValueInRange(new L(a.lineNumber,a.column,a.lineNumber,l.getLineLength(a.lineNumber)+1)),g=(d+a.text+h).split(c),f=Uc.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p=g.map(_=>{const b=l.tokenization.tokenizeLinesAt(a.lineNumber,[_])?.[0];let C;return b?C=Bc.fromLineTokens(b).toLineTokens(_,this._languageService.languageIdCodec):C=$t.createEmpty(_,this._languageService.languageIdCodec),Rw(new Mw([C]),f,[],J("div"),!0).minWidthInPx});return Math.max(...p)}),this.startLineOffset=this._trimVertically.map(r=>r.topOffset),this.originalLines=this._state.map(r=>r?new be(r.lineNumber,Math.min(r.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=$(this,r=>{this._ghostText.read(r);const a=this._state.read(r);if(!a)return null;this._editorObs.observePosition(De(this,new R(a.lineNumber,a.column)),r.store).read(r);const l=this._editorObs.layoutInfo.read(r),c=this._editorObs.scrollLeft.read(r),d=this._editorObs.layoutInfoVerticalScrollbarWidth.read(r),h=l.contentLeft+this._editorMaxContentWidthInRange.read(r)-c,u=this._maxPrefixTrim.read(r).prefixLeftOffset??0,g=l.contentLeft+u-c;if(h<=g)return null;const{topOffset:f,bottomOffset:p}=this._trimVertically.read(r),_=this._editorObs.scrollTop.read(r),b=this._ghostTextView.height.read(r)-f-p,C=this._editor.getTopForLineNumber(a.lineNumber)-_+f,w=C+b,v=new xt(g,C,h,w);return{overlay:v,startsAtContentLeft:u===0,contentLeft:l.contentLeft,minContentWidthRequired:u+v.width+d}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=Ae.div({style:{pointerEvents:"none"}},$(this,r=>{const a=Wl(this._overlayLayout).read(r);if(!a)return;const l=a.map(u=>xt.fromLeftTopRightBottom(u.contentLeft-aE-K_,u.overlay.top,u.contentLeft,u.overlay.bottom)).read(r),c=this._input.map(u=>u?.inDiffEditor?ALe:PLe).read(r),d=a.map(u=>u.overlay.withMargin(0,K_,0,u.startsAtContentLeft?0:K_).intersectHorizontal(new ge(l.left,Number.MAX_SAFE_INTEGER))),h=d.map(u=>u.withMargin(c,c));return[Ae.div({class:"originalUnderlayInsertion",style:{...h.read(r).toStyles(),borderRadius:aE,border:`${K_+c}px solid ${Q(ki)}`,boxSizing:"border-box"}}),Ae.div({class:"originalOverlayInsertion",style:{...d.read(r).toStyles(),borderRadius:aE,border:Fv(this._tabAction).map(u=>`${K_}px solid ${Q(u)}`),boxSizing:"border-box",backgroundColor:Q(aZ)}}),Ae.div({class:"originalOverlayHiderInsertion",style:{...l.toStyles(),backgroundColor:Q(ki)}})]})).keepUpdated(this._store),this._view=Ae.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=Jt(this._editor),this._ghostTextView=this._register(n.createInstance(Av,this._editor,{ghostText:this._ghostText,minReservedLineCount:Nt(0),targetTextModel:this._editorObs.model.map(r=>r??void 0),warning:Nt(void 0),handleInlineCompletionShown:Nt(()=>{})},De(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(r=>{this._onDidClick.fire(r)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,r=>{const a=this._overlayLayout.read(r);return a===null?0:a.minContentWidthRequired})}))}};UM=MLe([uH(3,fe),uH(4,_i)],UM);var OLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gH=function(o,e){return function(t,i){e(t,i,o)}};let $M=class extends A{constructor(e,t,i,n,s,r){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=n,this._languageService=s,this._themeService=r,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((a,l)=>a?w5(a.replacements.flatMap(c=>[c.originalRange,c.modifiedRange]),a.originalRange,a.modifiedLines,this._editor.editor,l):void 0),this._modifiedLineElements=$(this,a=>{const l=[];let c=0;const d=this._maxPrefixTrim.read(a),h=this._edit.read(a);if(!h||!d)return;const u=d.prefixTrim,g=FLe(h.replacements.map(_=>_.modifiedRange)).map(_=>new L(_.startLineNumber,_.startColumn-u,_.endLineNumber,_.endColumn-u)),f=this._editor.model.get(),p=h.modifiedRange.startLineNumber;for(let _=0;_I.startLineNumber===C)){const I=Math.min(D.endColumn,w.length+1);x.push(new ug(new L(1,D.startColumn,1,I),"inlineCompletions-modified-bubble",0))}const k=Rw(new Mw([S]),Uc.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),x,b,!0);this._editor.getOption(59).read(a),c=Math.max(c,k.minWidthInPx),l.push(b)}return{lines:l,requiredWidth:c}}),this._layout=$(this,a=>{const l=this._modifiedLineElements.read(a),c=this._maxPrefixTrim.read(a),d=this._edit.read(a);if(!l||!c||!d)return;const{prefixLeftOffset:h}=c,{requiredWidth:u}=l,g=this._editor.observeLineHeightsForLineRange(d.originalRange).read(a),f=(()=>{const ie=g.slice(0,d.modifiedRange.length);for(;ie.lengththis._editor.editor.getOffsetForColumn(ie,v.getLineMaxColumn(ie))-h),x=Math.max(...S,u),k=d.originalRange.startLineNumber,D=d.originalRange.endLineNumberExclusive-1,I=this._editor.editor.getTopForLineNumber(k)-C,T=this._editor.editor.getBottomForLineNumber(D)-C,F=xt.fromLeftTopWidthHeight(w+h,I,x,T-I),O=xt.fromLeftTopWidthHeight(F.left,F.bottom,F.width,f.reduce((ie,X)=>ie+X,0)),B=xt.hull([F,O]),U=B.intersectVertical(new ge(F.bottom,Number.MAX_SAFE_INTEGER)),K=new xt(U.left,U.top,U.right,U.bottom);return{originalLinesOverlay:F,modifiedLinesOverlay:O,background:B,lowerBackground:U,lowerText:K,modifiedLineHeights:f,minContentWidthRequired:h+x+_}}),this._viewZoneInfo=$(a=>{if(!this._editor.getOption(71).map(g=>g.edits.allowCodeShifting==="always").read(a))return;const c=this._layout.read(a),d=this._edit.read(a);if(!c||!d)return;const h=c.lowerBackground.height,u=d.originalRange.endLineNumberExclusive;return{height:h,lineNumber:u}}),this.minEditorScrollHeight=$(this,a=>{const l=Wl(this._layout).read(a);return!l||this._viewZoneInfo.read(a)!==void 0?0:l.read(a).lowerText.bottom+this._editor.editor.getScrollTop()}),this._div=Ae.div({class:"line-replacement"},[$(this,a=>{const l=Wl(this._layout).read(a),c=this._modifiedLineElements.read(a);if(!l||!c)return[];const d=l.read(a),h=this._editor.layoutInfoContentLeft.read(a),u=this._isInDiffEditor.read(a)?3:1;c.lines.forEach((p,_)=>{p.style.width=`${d.lowerText.width}px`,p.style.height=`${d.modifiedLineHeights[_]}px`,p.style.position="relative"});const g=Fv(this._tabAction).read(a),f=Zk(this._tabAction).read(a);return[Ae.div({style:{position:"absolute",...mr(p=>y5(this._editor).read(p)),overflow:"hidden",pointerEvents:"none"}},[Ae.div({class:"borderAroundLineReplacement",style:{position:"absolute",...mr(p=>l.read(p).background.translateX(-h).withMargin(u)),borderRadius:"4px",border:`${u+1}px solid ${Q(ki)}`,boxSizing:"border-box",pointerEvents:"none"}}),Ae.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...mr(p=>l.read(p).background.translateX(-h)),borderRadius:"4px",border:ir(f,this._themeService).map(p=>`1px solid ${p.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:Q(lC)}}),Ae.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...mr(p=>l.read(p).lowerBackground.translateX(-h)),borderRadius:"0 0 4px 4px",background:Q(ki),boxShadow:`${Q(OL)} 0 6px 6px -6px`,border:`1px solid ${Q(g)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:p=>{p.preventDefault()},onclick:p=>this._onDidClick.fire(new Wn(pe(p),p))},[Ae.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:Q(sLe)}})]),Ae.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...mr(p=>l.read(p).lowerText.translateX(-h)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...c.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(a=>this._isMouseOverWidget(a),this._store),this._previousViewZoneInfo=void 0,this._register(ue(()=>this._editor.editor.changeViewZones(a=>this.removePreviousViewZone(a)))),this._register(OJ(this._viewZoneInfo,({lastValue:a,newValue:l})=>{a===l||a?.height===l?.height&&a?.lineNumber===l?.lineNumber||this._editor.editor.changeViewZones(c=>{this.removePreviousViewZone(c),l&&this.addViewZone(l,c)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:$(this,a=>this._layout.read(a)?.minContentWidthRequired??0),position:Nt({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!t||!(e.event instanceof ed)?!1:t.lowerBackground.containsPoint(new tn(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();t!==null&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:J("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const n=this._editor.cursorLineNumber.get();n!==null&&n>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}};$M=OLe([gH(4,_i),gH(5,ci)],$M);function FLe(o){const e=[];for(;o.length;){let t=o.shift();t.startLineNumber!==t.endLineNumber&&(o.push(new L(t.startLineNumber+1,1,t.endLineNumber,t.endColumn)),t=new L(t.startLineNumber,t.startColumn,t.startLineNumber,Number.MAX_SAFE_INTEGER)),e.push(t)}return e}var WLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fH=function(o,e){return function(t,i){e(t,i,o)}};const Uf=0,G_=0,ca=1,BLe=1,HLe=3,tc=4,lE=20,pH=12;let xx=class extends A{static fitsInsideViewport(e,t,i,n){const s=Jt(e),r=s.layoutInfoWidth.read(n),a=s.layoutInfoContentLeft.read(n),l=e.getLayoutInfo().verticalScrollbarWidth,c=s.layoutInfoMinimap.read(n).minimapLeft!==0?s.layoutInfoMinimap.read(n).minimapWidth:0,d=rh(s,i.displayRange,void 0),h=i.lineEdit.newLines.reduce((f,p)=>Math.max(f,S5(p,e,t)),0),u=lE,g=pH+2*ca;return d+h+u+gthis._uiState.read(c)?"block":"none"),this.previewRef=Ae.ref();const l=this._uiState.map(c=>c?.isInDiffEditor?HLe:BLe);this._editorContainer=Ae.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new Wn(pe(c),c))}},[Ae.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(rd,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[kt.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=Jt(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=$(this,c=>{this._editorContainer.readEffect(c),this._previewEditorObs.model.read(c),this._display.read(c),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(c));const d=this._uiState.read(c),h=this._edit.read(c);if(!d||!h)return;const u=h.originalLineRange,g=[];u.startLineNumber>1&&g.push(new L(1,1,u.startLineNumber-1,1)),u.startLineNumber+d.newTextLineCount{f.forEach(b=>_.removeZone(b)),p>0&&this._activeViewZones.push(_.addZone({afterLineNumber:u.startLineNumber+d.newTextLineCount-1,heightInLines:p,showInHiddenAreas:!0,domNode:J("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=$(this,c=>{const d=this._edit.read(c);return d?(this._updatePreviewEditor.read(c),rh(this._previewEditorObs,d.modifiedLineRange,c)):0}),this._cursorPosIfTouchesEdit=$(this,c=>{const d=this._editorObs.cursorPosition.read(c),h=this._edit.read(c);if(!(!h||!d))return h.modifiedLineRange.contains(d.lineNumber)?d:void 0}),this._originalStartPosition=$(this,c=>{const d=this._edit.read(c);return d?new R(d.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=$(this,c=>{const d=this._edit.read(c);return d?new R(d.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(c=>c?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(c=>c?.y),this._originalDisplayRange=this._edit.map(c=>c?.displayRange),this._editorMaxContentWidthInRange=$(this,c=>{const d=this._originalDisplayRange.read(c);return d?(this._editorObs.versionId.read(c),ld(this,(h,u)=>{const g=rh(this._editorObs,d,h);return Math.max(g,u??0)})):Nt(0)}).map((c,d)=>c.read(d)),this._previewEditorLayoutInfo=$(this,c=>{const d=this._edit.read(c);if(!d||!this._uiState.read(c))return null;const u=d.originalLineRange,g=this._editorObs.scrollLeft.read(c),f=this._editorMaxContentWidthInRange.read(c),p=this._editorObs.layoutInfo.read(c),_=this._previewEditorWidth.read(c),b=p.contentWidth-p.verticalScrollbarWidth,C=this._editor.getContainerDomNode().getBoundingClientRect(),w=p.contentLeft+p.contentWidth+C.left,v=pe(this._editor.getContainerDomNode()).innerWidth-w,S=pe(this._editor.getContainerDomNode()).innerWidth-C.right,x=Math.min(p.contentWidth*.3,_,100),k=0,D=k+v,I=this._cursorPosIfTouchesEdit.read(c),T=Math.max(b+g-k-Math.max(0,x-D),Math.min(I?uLe(this._editorObs,I,c)+50:0,b+g)),F=Math.min(f+lE,T),O=f+lE+_+70,B=T-F;let U,K;F>g?(U=0,K=p.contentLeft+F-g):(U=g-F,K=p.contentLeft);const ie=this._originalVerticalStartPosition.read(c)??this._editor.getTopForLineNumber(u.startLineNumber)-this._editorObs.scrollTop.read(c),X=this._originalVerticalEndPosition.read(c)??this._editor.getBottomForLineNumber(u.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(c),ne=p.contentLeft-g;let ce=xt.fromLeftTopRightBottom(ne,ie,K,X);const ke=ce.height===0;ke||(ce=ce.withMargin(G_,Uf));const ot=this._previewEditorObs.observeLineHeightsForLineRange(d.modifiedLineRange).read(c).reduce((EX,NX)=>EX+NX,0),Lt=X-ie,Zt=Math.max(Lt,ot),mn=B===0,ms=0,Gi=Math.min(_+pH,S+p.width-p.contentLeft-ms);let yo=xt.fromLeftTopWidthHeight(ce.right+ms,ie,Gi,Zt);return ke?yo=yo.withMargin(G_,Uf).translateY(G_):yo=yo.withMargin(G_,Uf).translateX(Uf+ca),{codeRect:ce,editRect:yo,codeScrollLeft:g,contentLeft:p.contentLeft,isInsertion:ke,maxContentWidth:O,shouldShowShadow:mn,desiredPreviewEditorScrollLeft:U,previewEditorWidth:Gi}}),this._stickyScrollController=ia.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?dt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Nt(0),this._shouldOverflow=$(this,c=>!1),this._originalBackgroundColor=dt(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(lC)??V.transparent),this._backgroundSvg=Ae.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[Ae.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:$(this,c=>{const d=this._previewEditorLayoutInfo.read(c);if(!(!d||this._originalBackgroundColor.read(c).isTransparent()))return new FM().moveTo(d.codeRect.getRightTop()).lineTo(d.codeRect.getRightTop().deltaX(1e3)).lineTo(d.codeRect.getRightBottom().deltaX(1e3)).lineTo(d.codeRect.getRightBottom()).build()}),style:{fill:cU(ki,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=Ae.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(c=>c?.isInsertion?"none":"block")}},$(this,c=>{const d=Wl(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=l.read(c),u=Zk(this._tabAction).map(x=>`${ca}px solid ${Q(x)}`),g=`${ca+h}px solid ${Q(ki)}`,f=d.read(c).codeScrollLeft!==0,p=d.map(x=>x.codeRect.bottomxt.fromLeftTopRightBottom(x.contentLeft-tc-ca,x.codeRect.top,x.contentLeft,x.codeRect.bottom+_)).read(c),C=new ge(b.left,Number.MAX_SAFE_INTEGER),w=d.map(x=>x.codeRect.intersectHorizontal(C)),v=w.map(x=>x.withMargin(h,0,h,h).intersectHorizontal(C)),S=w.map(x=>xt.fromLeftTopWidthHeight(x.right-_+ca,x.bottom-ca,_,_).intersectHorizontal(C));return[Ae.div({class:"originalSeparatorSideBySide",style:{...v.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${tc}px 0 0 ${tc}px`,borderTop:g,borderBottom:g,borderLeft:f?"none":g}}),Ae.div({class:"originalOverlaySideBySide",style:{...w.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${tc}px 0 0 ${tc}px`,borderTop:u,borderBottom:u,borderLeft:f?"none":u,backgroundColor:Q(lC)}}),Ae.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:p.map(x=>x?"block":"none"),...S.read(c).toStyles()}},[Ae.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:ir(lC,this._themeService).map(x=>x.toString())}}),Ae.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:u,borderRight:u,borderRadius:"0 100% 0 0",backgroundColor:Q(ki)}})]),Ae.div({class:"originalOverlaySideBySideHider",style:{...b.toStyles(),backgroundColor:Q(ki)}})]})).keepUpdated(this._store),this._modifiedOverlay=Ae.div({style:{pointerEvents:"none"}},$(this,c=>{const d=Wl(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=d.map(w=>w.codeRect.bottom`0 ${tc}px ${tc}px ${w?tc:0}px`),f=ir(Fv(this._tabAction),this._themeService).map(w=>`1px solid ${w.toString()}`),p=`${ca+u}px solid ${Q(ki)}`,_=d.map(w=>w.editRect.withMargin(0,ca)),b=_.map(w=>w.withMargin(u,u,u,0)),C=$(this,w=>{const v=_.read(w),S=d.read(w);return!S.isInsertion||S.contentLeft>=v.left?xt.fromLeftTopWidthHeight(v.left,v.top,0,0):new xt(S.contentLeft,v.top,v.left,v.top+ca*2)});return[Ae.div({class:"modifiedInsertionSideBySide",style:{...C.read(c).toStyles(),backgroundColor:Fv(this._tabAction).map(w=>Q(w))}}),Ae.div({class:"modifiedSeparatorSideBySide",style:{...b.read(c).toStyles(),borderRadius:g,borderTop:p,borderBottom:p,borderRight:p,boxSizing:"border-box"}}),Ae.div({class:"modifiedOverlaySideBySide",style:{..._.read(c).toStyles(),borderRadius:g,border:f,boxSizing:"border-box",backgroundColor:Q(aZ)}})]})).keepUpdated(this._store),this._nonOverflowView=Ae.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,$(this,c=>this._shouldOverflow.read(c)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Nt(null),allowEditorOverflow:!1,minContentWidthInPx:$(this,c=>{const d=this._previewEditorLayoutInfo.read(c)?.maxContentWidth;return d===void 0?0:d})})),this.previewEditor.setModel(this._previewTextModel),this._register(xe(c=>{const d=this._previewEditorLayoutInfo.read(c);if(!d)return;const h=d.editRect.withMargin(-G_,-Uf);this.previewEditor.layout({height:h.height,width:d.previewEditorWidth+15}),this._editorContainer.element.style.top=`${h.top}px`,this._editorContainer.element.style.left=`${h.left}px`,this._editorContainer.element.style.width=`${d.previewEditorWidth+Uf}px`})),this._register(xe(c=>{const d=this._previewEditorLayoutInfo.read(c);d&&this._previewEditorObs.editor.setScrollLeft(d.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};xx=WLe([fH(5,fe),fH(6,ci)],xx);var VLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zLe=function(o,e){return function(t,i){e(t,i,o)}};const ic=1;let wp=class extends A{static{this.MAX_LENGTH=100}constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=n,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(Nt(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(Nt(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=De(this,null),this.isHovered=this._hoverableElement.map((r,a)=>r?.didMouseMoveDuringHover.read(a)??!1),this._renderTextEffect=$(this,r=>{const a=this._editor.model.get(),l=a.getLineContent(this._edit.range.startLineNumber),c=yn.replace(new ge(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),d=c.replace(l),h=a.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[d])?.[0];let u;h?u=Bc.fromLineTokens(h).slice(c.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):u=$t.createEmpty(this._edit.text,this._languageService.languageIdCodec);const g=Rw(new Mw([u]),Uc.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${g.minWidthInPx}px`});const s=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=$(this,r=>{this._renderTextEffect.read(r);const a=this._start.read(r),l=this._end.read(r);if(!a||!l||a.x>l.x||a.y>l.y)return;const c=s.read(r),d=this._editor.scrollLeft.read(r),h=this._editor.getOption(59).read(r).typicalHalfwidthCharacterWidth,u=3*h,g=4,f=new tn(u,g),p=xt.fromPoints(a,l).withHeight(c).translateX(-d),_=xt.fromPointSize(p.getLeftBottom().add(f),new tn(this._edit.text.length*h,p.height)),b=_.withLeft(p.left);return{originalLine:p,modifiedLine:_,lowerBackground:b,lineHeight:c}}),this.minEditorScrollHeight=$(this,r=>{const a=Wl(this._layout).read(r);return a?a.read(r).modifiedLine.bottom+ic+this._editor.editor.getScrollTop():0}),this._root=Ae.div({class:"word-replacement"},[$(this,r=>{const a=Wl(this._layout).read(r);if(!a)return[];const l=Zk(this._tabAction).map(d=>Q(d)).read(r),c=Fv(this._tabAction).map(d=>Q(d)).read(r);return[Ae.div({style:{position:"absolute",...mr(d=>y5(this._editor).read(d)),overflow:"hidden",pointerEvents:"none"}},[Ae.div({style:{position:"absolute",...mr(d=>a.read(d).lowerBackground.withMargin(ic,2*ic,ic,0)),background:Q(ki),cursor:"pointer",pointerEvents:"auto"},onmousedown:d=>{d.preventDefault()},onmouseup:d=>this._onDidClick.fire(new Wn(pe(d),d)),obsRef:d=>{this._hoverableElement.set(d,void 0)}}),Ae.div({style:{position:"absolute",...mr(d=>a.read(d).modifiedLine.withMargin(ic,2*ic)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`${ic}px solid ${c}`,background:Q(oLe),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${Q(ki)}`}},[this._line]),Ae.div({style:{position:"absolute",...mr(d=>a.read(d).originalLine.withMargin(ic)),boxSizing:"border-box",borderRadius:"4px",border:`${ic}px solid ${l}`,background:Q(nLe),pointerEvents:"none"}},[]),Ae.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:a.map(d=>d.modifiedLine.left-16),top:a.map(d=>d.modifiedLine.top+Math.round((d.lineHeight-14-5)/2))}},[Ae.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:Q(A7)}),Ae.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:Q(A7)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:Nt(0),position:Nt({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}};wp=VLe([zLe(3,_i)],wp);class ULe extends A{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new P),this.onDidClick=this._onDidClick.event,this.isHovered=Jt(this._originalEditor).isTargetHovered(s=>s.target.type===6&&s.target.detail.injectedText?.options.attachedData instanceof cE&&s.target.detail.injectedText.options.attachedData.owner===this,this._store),this._tokenizationFinished=qLe(this._modifiedTextModel),this._decorations=$(this,s=>{const r=this._state.read(s);if(!r)return;const a=r.modifiedText,l=r.mode==="insertionInline",c=r.diff.length===1&&r.diff[0].innerChanges?.length===1,d=!0,h=[],u=[],g=Te.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),f=Te.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),p=Te.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),_=Te.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),b=Te.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),C=Te.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),w=Te.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),v=r.mode!=="sideBySide"&&r.mode!=="deletion"&&r.mode!=="insertionInline"&&r.mode!=="lineReplacement",S=r.mode==="lineReplacement";for(const x of r.diff)if(v&&(x.original.isEmpty||h.push({range:x.original.toInclusiveRange(),options:f}),x.modified.isEmpty||u.push({range:x.modified.toInclusiveRange(),options:g})),x.modified.isEmpty||x.original.isEmpty)x.original.isEmpty||h.push({range:x.original.toInclusiveRange(),options:p}),x.modified.isEmpty||u.push({range:x.modified.toInclusiveRange(),options:_});else{const k=l&&$Le(x);for(const D of x.innerChanges||[]){if(x.original.contains(D.originalRange.startLineNumber)&&!(S&&D.originalRange.isEmpty())){const I=this._originalEditor.getModel()?.getValueInRange(D.originalRange,1);h.push({range:D.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:iE("inlineCompletions-char-delete",D.originalRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",D.originalRange.isEmpty()&&"empty",(D.originalRange.isEmpty()&&c||r.mode==="deletion"&&I===` +`)&&d&&!k&&"diff-range-empty"),inlineClassName:k?iE("strike-through","inlineCompletions"):null,zIndex:1}})}if(x.modified.contains(D.modifiedRange.startLineNumber)&&u.push({range:D.modifiedRange,options:D.modifiedRange.isEmpty()&&d&&!k&&c?C:b}),k){const I=a.getValueOfRange(D.modifiedRange),T=I.length>3?[{text:I.slice(0,1),extraClasses:["start"],offsetRange:new ge(D.modifiedRange.startColumn-1,D.modifiedRange.startColumn)},{text:I.slice(1,-1),extraClasses:[],offsetRange:new ge(D.modifiedRange.startColumn,D.modifiedRange.endColumn-2)},{text:I.slice(-1),extraClasses:["end"],offsetRange:new ge(D.modifiedRange.endColumn-2,D.modifiedRange.endColumn-1)}]:[{text:I,extraClasses:["start","end"],offsetRange:new ge(D.modifiedRange.startColumn-1,D.modifiedRange.endColumn)}];this._tokenizationFinished.read(s);const F=this._modifiedTextModel.tokenization.getLineTokens(D.modifiedRange.startLineNumber);for(const{text:O,extraClasses:B,offsetRange:U}of T)h.push({range:L.fromPositions(D.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:F.getTokensInRange(U),content:O,inlineClassName:iE("inlineCompletions-char-insert",D.modifiedRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",...B),cursorStops:dr.None,attachedData:new cE(this)},zIndex:2,showIfCollapsed:!0}})}}}if(r.isInDiffEditor)for(const x of r.diff)x.original.isEmpty||h.push({range:x.original.toExclusiveRange(),options:w});return{originalDecorations:h,modifiedDecorations:u}}),this._register(Jt(this._originalEditor).setDecorations(this._decorations.map(s=>s?.originalDecorations??[])));const n=this._state.map(s=>s?.modifiedCodeEditor);this._register(Xn((s,r)=>{const a=n.read(s);a&&r.add(Jt(a).setDecorations(this._decorations.map(l=>l?.modifiedDecorations??[])))})),this._register(this._originalEditor.onMouseUp(s=>{if(s.target.type!==6)return;const r=s.target.detail.injectedText?.options.attachedData;r instanceof cE&&r.owner===this&&this._onDidClick.fire(s.event)}))}}class cE{constructor(e){this.owner=e}}function $Le(o){return o.innerChanges?o.innerChanges.every(e=>yy(e.modifiedRange)&&yy(e.originalRange)):!1}let jLe=0;function qLe(o){return dt(o.onDidChangeTokens,()=>jLe++)}var KLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GLe=function(o,e){return function(t,i){e(t,i,o)}};let jM=class extends A{constructor(e,t,i,n,s,r){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=n,this._focusIsInMenu=s,this._instantiationService=r,this._editorObs=Jt(this._editor),this._tabAction=$(d=>this._model.read(d)?.tabAction.read(d)??Gn.Inactive),this._constructorDone=De(this,!1),this._uiState=$(this,d=>{const h=this._model.read(d);if(!h||!this._constructorDone.read(d))return;const u=h.inlineEdit;let g=ys.fromEdit(u.edit),f=u.edit.apply(u.originalText),p=Sy(g,u.originalText,new Xd(f)),_=this.determineRenderState(h,d,p,new Xd(f));if(!_){Ee(new Error(`unable to determine view: tried to render ${this._previousView?.view}`));return}if(_.kind===lt.SideBySide){const C=_Le(f,u.modifiedLineRange,l.getOptions().tabSize);f=C.applyToString(f),g=gLe(g,C),p=Sy(g,u.originalText,new Xd(f))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==f&&this._previewTextModel.setValue(f),h.showCollapsed.read(d)&&!this._indicator.read(d)?.isHoverVisible.read(d)&&(_={kind:lt.Collapsed,viewData:_.viewData}),h.handleInlineEditShown(_.kind,_.viewData),{state:_,diff:p,edit:u,newText:f,newTextLineCount:u.modifiedLineRange.length,isInDiffEditor:h.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(Mg,"",this._editor.getModel().getLanguageId(),{...Mg.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=De(this,!1),this._indicator=$(this,d=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(d))return;const h=An({owner:this,equalsFn:Vu(lO())},g=>{const f=this._ghostTextIndicator.read(g);if(f)return f.lineRange;const p=this._uiState.read(g);if(p){if(p.state?.kind==="custom"){const _=p.state.displayLocation?.range;if(!_)throw new Ce("custom view should have a range");return new be(_.startLineNumber,_.endLineNumber)}return p.state?.kind==="insertionMultiLine"?this._insertion.originalLines.read(g):p.edit.displayRange}}),u=$(this,g=>{const f=this._model.read(g);if(f)return f;const p=this._ghostTextIndicator.read(g);return p?p.model:f});return d.store.add(this._instantiationService.createInstance(BM,this._editorObs,h,this._gutterIndicatorOffset,u,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=$(this,d=>this._sideBySide.isHovered.read(d)||this._wordReplacementViews.read(d).some(h=>h.isHovered.read(d))||this._deletion.isHovered.read(d)||this._inlineDiffView.isHovered.read(d)||this._lineReplacementView.isHovered.read(d)||this._insertion.isHovered.read(d)||this._customView.isHovered.read(d)),this._gutterIndicatorOffset=$(this,d=>{if(this._uiState.read(d)?.state?.kind==="insertionMultiLine")return this._insertion.startLineOffset.read(d);const h=this._ghostTextIndicator.read(d);return h?XLe(h,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(xx,this._editor,this._model.map(d=>d?.inlineEdit),this._previewTextModel,this._uiState.map(d=>d&&d.state?.kind===lt.SideBySide?{newTextLineCount:d.newTextLineCount,isInDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(RLe,this._editor,this._model.map(d=>d?.inlineEdit),this._uiState.map(d=>d&&d.state?.kind===lt.Deletion?{originalRange:d.state.originalRange,deletions:d.state.deletions,inDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(UM,this._editor,this._uiState.map(d=>d&&d.state?.kind===lt.InsertionMultiLine?{lineNumber:d.state.lineNumber,startColumn:d.state.column,text:d.state.text,inDiffEditor:d.isInDiffEditor}:void 0),this._tabAction)),this._inlineDiffViewState=$(this,d=>{const h=this._uiState.read(d);if(!(!h||!h.state)&&!(h.state.kind==="wordReplacements"||h.state.kind==="insertionMultiLine"||h.state.kind==="collapsed"||h.state.kind==="custom"))return{modifiedText:new Xd(h.newText),diff:h.diff,mode:h.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:h.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(VM,this._editor,this._model.map((d,h)=>this._uiState.read(h)?.state?.kind==="collapsed"?d?.inlineEdit:void 0))),this._customView=this._register(this._instantiationService.createInstance(zM,this._editor,this._model.map((d,h)=>this._uiState.read(h)?.state?.kind==="custom"?d?.displayLocation:void 0),this._tabAction)),this._inlineDiffView=this._register(new ULe(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=hO(this,this._uiState.map(d=>d?.state?.kind==="wordReplacements"?d.state.replacements:[]),(d,h)=>h.add(this._instantiationService.createInstance(wp,this._editorObs,d,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance($M,this._editorObs,this._uiState.map(d=>d?.state?.kind===lt.LineReplacement?{originalRange:d.state.originalRange,modifiedRange:d.state.modifiedRange,modifiedLines:d.state.modifiedLines,replacements:d.state.replacements}:void 0),this._uiState.map(d=>d?.isInDiffEditor??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(d=>d.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(d=>d.edits.renderSideBySide),this._register(Xn((d,h)=>{const u=this._model.read(d);u&&h.add(te.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(d).map(g=>g.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(g=>{this._viewHasBeenShownLongerThan(350)&&(g.preventDefault(),u.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(HM,this._host,this._model,this._indicator,this._inlineCollapsedView));const a=$(this,d=>Math.max(...this._wordReplacementViews.read(d).map(h=>h.minEditorScrollHeight.read(d)),this._lineReplacementView.minEditorScrollHeight.read(d),this._customView.minEditorScrollHeight.read(d))).recomputeInitiallyAndOnChange(this._store),l=this._editor.getModel();let c;this._register(xe(d=>{const h=a.read(d);this._editor.changeViewZones(u=>{const g=this._editor.getScrollHeight(),f=h-g+1;f!==0&&c&&(u.removeZone(c),c=void 0),!(f<=0)&&(c=u.addZone({afterLineNumber:l.getLineCount(),heightInPx:f,domNode:J("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,n){const s=e.inlineEdit,r=this._previousView?.id===this.getCacheId(e)&&!e.displayLocation?.jumpToEdit,a=this._previousView?.editorWidth!==this._editorObs.layoutInfoWidth.read(t)&&(this._previousView?.view===lt.SideBySide||this._previousView?.view===lt.LineReplacement);if(r&&!a)return this._previousView.view;if(e.inlineEdit.inlineCompletion instanceof em&&e.inlineEdit.inlineCompletion.uri||e.displayLocation&&!e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))return lt.Custom;const l=s.originalLineRange.length,c=s.modifiedLineRange.length,d=i.flatMap(u=>u.innerChanges??[]),h=d.length===1;if(!e.isInDiffEditor){if(h&&this._useCodeShifting.read(t)!=="never"&&gZ(i))return ZLe(i,s.cursorPosition)?lt.InsertionInline:lt.LineReplacement;if(_H(d,s,n))return lt.Deletion;if(mH(i)&&this._useCodeShifting.read(t)==="always")return lt.InsertionMultiLine;if(d.every(g=>si.ofRange(g.originalRange).columnCountn.getValueOfRange(p.modifiedRange)),f=d.map(p=>e.inlineEdit.originalText.getValueOfRange(p.originalRange));if(!g.some(p=>p.includes(" "))&&!f.some(p=>p.includes(" "))&&(!d.some(p=>p.originalRange.isEmpty())||!bH(d.map(p=>new Ni(p.originalRange,"")),s.originalText).some(p=>p.range.isEmpty()&&si.ofRange(p.range).columnCount0&&c>0)return l===1&&c===1&&!e.isInDiffEditor?lt.LineReplacement:this._renderSideBySide.read(t)!=="never"&&xx.fitsInsideViewport(this._editor,this._previewTextModel,s,t)?lt.SideBySide:lt.LineReplacement;if(e.isInDiffEditor){if(_H(d,s,n))return lt.Deletion;if(mH(i)&&this._useCodeShifting.read(t)==="always")return lt.InsertionMultiLine}return lt.SideBySide}determineRenderState(e,t,i,n){const s=e.inlineEdit;let r=this.determineView(e,t,i,n);if(this._willRenderAboveCursor(t,s,r))switch(r){case lt.LineReplacement:case lt.WordReplacements:r=lt.SideBySide;break}this._previousView={id:this.getCacheId(e),view:r,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const a=i.flatMap(f=>f.innerChanges??[]),l=this._editor.getModel(),c=a.map(f=>({originalRange:f.originalRange,modifiedRange:f.modifiedRange,original:l.getValueInRange(f.originalRange),modified:n.getValueOfRange(f.modifiedRange)})),d=s.cursorPosition,h=c.length===0?!1:c[0].modified.startsWith(l.getEOL()),u={cursorColumnDistance:s.edit.replacements.length===0?0:s.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:s.lineEdit.lineRange.startLineNumber-d.lineNumber+(h&&s.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:s.lineEdit.lineRange.length,lineCountModified:s.lineEdit.newLines.length,characterCountOriginal:c.reduce((f,p)=>f+p.original.length,0),characterCountModified:c.reduce((f,p)=>f+p.modified.length,0),disjointReplacements:c.length,sameShapeReplacements:c.every(f=>f.original===c[0].original&&f.modified===c[0].modified)};switch(r){case lt.InsertionInline:return{kind:lt.InsertionInline,viewData:u};case lt.SideBySide:return{kind:lt.SideBySide,viewData:u};case lt.Collapsed:return{kind:lt.Collapsed,viewData:u};case lt.Custom:return{kind:lt.Custom,displayLocation:e.displayLocation,viewData:u}}if(r===lt.Deletion)return{kind:lt.Deletion,originalRange:s.originalLineRange,deletions:a.map(f=>f.originalRange),viewData:u};if(r===lt.InsertionMultiLine){const f=a[0];return{kind:lt.InsertionMultiLine,lineNumber:f.originalRange.startLineNumber,column:f.originalRange.startColumn,text:n.getValueOfRange(f.modifiedRange),viewData:u}}const g=c.map(f=>new Ni(f.originalRange,f.modified));if(g.length!==0){if(r===lt.WordReplacements){let f=YLe(g,s.originalText);return f.some(p=>p.range.isEmpty())&&(f=bH(g,s.originalText)),{kind:lt.WordReplacements,replacements:f,viewData:u}}if(r===lt.LineReplacement)return{kind:lt.LineReplacement,originalRange:s.originalLineRange,modifiedRange:s.modifiedLineRange,modifiedLines:s.modifiedLineRange.mapToLineArray(f=>n.getLineAt(f)),replacements:a.map(f=>({originalRange:f.originalRange,modifiedRange:f.modifiedRange})),viewData:u}}}_willRenderAboveCursor(e,t,i){if(this._useCodeShifting.read(e)==="always")return!1;for(const s of t.multiCursorPositions)if(i===lt.WordReplacements&&s.lineNumber===t.originalLineRange.startLineNumber+1||i===lt.LineReplacement&&s.lineNumber>=t.originalLineRange.endLineNumberExclusive&&s.lineNumber=e}};jM=KLe([GLe(5,fe)],jM);function gZ(o){return o.every(t=>t.innerChanges.every(i=>e(i)));function e(t){return!(!t.originalRange.isEmpty()||!(t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber))}}function ZLe(o,e){if(!e||!gZ(o))return!1;const t=e;return o.every(n=>n.innerChanges.every(s=>i(s)));function i(n){const s=n.originalRange.getStartPosition();return!!(t.isBeforeOrEqual(s)||s.lineNumberi.innerChanges??[]);if(e.length!==1)return!1;const t=e[0];return!(!t.originalRange.isEmpty()||t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber)}function _H(o,e,t){return o.map(n=>({original:e.originalText.getValueOfRange(n.originalRange),modified:t.getValueOfRange(n.modifiedRange)})).every(({original:n,modified:s})=>s.trim()===""&&n.length>0&&(n.length>s.length||n.trim()!==""))}function YLe(o,e){return fZ(o,e,t=>/^[a-zA-Z]$/.test(t))}function bH(o,e){return fZ(o,e,t=>!/^\s$/.test(t))}function fZ(o,e,t){const i=[];o.sort((s,r)=>L.compareRangesUsingStarts(s.range,r.range));for(const s of o){let r=s.range.startColumn-1,a=s.range.endColumn-2,l="",c="";const d=e.getLineAt(s.range.startLineNumber),h=e.getLineAt(s.range.endLineNumber);if(n(d[r]))for(;n(d[r-1]);)l=d[r-1]+l,r--;if(n(h[a])||a0&&L.areIntersectingOrTouching(i[i.length-1].range,u.range)&&(u=Ni.joinReplacements([i.pop(),u],e)),i.push(u)}function n(s){return s===void 0?!1:t(s)}return i}function XLe(o,e){const t=o.model.inlineEdit.edit.replacements;if(t.length!==1)return 0;const i=e.getModel();if(!i)return 0;const n=i.getEOL(),s=t[0];if(s.range.isEmpty()&&s.text.startsWith(n)){const r=e.getLineHeightForPosition(s.range.getStartPosition());return QLe(s.text,n)*r}return 0}function QLe(o,e){if(!e.length)return 0;let t=0,i=0;for(;o.startsWith(e,i);)t++,i+=e.length;return t}var JLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eke=function(o,e){return function(t,i){e(t,i,o)}};let qM=class extends A{static{this.hot=lk(this)}constructor(e,t,i,n,s){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=n,this._inlineEdit=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._edit.read(r);if(!l)return;const c=this._editor.getModel();if(!c)return;const d=a.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;if(!d)return;const h=d.replacements.map(f=>{const p=L.fromPositions(c.getPositionAt(f.replaceRange.start),c.getPositionAt(f.replaceRange.endExclusive));return new Ni(p,f.newText)}),u=new ho(h),g=new Wg(c);return new iZ(g,u,a.primaryPosition.read(void 0),a.allPositions.read(void 0),l.commands,l.inlineCompletion)}),this._inlineEditModel=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._inlineEdit.read(r);if(!l)return;const c=$(this,d=>{if(this._editorObs.isFocused.read(d)){if(a.tabShouldJumpToInlineEdit.read(d))return Gn.Jump;if(a.tabShouldAcceptInlineEdit.read(d))return Gn.Accept}return Gn.Inactive});return new nZ(a,l,c)}),this._inlineEditHost=$(this,r=>{const a=this._model.read(r);if(a)return new Gxe(a)}),this._ghostTextIndicator=$(this,r=>{const a=this._model.read(r);if(!a)return;const l=a.inlineCompletionState.read(r);if(!l)return;const c=l.inlineCompletion;if(!c||!c.showInlineEditMenu)return;const d=be.ofLength(l.primaryGhostText.lineNumber,1);return new Zxe(this._editor,a,d,c)}),this._editorObs=Jt(this._editor),this._register(s.createInstance(jM,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}};qM=JLe([eke(4,fe)],qM);var tke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ike=function(o,e){return function(t,i){e(t,i,o)}};let KM=class extends A{constructor(e,t,i,n){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=n,this._ghostTexts=$(this,s=>this._model.read(s)?.ghostTexts.read(s)??[]),this._stablizedGhostTexts=oye(this._ghostTexts,this._store),this._editorObs=Jt(this._editor),this._ghostTextWidgets=hO(this,this._stablizedGhostTexts,(s,r)=>sr(a=>this._instantiationService.createInstance(Av.hot.read(a),this._editor,{ghostText:s,warning:this._model.map((l,c)=>{const d=l?.warning?.read(c);return d?{icon:d.icon}:void 0}),minReservedLineCount:Nt(0),targetTextModel:this._model.map(l=>l?.textModel),handleInlineCompletionShown:this._model.map((l,c)=>{const d=l?.inlineCompletionState.read(c)?.inlineCompletion;return d?h=>l.handleInlineSuggestionShown(d,lt.GhostText,h):()=>{}})},this._editorObs.getOption(71).map(l=>({syntaxHighlightingEnabled:l.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(r)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=$(this,s=>this._model.read(s)?.inlineEditState.read(s)?.inlineEdit),this._everHadInlineEdit=ld(this,(s,r)=>r||!!this._inlineEdit.read(s)||!!this._model.read(s)?.inlineCompletionState.read(s)?.inlineCompletion?.showInlineEditMenu),this._inlineEditWidget=sr(s=>{if(this._everHadInlineEdit.read(s))return this._instantiationService.createInstance(qM.hot.read(s),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(s=>s.fontFamily),this._register($ne($(s=>` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${this._fontFamily.read(s)}; -}`))),this._register(new SM(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e)??!1}};oP=bIe([CIe(3,pe)],oP);var vIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yc=function(o,e){return function(t,i){e(t,i,o)}},Cl;let Ao=class extends F{static{Cl=this}static{this._instances=new Set}static{this.hot=nk(this)}static{this.ID="editor.contrib.inlineCompletionsController"}static getInFocusedEditorOrParent(e){const t=vZ(e);return t?Cl.get(t):null}static get(e){return vLe(e.getContribution(Cl.ID))}constructor(e,t,i,n,s,r,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=s,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=oi(this.editor),this._positions=$(this,p=>this._editorObs.selections.read(p)?.map(_=>_.getEndPosition())??[new R(1,1)]),this._suggestWidgetAdapter=this._register(new ske(this._editorObs,p=>this.model.get()?.handleSuggestAccepted(p),()=>this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())),this._enabledInConfig=pt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=pt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=pt(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=$(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Ee(this,!1),this._focusIsInEditorOrMenu=$(this,p=>{const _=this._editorObs.isFocused.read(p),b=this._focusIsInMenu.read(p);return _||b}),this._cursorIsInIndentation=$(this,p=>{const _=this._editorObs.cursorPosition.read(p);if(_===null)return!1;const b=this._editorObs.model.read(p);if(!b)return!1;this._editorObs.versionId.read(p);const C=b.getLineIndentColumn(_.lineNumber);return _.column<=C}),this.model=br(this,p=>{if(this._editorObs.isReadonly.read(p))return;const _=this._editorObs.model.read(p);return _?this._instantiationService.createInstance(P2,_,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Er(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(p=>!0),this._view=this._register(this._instantiationService.createInstance(oP,this.editor,this.model,this._focusIsInMenu)),Cl._instances.add(this),this._register(ge(()=>Cl._instances.delete(this))),this._register(ke(p=>{const _=this.model.read(p);if(!_)return;const b=_.state.read(p);if(!b||!this._focusIsInEditorOrMenu.read(void 0))return;const C=b.kind==="inlineEdit"?b.nextEditUri:void 0;for(const w of Cl._instances)w!==this&&(C&&zh(C,w.editor.getModel()?.uri)?w.model.read(void 0)?.trigger():w.reject())})),this._register(ke(p=>{const _=this.model.read(p),b=this.editor.getModel()?.uri;!_||!b||p.store.add(_.onDidAccept(()=>{for(const C of Cl._instances){if(C===this)continue;const w=C.model.read(void 0)?.state.read(void 0);w?.kind==="inlineEdit"&&zh(w.nextEditUri,b)&&C.model.read(void 0)?.stop("automatic")}}))})),this._register(Ka(this._editorObs.onDidType,(p,_)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(Ka(this._editorObs.onDidPaste,(p,_)=>{this._enabled.get()&&this.model.get()?.trigger()}));const h=new Set([lm.Tab.id,lm.DeleteLeft.id,lm.DeleteRight.id,rw,"acceptSelectedSuggestion",Ok.ID,Ak.ID,Wt.NextMatchFindAction,...pv.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(p=>{if(h.has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()){let _=!1;p.commandId===rw&&(_=!0),this._editorObs.forceUpdate(b=>{this.model.get()?.trigger(b,{noDelay:_})})}})),this._register(Ka(this._editorObs.selections,(p,_,b)=>{if(b.some(C=>C.reason===3||C.source==="api")){if(!this._hideInlineEditOnSelectionChange.get()&&this.model.get()?.state.get()?.kind==="inlineEdit")return;const C=this.model.get();if(!C)return;C.state.get()?.kind==="ghostText"&&this.model.get()?.stop()}})),this._register(ke(p=>{const _=this._focusIsInEditorOrMenu.read(p),b=this.model.read(void 0);if(_){const C=b?.state.read(void 0);(!C||C.kind!=="inlineEdit"||!C.nextEditUri)&&At(w=>{for(const v of Cl._instances)v!==this&&v.model.read(void 0)?.stop("automatic",w)});return}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||d_.dropDownVisible||b&&(b.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest&&b.inlineEditAvailable.read(void 0)||At(C=>{b.stop("automatic",C)}))})),this._register(ke(p=>{const _=this.model.read(p)?.inlineCompletionState.read(p);_?.suggestItem?_.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(ge(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const u=Ed(this,(p,_)=>{const C=this.model.read(p)?.state.read(p);return this._suggestWidgetAdapter.selectedItem.get()?_:C?.inlineCompletion?.semanticId});this._register(Jj($(p=>(this._playAccessibilitySignal.read(p),u.read(p),{})),async(p,_,b,C)=>{let w=this.model.get(),v=w?.state.get();if(!v||!w||(await ql(50,XN(C)),await HK(this._suggestWidgetAdapter.selectedItem,ss,()=>!1,XN(C)),w=this.model.get(),v=w?.state.get(),!v||!w))return;const S=v.kind==="ghostText"?w.textModel.getLineContent(v.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal(v.kind==="ghostText"?tt.inlineSuggestion:tt.nextEditSuggestion),this.editor.getOption(12)&&(v.kind==="ghostText"?this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(S)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const g=new yxe(this._contextKeyService);this._register(g.bind(Tt.cursorInIndentation,this._cursorIsInIndentation)),this._register(g.bind(Tt.hasSelection,p=>!this._editorObs.cursorSelection.read(p)?.isEmpty())),this._register(g.bind(Tt.cursorAtInlineEdit,this.model.map((p,_)=>p?.inlineEditState?.read(_)?.cursorAtInlineEdit.read(_)))),this._register(g.bind(Tt.tabShouldAcceptInlineEdit,this.model.map((p,_)=>!!p?.tabShouldAcceptInlineEdit.read(_)))),this._register(g.bind(Tt.tabShouldJumpToInlineEdit,this.model.map((p,_)=>!!p?.tabShouldJumpToInlineEdit.read(_)))),this._register(g.bind(Tt.inlineEditVisible,p=>this.model.read(p)?.inlineEditState.read(p)!==void 0)),this._register(g.bind(Tt.inlineSuggestionHasIndentation,p=>this.model.read(p)?.getIndentationInfo(p)?.startsWithIndentation)),this._register(g.bind(Tt.inlineSuggestionHasIndentationLessThanTabSize,p=>this.model.read(p)?.getIndentationInfo(p)?.startsWithIndentationLessThanTabSize)),this._register(g.bind(Tt.suppressSuggestions,p=>{const b=this.model.read(p)?.inlineCompletionState.read(p);return b?.primaryGhostText&&b?.inlineCompletion?b.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(g.bind(Tt.inlineSuggestionVisible,p=>{const b=this.model.read(p)?.inlineCompletionState.read(p);return!!b?.inlineCompletion&&b?.primaryGhostText!==void 0&&!b?.primaryGhostText.isEmpty()}));const f=$(this,p=>{const C=this.model.read(p)?.inlineCompletionState.read(p)?.primaryGhostText;return!C||C.isEmpty()?void 0:new R(C.lineNumber,C.parts[0].column)});this._register(g.bind(Tt.cursorBeforeGhostText,p=>{const _=f.read(p);if(!_)return!1;const b=this._editorObs.cursorPosition.read(p);return b?_.equals(b):!1})),this._register(this._instantiationService.createInstance(y2,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(169)&&(n=m(1204,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Ws(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new R(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){At(e=>{const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const i of Cl._instances)i!==this&&i.model.get()?.stop("automatic",e)})}jump(){const e=this.model.get();e&&e.jump()}};Ao=Cl=vIe([yc(1,pe),yc(2,Ne),yc(3,Oe),yc(4,Vt),yc(5,qr),yc(6,ue),yc(7,Td),yc(8,dt),yc(9,Mn)],Ao);class O3 extends de{static{this.ID=UG}constructor(){super({id:O3.ID,label:H(1183,"Show Next Inline Suggestion"),precondition:K.and(N.writable,Tt.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){Ao.get(t)?.model.get()?.next()}}class F3 extends de{static{this.ID=zG}constructor(){super({id:F3.ID,label:H(1184,"Show Previous Inline Suggestion"),precondition:K.and(N.writable,Tt.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){Ao.get(t)?.model.get()?.previous()}}const wIe="vscode://schemas/inlineCompletionProviderIdArgs";function SIe(o){const e=[];return o.providerId&&(e.push(o.providerId.toStringWithoutVersion()),e.push(o.providerId.extensionId+":*")),e}const sV=ELe(kLe({showNoResultNotification:sN(QH()),providerId:sN(TLe(wIe,yLe())),explicit:sN(QH())}),xLe());class yIe extends de{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:H(1185,"Trigger Inline Suggestion"),precondition:N.writable,metadata:{description:m(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:m(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:sV.getJSONSchema()}]}})}async run(e,t,i){const n=e.get(Li),s=e.get(ue),r=Ao.get(t),a=sV.validateOrThrow(i),l=a?.providerId?s.inlineCompletionsProvider.all(t.getModel()).find(c=>SIe(c).some(d=>d===a.providerId)):void 0;await Mte(async c=>{await r?.model.get()?.trigger(c,{provider:l,explicit:a?.explicit??!0}),r?.playAccessibilitySignal(c)}),a?.showNoResultNotification&&(r?.model.get()?.state.get()||n.notify({severity:U_.Info,message:m(1174,"No inline suggestion is available.")}))}}class LIe extends de{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:H(1186,"Accept Next Word Of Inline Suggestion"),precondition:K.and(N.writable,Tt.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:K.and(N.writable,Tt.inlineSuggestionVisible,Tt.cursorBeforeGhostText,F_.negate())},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1175,"Accept Word"),group:"primary",order:2}]})}async run(e,t){await Ao.get(t)?.model.get()?.acceptNextWord()}}class xIe extends de{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:H(1187,"Accept Next Line Of Inline Suggestion"),precondition:K.and(N.writable,Tt.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1176,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){await Ao.get(t)?.model.get()?.acceptNextLine()}}class DIe extends de{constructor(){super({id:rw,label:H(1188,"Accept Inline Suggestion"),precondition:K.or(Tt.inlineSuggestionVisible,Tt.inlineEditVisible),menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1177,"Accept"),group:"primary",order:2},{menuId:M.InlineEditsActions,title:m(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:K.or(K.and(Tt.inlineSuggestionVisible,N.tabMovesFocus.toNegated(),ze.Visible.toNegated(),N.hoverFocused.toNegated(),Tt.hasSelection.toNegated(),Tt.inlineSuggestionHasIndentationLessThanTabSize),K.and(Tt.inlineEditVisible,N.tabMovesFocus.toNegated(),ze.Visible.toNegated(),N.hoverFocused.toNegated(),Tt.tabShouldAcceptInlineEdit))}]})}async run(e,t){const i=Ao.getInFocusedEditorOrParent(e);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}Sn.registerKeybindingRule({id:rw,weight:202,primary:2,when:K.and(Tt.inInlineEditsPreviewEditor)});class kIe extends de{constructor(){super({id:bwe,label:H(1189,"Jump to next inline edit"),precondition:Tt.inlineEditVisible,menuOpts:[{menuId:M.InlineEditsActions,title:m(1179,"Jump"),group:"primary",order:1,when:Tt.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:K.and(Tt.inlineEditVisible,N.tabMovesFocus.toNegated(),ze.Visible.toNegated(),N.hoverFocused.toNegated(),Tt.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=Ao.get(t);i&&i.jump()}}class jk extends de{static{this.ID=$G}constructor(){super({id:jk.ID,label:H(1190,"Hide Inline Suggestion"),precondition:K.or(Tt.inlineSuggestionVisible,Tt.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:M.InlineEditsActions,title:m(1180,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=Ao.getInFocusedEditorOrParent(e);At(n=>{i?.model.get()?.stop("explicitCancel",n)}),i?.editor.focus()}}class W3 extends de{static{this.ID=wM}constructor(){super({id:W3.ID,label:H(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:K.true()})}async run(e,t){const i=e.get(Oe),n=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!n)}}Sn.registerKeybindingRule({id:jk.ID,weight:-1,primary:9,secondary:[1033],when:K.and(Tt.inInlineEditsPreviewEditor)});class B3 extends yn{static{this.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar"}constructor(){super({id:B3.ID,title:m(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:M.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:K.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(Oe),n=t.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",n)}}class IIe extends de{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:m(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:K.or(Tt.inlineEditVisible,Tt.inlineSuggestionVisible)})}async run(e,t){const i=e.get(Mo),s=Ao.get(t)?.model.get();if(!s)return;const r=s.extractReproSample(),l=No(JSON.stringify({inlineCompletion:r.inlineCompletion},null,4)).map(d=>"// "+d).join(` +}`))),this._register(new dR(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e)??!1}};KM=tke([ike(3,fe)],KM);var nke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nc=function(o,e){return function(t,i){e(t,i,o)}},il;let wo=class extends A{static{il=this}static{this._instances=new Set}static{this.hot=lk(this)}static{this.ID="editor.contrib.inlineCompletionsController"}static getInFocusedEditorOrParent(e){const t=NK(e);return t?il.get(t):null}static get(e){return n0e(e.getContribution(il.ID))}constructor(e,t,i,n,s,r,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=s,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=Jt(this.editor),this._positions=$(this,p=>this._editorObs.selections.read(p)?.map(_=>_.getEndPosition())??[new R(1,1)]),this._suggestWidgetAdapter=this._register(new Vxe(this._editorObs,p=>this.model.get()?.handleSuggestAccepted(p),()=>this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())),this._enabledInConfig=dt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=dt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=dt(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=$(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=De(this,!1),this._focusIsInEditorOrMenu=$(this,p=>{const _=this._editorObs.isFocused.read(p),b=this._focusIsInMenu.read(p);return _||b}),this._cursorIsInIndentation=$(this,p=>{const _=this._editorObs.cursorPosition.read(p);if(_===null)return!1;const b=this._editorObs.model.read(p);if(!b)return!1;this._editorObs.versionId.read(p);const C=b.getLineIndentColumn(_.lineNumber);return _.column<=C}),this.model=sr(this,p=>{if(this._editorObs.isReadonly.read(p))return;const _=this._editorObs.model.read(p);return _?this._instantiationService.createInstance(SM,_,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=pr(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(p=>!0),this._view=this._register(this._instantiationService.createInstance(KM,this.editor,this.model,this._focusIsInMenu)),il._instances.add(this),this._register(ue(()=>il._instances.delete(this))),this._register(xe(p=>{const _=this.model.read(p);if(!_)return;const b=_.state.read(p);if(!b||!this._focusIsInEditorOrMenu.read(void 0))return;const C=b.kind==="inlineEdit"?b.nextEditUri:void 0;for(const w of il._instances)w!==this&&(C&&wh(C,w.editor.getModel()?.uri)?w.model.read(void 0)?.trigger():w.reject())})),this._register(xe(p=>{const _=this.model.read(p),b=this.editor.getModel()?.uri;!_||!b||p.store.add(_.onDidAccept(()=>{for(const C of il._instances){if(C===this)continue;const w=C.model.read(void 0)?.state.read(void 0);w?.kind==="inlineEdit"&&wh(w.nextEditUri,b)&&C.model.read(void 0)?.stop("automatic")}}))})),this._register(Ta(this._editorObs.onDidType,(p,_)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(Ta(this._editorObs.onDidPaste,(p,_)=>{this._enabled.get()&&this.model.get()?.trigger()}));const h=new Set([Rp.Tab.id,Rp.DeleteLeft.id,Rp.DeleteRight.id,Sv,"acceptSelectedSuggestion",Vk.ID,Hk.ID,Tt.NextMatchFindAction,...TC.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(p=>{if(h.has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()){let _=!1;p.commandId===Sv&&(_=!0),this._editorObs.forceUpdate(b=>{this.model.get()?.trigger(b,{noDelay:_})})}})),this._register(Ta(this._editorObs.selections,(p,_,b)=>{if(b.some(C=>C.reason===3||C.source==="api")){if(!this._hideInlineEditOnSelectionChange.get()&&this.model.get()?.state.get()?.kind==="inlineEdit")return;const C=this.model.get();if(!C)return;C.state.get()?.kind==="ghostText"&&this.model.get()?.stop()}})),this._register(xe(p=>{const _=this._focusIsInEditorOrMenu.read(p),b=this.model.read(void 0);if(_){const C=b?.state.read(void 0);(!C||C.kind!=="inlineEdit"||!C.nextEditUri)&&Et(w=>{for(const v of il._instances)v!==this&&v.model.read(void 0)?.stop("automatic",w)});return}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||Pm.dropDownVisible||b&&(b.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest&&b.inlineEditAvailable.read(void 0)||Et(C=>{b.stop("automatic",C)}))})),this._register(xe(p=>{const _=this.model.read(p)?.inlineCompletionState.read(p);_?.suggestItem?_.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(ue(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const u=ld(this,(p,_)=>{const C=this.model.read(p)?.state.read(p);return this._suggestWidgetAdapter.selectedItem.get()?_:C?.inlineCompletion?.semanticId});this._register(f$($(p=>(this._playAccessibilitySignal.read(p),u.read(p),{})),async(p,_,b,C)=>{let w=this.model.get(),v=w?.state.get();if(!v||!w||(await El(50,VE(C)),await Yj(this._suggestWidgetAdapter.selectedItem,Yn,()=>!1,VE(C)),w=this.model.get(),v=w?.state.get(),!v||!w))return;const S=v.kind==="ghostText"?w.textModel.getLineContent(v.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal(v.kind==="ghostText"?Ze.inlineSuggestion:Ze.nextEditSuggestion),this.editor.getOption(12)&&(v.kind==="ghostText"?this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(S)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const g=new rye(this._contextKeyService);this._register(g.bind(kt.cursorInIndentation,this._cursorIsInIndentation)),this._register(g.bind(kt.hasSelection,p=>!this._editorObs.cursorSelection.read(p)?.isEmpty())),this._register(g.bind(kt.cursorAtInlineEdit,this.model.map((p,_)=>p?.inlineEditState?.read(_)?.cursorAtInlineEdit.read(_)))),this._register(g.bind(kt.tabShouldAcceptInlineEdit,this.model.map((p,_)=>!!p?.tabShouldAcceptInlineEdit.read(_)))),this._register(g.bind(kt.tabShouldJumpToInlineEdit,this.model.map((p,_)=>!!p?.tabShouldJumpToInlineEdit.read(_)))),this._register(g.bind(kt.inlineEditVisible,p=>this.model.read(p)?.inlineEditState.read(p)!==void 0)),this._register(g.bind(kt.inlineSuggestionHasIndentation,p=>this.model.read(p)?.getIndentationInfo(p)?.startsWithIndentation)),this._register(g.bind(kt.inlineSuggestionHasIndentationLessThanTabSize,p=>this.model.read(p)?.getIndentationInfo(p)?.startsWithIndentationLessThanTabSize)),this._register(g.bind(kt.suppressSuggestions,p=>{const b=this.model.read(p)?.inlineCompletionState.read(p);return b?.primaryGhostText&&b?.inlineCompletion?b.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(g.bind(kt.inlineSuggestionVisible,p=>{const b=this.model.read(p)?.inlineCompletionState.read(p);return!!b?.inlineCompletion&&b?.primaryGhostText!==void 0&&!b?.primaryGhostText.isEmpty()}));const f=$(this,p=>{const C=this.model.read(p)?.inlineCompletionState.read(p)?.primaryGhostText;return!C||C.isEmpty()?void 0:new R(C.lineNumber,C.parts[0].column)});this._register(g.bind(kt.cursorBeforeGhostText,p=>{const _=f.read(p);if(!_)return!1;const b=this._editorObs.cursorPosition.read(p);return b?_.equals(b):!1})),this._register(this._instantiationService.createInstance(hM,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(169)&&(n=m(1204,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Is(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new R(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){Et(e=>{const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const i of il._instances)i!==this&&i.model.get()?.stop("automatic",e)})}jump(){const e=this.model.get();e&&e.jump()}};wo=il=nke([nc(1,fe),nc(2,Ie),nc(3,Pe),nc(4,Pt),nc(5,Rr),nc(6,he),nc(7,dd),nc(8,st),nc(9,kn)],wo);class x5 extends le{static{this.ID=Jq}constructor(){super({id:x5.ID,label:H(1183,"Show Next Inline Suggestion"),precondition:q.and(N.writable,kt.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){wo.get(t)?.model.get()?.next()}}class L5 extends le{static{this.ID=Qq}constructor(){super({id:L5.ID,label:H(1184,"Show Previous Inline Suggestion"),precondition:q.and(N.writable,kt.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){wo.get(t)?.model.get()?.previous()}}const ske="vscode://schemas/inlineCompletionProviderIdArgs";function oke(o){const e=[];return o.providerId&&(e.push(o.providerId.toStringWithoutVersion()),e.push(o.providerId.extensionId+":*")),e}const CH=u0e(d0e({showNoResultNotification:GI(g8()),providerId:GI(f0e(ske,r0e())),explicit:GI(g8())}),l0e());class rke extends le{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:H(1185,"Trigger Inline Suggestion"),precondition:N.writable,metadata:{description:m(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:m(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:CH.getJSONSchema()}]}})}async run(e,t,i){const n=e.get(bi),s=e.get(he),r=wo.get(t),a=CH.validateOrThrow(i),l=a?.providerId?s.inlineCompletionsProvider.all(t.getModel()).find(c=>oke(c).some(d=>d===a.providerId)):void 0;await FJ(async c=>{await r?.model.get()?.trigger(c,{provider:l,explicit:a?.explicit??!0}),r?.playAccessibilitySignal(c)}),a?.showNoResultNotification&&(r?.model.get()?.state.get()||n.notify({severity:g_.Info,message:m(1174,"No inline suggestion is available.")}))}}class ake extends le{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:H(1186,"Accept Next Word Of Inline Suggestion"),precondition:q.and(N.writable,kt.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:q.and(N.writable,kt.inlineSuggestionVisible,kt.cursorBeforeGhostText,a_.negate())},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1175,"Accept Word"),group:"primary",order:2}]})}async run(e,t){await wo.get(t)?.model.get()?.acceptNextWord()}}class lke extends le{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:H(1187,"Accept Next Line Of Inline Suggestion"),precondition:q.and(N.writable,kt.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1176,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){await wo.get(t)?.model.get()?.acceptNextLine()}}class cke extends le{constructor(){super({id:Sv,label:H(1188,"Accept Inline Suggestion"),precondition:q.or(kt.inlineSuggestionVisible,kt.inlineEditVisible),menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m(1177,"Accept"),group:"primary",order:2},{menuId:M.InlineEditsActions,title:m(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:q.or(q.and(kt.inlineSuggestionVisible,N.tabMovesFocus.toNegated(),Be.Visible.toNegated(),N.hoverFocused.toNegated(),kt.hasSelection.toNegated(),kt.inlineSuggestionHasIndentationLessThanTabSize),q.and(kt.inlineEditVisible,N.tabMovesFocus.toNegated(),Be.Visible.toNegated(),N.hoverFocused.toNegated(),kt.tabShouldAcceptInlineEdit))}]})}async run(e,t){const i=wo.getInFocusedEditorOrParent(e);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}fn.registerKeybindingRule({id:Sv,weight:202,primary:2,when:q.and(kt.inInlineEditsPreviewEditor)});class dke extends le{constructor(){super({id:tCe,label:H(1189,"Jump to next inline edit"),precondition:kt.inlineEditVisible,menuOpts:[{menuId:M.InlineEditsActions,title:m(1179,"Jump"),group:"primary",order:1,when:kt.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:q.and(kt.inlineEditVisible,N.tabMovesFocus.toNegated(),Be.Visible.toNegated(),N.hoverFocused.toNegated(),kt.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=wo.get(t);i&&i.jump()}}class Yk extends le{static{this.ID=eK}constructor(){super({id:Yk.ID,label:H(1190,"Hide Inline Suggestion"),precondition:q.or(kt.inlineSuggestionVisible,kt.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:M.InlineEditsActions,title:m(1180,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=wo.getInFocusedEditorOrParent(e);Et(n=>{i?.model.get()?.stop("explicitCancel",n)}),i?.editor.focus()}}class k5 extends le{static{this.ID=cR}constructor(){super({id:k5.ID,label:H(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:q.true()})}async run(e,t){const i=e.get(Pe),n=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!n)}}fn.registerKeybindingRule({id:Yk.ID,weight:-1,primary:9,secondary:[1033],when:q.and(kt.inInlineEditsPreviewEditor)});class D5 extends pn{static{this.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar"}constructor(){super({id:D5.ID,title:m(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:M.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:q.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(Pe),n=t.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",n)}}class hke extends le{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:m(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:q.or(kt.inlineEditVisible,kt.inlineSuggestionVisible)})}async run(e,t){const i=e.get(Co),s=wo.get(t)?.model.get();if(!s)return;const r=s.extractReproSample(),l=bo(JSON.stringify({inlineCompletion:r.inlineCompletion},null,4)).map(d=>"// "+d).join(` `),c=`${r.documentValue} // ${l} // -`;return await i.writeText(c),{reproCase:c}}}var EIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QS=function(o,e){return function(t,i){e(t,i,o)}};class NIe{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let rP=class{constructor(e,t,i,n,s){this._editor=e,this.accessibilityService=t,this._instantiationService=i,this._telemetryService=n,this._markdownRendererService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Ao.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new Gb(1e3,this,D.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(i.type===7&&t.shouldShowHoverAt(i.range))return new Gb(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new Gb(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===9&&i.element){const n=Cw.getWarningWidgetContext(i.element);if(n&&t.shouldShowHoverAt(n.range))return new Gb(1e3,this,n.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const i=Ao.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new NIe(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new z,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,n));const s=n.controller.model.get(),r=document.createElement("div");e.fragment.appendChild(r),i.add(os((l,c)=>{const d=c.add(this._instantiationService.createInstance(d_.hot.read(l),this._editor,!1,Ot(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.activeCommands,s.warning,()=>{e.onContentsChanged()}));r.replaceChildren(d.getDomNode())})),s.triggerExplicitly();const a={hoverPart:n,hoverElement:r,dispose(){i.dispose()}};return new pf([a])}getAccessibleContent(e){return m(1205,"There are inline completions here")}renderScreenReaderText(e,t){const i=new z,n=ee,s=n("div.hover-row.markdown-hover"),r=Y(s,n("div.hover-contents",{"aria-live":"assertive"})),a=l=>{const c=m(1206,"Suggestion:"),d=i.add(this._markdownRendererService.render(new ts().appendText(c).appendCodeblock("text",l),{context:this._editor,asyncRenderCallback:()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}}));r.replaceChildren(d.element)};return i.add(ke(l=>{const c=t.controller.model.read(l)?.primaryGhostText.read(l);if(c){const d=this._editor.getModel().getLineContent(c.lineNumber);a(c.renderForScreenReader(d))}else gn(r)})),e.fragment.appendChild(s),i}};rP=EIe([QS(1,Mn),QS(2,pe),QS(3,cs),QS(4,Sa)],rP);class TIe{}nt(Ao.ID,wLe(Ao.hot),3);oe(yIe);oe(O3);oe(F3);oe(LIe);oe(xIe);oe(DIe);oe(W3);oe(jk);oe(kIe);Lt(B3);oe(IIe);Lt(k3);Lt(I3);Bf.register(rP);Rk.register(new TIe);var RIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vN=function(o,e){return function(t,i){e(t,i,o)}},nC;let Sw=class{static{nC=this}static{this.ID="editor.contrib.gotodefinitionatposition"}static{this.MAX_SOURCE_PREVIEW_LINES=8}constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new z,this.toUnhookForKeyboard=new z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new Ck(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Te(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(nC.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new dG(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Qi(r=>this.findDefinition(e,r));let n;try{n=await this.previousPromise}catch(r){Te(r);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const s=n[0].originSelectionRange?D.lift(n[0].originSelectionRange):new D(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let r=s;for(const{originSelectionRange:a}of n)a&&(r=D.plusRange(r,a));this.addDecoration(r,new ts().appendText(m(1077,"Click to show {0} definitions.",n.length)))}else{const r=n[0];return r.uri?this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:c}=r.range;if(c<1||c>l.getLineCount()){a.dispose();return}const d=this.getPreviewValue(l,c,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.uri);this.addDecoration(s,d?new ts().appendCodeblock(h||"",d):void 0),a.dispose()}):void 0}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=nC.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),n=e.validateRange(n),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(101)&&!this.isInPeekEditor(i);return new E1({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Ne);return lo.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Sw=nC=RIe([vN(1,ys),vN(2,yi),vN(3,ue)],Sw);nt(Sw.ID,Sw,2);class MIe extends de{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:H(1101,"Developer: Debug Editor GPU Renderer"),precondition:K.true()})}async run(e,t){const i=e.get(pe),s=await e.get(as).pick([{label:m(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:m(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:m(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(s)switch(s.id){case"logTextureAtlasStats":i.invokeFunction(r=>{const a=r.get(Ht),l=ms.atlas;if(!ms.atlas){a.error("No texture atlas found");return}const c=l.getStats();a.info(["Texture atlas stats",...c].join(` +`;return await i.writeText(c),{reproCase:c}}}var uke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sS=function(o,e){return function(t,i){e(t,i,o)}};class gke{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let GM=class{constructor(e,t,i,n,s){this._editor=e,this.accessibilityService=t,this._instantiationService=i,this._telemetryService=n,this._markdownRendererService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=wo.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new db(1e3,this,L.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(i.type===7&&t.shouldShowHoverAt(i.range))return new db(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new db(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===9&&i.element){const n=Av.getWarningWidgetContext(i.element);if(n&&t.shouldShowHoverAt(n.range))return new db(1e3,this,n.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const i=wo.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new gke(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new z,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,n));const s=n.controller.model.get(),r=document.createElement("div");e.fragment.appendChild(r),i.add(Xn((l,c)=>{const d=c.add(this._instantiationService.createInstance(Pm.hot.read(l),this._editor,!1,Nt(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.activeCommands,s.warning,()=>{e.onContentsChanged()}));r.replaceChildren(d.getDomNode())})),s.triggerExplicitly();const a={hoverPart:n,hoverElement:r,dispose(){i.dispose()}};return new jg([a])}getAccessibleContent(e){return m(1205,"There are inline completions here")}renderScreenReaderText(e,t){const i=new z,n=J,s=n("div.hover-row.markdown-hover"),r=Z(s,n("div.hover-contents",{"aria-live":"assertive"})),a=l=>{const c=m(1206,"Suggestion:"),d=i.add(this._markdownRendererService.render(new Kn().appendText(c).appendCodeblock("text",l),{context:this._editor,asyncRenderCallback:()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}}));r.replaceChildren(d.element)};return i.add(xe(l=>{const c=t.controller.model.read(l)?.primaryGhostText.read(l);if(c){const d=this._editor.getModel().getLineContent(c.lineNumber);a(c.renderForScreenReader(d))}else on(r)})),e.fragment.appendChild(s),i}};GM=uke([sS(1,kn),sS(2,fe),sS(3,ts),sS(4,aa)],GM);class fke{}Xe(wo.ID,s0e(wo.hot),3);se(rke);se(x5);se(L5);se(ake);se(lke);se(cke);se(k5);se(Yk);se(dke);bt(D5);se(hke);bt(p5);bt(m5);mf.register(GM);Fk.register(new fke);var pke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dE=function(o,e){return function(t,i){e(t,i,o)}},Cb;let Wv=class{static{Cb=this}static{this.ID="editor.contrib.gotodefinitionatposition"}static{this.MAX_SOURCE_PREVIEW_LINES=8}constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new z,this.toUnhookForKeyboard=new z,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new xk(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Ee(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Cb.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new vq(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=$i(r=>this.findDefinition(e,r));let n;try{n=await this.previousPromise}catch(r){Ee(r);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const s=n[0].originSelectionRange?L.lift(n[0].originSelectionRange):new L(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let r=s;for(const{originSelectionRange:a}of n)a&&(r=L.plusRange(r,a));this.addDecoration(r,new Kn().appendText(m(1077,"Click to show {0} definitions.",n.length)))}else{const r=n[0];return r.uri?this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:c}=r.range;if(c<1||c>l.getLineCount()){a.dispose();return}const d=this.getPreviewValue(l,c,r),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.uri);this.addDecoration(s,d?new Kn().appendCodeblock(h||"",d):void 0),a.dispose()}):void 0}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=Cb.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),n=e.validateRange(n),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(101)&&!this.isInPeekEditor(i);return new jw({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Ie);return Xs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Wv=Cb=pke([dE(1,fs),dE(2,_i),dE(3,he)],Wv);Xe(Wv.ID,Wv,2);class mke extends le{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:H(1101,"Developer: Debug Editor GPU Renderer"),precondition:q.true()})}async run(e,t){const i=e.get(fe),s=await e.get(Jn).pick([{label:m(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:m(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:m(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(s)switch(s.id){case"logTextureAtlasStats":i.invokeFunction(r=>{const a=r.get(Mt),l=as.atlas;if(!as.atlas){a.error("No texture atlas found");return}const c=l.getStats();a.info(["Texture atlas stats",...c].join(` -`))});break;case"saveTextureAtlas":i.invokeFunction(async r=>{const a=r.get(xd),l=r.get(W6),c=a.getWorkspace().folders;if(c.length>0){const d=ms.atlas,h=[];for(const[u,g]of d.pages.entries())h.push(l.writeFile(be.joinPath(c[0].uri,`textureAtlasPage${u}_actual.png`),Eh.wrap(new Uint8Array(await(await g.source.convertToBlob()).arrayBuffer()))),l.writeFile(be.joinPath(c[0].uri,`textureAtlasPage${u}_usage.png`),Eh.wrap(new Uint8Array(await(await g.getUsagePreview()).arrayBuffer()))));await Promise.all(h)}});break;case"drawGlyph":i.invokeFunction(async r=>{const a=r.get(Oe),l=r.get(W6),c=r.get(as),h=r.get(xd).getWorkspace().folders;if(h.length===0)return;const u=ms.atlas,g=a.getValue("editor.fontFamily"),f=a.getValue("editor.fontSize"),p=new Fv(f,g,St().devicePixelRatio,ms.decorationStyleCache);let _=await c.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!_)return;const b=_.match(/0x(?[0-9a-f]+)/i)?.groups?.codePoint;b!==void 0&&(_=String.fromCodePoint(parseInt(b,16)));const C=0,v=u.getGlyph(p,_,C,0,0);if(!v)return;const S=u.pages[v.pageIndex].source.getContext("2d")?.getImageData(v.x,v.y,v.w,v.h);if(!S)return;const L=new OffscreenCanvas(S.width,S.height);ef(L.getContext("2d")).putImageData(S,0,0);const k=await L.convertToBlob({type:"image/png"}),I=be.joinPath(h[0].uri,`glyph_${_}_${C}_${f}px_${g.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await l.writeFile(I,Eh.wrap(new Uint8Array(await k.arrayBuffer())))});break}}}oe(MIe);var Na;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(Na||(Na={}));class PIe extends de{constructor(){super({id:VG,label:H(1107,"Show or Focus Hover"),metadata:{description:H(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Na.NoAutoFocus,Na.FocusIfVisible,Na.AutoFocusImmediately],enumDescriptions:[m(1104,"The hover will not automatically take focus."),m(1105,"The hover will take focus only if it is already visible."),m(1106,"The hover will automatically take focus when it appears.")],default:Na.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:Hi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ls.get(t);if(!n)return;const s=i?.focus;let r=Na.FocusIfVisible;Object.values(Na).includes(s)?r=s:typeof s=="boolean"&&s&&(r=Na.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),h=new D(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,1,2,c)},l=t.getOption(2)===2;n.isHoverVisible?r!==Na.NoAutoFocus?n.focus():a(l):a(l||r===Na.AutoFocusImmediately)}}class AIe extends de{constructor(){super({id:rwe,label:H(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:H(1110,"Show the definition preview hover in the editor.")}})}run(e,t){const i=ls.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new D(n.lineNumber,n.column,n.lineNumber,n.column),r=Sw.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,2,!0)})}}class OIe extends de{constructor(){super({id:awe,label:H(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){ls.get(t)?.hideContentHover()}}class FIe extends de{constructor(){super({id:lwe,label:H(1112,"Scroll Up Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:16,weight:100},metadata:{description:H(1113,"Scroll up the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.scrollUp()}}class WIe extends de{constructor(){super({id:cwe,label:H(1114,"Scroll Down Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:18,weight:100},metadata:{description:H(1115,"Scroll down the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.scrollDown()}}class BIe extends de{constructor(){super({id:dwe,label:H(1116,"Scroll Left Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:15,weight:100},metadata:{description:H(1117,"Scroll left the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.scrollLeft()}}class HIe extends de{constructor(){super({id:hwe,label:H(1118,"Scroll Right Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:17,weight:100},metadata:{description:H(1119,"Scroll right the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.scrollRight()}}class VIe extends de{constructor(){super({id:uwe,label:H(1120,"Page Up Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:H(1121,"Page up the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.pageUp()}}class zIe extends de{constructor(){super({id:gwe,label:H(1122,"Page Down Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:H(1123,"Page down the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.pageDown()}}class UIe extends de{constructor(){super({id:fwe,label:H(1124,"Go To Top Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:H(1125,"Go to the top of the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.goToTop()}}class $Ie extends de{constructor(){super({id:pwe,label:H(1126,"Go To Bottom Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:H(1127,"Go to the bottom of the editor hover.")}})}run(e,t){const i=ls.get(t);i&&i.goToBottom()}}class jIe extends de{constructor(){super({id:fk,label:mwe,alias:"Increase Hover Verbosity Level",precondition:N.hoverVisible})}run(e,t,i){const n=ls.get(t);if(!n)return;const s=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(bo.Increase,s,i?.focus)}}class qIe extends de{constructor(){super({id:pk,label:_we,alias:"Decrease Hover Verbosity Level",precondition:N.hoverVisible})}run(e,t,i){const n=ls.get(t);if(!n)return;const s=i?.index!==void 0?i.index:n.focusedHoverPartIndex();ls.get(t)?.updateHoverVerbosityLevel(bo.Decrease,s,i?.focus)}}class KIe{constructor(e){this._editor=e}computeSync(e){const t=r=>({value:r}),i=this._editor.getLineDecorations(e.lineNumber),n=[],s=e.laneOrLine==="lineNo";if(!i)return n;for(const r of i){const a=r.options.glyphMargin?.position??Xa.Center;if(!s&&a!==e.laneOrLine)continue;const l=s?r.options.lineNumberHoverMessage:r.options.glyphMarginHoverMessage;!l||o_(l)||n.push(...b4(l).map(t))}return n}}var GIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ZIe=function(o,e){return function(t,i){e(t,i,o)}},aP;const oV=ee;let lP=class extends F{static{aP=this}static{this.ID="editor.contrib.modesGlyphHoverWidget"}constructor(e,t){super(),this._markdownRendererService=t,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new P5(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new jG(this._editor,new KIe(this._editor))),this._register(this._hoverOperation.onResult(i=>this._withResult(i))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(59)&&this._updateFont()})),this._register(Ti(this._hover.containerDomNode,"mouseleave",i=>{this._onMouseLeave(i)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return aP.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const s of i){const r=oV("div.hover-row.markdown-hover"),a=Y(r,oV("div.hover-contents")),l=this._renderDisposeables.add(this._markdownRendererService.render(s.value,{context:this._editor}));a.appendChild(l.element),n.appendChild(r)}this._updateContents(n),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),r=this._editor.getOption(75),a=this._hover.containerDomNode.clientHeight,l=n-s-(a-r)/2,c=i.glyphMarginLeft+i.glyphMarginWidth+(t==="lineNo"?i.lineNumbersWidth:0),h=i.height-a,u=Math.max(0,Math.min(Math.round(l),h));if(this._editor.getOption(51)){const f=this._editor.getDomNode();if(f){const p=wi(f);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${p.left+c}px`,this._hover.containerDomNode.style.top=`${p.top+u}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${u}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!mk(t,e.x,e.y))&&this.hide()}};lP=aP=GIe([ZIe(1,Sa)],lP);var YIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XIe=function(o,e){return function(t,i){e(t,i,o)}};let vx=class extends F{static{this.ID="editor.contrib.marginHover"}constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new z,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new It(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnGlyphHoverWidget(e)&&this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){const t=this._glyphWidget?.getDomNode();return t?mk(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e))||this.hideGlyphHover()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this.hideGlyphHover()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this.hideGlyphHover())}hideGlyphHover(){this._glyphWidget?.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(lP,this._editor)),this._glyphWidget}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose()}};vx=YIe([XIe(1,pe)],vx);class QIe{}class JIe{}class eEe{}nt(ls.ID,ls,2);nt(vx.ID,vx,2);oe(PIe);oe(AIe);oe(OIe);oe(FIe);oe(WIe);oe(BIe);oe(HIe);oe(VIe);oe(zIe);oe(UIe);oe($Ie);oe(jIe);oe(qIe);Bf.register(aw);Bf.register(t2);jr((o,e)=>{const t=o.getColor(Y4);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});Rk.register(new QIe);Rk.register(new JIe);Rk.register(new eEe);function oX(o,e,t,i){if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return[];const n=e.getLanguageConfiguration(o.getLanguageId()).indentRulesSupport;if(!n)return[];const s=new B4(o,n,e);for(i=Math.min(i,o.getLineCount());t<=i&&s.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=o.getOptions(),c=(p,_)=>(_=_||1,Vr.shiftIndent(p,p.length+_,r,a,l)),d=(p,_)=>(_=_||1,Vr.unshiftIndent(p,p.length+_,r,a,l)),h=[],u=o.getLineContent(t);let g=Rt(u),f=g;s.shouldIncrease(t)?(f=c(f),g=c(g)):s.shouldIndentNextLine(t)&&(f=c(f)),t++;for(let p=t;p<=i;p++){if(tEe(o,p))continue;const _=o.getLineContent(p),b=Rt(_),C=f;s.shouldDecrease(p,C)&&(f=d(f),g=d(g)),b!==f&&h.push(Ci.replaceMove(new le(p,1,p,b.length+1),R4(f,a,l))),!s.shouldIgnore(p)&&(s.shouldIncrease(p,C)?(g=c(g),f=g):s.shouldIndentNextLine(p,C)?f=c(f):f=g)}return h}function tEe(o,e){return o.tokenization.isCheapToTokenize(e)?o.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var iEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nEe=function(o,e){return function(t,i){e(t,i,o)}};class H3 extends de{static{this.ID="editor.action.indentationToSpaces"}constructor(){super({id:H3.ID,label:H(1148,"Convert Indentation to Spaces"),precondition:N.writable,metadata:{description:H(1149,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const r=new lEe(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}class V3 extends de{static{this.ID="editor.action.indentationToTabs"}constructor(){super({id:V3.ID,label:H(1150,"Convert Indentation to Tabs"),precondition:N.writable,metadata:{description:H(1151,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const r=new cEe(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}class z3 extends de{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(as),n=e.get(ri),s=t.getModel();if(!s)return;const r=n.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),a=s.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?m(1144,"Configured Tab Size"):d===r.tabSize?m(1145,"Default Tab Size"):d===a.tabSize?m(1146,"Current Tab Size"):void 0})),c=Math.min(s.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:m(1147,"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&s&&!s.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?s.updateOptions({tabSize:h}):s.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}class U3 extends z3{static{this.ID="editor.action.indentUsingTabs"}constructor(){super(!1,!1,{id:U3.ID,label:H(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:H(1153,"Use indentation with tabs.")}})}}class $3 extends z3{static{this.ID="editor.action.indentUsingSpaces"}constructor(){super(!0,!1,{id:$3.ID,label:H(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:H(1155,"Use indentation with spaces.")}})}}class j3 extends z3{static{this.ID="editor.action.changeTabDisplaySize"}constructor(){super(!0,!0,{id:j3.ID,label:H(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:H(1157,"Change the space size equivalent of the tab.")}})}}class q3 extends de{static{this.ID="editor.action.detectIndentation"}constructor(){super({id:q3.ID,label:H(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:H(1159,"Detect the indentation from content.")}})}run(e,t){const i=e.get(ri),n=t.getModel();if(!n)return;const s=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(s.insertSpaces,s.tabSize)}}class sEe extends de{constructor(){super({id:"editor.action.reindentlines",label:H(1160,"Reindent Lines"),precondition:N.writable,metadata:{description:H(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(ai),n=t.getModel();if(!n)return;const s=oX(n,i,1,n.getLineCount());s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class oEe extends de{constructor(){super({id:"editor.action.reindentselectedlines",label:H(1162,"Reindent Selected Lines"),precondition:N.writable,metadata:{description:H(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(ai),n=t.getModel();if(!n)return;const s=t.getSelections();if(s===null)return;const r=[];for(const a of s){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=oX(n,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class rEe{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(D.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let wx=class{static{this.ID="editor.contrib.autoIndentOnPaste"}constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new z,this.callOnModel=new z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(!this.editor.getOption(17)||this.editor.getOption(16)<4)&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||!this.editor.getOption(18)&&aEe(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(16),{tabSize:r,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],d={shiftIndent:f=>Vr.shiftIndent(f,f.length+1,r,a,l),unshiftIndent:f=>Vr.unshiftIndent(f,f.length+1,r,a,l)};let h=e.startLineNumber,u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=dC(s,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(f!==null){const p=Rt(u),_=mo(f,r),b=mo(p,r);if(_!==b){const C=WC(_,r,l);c.push({range:new D(h,1,h,p.length+1),text:C}),u=C+u.substring(p.length)}else{const C=W$(i,h,this._languageConfigurationService);if(C===0||C===8)return}}}const g=h;for(;hi.tokenization.getLineTokens(_),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(_,b)=>i.getLanguageIdAtPosition(_,b)},getLineContent:_=>_===g?u:i.getLineContent(_)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(p!==null){const _=mo(p,r),b=mo(Rt(i.getLineContent(h+1)),r);if(_!==b){const C=_-b;for(let w=h+1;w<=e.endLineNumber;w++){const v=i.getLineContent(w),S=Rt(v),x=mo(S,r)+C,k=WC(x,r,l);k!==S&&c.push({range:new D(w,1,w,S.length+1),text:k})}}}}if(c.length>0){this.editor.pushUndoStop();const f=new rEe(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=s=>s.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(r)}else for(let s=t.startLineNumber;s<=t.endLineNumber;s++){const r=e.getLineContent(s);if(s===t.startLineNumber){const a=r.substring(t.startColumn-1);n=i(a)}else if(s===t.endLineNumber){const a=r.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(s)===0;if(!n)break}return n}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};wx=iEe([nEe(1,ai)],wx);function aEe(o,e){const t=i=>Qne(o,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function rX(o,e,t,i){if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let n="";for(let r=0;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uEe=function(o,e){return function(t,i){e(t,i,o)}},Q0;let C_=class{static{Q0=this}static{this.ID="editor.contrib.inPlaceReplaceController"}static get(e){return e.getContribution(Q0.ID)}static{this.DECORATION=Me.register({description:"in-place-replace",className:"valueSetReplacement"})}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){this.currentRequest?.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let s=i;if(s.startLineNumber!==s.endLineNumber)return;const r=new dG(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=Qi(l=>this.editorWorkerService.navigateValueSet(a,s,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!r.validate(this.editor))return;const c=D.lift(l.range);let d=l.range;const h=l.value.length-(s.endColumn-s.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+l.value.length},h>1&&(s=new le(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+h-1));const u=new dEe(c,s,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:Q0.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=ql(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Te)}).catch(Te)):Promise.resolve(void 0)}};C_=Q0=hEe([uEe(1,uo)],C_);class gEe extends de{constructor(){super({id:"editor.action.inPlaceReplace.up",label:H(1240,"Replace with Previous Value"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=C_.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class fEe extends de{constructor(){super({id:"editor.action.inPlaceReplace.down",label:H(1241,"Replace with Next Value"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=C_.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}nt(C_.ID,C_,4);oe(gEe);oe(fEe);class pEe{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=mEe(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function mEe(o){const e=o.getLineCount(),t=o.getLineContent(e),i=ua(t)===-1;if(!(!e||i))return Ci.insert(new R(e,o.getLineMaxColumn(e)),o.getEOL())}class K3 extends de{static{this.ID="editor.action.insertFinalNewLine"}constructor(){super({id:K3.ID,label:H(1242,"Insert Final New Line"),precondition:N.writable})}run(e,t,i){const n=t.getSelection();if(n===null)return;const s=new pEe(n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}oe(K3);class _Ee extends de{constructor(){super({id:"expandLineSelection",label:H(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:N.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,Dn.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}oe(_Ee);var bEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},JS=function(o,e){return function(t,i){e(t,i,o)}},J0;const aX=new re("LinkedEditingInputVisible",!1),CEe="linked-editing-decoration";let v_=class extends F{static{J0=this}static{this.ID="editor.contrib.linkedEditing"}static{this.DECORATION=Me.register({description:"linked-editing",stickiness:0,className:CEe})}static get(e){return e.getContribution(J0.ID)}constructor(e,t,i,n,s){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=aX.bindTo(t),this._debounceInformation=s.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(78)||r.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(se.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new Fr(this._debounceInformation.get(t)),s=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Fr(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{s()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}s()})),this._localToDispose.add({dispose:()=>{n.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}const s=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this._currentRequestPosition?.equals(t)||this._currentDecorations.getRange(0)?.containsPosition(t)||this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const s=this._currentRequestCts=new Jt;try{const r=new fn(!1),a=await lX(this._providers,i,t,s.token);if(this._debounceInformation.update(i,r.elapsed()),s!==this._currentRequestCts||(this._currentRequestCts=null,n!==i.getVersionId()))return;let l=[];a?.ranges&&(l=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let c=!1;for(let h=0,u=l.length;h({range:h,options:J0.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){hr(r)||Te(r),(this._currentRequestCts===s||!this._currentRequestCts)&&this.clearRanges()}}};v_=J0=bEe([JS(1,Ne),JS(2,ue),JS(3,ai),JS(4,qr)],v_);class vEe extends de{constructor(){super({id:"editor.action.linkedEditing",label:H(1276,"Start Linked Editing"),precondition:K.and(N.writable,N.hasRenameProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(at),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return be.isUri(n)&&R.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Te):super.runCommand(e,t)}run(e,t){const i=v_.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const wEe=tn.bindToContribution(v_.get);ae(new wEe({id:"cancelLinkedEditingInput",precondition:aX,handler:o=>o.clearRanges(),kbOpts:{kbExpr:N.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function lX(o,e,t,i){const n=o.ordered(e);return s4(n.map(s=>async()=>{try{return await s.provideLinkedEditingRanges(e,t,i)}catch(r){Bi(r);return}}),s=>!!s&&ws(s?.ranges))}E("editor.linkedEditingBackground",{dark:V.fromHex("#f00").transparent(.3),light:V.fromHex("#f00").transparent(.3),hcDark:V.fromHex("#f00").transparent(.3),hcLight:V.white},m(1275,"Background color when the editor auto renames on type."));ho("_executeLinkedEditingProvider",(o,e,t)=>{const{linkedEditingRangeProvider:i}=o.get(ue);return lX(i,e,t,$e.None)});nt(v_.ID,v_,1);oe(vEe);let SEe=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class yw{static{this.Empty=new yw([])}constructor(e){this._disposables=new z;let t=[];for(const[i,n]of e){const s=i.links.map(r=>new SEe(r,n));t=yw._union(t,s),Lf(i)&&(this._disposables??=new z,this._disposables.add(i))}this.links=t}dispose(){this._disposables?.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,s,r,a;for(n=0,r=0,s=e.length,a=t.length;n{try{const l=await r.provideLinks(e,t);l&&(i[a]=[l,r])}catch(l){Bi(l)}});await Promise.all(n);let s=new yw(ol(i));return t.isCancellationRequested&&(s.dispose(),s=yw.Empty),s}it.registerCommand("_executeLinkProvider",async(o,...e)=>{let[t,i]=e;rt(t instanceof be),typeof i!="number"&&(i=0);const{linkProvider:n}=o.get(ue),s=o.get(ri).getModel(t);if(!s)return[];const r=await cX(n,s,$e.None);if(!r)return[];for(let l=0;l=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},e0=function(o,e){return function(t,i){e(t,i,o)}},cP;let Lw=class extends F{static{cP=this}static{this.ID="editor.linkDetector"}static get(e){return e.getContribution(cP.ID)}constructor(e,t,i,n,s){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new It(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new Ck(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Qi(t=>cX(this.providers,e,t));try{const t=new fn(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Te(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(86)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const s=[];if(e)for(const r of e)s.push(Tm.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{n.activate(s,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(86)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve($e.None).then(s=>{if(typeof s=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Ie.file&&s.startsWith(`${Ie.file}:`)){const a=be.parse(s);if(a.scheme===Ie.file){const l=pl(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(s=u$(r,c))}}}return this.openerService.open(s,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},s=>{const r=s instanceof Error?s.message:s;r==="invalid"?this.notificationService.warn(m(1277,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(m(1278,"Failed to open this link because its target is missing.")):Te(s)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink"))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};Lw=cP=yEe([e0(1,Pd),e0(2,Li),e0(3,ue),e0(4,qr)],Lw);const rV={general:Me.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Me.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Tm{static decoration(e,t){return{range:e.range,options:Tm._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?rV.active:rV.general};return n.hoverMessage=LEe(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Tm._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Tm._getOptions(this.link,t,!1))}}function LEe(o,e){const t=o.url&&/^command:/i.test(o.url.toString()),i=o.tooltip?o.tooltip:t?m(1279,"Execute command"):m(1280,"Follow link"),n=e?je?m(1281,"cmd + click"):m(1282,"ctrl + click"):je?m(1283,"option + click"):m(1284,"alt + click");if(o.url){let s="";if(/^command:/i.test(o.url.toString())){const a=o.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];s=m(1285,"Execute command {0}",l)}}return new ts("",!0).appendLink(o.url.toString(!0).replace(/ /g,"%20"),i,s).appendMarkdown(` (${n})`)}else return new ts().appendText(`${i} (${n})`)}class xEe extends de{constructor(){super({id:"editor.action.openLink",label:H(1286,"Open Link"),precondition:void 0})}run(e,t){const i=Lw.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const s of n){const r=i.getLinkOccurrence(s.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}nt(Lw.ID,Lw,1);oe(xEe);class aV extends F{static{this.ID="editor.contrib.longLinesHelper"}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(133);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}nt(aV.ID,aV,2);class lV extends F{static{this.ID="editor.contrib.middleScroll"}constructor(e){super(),this._editor=e;const t=oi(this._editor),i=t.getOption(171);this._register(ke(n=>{if(!i.read(n))return;const s=t.domNode.read(n);if(!s)return;const r=n.store.add(x4("scrollingSession",void 0));n.store.add(this._editor.onMouseDown(l=>{if(r.read(void 0)){r.set(void 0,void 0);return}if(!l.event.middleButton)return;l.event.stopPropagation(),l.event.preventDefault();const d=new z,h=new dn(l.event.posx,l.event.posy),g=DEe(me(s),h,d).map(_=>_.subtract(h).withThreshold(5)),f=s.getBoundingClientRect(),p=new dn(h.x-f.left,h.y-f.top);r.set({mouseDeltaAfterThreshold:g,initialMousePosInEditor:p,didScroll:!1,dispose:()=>d.dispose()},void 0),d.add(this._editor.onMouseUp(_=>{const b=r.read(void 0);b&&b.didScroll&&r.set(void 0,void 0)})),d.add(this._editor.onKeyDown(_=>{r.set(void 0,void 0)}))})),n.store.add(ke(l=>{const c=r.read(l);if(!c)return;let d=Date.now();l.store.add(ke(u=>{Wk.instance.invalidateOnNextAnimationFrame(u);const g=Date.now(),f=g-d;d=g;const p=c.mouseDeltaAfterThreshold.read(void 0),_=f/32,b=p.scale(_),C=new dn(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(kEe(C.add(b))),b.isZero()||(c.didScroll=!0)}));const h=$(u=>{const g=c.mouseDeltaAfterThreshold.read(u);let f="";return f+=g.y<0?"n":g.y>0?"s":"",f+=g.x<0?"w":g.x>0?"e":"",f});l.store.add(ke(u=>{s.setAttribute("data-scroll-direction",h.read(u))}))}));const a=n.store.add(Fe.div({class:["scroll-editor-on-middle-click-dot",r.map(l=>l?"":"hidden")],style:{left:r.map(l=>l?l.initialMousePosInEditor.x:0),top:r.map(l=>l?l.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());n.store.add(jp(s,a.element)),n.store.add(ke(l=>{const c=r.read(l);s.classList.toggle("scroll-editor-on-middle-click-editor",!!c)}))}))}}function DEe(o,e,t){const i=Ee("pos",e);return t.add(B(o,"mousemove",n=>{i.set(new dn(n.pageX,n.pageY),void 0)})),i}function kEe(o){return{scrollLeft:o.x,scrollTop:o.y}}nt(lV.ID,lV,2);const IEe=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightTextBackground",IEe,m(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const EEe=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:ti,hcLight:ti},m(1566,"Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:ti,hcLight:ti},m(1567,"Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",EEe,m(1568,"Border color of a textual occurrence for a symbol."));const NEe=E("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",m(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),TEe=E("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",m(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),REe=E("editorOverviewRuler.wordHighlightTextForeground",sj,m(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),MEe=Me.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:_i(TEe),position:or.Center},minimap:{color:_i(PD),position:1}}),PEe=Me.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:_i(REe),position:or.Center},minimap:{color:_i(PD),position:1}}),AEe=Me.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:_i(sj),position:or.Center},minimap:{color:_i(PD),position:1}}),OEe=Me.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),FEe=Me.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:_i(NEe),position:or.Center},minimap:{color:_i(PD),position:1}});function WEe(o){return o===n_.Write?MEe:o===n_.Text?PEe:FEe}function BEe(o){return o?OEe:AEe}jr((o,e)=>{const t=o.getColor(Z4);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var HEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},VEe=function(o,e){return function(t,i){e(t,i,o)}},dP;function du(o,e){const t=e.filter(i=>!o.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(s=>`line ${s.viewState.position.lineNumber} column ${s.viewState.position.column}`).join(", "),n=t.length===1?m(1288,"Cursor added: {0}",i):m(1289,"Cursors added: {0}",i);Ya(n)}}class zEe extends de{constructor(){super({id:"editor.action.insertCursorAbove",label:H(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1290,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const r=s.getCursorStates();s.setCursorStates(i.source,3,Dn.addCursorUp(s,r,n)),s.revealTopMostCursor(i.source),du(r,s.getCursorStates())}}class UEe extends de{constructor(){super({id:"editor.action.insertCursorBelow",label:H(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1291,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const r=s.getCursorStates();s.setCursorStates(i.source,3,Dn.addCursorDown(s,r,n)),s.revealBottomMostCursor(i.source),du(r,s.getCursorStates())}}class $Ee extends de{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:H(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new le(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),s=t._getViewModel(),r=s.getCursorStates(),a=[];n.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),du(r,s.getCursorStates())}}class jEe extends de{constructor(){super({id:"editor.action.addCursorsToBottom",label:H(1301,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),s=[];for(let l=i[0].startLineNumber;l<=n;l++)s.push(new le(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();s.length>0&&t.setSelections(s),du(a,r.getCursorStates())}}class qEe extends de{constructor(){super({id:"editor.action.addCursorsToTop",label:H(1302,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new le(a,i[0].startColumn,a,i[0].endColumn));const s=t._getViewModel(),r=s.getCursorStates();n.length>0&&t.setSelections(n),du(r,s.getCursorStates())}}class t0{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class xw{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new xw(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,s,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,s=!0,r=!0):(s=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const h=e.getConfiguredWordAtPosition(l.getStartPosition());if(!h)return null;c=h.word,d=new le(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new xw(e,t,n,c,s,r,d)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new t0(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new t0(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new le(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new t0(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new t0(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new le(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}class w_ extends F{static{this.ID="editor.contrib.multiCursorController"}static get(e){return e.getContribution(w_.ID)}constructor(e){super(),this._sessionDispose=this._register(new z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=xw.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new le(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!dX(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let s=0,r=t.length;snew le(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn)))}}}class Q_ extends de{run(e,t){const i=w_.get(t);if(!i)return;const n=t._getViewModel();if(n){const s=n.getCursorStates(),r=co.get(t);if(r)this._run(i,r);else{const a=e.get(pe).createInstance(co,t);this._run(i,a),a.dispose()}du(s,n.getCursorStates())}}}class KEe extends Q_{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:H(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2082,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1293,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class GEe extends Q_{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:H(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1294,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class ZEe extends Q_{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:H(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:Hi(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class YEe extends Q_{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:H(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class XEe extends Q_{constructor(){super({id:"editor.action.selectHighlights",label:H(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:3114,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1295,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class QEe extends Q_{constructor(){super({id:"editor.action.changeAll",label:H(1308,"Change All Occurrences"),precondition:K.and(N.writable,N.editorTextFocus),kbOpts:{kbExpr:N.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class JEe{constructor(e,t,i,n,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(D.compareRangesUsingStarts)),this._cachedFindMatches}}let Sx=class extends F{static{dP=this}static{this.ID="editor.contrib.selectionHighlighter"}constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new It(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=co.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(dP._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,n,s){if(!t||!s.hasModel())return null;if(!i){const h=s.getSelection();if(h.startLineNumber!==h.endLineNumber)return null}const r=w_.get(s);if(!r)return null;const a=co.get(s);if(!a)return null;let l=r.getSession(a);if(!l){const h=s.getSelections();if(h.length>1){const g=a.getState().matchCase;if(!dX(s.getModel(),h,g))return null}l=xw.create(s,a)}if(!l||l.currentMatch||/^[ \t]+$/.test(l.searchText)||n>0&&l.searchText.length>n)return null;const c=a.getState(),d=c.matchCase;if(c.isRevealed){let h=c.searchString;d||(h=h.toLowerCase());let u=l.searchText;if(d||(u=u.toLowerCase()),h===u&&l.matchCase===c.matchCase&&l.wholeWord===c.wholeWord&&!c.isRegex)return null}return new JEe(s.getModel(),l.searchText,l.matchCase,l.wholeWord?s.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(D.compareRangesUsingStarts);const s=[];for(let c=0,d=0,h=i.length,u=n.length;c=u)s.push(g),c++;else{const f=D.compareRangesUsingStarts(g,n[d]);f<0?((n[d].isEmpty()||!D.areIntersecting(g,n[d]))&&s.push(g),c++):(f>0||c++,d++)}}const r=this.editor.getOption(90)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=s.map(c=>({range:c,options:BEe(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};Sx=dP=HEe([VEe(1,ue)],Sx);function dX(o,e,t){const i=cV(o,e[0],!t);for(let n=1,s=e.length;n{const[t,i,n]=e;rt(be.isUri(t)),rt(R.isIPosition(i)),rt(typeof n=="string"||!n);const s=o.get(ue),r=await o.get(ys).createModelReference(t);try{const a=await hX(s.signatureHelpProvider,r.object.textEditorModel,R.lift(i),{triggerKind:Hl.Invoke,isRetrigger:!1,triggerCharacter:n},$e.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var Qd;(function(o){o.Default={type:0};class e{constructor(n,s){this.request=n,this.previouslyActiveHints=s,this.type=2}}o.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}o.Active=t})(Qd||(Qd={}));class G3 extends F{static{this.DEFAULT_DELAY=120}constructor(e,t,i=G3.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new P),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Qd.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new _t),this.triggerChars=new Ey,this.retriggerChars=new Ey,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Fr(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Qd.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(Te)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(98).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(98).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Qd.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(iNe);this._pendingTriggers=[];const s={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Qd.Pending(Qi(l=>hX(this.providers,r,a,s,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l?.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Qd.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Qd.Default),Te(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Hl.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Hl.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Hl.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function iNe(o,e){switch(e.triggerKind){case Hl.Invoke:return e;case Hl.ContentChange:return o;case Hl.TriggerCharacter:default:return e}}var nNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dV=function(o,e){return function(t,i){e(t,i,o)}},hP;const Wo=ee,sNe=Kt("parameter-hints-next",Z.chevronDown,m(1312,"Icon for show next parameter hint.")),oNe=Kt("parameter-hints-previous",Z.chevronUp,m(1313,"Icon for show previous parameter hint."));let uP=class extends F{static{hP=this}static{this.ID="editor.widget.parameterHintsWidget"}constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.markdownRendererService=n,this.renderDisposeables=this._register(new z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=yf.Visible.bindTo(i),this.keyMultipleSignatures=yf.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Wo(".editor-widget.parameter-hints-widget"),t=Y(e,Wo(".phwrapper"));t.tabIndex=-1;const i=Y(t,Wo(".controls")),n=Y(i,Wo(".button"+ye.asCSSSelector(oNe))),s=Y(i,Wo(".overloads")),r=Y(i,Wo(".button"+ye.asCSSSelector(sNe)));this._register(B(n,"click",u=>{ct.stop(u),this.previous()})),this._register(B(r,"click",u=>{ct.stop(u),this.next()}));const a=Wo(".body"),l=new o1(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Y(a,Wo(".signature")),d=Y(a,Wo(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:s,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(59),g=this.domNodes.element;g.style.fontSize=`${u.fontSize}px`,g.style.lineHeight=`${u.lineHeight/u.fontSize}`,g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",io.fontFamily)};h(),this._register(se.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(g=>g.hasChanged(59)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=Y(this.domNodes.signature,Wo(".code")),s=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(s)this.renderParameters(n,i,r);else{const c=Y(n,Wo("span"));c.textContent=i.label}const a=i.parameters[r];if(a?.documentation){const c=Wo("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);c.appendChild(d.element)}Y(this.domNodes.docs,Wo("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")Y(this.domNodes.docs,Wo("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);Y(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const d=i.parameters[r];Array.isArray(d.label)?c=i.label.substring(d.label[0],d.label[1]):c=d.label,d.documentation&&(c+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(Ws(m(1314,"{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&dh(t.documentation).length>0||t&&typeof t.documentation=="object"&&dh(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&dh(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&dh(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,s]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),Y(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${Eo(i.label)}(?=\\W|$)`,"g");n.test(e.label);const s=n.lastIndex-i.label.length;return s>=0?[s,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return hP.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};uP=hP=nNe([dV(2,Ne),dV(3,Sa)],uP);E("editorHoverWidget.highlightForeground",Wp,m(1315,"Foreground color of the active item in the parameter hint."));var rNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hV=function(o,e){return function(t,i){e(t,i,o)}},gP;let S_=class extends F{static{gP=this}static{this.ID="editor.controller.parameterHints"}static get(e){return e.getContribution(gP.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new G3(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{n?(this.widget.value.show(),this.widget.value.render(n)):this.widget.rawValue?.hide()})),this.widget=new $n(()=>this._register(t.createInstance(uP,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}};S_=gP=rNe([hV(1,pe),hV(2,ue)],S_);class aNe extends de{constructor(){super({id:"editor.action.triggerParameterHints",label:H(1311,"Trigger Parameter Hints"),precondition:N.hasSignatureHelpProvider,kbOpts:{kbExpr:N.editorTextFocus,primary:3082,weight:100}})}run(e,t){S_.get(t)?.trigger({triggerKind:Hl.Invoke})}}nt(S_.ID,S_,2);oe(aNe);const Z3=175,Y3=tn.bindToContribution(S_.get);ae(new Y3({id:"closeParameterHints",precondition:yf.Visible,handler:o=>o.cancel(),kbOpts:{weight:Z3,kbExpr:N.focus,primary:9,secondary:[1033]}}));ae(new Y3({id:"showPrevParameterHint",precondition:K.and(yf.Visible,yf.MultipleSignatures),handler:o=>o.previous(),kbOpts:{weight:Z3,kbExpr:N.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));ae(new Y3({id:"showNextParameterHint",precondition:K.and(yf.Visible,yf.MultipleSignatures),handler:o=>o.next(),kbOpts:{weight:Z3,kbExpr:N.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));class uV extends F{static{this.ID="editor.contrib.placeholderText"}constructor(e){super(),this._editor=e,this._editorObs=oi(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=Un({owner:this,equalsFn:aT},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=lNe(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=$(t=>{if(!this._shouldViewBeAlive.read(t))return;const i=ot("div.editorPlaceholder");t.store.add(ke(n=>{const s=this._state.read(n),r=s?.placeholder!==void 0;i.root.style.display=r?"block":"none",i.root.innerText=s?.placeholder??""})),t.store.add(ke(n=>{const s=this._editorObs.layoutInfo.read(n);i.root.style.left=`${s.contentLeft}px`,i.root.style.width=s.contentWidth-s.verticalScrollbarWidth+"px",i.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),t.store.add(ke(n=>{i.root.style.fontFamily=this._editorObs.getOption(58).read(n),i.root.style.fontSize=this._editorObs.getOption(61).read(n)+"px",i.root.style.lineHeight=this._editorObs.getOption(75).read(n)+"px"})),t.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Ot(0),position:Ot(null),domNode:i.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}}function lNe(o,e){return Ed(o,(t,i)=>i===!0?!0:e(t))}var cNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dNe=function(o,e){return function(t,i){e(t,i,o)}};class hNe{constructor(e){this.instantiationService=e}init(...e){}}function uNe(o){return o()}let gV=class extends hNe{constructor(e,t){super(t),this.init(e)}};gV=cNe([dNe(1,pe)],gV);nt(uV.ID,uNe(()=>uV),0);E("editor.placeholder.foreground",tce,m(1334,"Foreground color of the placeholder text in the editor."));const qk=Ve("textResourceConfigurationService"),uX=Ve("textResourcePropertiesService");var gNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},i0=function(o,e){return function(t,i){e(t,i,o)}};const J_=new re("renameInputVisible",!1,m(1391,"Whether the rename input widget is visible"));new re("renameInputFocused",!1,m(1392,"Whether the rename input widget is focused"));let fP=class{constructor(e,t,i,n,s,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new z,this._visibleContextKey=J_.bindTo(s),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new fn,this._inputWithButton=new fNe,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(59)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new X3(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(B_),i=e.getColor(J4);this._domNode.style.backgroundColor=String(e.getColor(tr)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(oj)??"");const n=e.getColor(rj);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(OT)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(OT)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;rt(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=Hh(this.getDomNode().ownerDocument.body),t=wi(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(75),{totalHeight:s}=y_.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>s*6?[2,1]:[1,2];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=m(1393,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;rt(this._renameCandidateListView),rt(this._nPxAvailableAbove!==void 0),rt(this._nPxAvailableBelow!==void 0);const t=Gc(this._inputWithButton.domNode),i=Gc(this._label);let n;e===2?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:_o(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,s){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=s;const l=new z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),l.add(B(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(B(this._inputWithButton.button,te.KEY_DOWN,d=>{const h=new Et(d);(h.equals(3)||h.equals(10))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new R(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(ge(()=>{this._renameCts=void 0,s.dispose(!0)})),l.add(ge(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(ge(()=>this._candidates.clear()));const c=new xf;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),c.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),rt(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,g;const f=this._renameCandidateListView.focusedCandidate;if(f!==void 0?(this._trace("using new name from renameSuggestion"),u=f,g={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,g=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:u,wantsPreview:i&&d,stats:{source:g,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(s.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),rt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Jt;const i=t?Mv.Invoke:Mv.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){rt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,s=t.length;return!D.isEmpty(i)&&!D.spansMultipleLines(i)&&D.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),s=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:s}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...c)=>this._trace("_updateRenameCandidates",...c);n("start");const s=await Vm(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),s===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=s.flatMap(c=>c.status==="fulfilled"&&Cn(c.value)?c.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=bd(r,c=>c.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(n(`valid distinct candidates - ${r.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(l),n("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};fP=gNe([i0(2,pi),i0(3,dt),i0(4,Ne),i0(5,Ht)],fP);class X3{constructor(e,t){this._disposables=new z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=X3._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(Of({listInactiveFocusForeground:xv,listInactiveFocusBackground:Dv}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Ya(m(1394,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=y_.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},s=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new y_(r,i)}renderElement(r,a,l){l.populate(r)}disposeTemplate(r){r.dispose()}};return new ur("NewSymbolNameCandidates",e,n,[s],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class fNe{constructor(){this._buttonHoverContent="",this._onDidInputChange=new P,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",m(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=m(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=m(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(va().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(B(this.input,te.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(B(this.input,te.KEY_DOWN,e=>{const t=new Et(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(B(this.input,te.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(B(this.input,te.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(B(this.input,te.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return rt(this._inputNode),this._inputNode}get button(){return rt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=tl(Z.sparkle),Tn(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=tl(Z.stopCircle),Tn(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}class y_{static{this._PADDING=2}constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${y_._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=tl(Z.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),wn(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(UT.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+y_._PADDING*2}}dispose(){}}var pNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Iu=function(o,e){return function(t,i){e(t,i,o)}},pP;class Q3{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` -`):void 0}:{range:D.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` +`))});break;case"saveTextureAtlas":i.invokeFunction(async r=>{const a=r.get(sd),l=r.get(J8),c=a.getWorkspace().folders;if(c.length>0){const d=as.atlas,h=[];for(const[u,g]of d.pages.entries())h.push(l.writeFile(_e.joinPath(c[0].uri,`textureAtlasPage${u}_actual.png`),lh.wrap(new Uint8Array(await(await g.source.convertToBlob()).arrayBuffer()))),l.writeFile(_e.joinPath(c[0].uri,`textureAtlasPage${u}_usage.png`),lh.wrap(new Uint8Array(await(await g.getUsagePreview()).arrayBuffer()))));await Promise.all(h)}});break;case"drawGlyph":i.invokeFunction(async r=>{const a=r.get(Pe),l=r.get(J8),c=r.get(Jn),h=r.get(sd).getWorkspace().folders;if(h.length===0)return;const u=as.atlas,g=a.getValue("editor.fontFamily"),f=a.getValue("editor.fontSize"),p=new JC(f,g,_t().devicePixelRatio,as.decorationStyleCache);let _=await c.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!_)return;const b=_.match(/0x(?[0-9a-f]+)/i)?.groups?.codePoint;b!==void 0&&(_=String.fromCodePoint(parseInt(b,16)));const C=0,v=u.getGlyph(p,_,C,0,0);if(!v)return;const S=u.pages[v.pageIndex].source.getContext("2d")?.getImageData(v.x,v.y,v.w,v.h);if(!S)return;const x=new OffscreenCanvas(S.width,S.height);Tg(x.getContext("2d")).putImageData(S,0,0);const D=await x.convertToBlob({type:"image/png"}),I=_e.joinPath(h[0].uri,`glyph_${_}_${C}_${f}px_${g.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await l.writeFile(I,lh.wrap(new Uint8Array(await D.arrayBuffer())))});break}}}se(mke);var fa;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(fa||(fa={}));class _ke extends le{constructor(){super({id:Xq,label:H(1107,"Show or Focus Hover"),metadata:{description:H(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[fa.NoAutoFocus,fa.FocusIfVisible,fa.AutoFocusImmediately],enumDescriptions:[m(1104,"The hover will not automatically take focus."),m(1105,"The hover will take focus only if it is already visible."),m(1106,"The hover will automatically take focus when it appears.")],default:fa.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:Mi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=es.get(t);if(!n)return;const s=i?.focus;let r=fa.FocusIfVisible;Object.values(fa).includes(s)?r=s:typeof s=="boolean"&&s&&(r=fa.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),h=new L(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,1,2,c)},l=t.getOption(2)===2;n.isHoverVisible?r!==fa.NoAutoFocus?n.focus():a(l):a(l||r===fa.AutoFocusImmediately)}}class bke extends le{constructor(){super({id:Ube,label:H(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:H(1110,"Show the definition preview hover in the editor.")}})}run(e,t){const i=es.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new L(n.lineNumber,n.column,n.lineNumber,n.column),r=Wv.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,2,!0)})}}class Cke extends le{constructor(){super({id:$be,label:H(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){es.get(t)?.hideContentHover()}}class vke extends le{constructor(){super({id:jbe,label:H(1112,"Scroll Up Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:16,weight:100},metadata:{description:H(1113,"Scroll up the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.scrollUp()}}class wke extends le{constructor(){super({id:qbe,label:H(1114,"Scroll Down Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:18,weight:100},metadata:{description:H(1115,"Scroll down the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.scrollDown()}}class Ske extends le{constructor(){super({id:Kbe,label:H(1116,"Scroll Left Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:15,weight:100},metadata:{description:H(1117,"Scroll left the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.scrollLeft()}}class yke extends le{constructor(){super({id:Gbe,label:H(1118,"Scroll Right Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:17,weight:100},metadata:{description:H(1119,"Scroll right the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.scrollRight()}}class xke extends le{constructor(){super({id:Zbe,label:H(1120,"Page Up Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:H(1121,"Page up the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.pageUp()}}class Lke extends le{constructor(){super({id:Ybe,label:H(1122,"Page Down Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:H(1123,"Page down the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.pageDown()}}class kke extends le{constructor(){super({id:Xbe,label:H(1124,"Go To Top Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:H(1125,"Go to the top of the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.goToTop()}}class Dke extends le{constructor(){super({id:Qbe,label:H(1126,"Go To Bottom Hover"),precondition:N.hoverFocused,kbOpts:{kbExpr:N.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:H(1127,"Go to the bottom of the editor hover.")}})}run(e,t){const i=es.get(t);i&&i.goToBottom()}}class Ike extends le{constructor(){super({id:Ck,label:Jbe,alias:"Increase Hover Verbosity Level",precondition:N.hoverVisible})}run(e,t,i){const n=es.get(t);if(!n)return;const s=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(oo.Increase,s,i?.focus)}}class Eke extends le{constructor(){super({id:vk,label:eCe,alias:"Decrease Hover Verbosity Level",precondition:N.hoverVisible})}run(e,t,i){const n=es.get(t);if(!n)return;const s=i?.index!==void 0?i.index:n.focusedHoverPartIndex();es.get(t)?.updateHoverVerbosityLevel(oo.Decrease,s,i?.focus)}}class Nke{constructor(e){this._editor=e}computeSync(e){const t=r=>({value:r}),i=this._editor.getLineDecorations(e.lineNumber),n=[],s=e.laneOrLine==="lineNo";if(!i)return n;for(const r of i){const a=r.options.glyphMargin?.position??Aa.Center;if(!s&&a!==e.laneOrLine)continue;const l=s?r.options.lineNumberHoverMessage:r.options.glyphMarginHoverMessage;!l||Em(l)||n.push(...rO(l).map(t))}return n}}var Tke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rke=function(o,e){return function(t,i){e(t,i,o)}},ZM;const vH=J;let YM=class extends A{static{ZM=this}static{this.ID="editor.contrib.modesGlyphHoverWidget"}constructor(e,t){super(),this._markdownRendererService=t,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new SF(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new tK(this._editor,new Nke(this._editor))),this._register(this._hoverOperation.onResult(i=>this._withResult(i))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(59)&&this._updateFont()})),this._register(Li(this._hover.containerDomNode,"mouseleave",i=>{this._onMouseLeave(i)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return ZM.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const s of i){const r=vH("div.hover-row.markdown-hover"),a=Z(r,vH("div.hover-contents")),l=this._renderDisposeables.add(this._markdownRendererService.render(s.value,{context:this._editor}));a.appendChild(l.element),n.appendChild(r)}this._updateContents(n),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),r=this._editor.getOption(75),a=this._hover.containerDomNode.clientHeight,l=n-s-(a-r)/2,c=i.glyphMarginLeft+i.glyphMarginWidth+(t==="lineNo"?i.lineNumbersWidth:0),h=i.height-a,u=Math.max(0,Math.min(Math.round(l),h));if(this._editor.getOption(51)){const f=this._editor.getDomNode();if(f){const p=pi(f);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${p.left+c}px`,this._hover.containerDomNode.style.top=`${p.top+u}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${u}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!wk(t,e.x,e.y))&&this.hide()}};YM=ZM=Tke([Rke(1,aa)],YM);var Mke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Pke=function(o,e){return function(t,i){e(t,i,o)}};let Lx=class extends A{static{this.ID="editor.contrib.marginHover"}constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new z,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new St(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnGlyphHoverWidget(e)&&this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){const t=this._glyphWidget?.getDomNode();return t?wk(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e))||this.hideGlyphHover()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this.hideGlyphHover()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this.hideGlyphHover())}hideGlyphHover(){this._glyphWidget?.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(YM,this._editor)),this._glyphWidget}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose()}};Lx=Mke([Pke(1,fe)],Lx);class Ake{}class Oke{}class Fke{}Xe(es.ID,es,2);Xe(Lx.ID,Lx,2);se(_ke);se(bke);se(Cke);se(vke);se(wke);se(Ske);se(yke);se(xke);se(Lke);se(kke);se(Dke);se(Ike);se(Eke);mf.register(yv);mf.register(UR);Tr((o,e)=>{const t=o.getColor(WO);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});Fk.register(new Ake);Fk.register(new Oke);Fk.register(new Fke);function pZ(o,e,t,i){if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return[];const n=e.getLanguageConfiguration(o.getLanguageId()).indentRulesSupport;if(!n)return[];const s=new DO(o,n,e);for(i=Math.min(i,o.getLineCount());t<=i&&s.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=o.getOptions(),c=(p,_)=>(_=_||1,Dr.shiftIndent(p,p.length+_,r,a,l)),d=(p,_)=>(_=_||1,Dr.unshiftIndent(p,p.length+_,r,a,l)),h=[],u=o.getLineContent(t);let g=Dt(u),f=g;s.shouldIncrease(t)?(f=c(f),g=c(g)):s.shouldIndentNextLine(t)&&(f=c(f)),t++;for(let p=t;p<=i;p++){if(Wke(o,p))continue;const _=o.getLineContent(p),b=Dt(_),C=f;s.shouldDecrease(p,C)&&(f=d(f),g=d(g)),b!==f&&h.push(gi.replaceMove(new ae(p,1,p,b.length+1),vO(f,a,l))),!s.shouldIgnore(p)&&(s.shouldIncrease(p,C)?(g=c(g),f=g):s.shouldIndentNextLine(p,C)?f=c(f):f=g)}return h}function Wke(o,e){return o.tokenization.isCheapToTokenize(e)?o.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var Bke=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hke=function(o,e){return function(t,i){e(t,i,o)}};class I5 extends le{static{this.ID="editor.action.indentationToSpaces"}constructor(){super({id:I5.ID,label:H(1148,"Convert Indentation to Spaces"),precondition:N.writable,metadata:{description:H(1149,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const r=new jke(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}class E5 extends le{static{this.ID="editor.action.indentationToTabs"}constructor(){super({id:E5.ID,label:H(1150,"Convert Indentation to Tabs"),precondition:N.writable,metadata:{description:H(1151,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const r=new qke(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}class N5 extends le{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Jn),n=e.get(ei),s=t.getModel();if(!s)return;const r=n.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),a=s.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?m(1144,"Configured Tab Size"):d===r.tabSize?m(1145,"Default Tab Size"):d===a.tabSize?m(1146,"Current Tab Size"):void 0})),c=Math.min(s.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:m(1147,"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&s&&!s.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?s.updateOptions({tabSize:h}):s.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}class T5 extends N5{static{this.ID="editor.action.indentUsingTabs"}constructor(){super(!1,!1,{id:T5.ID,label:H(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:H(1153,"Use indentation with tabs.")}})}}class R5 extends N5{static{this.ID="editor.action.indentUsingSpaces"}constructor(){super(!0,!1,{id:R5.ID,label:H(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:H(1155,"Use indentation with spaces.")}})}}class M5 extends N5{static{this.ID="editor.action.changeTabDisplaySize"}constructor(){super(!0,!0,{id:M5.ID,label:H(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:H(1157,"Change the space size equivalent of the tab.")}})}}class P5 extends le{static{this.ID="editor.action.detectIndentation"}constructor(){super({id:P5.ID,label:H(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:H(1159,"Detect the indentation from content.")}})}run(e,t){const i=e.get(ei),n=t.getModel();if(!n)return;const s=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(s.insertSpaces,s.tabSize)}}class Vke extends le{constructor(){super({id:"editor.action.reindentlines",label:H(1160,"Reindent Lines"),precondition:N.writable,metadata:{description:H(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(ti),n=t.getModel();if(!n)return;const s=pZ(n,i,1,n.getLineCount());s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class zke extends le{constructor(){super({id:"editor.action.reindentselectedlines",label:H(1162,"Reindent Selected Lines"),precondition:N.writable,metadata:{description:H(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(ti),n=t.getModel();if(!n)return;const s=t.getSelections();if(s===null)return;const r=[];for(const a of s){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=pZ(n,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class Uke{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(L.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let kx=class{static{this.ID="editor.contrib.autoIndentOnPaste"}constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new z,this.callOnModel=new z,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(!this.editor.getOption(17)||this.editor.getOption(16)<4)&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||!this.editor.getOption(18)&&$ke(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(16),{tabSize:r,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],d={shiftIndent:f=>Dr.shiftIndent(f,f.length+1,r,a,l),unshiftIndent:f=>Dr.unshiftIndent(f,f.length+1,r,a,l)};let h=e.startLineNumber,u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=kb(s,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(f!==null){const p=Dt(u),_=no(f,r),b=no(p,r);if(_!==b){const C=eC(_,r,l);c.push({range:new L(h,1,h,p.length+1),text:C}),u=C+u.substring(p.length)}else{const C=Jz(i,h,this._languageConfigurationService);if(C===0||C===8)return}}}const g=h;for(;hi.tokenization.getLineTokens(_),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(_,b)=>i.getLanguageIdAtPosition(_,b)},getLineContent:_=>_===g?u:i.getLineContent(_)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(p!==null){const _=no(p,r),b=no(Dt(i.getLineContent(h+1)),r);if(_!==b){const C=_-b;for(let w=h+1;w<=e.endLineNumber;w++){const v=i.getLineContent(w),S=Dt(v),k=no(S,r)+C,D=eC(k,r,l);D!==S&&c.push({range:new L(w,1,w,S.length+1),text:D})}}}}if(c.length>0){this.editor.pushUndoStop();const f=new Uke(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=s=>s.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(r)}else for(let s=t.startLineNumber;s<=t.endLineNumber;s++){const r=e.getLineContent(s);if(s===t.startLineNumber){const a=r.substring(t.startColumn-1);n=i(a)}else if(s===t.endLineNumber){const a=r.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(s)===0;if(!n)break}return n}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};kx=Bke([Hke(1,ti)],kx);function $ke(o,e){const t=i=>iie(o,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function mZ(o,e,t,i){if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let n="";for(let r=0;r=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zke=function(o,e){return function(t,i){e(t,i,o)}},n0;let Um=class{static{n0=this}static{this.ID="editor.contrib.inPlaceReplaceController"}static get(e){return e.getContribution(n0.ID)}static{this.DECORATION=Te.register({description:"in-place-replace",className:"valueSetReplacement"})}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){this.currentRequest?.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let s=i;if(s.startLineNumber!==s.endLineNumber)return;const r=new vq(this.editor,5),a=n.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=$i(l=>this.editorWorkerService.navigateValueSet(a,s,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!r.validate(this.editor))return;const c=L.lift(l.range);let d=l.range;const h=l.value.length-(s.endColumn-s.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+l.value.length},h>1&&(s=new ae(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+h-1));const u=new Kke(c,s,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:n0.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=El(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Ee)}).catch(Ee)):Promise.resolve(void 0)}};Um=n0=Gke([Zke(1,eo)],Um);class Yke extends le{constructor(){super({id:"editor.action.inPlaceReplace.up",label:H(1240,"Replace with Previous Value"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=Um.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class Xke extends le{constructor(){super({id:"editor.action.inPlaceReplace.down",label:H(1241,"Replace with Next Value"),precondition:N.writable,kbOpts:{kbExpr:N.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=Um.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}Xe(Um.ID,Um,4);se(Yke);se(Xke);class Qke{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=Jke(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Jke(o){const e=o.getLineCount(),t=o.getLineContent(e),i=Qr(t)===-1;if(!(!e||i))return gi.insert(new R(e,o.getLineMaxColumn(e)),o.getEOL())}class A5 extends le{static{this.ID="editor.action.insertFinalNewLine"}constructor(){super({id:A5.ID,label:H(1242,"Insert Final New Line"),precondition:N.writable})}run(e,t,i){const n=t.getSelection();if(n===null)return;const s=new Qke(n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}se(A5);class eDe extends le{constructor(){super({id:"expandLineSelection",label:H(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:N.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,Cn.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}se(eDe);var tDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oS=function(o,e){return function(t,i){e(t,i,o)}},s0;const _Z=new oe("LinkedEditingInputVisible",!1),iDe="linked-editing-decoration";let $m=class extends A{static{s0=this}static{this.ID="editor.contrib.linkedEditing"}static{this.DECORATION=Te.register({description:"linked-editing",stickiness:0,className:iDe})}static get(e){return e.getContribution(s0.ID)}constructor(e,t,i,n,s){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=_Z.bindTo(t),this._debounceInformation=s.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new z),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(78)||r.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(te.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new yr(this._debounceInformation.get(t)),s=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new yr(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{s()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}s()})),this._localToDispose.add({dispose:()=>{n.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}const s=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this._currentRequestPosition?.equals(t)||this._currentDecorations.getRange(0)?.containsPosition(t)||this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const s=this._currentRequestCts=new qt;try{const r=new rn(!1),a=await bZ(this._providers,i,t,s.token);if(this._debounceInformation.update(i,r.elapsed()),s!==this._currentRequestCts||(this._currentRequestCts=null,n!==i.getVersionId()))return;let l=[];a?.ranges&&(l=a.ranges),this._currentWordPattern=a?.wordPattern||this._languageWordPattern;let c=!1;for(let h=0,u=l.length;h({range:h,options:s0.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Xo(r)||Ee(r),(this._currentRequestCts===s||!this._currentRequestCts)&&this.clearRanges()}}};$m=s0=tDe([oS(1,Ie),oS(2,he),oS(3,ti),oS(4,Rr)],$m);class nDe extends le{constructor(){super({id:"editor.action.linkedEditing",label:H(1276,"Start Linked Editing"),precondition:q.and(N.writable,N.hasRenameProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(et),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return _e.isUri(n)&&R.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Ee):super.runCommand(e,t)}run(e,t){const i=$m.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const sDe=Ki.bindToContribution($m.get);re(new sDe({id:"cancelLinkedEditingInput",precondition:_Z,handler:o=>o.clearRanges(),kbOpts:{kbExpr:N.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function bZ(o,e,t,i){const n=o.ordered(e);return qA(n.map(s=>async()=>{try{return await s.provideLinkedEditingRanges(e,t,i)}catch(r){Ri(r);return}}),s=>!!s&&us(s?.ranges))}E("editor.linkedEditingBackground",{dark:V.fromHex("#f00").transparent(.3),light:V.fromHex("#f00").transparent(.3),hcDark:V.fromHex("#f00").transparent(.3),hcLight:V.white},m(1275,"Background color when the editor auto renames on type."));Js("_executeLinkedEditingProvider",(o,e,t)=>{const{linkedEditingRangeProvider:i}=o.get(he);return bZ(i,e,t,Ve.None)});Xe($m.ID,$m,1);se(nDe);let oDe=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class Bv{static{this.Empty=new Bv([])}constructor(e){this._disposables=new z;let t=[];for(const[i,n]of e){const s=i.links.map(r=>new oDe(r,n));t=Bv._union(t,s),ef(i)&&(this._disposables??=new z,this._disposables.add(i))}this.links=t}dispose(){this._disposables?.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,s,r,a;for(n=0,r=0,s=e.length,a=t.length;n{try{const l=await r.provideLinks(e,t);l&&(i[a]=[l,r])}catch(l){Ri(l)}});await Promise.all(n);let s=new Bv(Ua(i));return t.isCancellationRequested&&(s.dispose(),s=Bv.Empty),s}Ye.registerCommand("_executeLinkProvider",async(o,...e)=>{let[t,i]=e;Je(t instanceof _e),typeof i!="number"&&(i=0);const{linkProvider:n}=o.get(he),s=o.get(ei).getModel(t);if(!s)return[];const r=await CZ(n,s,Ve.None);if(!r)return[];for(let l=0;l=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rS=function(o,e){return function(t,i){e(t,i,o)}},XM;let Hv=class extends A{static{XM=this}static{this.ID="editor.linkDetector"}static get(e){return e.getContribution(XM.ID)}constructor(e,t,i,n,s){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new St(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new xk(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=$i(t=>CZ(this.providers,e,t));try{const t=new rn(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Ee(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(86)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const s=[];if(e)for(const r of e)s.push(tm.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{n.activate(s,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(86)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(Ve.None).then(s=>{if(typeof s=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Le.file&&s.startsWith(`${Le.file}:`)){const a=_e.parse(s);if(a.scheme===Le.file){const l=Qa(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(s=Dz(r,c))}}}return this.openerService.open(s,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},s=>{const r=s instanceof Error?s.message:s;r==="invalid"?this.notificationService.warn(m(1277,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(m(1278,"Failed to open this link because its target is missing.")):Ee(s)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink"))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};Hv=XM=rDe([rS(1,gd),rS(2,bi),rS(3,he),rS(4,Rr)],Hv);const wH={general:Te.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Te.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class tm{static decoration(e,t){return{range:e.range,options:tm._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?wH.active:wH.general};return n.hoverMessage=aDe(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,tm._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,tm._getOptions(this.link,t,!1))}}function aDe(o,e){const t=o.url&&/^command:/i.test(o.url.toString()),i=o.tooltip?o.tooltip:t?m(1279,"Execute command"):m(1280,"Follow link"),n=e?ze?m(1281,"cmd + click"):m(1282,"ctrl + click"):ze?m(1283,"option + click"):m(1284,"alt + click");if(o.url){let s="";if(/^command:/i.test(o.url.toString())){const a=o.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];s=m(1285,"Execute command {0}",l)}}return new Kn("",!0).appendLink(o.url.toString(!0).replace(/ /g,"%20"),i,s).appendMarkdown(` (${n})`)}else return new Kn().appendText(`${i} (${n})`)}class lDe extends le{constructor(){super({id:"editor.action.openLink",label:H(1286,"Open Link"),precondition:void 0})}run(e,t){const i=Hv.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const s of n){const r=i.getLinkOccurrence(s.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}Xe(Hv.ID,Hv,1);se(lDe);class SH extends A{static{this.ID="editor.contrib.longLinesHelper"}constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(133);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}Xe(SH.ID,SH,2);class yH extends A{static{this.ID="editor.contrib.middleScroll"}constructor(e){super(),this._editor=e;const t=Jt(this._editor),i=t.getOption(171);this._register(xe(n=>{if(!i.read(n))return;const s=t.domNode.read(n);if(!s)return;const r=n.store.add(gO("scrollingSession",void 0));n.store.add(this._editor.onMouseDown(l=>{if(r.read(void 0)){r.set(void 0,void 0);return}if(!l.event.middleButton)return;l.event.stopPropagation(),l.event.preventDefault();const d=new z,h=new tn(l.event.posx,l.event.posy),g=cDe(pe(s),h,d).map(_=>_.subtract(h).withThreshold(5)),f=s.getBoundingClientRect(),p=new tn(h.x-f.left,h.y-f.top);r.set({mouseDeltaAfterThreshold:g,initialMousePosInEditor:p,didScroll:!1,dispose:()=>d.dispose()},void 0),d.add(this._editor.onMouseUp(_=>{const b=r.read(void 0);b&&b.didScroll&&r.set(void 0,void 0)})),d.add(this._editor.onKeyDown(_=>{r.set(void 0,void 0)}))})),n.store.add(xe(l=>{const c=r.read(l);if(!c)return;let d=Date.now();l.store.add(xe(u=>{Uk.instance.invalidateOnNextAnimationFrame(u);const g=Date.now(),f=g-d;d=g;const p=c.mouseDeltaAfterThreshold.read(void 0),_=f/32,b=p.scale(_),C=new tn(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(dDe(C.add(b))),b.isZero()||(c.didScroll=!0)}));const h=$(u=>{const g=c.mouseDeltaAfterThreshold.read(u);let f="";return f+=g.y<0?"n":g.y>0?"s":"",f+=g.x<0?"w":g.x>0?"e":"",f});l.store.add(xe(u=>{s.setAttribute("data-scroll-direction",h.read(u))}))}));const a=n.store.add(Ae.div({class:["scroll-editor-on-middle-click-dot",r.map(l=>l?"":"hidden")],style:{left:r.map(l=>l?l.initialMousePosInEditor.x:0),top:r.map(l=>l?l.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());n.store.add(pp(s,a.element)),n.store.add(xe(l=>{const c=r.read(l);s.classList.toggle("scroll-editor-on-middle-click-editor",!!c)}))}))}}function cDe(o,e,t){const i=De("pos",e);return t.add(W(o,"mousemove",n=>{i.set(new tn(n.pageX,n.pageY),void 0)})),i}function dDe(o){return{scrollLeft:o.x,scrollTop:o.y}}Xe(yH.ID,yH,2);const hDe=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.wordHighlightTextBackground",hDe,m(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const uDe=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m(1566,"Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m(1567,"Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",uDe,m(1568,"Border color of a textual occurrence for a symbol."));const gDe=E("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",m(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),fDe=E("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",m(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),pDe=E("editorOverviewRuler.wordHighlightTextForeground",CU,m(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),mDe=Te.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:hi(fDe),position:jo.Center},minimap:{color:hi(BL),position:1}}),_De=Te.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:hi(pDe),position:jo.Center},minimap:{color:hi(BL),position:1}}),bDe=Te.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:hi(CU),position:jo.Center},minimap:{color:hi(BL),position:1}}),CDe=Te.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),vDe=Te.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:hi(gDe),position:jo.Center},minimap:{color:hi(BL),position:1}});function wDe(o){return o===Dm.Write?mDe:o===Dm.Text?_De:vDe}function SDe(o){return o?CDe:bDe}Tr((o,e)=>{const t=o.getColor(FO);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var yDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xDe=function(o,e){return function(t,i){e(t,i,o)}},QM;function Uh(o,e){const t=e.filter(i=>!o.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(s=>`line ${s.viewState.position.lineNumber} column ${s.viewState.position.column}`).join(", "),n=t.length===1?m(1288,"Cursor added: {0}",i):m(1289,"Cursors added: {0}",i);Pa(n)}}class LDe extends le{constructor(){super({id:"editor.action.insertCursorAbove",label:H(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1290,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const r=s.getCursorStates();s.setCursorStates(i.source,3,Cn.addCursorUp(s,r,n)),s.revealTopMostCursor(i.source),Uh(r,s.getCursorStates())}}class kDe extends le{constructor(){super({id:"editor.action.insertCursorBelow",label:H(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1291,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const s=t._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const r=s.getCursorStates();s.setCursorStates(i.source,3,Cn.addCursorDown(s,r,n)),s.revealBottomMostCursor(i.source),Uh(r,s.getCursorStates())}}class DDe extends le{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:H(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new ae(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),s=t._getViewModel(),r=s.getCursorStates(),a=[];n.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),Uh(r,s.getCursorStates())}}class IDe extends le{constructor(){super({id:"editor.action.addCursorsToBottom",label:H(1301,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),s=[];for(let l=i[0].startLineNumber;l<=n;l++)s.push(new ae(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();s.length>0&&t.setSelections(s),Uh(a,r.getCursorStates())}}class EDe extends le{constructor(){super({id:"editor.action.addCursorsToTop",label:H(1302,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new ae(a,i[0].startColumn,a,i[0].endColumn));const s=t._getViewModel(),r=s.getCursorStates();n.length>0&&t.setSelections(n),Uh(r,s.getCursorStates())}}class aS{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Vv{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Vv(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,s,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,s=!0,r=!0):(s=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const h=e.getConfiguredWordAtPosition(l.getStartPosition());if(!h)return null;c=h.word,d=new ae(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new Vv(e,t,n,c,s,r,d)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new aS(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new aS(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new ae(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new aS(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new aS(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new ae(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}class jm extends A{static{this.ID="editor.contrib.multiCursorController"}static get(e){return e.getContribution(jm.ID)}constructor(e){super(),this._sessionDispose=this._register(new z),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Vv.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ae(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!vZ(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let s=0,r=t.length;snew ae(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn)))}}}class S_ extends le{run(e,t){const i=jm.get(t);if(!i)return;const n=t._getViewModel();if(n){const s=n.getCursorStates(),r=Qs.get(t);if(r)this._run(i,r);else{const a=e.get(fe).createInstance(Qs,t);this._run(i,a),a.dispose()}Uh(s,n.getCursorStates())}}}class NDe extends S_{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:H(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2082,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1293,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class TDe extends S_{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:H(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1294,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class RDe extends S_{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:H(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:Mi(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class MDe extends S_{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:H(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class PDe extends S_{constructor(){super({id:"editor.action.selectHighlights",label:H(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:N.focus,primary:3114,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m(1295,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class ADe extends S_{constructor(){super({id:"editor.action.changeAll",label:H(1308,"Change All Occurrences"),precondition:q.and(N.writable,N.editorTextFocus),kbOpts:{kbExpr:N.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class ODe{constructor(e,t,i,n,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(L.compareRangesUsingStarts)),this._cachedFindMatches}}let Dx=class extends A{static{QM=this}static{this.ID="editor.contrib.selectionHighlighter"}constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new St(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=Qs.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(QM._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,n,s){if(!t||!s.hasModel())return null;if(!i){const h=s.getSelection();if(h.startLineNumber!==h.endLineNumber)return null}const r=jm.get(s);if(!r)return null;const a=Qs.get(s);if(!a)return null;let l=r.getSession(a);if(!l){const h=s.getSelections();if(h.length>1){const g=a.getState().matchCase;if(!vZ(s.getModel(),h,g))return null}l=Vv.create(s,a)}if(!l||l.currentMatch||/^[ \t]+$/.test(l.searchText)||n>0&&l.searchText.length>n)return null;const c=a.getState(),d=c.matchCase;if(c.isRevealed){let h=c.searchString;d||(h=h.toLowerCase());let u=l.searchText;if(d||(u=u.toLowerCase()),h===u&&l.matchCase===c.matchCase&&l.wholeWord===c.wholeWord&&!c.isRegex)return null}return new ODe(s.getModel(),l.searchText,l.matchCase,l.wholeWord?s.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(L.compareRangesUsingStarts);const s=[];for(let c=0,d=0,h=i.length,u=n.length;c=u)s.push(g),c++;else{const f=L.compareRangesUsingStarts(g,n[d]);f<0?((n[d].isEmpty()||!L.areIntersecting(g,n[d]))&&s.push(g),c++):(f>0||c++,d++)}}const r=this.editor.getOption(90)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=s.map(c=>({range:c,options:SDe(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};Dx=QM=yDe([xDe(1,he)],Dx);function vZ(o,e,t){const i=xH(o,e[0],!t);for(let n=1,s=e.length;n{const[t,i,n]=e;Je(_e.isUri(t)),Je(R.isIPosition(i)),Je(typeof n=="string"||!n);const s=o.get(he),r=await o.get(fs).createModelReference(t);try{const a=await wZ(s.signatureHelpProvider,r.object.textEditorModel,R.lift(i),{triggerKind:yl.Invoke,isRetrigger:!1,triggerCharacter:n},Ve.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var Td;(function(o){o.Default={type:0};class e{constructor(n,s){this.request=n,this.previouslyActiveHints=s,this.type=2}}o.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}o.Active=t})(Td||(Td={}));class O5 extends A{static{this.DEFAULT_DELAY=120}constructor(e,t,i=O5.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new P),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Td.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new ut),this.triggerChars=new P0,this.retriggerChars=new P0,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new yr(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Td.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(Ee)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(98).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(98).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Td.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(BDe);this._pendingTriggers=[];const s={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Td.Pending($i(l=>wZ(this.providers,r,a,s,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l?.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Td.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Td.Default),Ee(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:yl.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:yl.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:yl.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function BDe(o,e){switch(e.triggerKind){case yl.Invoke:return e;case yl.ContentChange:return o;case yl.TriggerCharacter:default:return e}}var HDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},LH=function(o,e){return function(t,i){e(t,i,o)}},JM;const xo=J,VDe=Ht("parameter-hints-next",G.chevronDown,m(1312,"Icon for show next parameter hint.")),zDe=Ht("parameter-hints-previous",G.chevronUp,m(1313,"Icon for show previous parameter hint."));let e2=class extends A{static{JM=this}static{this.ID="editor.widget.parameterHintsWidget"}constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.markdownRendererService=n,this.renderDisposeables=this._register(new z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=Jg.Visible.bindTo(i),this.keyMultipleSignatures=Jg.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xo(".editor-widget.parameter-hints-widget"),t=Z(e,xo(".phwrapper"));t.tabIndex=-1;const i=Z(t,xo(".controls")),n=Z(i,xo(".button"+Se.asCSSSelector(zDe))),s=Z(i,xo(".overloads")),r=Z(i,xo(".button"+Se.asCSSSelector(VDe)));this._register(W(n,"click",u=>{nt.stop(u),this.previous()})),this._register(W(r,"click",u=>{nt.stop(u),this.next()}));const a=xo(".body"),l=new ww(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Z(a,xo(".signature")),d=Z(a,xo(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:s,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(59),g=this.domNodes.element;g.style.fontSize=`${u.fontSize}px`,g.style.lineHeight=`${u.lineHeight/u.fontSize}`,g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",js.fontFamily)};h(),this._register(te.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(g=>g.hasChanged(59)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=Z(this.domNodes.signature,xo(".code")),s=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(s)this.renderParameters(n,i,r);else{const c=Z(n,xo("span"));c.textContent=i.label}const a=i.parameters[r];if(a?.documentation){const c=xo("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);c.appendChild(d.element)}Z(this.domNodes.docs,xo("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")Z(this.domNodes.docs,xo("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);Z(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const d=i.parameters[r];Array.isArray(d.label)?c=i.label.substring(d.label[0],d.label[1]):c=d.label,d.documentation&&(c+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(Is(m(1314,"{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Ud(t.documentation).length>0||t&&typeof t.documentation=="object"&&Ud(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Ud(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Ud(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,s]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,s),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(s),Z(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${_o(i.label)}(?=\\W|$)`,"g");n.test(e.label);const s=n.lastIndex-i.label.length;return s>=0?[s,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return JM.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};e2=JM=HDe([LH(2,Ie),LH(3,aa)],e2);E("editorHoverWidget.highlightForeground",lp,m(1315,"Foreground color of the active item in the parameter hint."));var UDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kH=function(o,e){return function(t,i){e(t,i,o)}},t2;let qm=class extends A{static{t2=this}static{this.ID="editor.controller.parameterHints"}static get(e){return e.getContribution(t2.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new O5(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{n?(this.widget.value.show(),this.widget.value.render(n)):this.widget.rawValue?.hide()})),this.widget=new On(()=>this._register(t.createInstance(e2,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}};qm=t2=UDe([kH(1,fe),kH(2,he)],qm);class $De extends le{constructor(){super({id:"editor.action.triggerParameterHints",label:H(1311,"Trigger Parameter Hints"),precondition:N.hasSignatureHelpProvider,kbOpts:{kbExpr:N.editorTextFocus,primary:3082,weight:100}})}run(e,t){qm.get(t)?.trigger({triggerKind:yl.Invoke})}}Xe(qm.ID,qm,2);se($De);const F5=175,W5=Ki.bindToContribution(qm.get);re(new W5({id:"closeParameterHints",precondition:Jg.Visible,handler:o=>o.cancel(),kbOpts:{weight:F5,kbExpr:N.focus,primary:9,secondary:[1033]}}));re(new W5({id:"showPrevParameterHint",precondition:q.and(Jg.Visible,Jg.MultipleSignatures),handler:o=>o.previous(),kbOpts:{weight:F5,kbExpr:N.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));re(new W5({id:"showNextParameterHint",precondition:q.and(Jg.Visible,Jg.MultipleSignatures),handler:o=>o.next(),kbOpts:{weight:F5,kbExpr:N.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));class DH extends A{static{this.ID="editor.contrib.placeholderText"}constructor(e){super(),this._editor=e,this._editorObs=Jt(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=An({owner:this,equalsFn:XE},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=jDe(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=$(t=>{if(!this._shouldViewBeAlive.read(t))return;const i=Qe("div.editorPlaceholder");t.store.add(xe(n=>{const s=this._state.read(n),r=s?.placeholder!==void 0;i.root.style.display=r?"block":"none",i.root.innerText=s?.placeholder??""})),t.store.add(xe(n=>{const s=this._editorObs.layoutInfo.read(n);i.root.style.left=`${s.contentLeft}px`,i.root.style.width=s.contentWidth-s.verticalScrollbarWidth+"px",i.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),t.store.add(xe(n=>{i.root.style.fontFamily=this._editorObs.getOption(58).read(n),i.root.style.fontSize=this._editorObs.getOption(61).read(n)+"px",i.root.style.lineHeight=this._editorObs.getOption(75).read(n)+"px"})),t.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Nt(0),position:Nt(null),domNode:i.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}}function jDe(o,e){return ld(o,(t,i)=>i===!0?!0:e(t))}var qDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KDe=function(o,e){return function(t,i){e(t,i,o)}};class GDe{constructor(e){this.instantiationService=e}init(...e){}}function ZDe(o){return o()}let IH=class extends GDe{constructor(e,t){super(t),this.init(e)}};IH=qDe([KDe(1,fe)],IH);Xe(DH.ID,ZDe(()=>DH),0);E("editor.placeholder.foreground",oae,m(1334,"Foreground color of the placeholder text in the editor."));const Xk=We("textResourceConfigurationService"),SZ=We("textResourcePropertiesService");var YDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lS=function(o,e){return function(t,i){e(t,i,o)}};const y_=new oe("renameInputVisible",!1,m(1391,"Whether the rename input widget is visible"));new oe("renameInputFocused",!1,m(1392,"Whether the rename input widget is focused"));let i2=class{constructor(e,t,i,n,s,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new z,this._visibleContextKey=y_.bindTo(s),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new rn,this._inputWithButton=new XDe,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(59)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new B5(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{this._renameCandidateListView?.focusedCandidate!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??=this._beforeFirstInputFieldEditSW.elapsed(),this._renameCandidateProvidersCts?.token.isCancellationRequested===!1&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(c_),i=e.getColor(VO);this._domNode.style.backgroundColor=String(e.getColor(Vo)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(vU)??"");const n=e.getColor(wU);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(kN)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(kN)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Je(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=Ch(this.getDomNode().ownerDocument.body),t=pi(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(75),{totalHeight:s}=Km.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>s*6?[2,1]:[1,2];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=m(1393,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Je(this._renameCandidateListView),Je(this._nPxAvailableAbove!==void 0),Je(this._nPxAvailableBelow!==void 0);const t=Dc(this._inputWithButton.domNode),i=Dc(this._label);let n;e===2?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:so(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,s){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=s;const l=new z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),l.add(W(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(W(this._inputWithButton.button,ee.KEY_DOWN,d=>{const h=new yt(d);(h.equals(3)||h.equals(10))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new R(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(ue(()=>{this._renameCts=void 0,s.dispose(!0)})),l.add(ue(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(ue(()=>this._candidates.clear()));const c=new tf;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=d=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),c.complete(d),!0),this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Je(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,g;const f=this._renameCandidateListView.focusedCandidate;if(f!==void 0?(this._trace("using new name from renameSuggestion"),u=f,g={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,g=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:u,wantsPreview:i&&d,stats:{source:g,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(s.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Je(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new qt;const i=t?ZC.Invoke:ZC.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){Je(this._editor.hasModel());const i=this._editor.getSelection();let n=0,s=t.length;return!L.isEmpty(i)&&!L.spansMultipleLines(i)&&L.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),s=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:s}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...c)=>this._trace("_updateRenameCandidates",...c);n("start");const s=await hm(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),s===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=s.flatMap(c=>c.status==="fulfilled"&&hn(c.value)?c.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=Xc(r,c=>c.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(n(`valid distinct candidates - ${r.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(l),n("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};i2=YDe([lS(2,ci),lS(3,st),lS(4,Ie),lS(5,Mt)],i2);class B5{constructor(e,t){this._disposables=new z,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=B5._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(gf({listInactiveFocusForeground:VC,listInactiveFocusBackground:zC}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Pa(m(1394,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=Km.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},s=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new Km(r,i)}renderElement(r,a,l){l.populate(r)}disposeTemplate(r){r.dispose()}};return new Qo("NewSymbolNameCandidates",e,n,[s],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class XDe{constructor(){this._buttonHoverContent="",this._onDidInputChange=new P,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new z}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",m(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=m(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=m(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(oa().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(W(this.input,ee.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(W(this.input,ee.KEY_DOWN,e=>{const t=new yt(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(W(this.input,ee.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(W(this.input,ee.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(W(this.input,ee.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Je(this._inputNode),this._inputNode}get button(){return Je(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=Ba(G.sparkle),xn(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??=Ba(G.stopCircle),xn(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}class Km{static{this._PADDING=2}constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${Km._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=Ba(G.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),gn(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(MN.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Km._PADDING*2}}dispose(){}}var QDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ou=function(o,e){return function(t,i){e(t,i,o)}},n2;class H5{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`):void 0}:{range:L.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(` -`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m(1380,"No result.")),n);return r}}async function mNe(o,e,t,i){const n=new Q3(e,t,o),s=await n.resolveRenameLocation($e.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,$e.None)}let Jh=class{static{pP=this}static{this.ID="editor.contrib.renameController"}static get(e){return e.getContribution(pP.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new z,this._cts=new Jt,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(fP,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Jt,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new Q3(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new Ld(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const f=i.resolveRenameLocation(n.token);this._progressService.showWhile(f,250),s=await f,e("resolved rename location")}catch(f){f instanceof Ar?e("resolve rename location cancelled",JSON.stringify(f,null," ")):(e("resolve rename location failed",f instanceof Error?f:JSON.stringify(f,null," ")),(typeof f=="string"||ld(f))&&Do.get(this.editor)?.showMessage(f||m(1381,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),Do.get(this.editor)?.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Ld(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async f=>[f,await f.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(f,p)=>{let _=c.slice();return f===Mv.Automatic&&(_=_.filter(([b,C])=>C)),_.map(([b])=>b.provideNewSymbolNames(a,s.range,f,p))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(s.range,s.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const g=Vm(i.provideRenameEdits(u.newName,r.token),r.token).then(async f=>{if(!f){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(f.rejectReason){e(`returning early - rejected with reason: ${f.rejectReason}`),this._notificationService.info(f.rejectReason);return}this.editor.setSelection(D.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:m(1382,"Renaming '{0}' to '{1}'",s?.text,u.newName),code:"undoredo.rename",quotableLabel:m(1383,"Renaming {0} to {1}",s?.text,u.newName),respectAutoSaveConfig:!0,reason:Jn.rename()}).then(p=>{e("edits applied"),p.ariaSummary&&Ws(m(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,u.newName,p.ariaSummary))}).catch(p=>{e(`error when applying edits ${JSON.stringify(p,null," ")}`),this._notificationService.error(m(1385,"Rename failed to apply edits")),this._logService.error(p)})},f=>{e("error when providing rename edits",JSON.stringify(f,null," ")),this._notificationService.error(m(1386,"Rename failed to compute edits")),this._logService.error(f)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(g,250),g}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}};Jh=pP=pNe([Iu(1,pe),Iu(2,Li),Iu(3,v1),Iu(4,yd),Iu(5,Ht),Iu(6,qk),Iu(7,ue)],Jh);class _Ne extends de{constructor(){super({id:"editor.action.rename",label:H(1388,"Rename Symbol"),precondition:K.and(N.writable,N.hasRenameProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(at),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return be.isUri(n)&&R.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Te):super.runCommand(e,t)}run(e,t){const i=e.get(Ht),n=Jh.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}nt(Jh.ID,Jh,4);oe(_Ne);const J3=tn.bindToContribution(Jh.get);ae(new J3({id:"acceptRenameInput",precondition:J_,handler:o=>o.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:K.and(N.focus,K.not("isComposing")),primary:3}}));ae(new J3({id:"acceptRenameInputWithPreview",precondition:K.and(J_,K.has("config.editor.rename.enablePreview")),handler:o=>o.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:K.and(N.focus,K.not("isComposing")),primary:2051}}));ae(new J3({id:"cancelRenameInput",precondition:J_,handler:o=>o.cancelRenameInput(),kbOpts:{weight:199,kbExpr:N.focus,primary:9,secondary:[1033]}}));Lt(class extends yn{constructor(){super({id:"focusNextRenameSuggestion",title:{...H(1389,"Focus Next Rename Suggestion")},precondition:J_,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(at).getFocusedCodeEditor();if(!t)return;const i=Jh.get(t);i&&i.focusNextRenameSuggestion()}});Lt(class extends yn{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...H(1390,"Focus Previous Rename Suggestion")},precondition:J_,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(at).getFocusedCodeEditor();if(!t)return;const i=Jh.get(t);i&&i.focusPreviousRenameSuggestion()}});ho("_executeDocumentRenameProvider",function(o,e,t,...i){const[n]=i;rt(typeof n=="string");const{renameProvider:s}=o.get(ue);return mNe(s,e,t,n)});ho("_executePrepareRename",async function(o,e,t){const{renameProvider:i}=o.get(ue),s=await new Q3(e,t,i).resolveRenameLocation($e.None);if(s?.rejectReason)throw new Error(s.rejectReason);return s});fi.as(rl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:m(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var bNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fV=function(o,e){return function(t,i){e(t,i,o)}};let yx=class extends F{static{this.ID="editor.sectionHeaderDetector"}constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{const s=this.editor.getModel()?.getLanguageId();s&&n.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new It(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!n?.markers))return{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const r=t.validateRange(s.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(s=>s.decorationId),n=e.map(s=>CNe(s));this.editor.changeDecorations(s=>{const r=s.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=r.length;a=this._minimumTimeBetweenRuns&&(this._lastRun=t,e())}}class KC{static create(e,t){return new KC(e,new tg(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new D(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,s,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new KC(this._startLineNumber,n),new KC(this._startLineNumber+r,s)]}applyEdit(e,t){const[i,n,s]=qh(t);this.acceptEdit(e,i,n,s,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new R(e.startLineNumber,e.startColumn),t,i,n,s),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const s=i-t;this._startLineNumber-=s;return}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const s=-t;this._startLineNumber-=s,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,s){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,n,s)}reportIfInvalid(e){this._tokens.reportIfInvalid(e,this._startLineNumber)}}class tg{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;for(;ae||u===e&&f>=t)&&(ue||f===e&&_>=t){if(fs?p-=s-i:p=i;else if(g===t&&f===i)if(g===n&&p>s)p-=s-i;else{d=!0;continue}else if(gs)g=t,f=i,p=f+(p-s);else{d=!0;continue}else if(g>n){if(l===0&&!d){c=a;break}g-=l}else if(g===n&&f>=s)e&&g===0&&(f+=e,p+=e),g-=l,f-=s-i,p-=s-i;else throw new Error("Not possible!");const b=4*c;r[b]=g,r[b+1]=f,r[b+2]=p,r[b+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,n,s,r){const a=i===0&&n===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")}):n>e.getLineCount()?tg._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")}):this._getEndCharacter(i)>e.getLineLength(n)&&tg._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")})}}}class pV{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var wNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wN=function(o,e){return function(t,i){e(t,i,o)}};let mP=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Jd}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,n);let r;if(s)r=s.metadata;else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let h=0;c>0&&h>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?1:0)<<11;r|=h|1}if(typeof d.bold<"u"){const h=(d.bold?2:0)<<11;r|=h|2}if(typeof d.underline<"u"){const h=(d.underline?4:0)<<11;r|=h|4}if(typeof d.strikethrough<"u"){const h=(d.strikethrough?8:0)<<11;r|=h|8}if(d.foreground){const h=d.foreground<<15;r|=h|16}r===0&&(r=2147483647)}}else r=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,r)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};mP=wNe([wN(1,pi),wN(2,yi),wN(3,Ht)],mP);function gX(o,e,t){const i=o.data,n=o.data.length/5|0,s=Math.max(Math.ceil(n/1024),400),r=[];let a=0,l=1,c=0;for(;ad&&i[5*C]===0;)C--;if(C-1===d){let w=h;for(;w+1L)e.warnOverlappingSemanticTokens(S,L+1);else{const A=e.getMetadata(I,T,t);A!==2147483647&&(f===0&&(f=S),u[g]=S-f,u[g+1]=L,u[g+2]=k,u[g+3]=A,g+=4,p=S,_=k)}l=S,c=L,a++}g!==u.length&&(u=u.subarray(0,g));const b=KC.create(f,u);r.push(b)}return r}class SNe{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class Jd{static{this._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143]}constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Jd._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const s=this._elements;this._currentLengthIndex++,this._currentLength=Jd._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?t[0]:[]}async function _X(o,e,t,i,n){const s=kNe(o,e),r=await Promise.all(s.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){c=d,l=null}return(!l||!Gk(l)&&!pX(l))&&(l=null),new DNe(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function INe(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:null}class ENe{constructor(e,t){this.provider=e,this.tokens=t}}function NNe(o,e){return o.has(e)}function bX(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function eW(o,e,t,i){const n=bX(o,e),s=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Bi(l),a=null}return(!a||!Gk(a))&&(a=null),new ENe(r,a)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}it.registerCommand("_provideDocumentSemanticTokensLegend",async(o,...e)=>{const[t]=e;rt(t instanceof be);const i=o.get(ri).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(ue),s=INe(n,i);return s?s[0].getLegend():o.get(Vt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});it.registerCommand("_provideDocumentSemanticTokens",async(o,...e)=>{const[t]=e;rt(t instanceof be);const i=o.get(ri).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(ue);if(!mX(n,i))return o.get(Vt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await _X(n,i,null,null,$e.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!Gk(a))return;const l=fX({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});it.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(o,...e)=>{const[t,i]=e;rt(t instanceof be);const n=o.get(ri).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(ue),r=bX(s,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!D.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await eW(s,n,D.lift(i),$e.None);if(a)return a.provider.getLegend()});it.registerCommand("_provideDocumentRangeSemanticTokens",async(o,...e)=>{const[t,i]=e;rt(t instanceof be),rt(D.isIRange(i));const n=o.get(ri).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(ue),r=await eW(s,n,D.lift(i),$e.None);if(!(!r||!r.tokens))return fX({id:0,type:"full",data:r.tokens.data})});const tW="editor.semanticHighlighting";function ey(o,e,t){const i=t.getValue(tW,{overrideIdentifier:o.getLanguageId(),resource:o.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var CX=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nl=function(o,e){return function(t,i){e(t,i,o)}},Zd;let _P=class extends F{constructor(e,t,i,n,s,r){super(),this._watchers=new gi;const a=d=>{this._watchers.get(d.uri)?.dispose(),this._watchers.set(d.uri,new bP(d,e,i,s,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);ey(d,i,n)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{ey(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{ey(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(tW)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){vt(this._watchers.values()),this._watchers.clear(),super.dispose()}};_P=CX([Nl(0,Kk),Nl(1,ri),Nl(2,pi),Nl(3,Oe),Nl(4,qr),Nl(5,ue)],_P);let bP=class extends F{static{Zd=this}static{this.REQUEST_MIN_DELAY=300}static{this.REQUEST_MAX_DELAY=2e3}constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Zd.REQUEST_MIN_DELAY,max:Zd.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new It(()=>this._fetchDocumentSemanticTokensNow(),Zd.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{vt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),vt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!mX(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Jt,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=_X(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],r=this._model.onDidChangeContent(l=>{s.push(l)}),a=new fn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,s)}},l=>{l&&(hr(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Te(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let r=0;r{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(pX(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=s.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const g=t.edits[u];if(g.start>l.length){i.warnInvalidEditStart(s.resultId,t.resultId,u,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const f=d-(g.start+g.deleteCount);f>0&&(Zd._copy(l,d-f,c,h-f,f),h-=f),g.data&&(Zd._copy(g.data,0,c,h-g.data.length,g.data.length),h-=g.data.length),d=g.start}d>0&&Zd._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(Gk(t)){this._currentDocumentResponse=new TNe(e,t.resultId,t.data);const a=gX(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};bP=Zd=CX([Nl(1,Kk),Nl(2,pi),Nl(3,qr),Nl(4,ue)],bP);class TNe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Y_(_P);var RNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Mb=function(o,e){return function(t,i){e(t,i,o)}};let Lx=class extends F{static{this.ID="editor.contrib.viewportSemanticTokens"}constructor(e,t,i,n,s,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new It(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){const c=this._editor.getModel();for(const d of this._provider.all(c)){const h=d.onDidChange?.(()=>{this._cancelAll(),a()});h&&this._rangeProvidersChangeListeners.push(h)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(tW)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){vt(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Qi(r=>Promise.resolve(eW(this._provider,e,t,r))),s=new fn(!1);return n.then(r=>{if(this._debounceInformation.update(e,s.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,gX(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};Lx=RNe([Mb(1,Kk),Mb(2,pi),Mb(3,Oe),Mb(4,qr),Mb(5,ue)],Lx);nt(Lx.ID,Lx,1);class MNe{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:r}=n,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=s.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(hh(h)&&Dl(d))break;d=h}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new D(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var PNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ANe=function(o,e){return function(t,i){e(t,i,o)}},CP;class iW{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new iW(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let Dw=class{static{CP=this}static{this.ID="editor.contrib.smartSelectController"}static get(e){return e.getContribution(CP.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await wX(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(129),$e.None).then(s=>{if(!(!ws(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!Qt(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),s[r].unshift(t[r]);this._state=s.map(r=>new iW(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>le.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};Dw=CP=PNe([ANe(1,ue)],Dw);class vX extends de{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=Dw.get(t);i&&await i.run(this._forward)}}class ONe extends vX{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:H(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(1398,"&&Expand Selection"),order:2}})}}it.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class FNe extends vX{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:H(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(1399,"&&Shrink Selection"),order:3}})}}nt(Dw.ID,Dw,4);oe(ONe);oe(FNe);async function wX(o,e,t,i,n){const s=o.all(e).concat(new MNe(i.selectSubwords));s.length===1&&s.unshift(new ta);const r=[],a=[];for(const l of s)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(c=>{if(ws(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((u,g)=>R.isBefore(u.getStartPosition(),g.getStartPosition())?1:R.isBefore(g.getStartPosition(),u.getStartPosition())||R.isBefore(u.getEndPosition(),g.getEndPosition())?-1:R.isBefore(g.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||D.containsRange(u,d)&&!D.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;uR.isIPosition(r)));const n=o.get(ue).selectionRangeProvider,s=await o.get(ys).createModelReference(t);try{return wX(n,s.object.textEditorModel,i.map(R.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},$e.None)}finally{s.dispose()}});const vP=Object.freeze({View:H(1638,"View"),Help:H(1639,"Help"),Test:H(1640,"Test"),File:H(1641,"File"),Preferences:H(1642,"Preferences"),Developer:H(1643,"Developer")});class WNe extends Ca{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...H(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:m(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:H(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:vP.View,toggled:{condition:K.equals("config.editor.stickyScroll.enabled",!0),title:m(1445,"Sticky Scroll"),mnemonicTitle:m(1446,"&&Sticky Scroll")},menu:[{id:M.CommandPalette},{id:M.MenubarAppearanceMenu,group:"4_editor",order:3},{id:M.StickyScrollContext}]})}async runEditorCommand(e,t){const i=e.get(Oe),n=!i.getValue("editor.stickyScroll.enabled"),s=_a.get(t)?.isFocused();i.updateValue("editor.stickyScroll.enabled",n),s&&t.focus()}}const Zk=100;class BNe extends Ca{constructor(){super({id:"editor.action.focusStickyScroll",title:{...H(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:m(1447,"&&Focus Editor Sticky Scroll")},precondition:K.and(K.has("config.editor.stickyScroll.enabled"),N.stickyScrollVisible),menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){_a.get(t)?.focus()}}class HNe extends Ca{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:H(1451,"Select the next editor sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Zk,primary:18}})}runEditorCommand(e,t){_a.get(t)?.focusNext()}}class VNe extends Ca{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:H(1452,"Select the previous sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Zk,primary:16}})}runEditorCommand(e,t){_a.get(t)?.focusPrevious()}}class zNe extends Ca{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:H(1453,"Go to the focused sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Zk,primary:3}})}runEditorCommand(e,t){_a.get(t)?.goToFocused()}}class UNe extends Ca{constructor(){super({id:"editor.action.selectEditor",title:H(1454,"Select Editor"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Zk,primary:9}})}runEditorCommand(e,t){_a.get(t)?.selectEditor()}}nt(_a.ID,_a,1);Lt(WNe);Lt(BNe);Lt(VNe);Lt(HNe);Lt(zNe);Lt(UNe);var SX=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sC=function(o,e){return function(t,i){e(t,i,o)}};class $Ne{constructor(e,t,i,n,s,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.gutterMenuLinkAction=r,this.completion=a}}let wP=class extends see{constructor(e,t,i,n,s,r){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve($e.None)}return e}};wP=SX([sC(5,Vk)],wP);let SP=class extends F{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){if(i.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const r=s.getOption(102);if(Zp.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Zp.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c?.word||(d=this._getTriggerCharacterInfo(e,t)),!c?.word&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new D(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,c)){const g=new O6(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await S3(this._languageFeatureService.completionProvider,e,t,new R1(void 0,mx.createSuggestFilter(s).itemKind,d?.providers),d&&{triggerKind:1,triggerCharacter:d.ch},n);let f;g.needsClipboard&&(f=await this._clipboardService.readText());const p=new rh(g.items,t.column,new O6(u,0),Ll.None,s.getOption(134),s.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},f);h=new wP(e,t.lineNumber,c,p,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve($e.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(D.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))s.triggerCharacters?.includes(i)&&n.add(s);if(n.size!==0)return{providers:n,ch:i}}};SP=SX([sC(0,ue),sC(1,Mo),sC(2,Vk),sC(3,at)],SP);Y_(SP);class jNe extends de{constructor(){super({id:"editor.action.forceRetokenize",label:H(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new fn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}oe(jNe);class nW extends yn{static{this.ID="editor.action.toggleTabFocusMode"}constructor(){super({id:nW.ID,title:H(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:H(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!Km.getTabFocusMode();Km.setTabFocusMode(t),Ws(t?m(1528,"Pressing Tab will now move focus to the next focusable element"):m(1529,"Pressing Tab will now insert the tab character"))}}Lt(nW);class sW{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),r=new mV(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${qNe(Array.from(a))}`,"g");const c=new Up(null,l),d=[];let h=!1,u,g=0,f=0,p=0;e:for(let _=n,b=s;_<=b;_++){const C=e.getLineContent(_),w=C.length;c.reset(0);do if(u=c.next(C),u){let v=u.index,S=u.index+u[0].length;if(v>0){const I=C.charCodeAt(v-1);Zi(I)&&v--}if(S+1=1e3){h=!0;break e}d.push(new D(_,v+1,_,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:g,invisibleCharacterCount:f,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new mV(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(s),a=uh.getLocales().filter(l=>!uh.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function qNe(o,e){return`[${Eo(o.map(i=>String.fromCodePoint(i)).join(""))}]`}class mV{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=uh.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of nd.codePoints)_V(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=Zw(r);n=n||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!nd.isInvisibleCharacter(a)&&(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!_V(e)&&nd.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function _V(o){return o===" "||o===` -`||o===" "}var KNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bV=function(o,e){return function(t,i){e(t,i,o)}};let yP=class extends F{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Y(e,ee("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??oc("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new wt(this.el,"click")),a=this._register(new wt(this.el,"keypress")),l=se.chain(a.event,h=>h.map(u=>new Et(u)).filter(u=>u.keyCode===3)),c=this._register(new wt(this.el,Bt.Tap)).event;this._register(ni.addTarget(this.el));const d=se.any(r.event,l,c);this._register(d(h=>{this.enabled&&(ct.stop(h,!0),i?.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};yP=KNe([bV(3,Us),bV(4,Pd)],yP);var yX=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},LP=function(o,e){return function(t,i){e(t,i,o)}};const GNe=26;let xP=class extends F{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(DP))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,GNe)}};xP=yX([LP(1,pe)],xP);let DP=class extends F{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=ee("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=ee("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Tn(this.element)}show(e){Tn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Y(this.element,ee("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ee(`div${ye.asCSSSelector(e.icon)}`));const n=Y(this.element,ee("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Y(this.element,ee("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(yP,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=Y(this.element,ee("div.action-container"));this.actionBar=this._register(new no(s)),this.actionBar.push(this._register(new nr("banner.close",m(1533,"Close Banner"),ye.asClassName(OK),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};DP=yX([LP(0,pe),LP(1,Sa)],DP);const LX=Ve("workspaceTrustManagementService");var oW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GC=function(o,e){return function(t,i){e(t,i,o)}};const ZNe=Kt("extensions-warning-message",Z.warning,m(1534,"Icon shown with a warning message in the extensions editor."));let kw=class extends F{static{this.ID="editor.contrib.unicodeHighlighter"}constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const r=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=r)a={message:m(1535,"This document contains many non-basic ASCII unicode characters"),command:new P1};else if(s.ambiguousCharacterCount>=r)a={message:m(1536,"This document contains many ambiguous unicode characters"),command:new $f};else if(s.invisibleCharacterCount>=r)a={message:m(1537,"This document contains many invisible unicode characters"),command:new M1};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:ZNe,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(xP,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=YNe(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?Ef.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?VJ:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new kP(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new XNe(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};kw=oW([GC(1,uo),GC(2,LX),GC(3,pe)],kw);function YNe(o,e){return{nonBasicASCII:e.nonBasicASCII===$o?!o:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===$o?!o:e.includeComments,includeStrings:e.includeStrings===$o?!o:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let kP=class extends F{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new It(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:Yk.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!fF(t,e))return null;const i=t.getValueInRange(e.range);return{reason:DX(i,this._options),inComment:pF(t,e),inString:mF(t,e)}}};kP=oW([GC(3,uo)],kP);class XNe extends F{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new It(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const s=sW.computeUnicodeHighlights(this._model,this._options,n);for(const r of s.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:Yk.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return fF(t,e)?{reason:DX(i,this._options),inComment:pF(t,e),inString:mF(t,e)}:null}}const xX=m(1538,"Configure Unicode Highlight Options");let IP=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(kw.ID);if(!n)return[];const s=[],r=new Set;let a=300;for(const l of t){const c=n.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=SN(h);let g;switch(c.reason.kind){case 0:{Zw(c.reason.confusableWith)?g=m(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,SN(c.reason.confusableWith.codePointAt(0))):g=m(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,SN(c.reason.confusableWith.codePointAt(0)));break}case 1:g=m(1541,"The character {0} is invisible.",u);break;case 2:g=m(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(g))continue;r.add(g);const f={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m(1543,"Adjust settings"),_=Jq(Xk.ID,f),b=new ts("",!0).appendMarkdown(g).appendText(" ").appendLink(_,p,xX);s.push(new la(this,l.range,[b],!1,a++))}return s}renderHoverParts(e,t){return k1e(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` -`)}};IP=oW([GC(1,Sa)],IP);function EP(o){return`U+${o.toString(16).padStart(4,"0")}`}function SN(o){let e=`\`${EP(o)}\``;return nd.isInvisibleCharacter(o)||(e+=` "${`${QNe(o)}`}"`),e}function QNe(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function DX(o,e){return sW.computeUnicodeHighlightReason(o,e)}class Yk{constructor(){this.map=new Map}static{this.instance=new Yk}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Me.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}class JNe extends de{constructor(){super({id:$f.ID,label:H(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(Oe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Qs.includeComments,!1,2)}}class eTe extends de{constructor(){super({id:$f.ID,label:H(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(Oe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Qs.includeStrings,!1,2)}}class $f extends yn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters"}constructor(){super({id:$f.ID,title:H(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(Oe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Qs.ambiguousCharacters,!1,2)}}class M1 extends yn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters"}constructor(){super({id:M1.ID,title:H(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(Oe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Qs.invisibleCharacters,!1,2)}}class P1 extends yn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters"}constructor(){super({id:P1.ID,title:H(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(Oe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Qs.nonBasicASCII,!1,2)}}class Xk extends yn{static{this.ID="editor.action.unicodeHighlight.showExcludeOptions"}constructor(){super({id:Xk.ID,title:H(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:s,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(as),c=e.get(Oe);function d(f){return nd.isInvisibleCharacter(f)?m(1549,"Exclude {0} (invisible character) from being highlighted",EP(f)):m(1550,"Exclude {0} from being highlighted",`${EP(f)} "${a}"`)}const h=[];if(n.kind===0)for(const f of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{iTe(c,[f])}});if(h.push({label:d(i),run:()=>tTe(c,[i])}),r){const f=new JNe;h.push({label:f.label,run:async()=>f.runAction(c)})}else if(s){const f=new eTe;h.push({label:f.label,run:async()=>f.runAction(c)})}function u(f){return typeof f.desc.title=="string"?f.desc.title:f.desc.title.value}if(n.kind===0){const f=new $f;h.push({label:u(f),run:async()=>f.runAction(c)})}else if(n.kind===1){const f=new M1;h.push({label:u(f),run:async()=>f.runAction(c)})}else if(n.kind===2){const f=new P1;h.push({label:u(f),run:async()=>f.runAction(c)})}else nTe(n);const g=await l.pick(h,{title:xX});g&&await g.run()}}async function tTe(o,e){const t=o.getValue(Qs.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(Qs.allowedCharacters,i,2)}async function iTe(o,e){const t=o.inspect(Qs.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await o.updateValue(Qs.allowedLocales,i,2)}function nTe(o){throw new Error(`Unexpected value: ${o}`)}Lt($f);Lt(M1);Lt(P1);Lt(Xk);nt(kw.ID,kw,1);Bf.register(IP);const A1=Ve("dialogService");var sTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CV=function(o,e){return function(t,i){e(t,i,o)}};const kX="ignoreUnusualLineTerminators";function oTe(o,e,t){o.setModelProperty(e.uri,kX,t)}function rTe(o,e){return o.getModelProperty(e.uri,kX)}let xx=class extends F{static{this.ID="editor.contrib.unusualLineTerminatorsDetector"}constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||rTe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Br(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){oTe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};xx=sTe([CV(1,A1),CV(2,at)],xx);nt(xx.ID,xx,1);const n0="**",vV="/",ty="[/\\\\]",iy="[^/\\\\]",aTe=/\//g;function wV(o,e){switch(o){case 0:return"";case 1:return`${iy}*?`;default:return`(?:${ty}|${iy}+${ty}${e?`|${ty}${iy}+`:""})*?`}}function SV(o,e){if(!o)return[];const t=[];let i=!1,n=!1,s="";for(const r of o){switch(r){case e:if(!i&&!n){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}s+=r}return s&&t.push(s),t}function IX(o){if(!o)return"";let e="";const t=SV(o,vV);if(t.every(i=>i===n0))e=".*";else{let i=!1;t.forEach((n,s)=>{if(n===n0){if(i)return;e+=wV(2,s===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!c?h="^":d===vV?h="":h=Eo(d),c+=h;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const u=`(?:${SV(a,",").map(g=>IX(g)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=iy;continue;case"*":e+=wV(1);continue;default:e+=Eo(d)}}sl===c,endsWith:i?Iee:(l,c)=>l.endsWith(c),isEqualOrParent:(l,c)=>_T(l,c,!oo||i)},s=`${i?t.toLowerCase():t}_${!!e.trimForExclusions}_${i}`;let r=yV.get(s);if(r)return xV(r,o,n);let a;return lTe.test(t)?r=fTe(t.substring(4),t,n):(a=cTe.exec(yN(t,n)))?r=pTe(a[1],t,n):(e.trimForExclusions?hTe:dTe).test(t)?r=mTe(t,n):(a=uTe.exec(yN(t,n)))?r=DV(a[1].substring(1),t,!0,n):(a=gTe.exec(yN(t,n)))?r=DV(a[1],t,!1,n):r=_Te(t,n),yV.set(s,r),xV(r,o,n)}function xV(o,e,t){if(typeof e=="string")return o;const i=function(n,s){return t.isEqualOrParent(n,e.base)?o(Gw(n.substring(e.base.length),Ua),s):null};return i.allBasenames=o.allBasenames,i.allPaths=o.allPaths,i.basenames=o.basenames,i.patterns=o.patterns,i}function yN(o,e){return e.trimForExclusions&&o.endsWith("/**")?o.substring(0,o.length-2):o}function fTe(o,e,t){return function(i,n){return typeof i=="string"&&t.endsWith(i,o)?e:null}}function pTe(o,e,t){const i=`/${o}`,n=`\\${o}`,s=function(a,l){return typeof a!="string"?null:l?t.equals(l,o)?e:null:t.equals(a,o)||t.endsWith(a,i)||t.endsWith(a,n)?e:null},r=[o];return s.basenames=r,s.patterns=[e],s.allBasenames=r,s}function mTe(o,e){const t=NX(o.slice(1,-1).split(",").map(a=>rW(a,e)).filter(a=>a!==Ul),o),i=t.length;if(!i)return Ul;if(i===1)return t[0];const n=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);s&&(n.allBasenames=s.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function DV(o,e,t,i){const n=Ua===zi.sep,s=n?o:o.replace(aTe,Ua),r=Ua+s,a=zi.sep+o;let l;return t?l=function(c,d){return typeof c=="string"&&(i.equals(c,s)||i.endsWith(c,r)||!n&&(i.equals(c,o)||i.endsWith(c,a)))?e:null}:l=function(c,d){return typeof c=="string"&&(i.equals(c,s)||!n&&i.equals(c,o))?e:null},l.allPaths=[(t?"*/":"./")+o],l}function _Te(o,e){try{const t=new RegExp(`^${IX(o)}$`,e.ignoreCase?"i":void 0);return function(i){return t.lastIndex=0,typeof i=="string"&&t.test(i)?o:null}}catch{return Ul}}function bTe(o,e,t){return!o||typeof e!="string"?!1:EX(o,t)(e)}function EX(o,e={}){if(!o)return LV;if(typeof o=="string"||CTe(o)){const t=rW(o,e);if(t===Ul)return LV;const i=function(n,s){return!!t(n,s)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return vTe(o,e)}function CTe(o){const e=o;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function vTe(o,e){const t=NX(Object.getOwnPropertyNames(o).map(a=>wTe(a,o[a],e)).filter(a=>a!==Ul)),i=t.length;if(!i)return Ul;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let g=0,f=t.length;g{for(const g of u){const f=await g;if(typeof f=="string")return f}return null})():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const n=function(a,l,c){let d,h;for(let u=0,g=t.length;u{for(const u of h){const g=await u;if(typeof g=="string")return g}return null})():null},s=t.find(a=>!!a.allBasenames);s&&(n.allBasenames=s.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function wTe(o,e,t){if(e===!1)return Ul;const i=rW(o,t);if(i===Ul)return Ul;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const s=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=n.replace("$(basename)",()=>l),h=c(d);return QN(h)?h.then(u=>u?o:null):h?o:null};return s.requiresSiblings=!0,s}}return i}function NX(o,e){const t=o.filter(a=>!!a.basenames);if(t.length<2)return o;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const s=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===47||h===92)break}l=a.substring(d)}const c=i.indexOf(l);return c!==-1?n[c]:null};s.basenames=i,s.patterns=n,s.allBasenames=i;const r=o.filter(a=>!a.basenames);return r.push(s),r}function aW(o,e,t,i,n,s){if(Array.isArray(o)){let r=0;for(const a of o){const l=aW(a,e,t,i,n,s);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof o=="string")return i?o==="*"?5:o===t?10:0:0;if(o){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=o;if(!i&&!c)return 0;d&&n&&(e=n);let h=0;if(l)if(l===e.scheme)h=10;else if(l==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===s)h=10;else if(d==="*"&&s!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:EU(a.base)},u===e.fsPath||bTe(u,e.fsPath))h=10;else return 0}return h}else return 0}}var STe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yTe=function(o,e){return function(t,i){e(t,i,o)}};class kV{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,Ty,!1).map(a=>({range:a.range,kind:n_.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const s=new gi,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(s);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,Ty,!1).map(d=>({range:d.range,kind:n_.Text}));c&&s.set(a.uri,c)}return s}}let NP=class extends F{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new kV)),this._register(e.multiDocumentHighlightProvider.register("*",new kV))}};NP=STe([yTe(0,ue)],NP);var TX=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tl=function(o,e){return function(t,i){e(t,i,o)}},mi,TP;const lW=new re("hasWordHighlights",!1);function RX(o,e,t,i){const n=o.ordered(e);return s4(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,Bi)),s=>s!=null).then(s=>{if(s){const r=new gi;return r.set(e.uri,s),r}return new gi})}function LTe(o,e,t,i,n){const s=o.ordered(e);return s4(s.map(r=>()=>{const a=n.filter(l=>L$(l)).filter(l=>aW(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Bi)}),r=>r!=null)}class MX{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Qi(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new D(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class xTe extends MX{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return RX(this._providers,e,t.getPosition(),n).then(s=>s||new gi)}}class DTe extends MX{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return LTe(this._providers,e,t.getPosition(),n,this._otherModels).then(s=>s||new gi)}}function kTe(o,e,t,i){return new xTe(e,t,i,o)}function ITe(o,e,t,i,n){return new DTe(e,t,i,o,n)}ho("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(ue);return(await RX(i.documentHighlightProvider,e,t,$e.None))?.get(e.uri)});let RP=class{static{mi=this}static{this.storedDecorationIDs=new gi}static{this.query=null}constructor(e,t,i,n,s,r,a,l){this.toUnhook=new z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new gi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new Fr(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=s,this.configurationService=a,this.logService=l,this._hasWordHighlights=lW.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{nD(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():mi.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll(mi.query?.modelInfo?.modelURI);break;case"multiFile":mi.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{const c=this.codeEditorService.getFocusedCodeEditor();c?c.getModel()?.uri.scheme===Ie.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==Ie.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,mi.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(D.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Ws(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Ws(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=mi.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),mi.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||zh(n.getModel().uri,e))continue;const s=mi.storedDecorationIDs.get(n.getModel().uri);if(!s)continue;n.removeDecorations(s),i.push(n.getModel().uri);const r=eu.get(n);r?.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)mi.storedDecorationIDs.delete(n)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==Ie.vscodeNotebookCell&&mi.query?.modelInfo?.modelURI.scheme!==Ie.vscodeNotebookCell?(mi.query=null,this._run()):mi.query?.modelInfo&&(mi.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Ie.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ie.vscodeNotebookCell&&s.push(l)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!V5(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){if(this.editor.hasTextFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){mi.query=null,this._stopAll();return}const s=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>s||a.endColumn{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Te)}catch(a){this.logService.error("Unexpected error during occurrence request. Log: ",a)}finally{r.dispose()}}else if(this.model.uri.scheme===Ie.vscodeNotebookCell){const n=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!mi.query||!mi.query.modelInfo)return;const s=await this.textModelService.createModelReference(mi.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(s.object.textEditorModel,mi.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(r=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Te)}catch(r){this.logService.error("Unexpected error during occurrence request. Log: ",r)}finally{s.dispose()}}}computeWithModel(e,t,i){return i.length?ITe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):kTe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=eu.get(t);if(!i)continue;const n=[],s=t.getModel()?.uri;if(s&&this.workerRequestValue.has(s)){const r=mi.storedDecorationIDs.get(s),a=this.workerRequestValue.get(s);if(a)for(const c of a)c.range&&n.push({range:c.range,options:WEe(c.kind)});let l=[];t.changeDecorations(c=>{l=c.deltaDecorations(r??[],n)}),mi.storedDecorationIDs=mi.storedDecorationIDs.set(s,l),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};RP=mi=TX([Tl(4,ys),Tl(5,at),Tl(6,Oe),Tl(7,Ht)],RP);let eu=class extends F{static{TP=this}static{this.ID="editor.contrib.wordHighlighter"}static get(e){return e.getContribution(TP.ID)}constructor(e,t,i,n,s,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Ie.accessibleView&&(this._wordHighlighter=new RP(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s,n,r,a))};this._register(e.onDidChangeModel(c=>{this._wordHighlighter&&(!c.newModelUrl&&c.oldModelUrl?.scheme!==Ie.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};eu=TP=TX([Tl(1,Ne),Tl(2,ue),Tl(3,at),Tl(4,ys),Tl(5,Oe),Tl(6,Ht)],eu);class PX extends de{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=eu.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class ETe extends PX{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:H(1572,"Go to Next Symbol Highlight"),precondition:lW,kbOpts:{kbExpr:N.editorTextFocus,primary:65,weight:100}})}}class NTe extends PX{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:H(1573,"Go to Previous Symbol Highlight"),precondition:lW,kbOpts:{kbExpr:N.editorTextFocus,primary:1089,weight:100}})}}class TTe extends de{constructor(){super({id:"editor.action.wordHighlight.trigger",label:H(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=eu.get(t);n&&n.restoreViewState(!0)}}nt(eu.ID,eu,0);oe(ETe);oe(NTe);oe(TTe);Y_(NP);class Qk extends tn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Hr(t.getOption(148),t.getOption(147)),s=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new R(c.positionLineNumber,c.positionColumn),h=this._move(n,s,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>lt.fromModelSelection(c))),l.length===1){const c=new R(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new le(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new le(t.lineNumber,t.column,t.lineNumber,t.column)}}class hu extends Qk{_move(e,t,i,n,s){return Ct.moveWordLeft(e,t,i,n,s)}}class uu extends Qk{_move(e,t,i,n,s){return Ct.moveWordRight(e,t,i,n)}}class RTe extends hu{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class MTe extends hu{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class PTe extends hu{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:K.and(N.textInputFocus,K.and(F_,wk)?.negate()),primary:2063,mac:{primary:527},weight:100}})}}class ATe extends hu{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class OTe extends hu{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class FTe extends hu{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:K.and(N.textInputFocus,K.and(F_,wk)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class WTe extends hu{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,s){return super._move(Hr(ps.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class BTe extends hu{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Hr(ps.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class HTe extends uu{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class VTe extends uu{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:K.and(N.textInputFocus,K.and(F_,wk)?.negate()),primary:2065,mac:{primary:529},weight:100}})}}class zTe extends uu{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class UTe extends uu{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class $Te extends uu{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:K.and(N.textInputFocus,K.and(F_,wk)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class jTe extends uu{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class qTe extends uu{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,s){return super._move(Hr(ps.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class KTe extends uu{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Hr(ps.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class Jk extends tn{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e?.get(ai);if(!t.hasModel()||!n)return;const s=Hr(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(g=>{const f=this._delete({wordSeparators:s,model:r,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new jn(f,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class cW extends Jk{_delete(e,t){const i=Ct.deleteWordLeft(e,t);return i||new D(1,1,1,1)}}class dW extends Jk{_delete(e,t){const i=Ct.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new D(n,s,n,s)}}class GTe extends cW{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:N.writable})}}class ZTe extends cW{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:N.writable})}}class YTe extends cW{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class XTe extends dW{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:N.writable})}}class QTe extends dW{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:N.writable})}}class JTe extends dW{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class eRe extends de{constructor(){super({id:"deleteInsideWord",precondition:N.writable,label:H(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=Hr(t.getOption(148),t.getOption(147)),s=t.getModel(),a=t.getSelections().map(l=>{const c=Ct.deleteInsideWord(n,s,l);return new jn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}ae(new RTe);ae(new MTe);ae(new PTe);ae(new ATe);ae(new OTe);ae(new FTe);ae(new HTe);ae(new VTe);ae(new zTe);ae(new UTe);ae(new $Te);ae(new jTe);ae(new WTe);ae(new BTe);ae(new qTe);ae(new KTe);ae(new GTe);ae(new ZTe);ae(new YTe);ae(new XTe);ae(new QTe);ae(new JTe);oe(eRe);class tRe extends Jk{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=yD.deleteWordPartLeft(e);return i||new D(1,1,1,1)}}class iRe extends Jk{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=yD.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new D(n,s,n,s)}}class AX extends Qk{_move(e,t,i,n,s){return yD.moveWordPartLeft(e,t,i,s)}}class nRe extends AX{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}it.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class sRe extends AX{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}it.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class OX extends Qk{_move(e,t,i,n,s){return yD.moveWordPartRight(e,t,i)}}class oRe extends OX{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class rRe extends OX{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ae(new tRe);ae(new iRe);ae(new nRe);ae(new sRe);ae(new oRe);ae(new rRe);class IV extends F{static{this.ID="editor.contrib.readOnlyMessageController"}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Do.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new ts(m(1378,"Cannot edit in read-only input")):t=new ts(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}nt(IV.ID,IV,2);var aRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EV=function(o,e){return function(t,i){e(t,i,o)}};let MP=class extends F{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ee(this,void 0);const n=vo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=vo("_textModel.onDidChangeContent",se.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(os(async(r,a)=>{n.read(r),s.read(r);const l=a.add(new N_e),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return n.sort(BU(Kn(s=>s.range.endLineNumber-s.range.startLineNumber,Lo))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};MP=aRe([EV(1,ue),EV(2,N1)],MP);DL.setBreadcrumbsSourceFactory((o,e)=>e.createInstance(MP,o));var lRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},LN=function(o,e){return function(t,i){e(t,i,o)}};let Dx=class extends F{static{this.ID="editor.contrib.floatingToolbar"}constructor(e,t,i,n){super();const s=this._register(oi(e)),r=this._register(n.createMenu(M.EditorContent,e.contextKeyService)),a=pt(this,r.onDidChange,()=>r.getActions().length===0);this._register(ke(l=>{if(a.read(l))return;const d=ot("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(Jv,d.root,M.EditorContent,{actionViewItemProvider:(u,g)=>{if(!(u instanceof sr))return;const f=i.lookupKeybinding(u.id);if(f)return t.createInstance(class extends Yh{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${f.getLabel()})`)}},u,{...g,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(ke(u=>{const g=s.model.read(u);h.context=g?.uri})),l.store.add(s.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:Ot(0),position:Ot({preference:1})}))}))}};Dx=lRe([LN(1,pe),LN(2,dt),LN(3,Ur)],Dx);nt(Dx.ID,Dx,1);var PP;(function(o){o.inspectTokensAction=m(786,"Developer: Inspect Tokens")})(PP||(PP={}));var kx;(function(o){o.gotoLineActionLabel=m(787,"Go to Line/Column...")})(kx||(kx={}));var AP;(function(o){o.helpQuickAccessActionLabel=m(788,"Show all Quick Access Providers")})(AP||(AP={}));var Ix;(function(o){o.quickCommandActionLabel=m(789,"Command Palette"),o.quickCommandHelp=m(790,"Show And Run Commands")})(Ix||(Ix={}));var Iw;(function(o){o.quickOutlineActionLabel=m(791,"Go to Symbol..."),o.quickOutlineByCategoryActionLabel=m(792,"Go to Symbol by Category...")})(Iw||(Iw={}));var OP;(function(o){o.editorViewAccessibleLabel=m(793,"Editor content")})(OP||(OP={}));var FP;(function(o){o.toggleHighContrast=m(794,"Toggle High Contrast Theme")})(FP||(FP={}));var WP;(function(o){o.bulkEditServiceSummary=m(795,"Made {0} edits in {1} files")})(WP||(WP={}));class NV extends F{static{this.ID="editor.contrib.iPadShowKeyboard"}constructor(e){super(),this.editor=e,this.widget=null,Or&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new hW(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}class hW extends F{static{this.ID="editor.contrib.ShowKeyboardWidget"}constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(B(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(B(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return hW.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}nt(NV.ID,NV,3);const fr=Ve("themeService");var cRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},TV=function(o,e){return function(t,i){e(t,i,o)}},BP;let Ew=class extends F{static{BP=this}static{this.ID="editor.contrib.inspectTokens"}static get(e){return e.getContribution(BP.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(bi.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new uW(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Ew=BP=cRe([TV(1,fr),TV(2,yi)],Ew);class dRe extends de{constructor(){super({id:"editor.action.inspectTokens",label:PP.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){Ew.get(t)?.launch()}}function hRe(o){let e="";for(let t=0,i=o.length;ts_,tokenize:(n,s,r)=>MF(e,r),tokenizeEncoded:(n,s,r)=>JD(i,r)}}class uW extends F{static{this._ID="editor.contrib.inspectTokensWidget"}constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=uRe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return uW._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const s=this._model.getLineContent(e.lineNumber);let r="";if(ii.prefix.length-t.prefix.length),ge(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return ol([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}fi.add(jf.Quickaccess,new gRe);var fRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},RV=function(o,e){return function(t,i){e(t,i,o)}},oC;let VP=class{static{oC=this}static{this.PREFIX="?"}constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=fi.as(jf.Quickaccess)}provide(e){const t=new z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(oC.PREFIX.length));n&&n.prefix&&n.prefix!==oC.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==oC.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}};VP=oC=fRe([RV(0,as),RV(1,dt)],VP);fi.as(jf.Quickaccess).registerQuickAccessProvider({ctor:VP,prefix:"",helpEntries:[{description:AP.helpQuickAccessActionLabel}]});class FX{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new _t);return s.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new z,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const r={editor:s},a=CZ(s);if(a){let l=s.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),r.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},n.add(qg(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(ge(()=>this.clearDecorations(s))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ya(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return V5(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:_i(Aj),position:or.Full}}}],[r,a]=i.deltaDecorations(n,s);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class ZC extends FX{static{this.PREFIX=":"}static{this.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset"}constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(ZC.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(ZC.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,F.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new z;s.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(ZC.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:g}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:g}],t.ariaLabel=g,!h){this.clearDecorations(n);return}const f=this.toRange(h,u);n.revealRangeInCenter(f,0),this.addDecorations(n,f)},a=new Ad({title:m(1336,"Use Zero-Based Offset"),icon:Z.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:J(t1),inputActiveOptionForeground:J(i1),inputActiveOptionBackground:J(H_)});s.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),s.add(t.onDidChangeValue(()=>r()));const l=CZ(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),s.add(ge(()=>l.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let n=parseInt(t.substring(1),10);const s=i.getValueLength();if(isNaN(n))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",s-1):m(1339,"Type a character position to go to (from 1 to {0}).",s)};{const r=n<0;this.useZeroBasedOffset||(n-=Math.sign(n)),r&&(n+=s);const a=i.getPositionAt(n);return{...a,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",a.lineNumber,a.column)}}}else{const n=t.split(/,|:|#/),s=i.getLineCount();let r=parseInt(n[0]?.trim(),10);if(n.length<1||isNaN(r))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",s)};r=r>=0?r:s+1+r,r=Math.min(Math.max(1,r),s);const a=i.getLineMaxColumn(r);let l=parseInt(n[1]?.trim(),10);return n.length<2||isNaN(l)?{lineNumber:r,column:1,label:n.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",r):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",r,a)}:(l=l>=0?l:a+l,l=Math.min(Math.max(1,l),a),{lineNumber:r,column:l,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",r,l)})}}}var pRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},MV=function(o,e){return function(t,i){e(t,i,o)}};let Nw=class extends ZC{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=se.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};Nw=pRe([MV(0,at),MV(1,Ls)],Nw);let WX=class BX extends de{static{this.ID="editor.action.gotoLine"}constructor(){super({id:BX.ID,label:kx.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(as).quickAccess.show(Nw.PREFIX)}};oe(WX);fi.as(jf.Quickaccess).registerQuickAccessProvider({ctor:Nw,prefix:Nw.PREFIX,helpEntries:[{description:kx.gotoLineActionLabel,commandId:WX.ID}]});const HX=[void 0,[]];function xN(o,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?mRe(o,n.values,t,i):VX(o,e,t,i)}function mRe(o,e,t,i){let n=0;const s=[];for(const r of e){const[a,l]=VX(o,r,t,i);if(typeof a!="number")return HX;n+=a,s.push(...l)}return[n,_Re(s)]}function VX(o,e,t,i){const n=rf(e.original,e.originalLowercase,t,o,o.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],c1(n)]:HX}function _Re(o){const e=o.sort((n,s)=>n.start-s.start),t=[];let i;for(const n of e)!i||!bRe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function bRe(o,e){return!(o.end=0,r=PV(o);let a;const l=o.split(zX);if(l.length>1)for(const c of l){const d=PV(c),{pathNormalized:h,normalized:u,normalizedLowercase:g}=AV(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:g,expectContiguousMatch:d}))}return{original:o,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function AV(o){let e;Rn?e=o.replace(/\//g,Ua):e=o.replace(/\\/g,Ua);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function OV(o){return Array.isArray(o)?zP(o.map(e=>e.original).join(zX)):zP(o.original)}var CRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},FV=function(o,e){return function(t,i){e(t,i,o)}},ny;let Bg=class extends FX{static{ny=this}static{this.PREFIX="@"}static{this.SCOPE_PREFIX=":"}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),F.None}provideWithTextEditor(e,t,i,n){const s=e.editor,r=this.getModel(s);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):F.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new z;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||n.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new xf,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(ge(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,s){const r=e.editor,a=new z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),s?.handleAccept?.(u,h.inBackground),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new _t),d=async h=>{c?.value?.cancel(),i.busy=!1,c.value=new Jt,i.busy=!0;try{const u=zP(i.value.substr(ny.PREFIX.length).trim()),g=await this.doGetSymbolPicks(l,u,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(g.length>0){if(i.items=g,h&&u.original.length===0){const f=Iv(g,p=>!!(p.type!=="separator"&&p.range&&D.containsPosition(p.range.decoration,h)));f&&(i.activeItems=[f])}}else u.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,0),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,s){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(ny.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=OV(t.values[0]),d=OV(t.values.slice(1))):c=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?ye.asClassName(Z.splitHorizontal):ye.asClassName(Z.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const g=[];for(let _=0;_l){let A=!1;if(c!==t&&([L,x]=xN(w,{...t,values:void 0},l,v),typeof L=="number"&&(A=!0)),typeof L!="number"&&([L,x]=xN(w,c,l,v),typeof L!="number"))continue;if(!A&&d){if(S&&d.original.length>0&&([k,I]=xN(S,d)),typeof k!="number")continue;typeof L=="number"&&(L+=k)}}const T=b.tags&&b.tags.indexOf(1)>=0;g.push({index:_,kind:b.kind,score:L,label:w,ariaLabel:$ce(b.name,b.kind),description:S,highlights:T?void 0:{label:x,description:I},range:{selection:D.collapseToStart(b.selectionRange),decoration:b.range},uri:s.uri,symbolName:C,strikethrough:T,buttons:h})}const f=g.sort((_,b)=>a?this.compareByKindAndScore(_,b):this.compareByScore(_,b));let p=[];if(a){let w=function(){b&&typeof _=="number"&&C>0&&(b.label=Gg(kN[_]||DN,C))},_,b,C=0;for(const v of f)_!==v.kind?(w(),_=v.kind,C=1,b={type:"separator"},p.push(b)):C++,p.push(v);w()}else f.length>0&&(p=[{label:m(1351,"symbols ({0})",g.length),type:"separator"},...f]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=kN[e.kind]||DN,n=kN[t.kind]||DN,s=i.localeCompare(n);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}};Bg=ny=CRe([FV(0,ue),FV(1,N1)],Bg);const DN=m(1352,"properties ({0})"),kN={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var vRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},IN=function(o,e){return function(t,i){e(t,i,o)}};let UP=class extends Bg{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=se.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};UP=vRe([IN(0,at),IN(1,ue),IN(2,N1)],UP);class eI extends de{static{this.ID="editor.action.quickOutline"}constructor(){super({id:eI.ID,label:Iw.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:N.hasDocumentSymbolProvider,kbOpts:{kbExpr:N.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(as).quickAccess.show(Bg.PREFIX,{itemActivation:Ma.NONE})}}oe(eI);fi.as(jf.Quickaccess).registerQuickAccessProvider({ctor:UP,prefix:Bg.PREFIX,helpEntries:[{description:Iw.quickOutlineActionLabel,prefix:Bg.PREFIX,commandId:eI.ID},{description:Iw.quickOutlineByCategoryActionLabel,prefix:Bg.PREFIX_BY_CATEGORY}]});function wRe(o){const e=new Map;for(const t of o)e.set(t,(e.get(t)??0)+1);return e}class YC{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&s.push({key:r,score:c})}}return s}static termFrequencies(e){return wRe(YC.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&/\p{Letter}{3,}/gu.test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const s=YC.termFrequencies(n);for(const r of s.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=YC.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function SRe(o){const e=o.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var Qp;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(Qp||(Qp={}));function EN(o){return Array.isArray(o.items)}function WV(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class yRe extends F{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const r=n.add(new _t),a=async()=>{s?.dispose(!0),e.busy=!1;const c=r.value=new z;s=c.add(new Jt(t));const d=s.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,c,d,i),g=(p,_)=>{let b,C;if(EN(p)?(b=p.items,C=p.active):b=p,b.length===0){if(_)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&($g(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},f=async p=>{let _=!1,b=!1;await Promise.all([(async()=>{typeof p.mergeDelay=="number"&&(await ql(p.mergeDelay),d.isCancellationRequested)||b||(_=g(p.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await p.additionalPicks;if(d.isCancellationRequested)return;let w,v;EN(p.picks)?(w=p.picks.items,v=p.picks.active):w=p.picks;let S,L;if(EN(C)?(S=C.items,L=C.active):S=C,S.length>0||!_){let x;if(!v&&!L){const k=e.activeItems[0];k&&w.indexOf(k)!==-1&&(x=k)}g({items:[...w,...S],active:v||L||x})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})()])};if(u!==null)if(WV(u))await f(u);else if(!(u instanceof Promise))g(u);else{e.busy=!0;try{const p=await u;if(d.isCancellationRequested)return;WV(p)?await f(p):g(p)}finally{d.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(c=>{if(i?.handleAccept){c.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0],c.inBackground);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(c.inBackground||e.hide(),d.accept(e.keyMods,c))}));const l=async(c,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(c)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),g=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(g){case Qp.NO_ACTION:break;case Qp.CLOSE_PICKER:e.hide();break;case Qp.REFRESH_PICKER:a();break;case Qp.REMOVE_ITEM:{const f=e.items.indexOf(d);if(f!==-1){const p=e.items.slice(),_=p.splice(f,1),b=e.activeItems.filter(w=>w!==_[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=p,b&&(e.activeItems=b),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:c,item:d})=>l(c,d))),n.add(e.onDidTriggerSeparatorButton(({button:c,separator:d})=>l(c,d))),n}}new ba(1e4);const LRe=new ba(1e4);function xRe(o){return kRe(o,"NFD",LRe)}const DRe=/[^\u0000-\u0080]/;function kRe(o,e,t){if(!o)return o;const i=t.get(o);if(i)return i;let n;return DRe.test(o)?n=o.normalize(e):n=o,t.set(o,n),n}const IRe=(function(){const o=/[\u0300-\u036f]/g;return function(e){return xRe(e).replace(o,"")}})();var UX=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ah=function(o,e){return function(t,i){e(t,i,o)}},Bu,Ki;let $P=class extends yRe{static{Bu=this}static{this.PREFIX=">"}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=VF(jv,Kfe,zq)}constructor(e,t,i,n,s,r){super(Bu.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(jP)),this.options=e}async _getPicks(e,t,i,n){const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=qg(()=>{const f=new YC;f.updateDocuments(s.map(_=>({key:_.commandId,textChunks:[this.getTfIdfChunk(_)]})));const p=f.calculateScores(e,i);return SRe(p).filter(_=>_.score>Bu.TFIDF_THRESHOLD).slice(0,Bu.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const f of s){f.labelNoAccents??=this.normalizeForFiltering(f.label);const p=Bu.WORD_FILTER(a,f.labelNoAccents)??void 0;let _;if(f.commandAlias&&(f.aliasNoAccents??=this.normalizeForFiltering(f.commandAlias),_=Bu.WORD_FILTER(a,f.aliasNoAccents)??void 0),p||_)f.highlights={label:p,detail:this.options.showAlias?_:void 0},l.push(f);else if(e===f.commandId)l.push(f);else if(e.length>=3){const b=r();if(i.isCancellationRequested)return[];const C=b.find(w=>w.key===f.commandId);C&&(f.tfIdfScore=C.score,l.push(f))}}const c=new Map;for(const f of l){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}l.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const _=this.commandsHistory.peek(f.commandId),b=this.commandsHistory.peek(p.commandId);if(_&&b)return _>b?-1:1;if(_)return-1;if(b)return 1;if(this.options.suggestedCommandIds){const v=this.options.suggestedCommandIds.has(f.commandId),S=this.options.suggestedCommandIds.has(p.commandId);if(v&&S)return 0;if(v)return-1;if(S)return 1}const C=f.commandCategory===vP.Developer.value,w=p.commandCategory===vP.Developer.value;return C&&!w?1:!C&&w?-1:f.label.localeCompare(p.label)});const d=[];let h=!1,u=!0,g=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(s,l,e,i);if(i.isCancellationRequested)return[];const p=f.map(_=>this.toCommandPick(_,n));return u&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:m(1744,"similar commands")}),p})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(s){hr(s)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),PL(s))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=IRe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}};$P=Bu=UX([ah(1,pe),ah(2,dt),ah(3,Vt),ah(4,cs),ah(5,A1)],$P);let jP=class extends F{static{Ki=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE="commandPalette.mru.cache"}static{this.PREF_KEY_COUNTER="commandPalette.mru.counter"}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Ph.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ki.getConfiguredCommandHistoryLength(this.configurationService),Ki.cache&&Ki.cache.limit!==this.configuredCommandsHistoryLength&&(Ki.cache.limit=this.configuredCommandsHistoryLength,Ki.hasChanges=!0))}load(){const e=this.storageService.get(Ki.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Ki.cache=new ba(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}Ki.counter=this.storageService.getNumber(Ki.PREF_KEY_COUNTER,0,Ki.counter)}push(e){Ki.cache&&(Ki.cache.set(e,Ki.counter++),Ki.hasChanges=!0)}peek(e){return Ki.cache?.peek(e)}saveState(){if(!Ki.cache||!Ki.hasChanges)return;const e={usesLRU:!0,entries:[]};Ki.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Ki.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Ki.PREF_KEY_COUNTER,Ki.counter,0,0),Ki.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:Ki.DEFAULT_COMMANDS_HISTORY_LENGTH}};jP=Ki=UX([ah(0,Ls),ah(1,Oe),ah(2,Ht)],jP);class ERe extends $P{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(Pbe(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:GF(i.label)||i.id})}return t}}var NRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vp=function(o,e){return function(t,i){e(t,i,o)}};let Tw=class extends ERe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Tw=NRe([vp(0,pe),vp(1,at),vp(2,dt),vp(3,Vt),vp(4,cs),vp(5,A1)],Tw);class tI extends de{static{this.ID="editor.action.quickCommand"}constructor(){super({id:tI.ID,label:Ix.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:N.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(as).quickAccess.show(Tw.PREFIX)}}oe(tI);fi.as(jf.Quickaccess).registerQuickAccessProvider({ctor:Tw,prefix:Tw.PREFIX,helpEntries:[{description:Ix.quickCommandHelp,commandId:tI.ID}]});var TRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wp=function(o,e){return function(t,i){e(t,i,o)}};let qP=class extends vf{constructor(e,t,i,n,s,r,a){super(!0,e,t,i,n,s,r,a)}};qP=TRe([wp(1,Ne),wp(2,at),wp(3,Li),wp(4,pe),wp(5,Ls),wp(6,Oe)],qP);nt(vf.ID,qP,4);class RRe{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}function MRe(o){if(!o||!Array.isArray(o))return[];const e=[];let t=0;for(let i=0,n=o.length;i{const u=BRe(d.token,h.token);return u!==0?u:d.index-h.index});let t=0,i="000000",n="ffffff";for(;o.length>=1&&o[0].token==="";){const d=o.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const s=new ORe;for(const d of e)s.getId(d);const r=s.getId(i),a=s.getId(n),l=new gW(t,r,a),c=new fW(l);for(let d=0,h=o.length;d"u"){const n=this._match(t),s=WRe(t);i=(n.metadata|s<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const FRe=/\b(comment|string|regex|regexp)\b/;function WRe(o){const e=o.match(FRe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function BRe(o,e){return oe?1:0}class gW{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new gW(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class fW{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const s=this._children.get(i);return typeof s<"u"?s.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const s=e.indexOf(".");let r,a;s===-1?(r=e,a=""):(r=e.substring(0,s),a=e.substring(s+1));let l=this._children.get(r);typeof l>"u"&&(l=new fW(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}}function HRe(o){const e=[];for(let t=1,i=o.length;tt.fire())),o&&e.add(o.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=o?o.getProductIconTheme():new jX,s={},r=new fE,a=new fE;for(const l of i.getIcons()){const c=n.getIcon(l);if(!c)continue;const d=c.font,h=po`--vscode-icon-${mS(l.id)}-font-family`,u=po`--vscode-icon-${mS(l.id)}-content`;d?(s[d.id]=d.definition,a.push(po`${h}: ${Hd(d.id)};`,po`${u}: ${Hd(c.fontCharacter)};`),r.push(po`.codicon-${mS(l.id)}:before { content: ${Hd(c.fontCharacter)}; font-family: ${Hd(d.id)}; }`)):(a.push(po`${u}: ${Hd(c.fontCharacter)}; ${h}: 'codicon';`),r.push(po`.codicon-${mS(l.id)}:before { content: ${Hd(c.fontCharacter)}; }`))}for(const l in s){const c=s[l],d=c.weight?po`font-weight: ${VB(c.weight)};`:po``,h=c.style?po`font-style: ${VB(c.style)};`:po``,u=new fE;for(const g of c.src)u.push(po`${Yl(g.location)} format(${Hd(g.format)})`);r.push(po`@font-face { src: ${u.join(", ")}; font-family: ${Hd(l)};${d}${h} font-display: block; }`)}return r.push(po`:root { ${a.join(" ")} }`),r.join(` -`)}}}class jX{getIcon(e){const t=MK();let i=e.defaults;for(;ye.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const jc="vs",Rm="vs-dark",Hg="hc-black",Vg="hc-light",qX=fi.as(Z$.ColorContribution),qRe=fi.as(Nj.ThemingContribution);class KX{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(sy(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,V.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=KP(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,V.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=qX.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case jc:return Tr.LIGHT;case Hg:return Tr.HIGH_CONTRAST_DARK;case Vg:return Tr.HIGH_CONTRAST_LIGHT;default:return Tr.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=KP(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=$X.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=es.getForeground(s),a=es.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}get tokenColorMap(){return[]}}function sy(o){return o===jc||o===Rm||o===Hg||o===Vg}function KP(o){switch(o){case jc:return VRe;case Rm:return zRe;case Hg:return URe;case Vg:return $Re}}function s0(o){const e=KP(o);return new KX(o,e)}class KRe extends F{constructor(){super(),this._onColorThemeChange=this._register(new P),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new P),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new jX,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(jc,s0(jc)),this._knownThemes.set(Rm,s0(Rm)),this._knownThemes.set(Hg,s0(Hg)),this._knownThemes.set(Vg,s0(Vg));const e=this._register(jRe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(jc),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),iU(kt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return xy(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=zr(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),F.None}_registerShadowDomContainer(e){const t=zr(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(jc),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=kt.matchMedia("(forced-colors: active)").matches;if(e!==qa(this._theme.type)){let t;Sd(this._theme.type)?t=e?Hg:Rm:t=e?Vg:jc,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};qRe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of qX.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${K4(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` -`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(HRe(s)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join(` -`),this._updateCSS(),bi.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}class GRe extends de{constructor(){super({id:"editor.action.toggleHighContrast",label:FP.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(fr),n=i.getColorTheme();qa(n.type)?(i.setTheme(this._originalThemeName||(Sd(n.type)?Rm:jc)),this._originalThemeName=null):(i.setTheme(Sd(n.type)?Hg:Vg),this._originalThemeName=n.themeName)}}oe(GRe);var GP;(function(o){o[o.Unknown=0]="Unknown",o[o.Disabled=1]="Disabled",o[o.Enabled=2]="Enabled"})(GP||(GP={}));var ZP;(function(o){o[o.Invoke=1]="Invoke",o[o.Auto=2]="Auto"})(ZP||(ZP={}));var YP;(function(o){o[o.None=0]="None",o[o.KeepWhitespace=1]="KeepWhitespace",o[o.InsertAsSnippet=4]="InsertAsSnippet"})(YP||(YP={}));var XP;(function(o){o[o.Method=0]="Method",o[o.Function=1]="Function",o[o.Constructor=2]="Constructor",o[o.Field=3]="Field",o[o.Variable=4]="Variable",o[o.Class=5]="Class",o[o.Struct=6]="Struct",o[o.Interface=7]="Interface",o[o.Module=8]="Module",o[o.Property=9]="Property",o[o.Event=10]="Event",o[o.Operator=11]="Operator",o[o.Unit=12]="Unit",o[o.Value=13]="Value",o[o.Constant=14]="Constant",o[o.Enum=15]="Enum",o[o.EnumMember=16]="EnumMember",o[o.Keyword=17]="Keyword",o[o.Text=18]="Text",o[o.Color=19]="Color",o[o.File=20]="File",o[o.Reference=21]="Reference",o[o.Customcolor=22]="Customcolor",o[o.Folder=23]="Folder",o[o.TypeParameter=24]="TypeParameter",o[o.User=25]="User",o[o.Issue=26]="Issue",o[o.Tool=27]="Tool",o[o.Snippet=28]="Snippet"})(XP||(XP={}));var QP;(function(o){o[o.Deprecated=1]="Deprecated"})(QP||(QP={}));var JP;(function(o){o[o.Invoke=0]="Invoke",o[o.TriggerCharacter=1]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(JP||(JP={}));var eA;(function(o){o[o.EXACT=0]="EXACT",o[o.ABOVE=1]="ABOVE",o[o.BELOW=2]="BELOW"})(eA||(eA={}));var tA;(function(o){o[o.NotSet=0]="NotSet",o[o.ContentFlush=1]="ContentFlush",o[o.RecoverFromMarkers=2]="RecoverFromMarkers",o[o.Explicit=3]="Explicit",o[o.Paste=4]="Paste",o[o.Undo=5]="Undo",o[o.Redo=6]="Redo"})(tA||(tA={}));var iA;(function(o){o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})(iA||(iA={}));var nA;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(nA||(nA={}));var sA;(function(o){o[o.None=0]="None",o[o.Keep=1]="Keep",o[o.Brackets=2]="Brackets",o[o.Advanced=3]="Advanced",o[o.Full=4]="Full"})(sA||(sA={}));var oA;(function(o){o[o.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",o[o.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",o[o.accessibilitySupport=2]="accessibilitySupport",o[o.accessibilityPageSize=3]="accessibilityPageSize",o[o.allowOverflow=4]="allowOverflow",o[o.allowVariableLineHeights=5]="allowVariableLineHeights",o[o.allowVariableFonts=6]="allowVariableFonts",o[o.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",o[o.ariaLabel=8]="ariaLabel",o[o.ariaRequired=9]="ariaRequired",o[o.autoClosingBrackets=10]="autoClosingBrackets",o[o.autoClosingComments=11]="autoClosingComments",o[o.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",o[o.autoClosingDelete=13]="autoClosingDelete",o[o.autoClosingOvertype=14]="autoClosingOvertype",o[o.autoClosingQuotes=15]="autoClosingQuotes",o[o.autoIndent=16]="autoIndent",o[o.autoIndentOnPaste=17]="autoIndentOnPaste",o[o.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",o[o.automaticLayout=19]="automaticLayout",o[o.autoSurround=20]="autoSurround",o[o.bracketPairColorization=21]="bracketPairColorization",o[o.guides=22]="guides",o[o.codeLens=23]="codeLens",o[o.codeLensFontFamily=24]="codeLensFontFamily",o[o.codeLensFontSize=25]="codeLensFontSize",o[o.colorDecorators=26]="colorDecorators",o[o.colorDecoratorsLimit=27]="colorDecoratorsLimit",o[o.columnSelection=28]="columnSelection",o[o.comments=29]="comments",o[o.contextmenu=30]="contextmenu",o[o.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",o[o.cursorBlinking=32]="cursorBlinking",o[o.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",o[o.cursorStyle=34]="cursorStyle",o[o.cursorSurroundingLines=35]="cursorSurroundingLines",o[o.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",o[o.cursorWidth=37]="cursorWidth",o[o.cursorHeight=38]="cursorHeight",o[o.disableLayerHinting=39]="disableLayerHinting",o[o.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",o[o.domReadOnly=41]="domReadOnly",o[o.dragAndDrop=42]="dragAndDrop",o[o.dropIntoEditor=43]="dropIntoEditor",o[o.editContext=44]="editContext",o[o.emptySelectionClipboard=45]="emptySelectionClipboard",o[o.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",o[o.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",o[o.extraEditorClassName=48]="extraEditorClassName",o[o.fastScrollSensitivity=49]="fastScrollSensitivity",o[o.find=50]="find",o[o.fixedOverflowWidgets=51]="fixedOverflowWidgets",o[o.folding=52]="folding",o[o.foldingStrategy=53]="foldingStrategy",o[o.foldingHighlight=54]="foldingHighlight",o[o.foldingImportsByDefault=55]="foldingImportsByDefault",o[o.foldingMaximumRegions=56]="foldingMaximumRegions",o[o.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",o[o.fontFamily=58]="fontFamily",o[o.fontInfo=59]="fontInfo",o[o.fontLigatures=60]="fontLigatures",o[o.fontSize=61]="fontSize",o[o.fontWeight=62]="fontWeight",o[o.fontVariations=63]="fontVariations",o[o.formatOnPaste=64]="formatOnPaste",o[o.formatOnType=65]="formatOnType",o[o.glyphMargin=66]="glyphMargin",o[o.gotoLocation=67]="gotoLocation",o[o.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",o[o.hover=69]="hover",o[o.inDiffEditor=70]="inDiffEditor",o[o.inlineSuggest=71]="inlineSuggest",o[o.letterSpacing=72]="letterSpacing",o[o.lightbulb=73]="lightbulb",o[o.lineDecorationsWidth=74]="lineDecorationsWidth",o[o.lineHeight=75]="lineHeight",o[o.lineNumbers=76]="lineNumbers",o[o.lineNumbersMinChars=77]="lineNumbersMinChars",o[o.linkedEditing=78]="linkedEditing",o[o.links=79]="links",o[o.matchBrackets=80]="matchBrackets",o[o.minimap=81]="minimap",o[o.mouseStyle=82]="mouseStyle",o[o.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",o[o.mouseWheelZoom=84]="mouseWheelZoom",o[o.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",o[o.multiCursorModifier=86]="multiCursorModifier",o[o.mouseMiddleClickAction=87]="mouseMiddleClickAction",o[o.multiCursorPaste=88]="multiCursorPaste",o[o.multiCursorLimit=89]="multiCursorLimit",o[o.occurrencesHighlight=90]="occurrencesHighlight",o[o.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",o[o.overtypeCursorStyle=92]="overtypeCursorStyle",o[o.overtypeOnPaste=93]="overtypeOnPaste",o[o.overviewRulerBorder=94]="overviewRulerBorder",o[o.overviewRulerLanes=95]="overviewRulerLanes",o[o.padding=96]="padding",o[o.pasteAs=97]="pasteAs",o[o.parameterHints=98]="parameterHints",o[o.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",o[o.placeholder=100]="placeholder",o[o.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",o[o.quickSuggestions=102]="quickSuggestions",o[o.quickSuggestionsDelay=103]="quickSuggestionsDelay",o[o.readOnly=104]="readOnly",o[o.readOnlyMessage=105]="readOnlyMessage",o[o.renameOnType=106]="renameOnType",o[o.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",o[o.renderControlCharacters=108]="renderControlCharacters",o[o.renderFinalNewline=109]="renderFinalNewline",o[o.renderLineHighlight=110]="renderLineHighlight",o[o.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",o[o.renderValidationDecorations=112]="renderValidationDecorations",o[o.renderWhitespace=113]="renderWhitespace",o[o.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",o[o.roundedSelection=115]="roundedSelection",o[o.rulers=116]="rulers",o[o.scrollbar=117]="scrollbar",o[o.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",o[o.scrollBeyondLastLine=119]="scrollBeyondLastLine",o[o.scrollPredominantAxis=120]="scrollPredominantAxis",o[o.selectionClipboard=121]="selectionClipboard",o[o.selectionHighlight=122]="selectionHighlight",o[o.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",o[o.selectionHighlightMultiline=124]="selectionHighlightMultiline",o[o.selectOnLineNumbers=125]="selectOnLineNumbers",o[o.showFoldingControls=126]="showFoldingControls",o[o.showUnused=127]="showUnused",o[o.snippetSuggestions=128]="snippetSuggestions",o[o.smartSelect=129]="smartSelect",o[o.smoothScrolling=130]="smoothScrolling",o[o.stickyScroll=131]="stickyScroll",o[o.stickyTabStops=132]="stickyTabStops",o[o.stopRenderingLineAfter=133]="stopRenderingLineAfter",o[o.suggest=134]="suggest",o[o.suggestFontSize=135]="suggestFontSize",o[o.suggestLineHeight=136]="suggestLineHeight",o[o.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",o[o.suggestSelection=138]="suggestSelection",o[o.tabCompletion=139]="tabCompletion",o[o.tabIndex=140]="tabIndex",o[o.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",o[o.unicodeHighlighting=142]="unicodeHighlighting",o[o.unusualLineTerminators=143]="unusualLineTerminators",o[o.useShadowDOM=144]="useShadowDOM",o[o.useTabStops=145]="useTabStops",o[o.wordBreak=146]="wordBreak",o[o.wordSegmenterLocales=147]="wordSegmenterLocales",o[o.wordSeparators=148]="wordSeparators",o[o.wordWrap=149]="wordWrap",o[o.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",o[o.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",o[o.wordWrapColumn=152]="wordWrapColumn",o[o.wordWrapOverride1=153]="wordWrapOverride1",o[o.wordWrapOverride2=154]="wordWrapOverride2",o[o.wrappingIndent=155]="wrappingIndent",o[o.wrappingStrategy=156]="wrappingStrategy",o[o.showDeprecated=157]="showDeprecated",o[o.inertialScroll=158]="inertialScroll",o[o.inlayHints=159]="inlayHints",o[o.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",o[o.effectiveCursorStyle=161]="effectiveCursorStyle",o[o.editorClassName=162]="editorClassName",o[o.pixelRatio=163]="pixelRatio",o[o.tabFocusMode=164]="tabFocusMode",o[o.layoutInfo=165]="layoutInfo",o[o.wrappingInfo=166]="wrappingInfo",o[o.defaultColorDecorators=167]="defaultColorDecorators",o[o.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",o[o.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",o[o.effectiveEditContext=170]="effectiveEditContext",o[o.scrollOnMiddleClick=171]="scrollOnMiddleClick",o[o.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"})(oA||(oA={}));var rA;(function(o){o[o.TextDefined=0]="TextDefined",o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})(rA||(rA={}));var aA;(function(o){o[o.LF=0]="LF",o[o.CRLF=1]="CRLF"})(aA||(aA={}));var lA;(function(o){o[o.Left=1]="Left",o[o.Center=2]="Center",o[o.Right=3]="Right"})(lA||(lA={}));var cA;(function(o){o[o.Increase=0]="Increase",o[o.Decrease=1]="Decrease"})(cA||(cA={}));var dA;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(dA||(dA={}));var hA;(function(o){o[o.Both=0]="Both",o[o.Right=1]="Right",o[o.Left=2]="Left",o[o.None=3]="None"})(hA||(hA={}));var uA;(function(o){o[o.Type=1]="Type",o[o.Parameter=2]="Parameter"})(uA||(uA={}));var gA;(function(o){o[o.Accepted=0]="Accepted",o[o.Rejected=1]="Rejected",o[o.Ignored=2]="Ignored"})(gA||(gA={}));var fA;(function(o){o[o.Code=1]="Code",o[o.Label=2]="Label"})(fA||(fA={}));var pA;(function(o){o[o.Automatic=0]="Automatic",o[o.Explicit=1]="Explicit"})(pA||(pA={}));var mA;(function(o){o[o.DependsOnKbLayout=-1]="DependsOnKbLayout",o[o.Unknown=0]="Unknown",o[o.Backspace=1]="Backspace",o[o.Tab=2]="Tab",o[o.Enter=3]="Enter",o[o.Shift=4]="Shift",o[o.Ctrl=5]="Ctrl",o[o.Alt=6]="Alt",o[o.PauseBreak=7]="PauseBreak",o[o.CapsLock=8]="CapsLock",o[o.Escape=9]="Escape",o[o.Space=10]="Space",o[o.PageUp=11]="PageUp",o[o.PageDown=12]="PageDown",o[o.End=13]="End",o[o.Home=14]="Home",o[o.LeftArrow=15]="LeftArrow",o[o.UpArrow=16]="UpArrow",o[o.RightArrow=17]="RightArrow",o[o.DownArrow=18]="DownArrow",o[o.Insert=19]="Insert",o[o.Delete=20]="Delete",o[o.Digit0=21]="Digit0",o[o.Digit1=22]="Digit1",o[o.Digit2=23]="Digit2",o[o.Digit3=24]="Digit3",o[o.Digit4=25]="Digit4",o[o.Digit5=26]="Digit5",o[o.Digit6=27]="Digit6",o[o.Digit7=28]="Digit7",o[o.Digit8=29]="Digit8",o[o.Digit9=30]="Digit9",o[o.KeyA=31]="KeyA",o[o.KeyB=32]="KeyB",o[o.KeyC=33]="KeyC",o[o.KeyD=34]="KeyD",o[o.KeyE=35]="KeyE",o[o.KeyF=36]="KeyF",o[o.KeyG=37]="KeyG",o[o.KeyH=38]="KeyH",o[o.KeyI=39]="KeyI",o[o.KeyJ=40]="KeyJ",o[o.KeyK=41]="KeyK",o[o.KeyL=42]="KeyL",o[o.KeyM=43]="KeyM",o[o.KeyN=44]="KeyN",o[o.KeyO=45]="KeyO",o[o.KeyP=46]="KeyP",o[o.KeyQ=47]="KeyQ",o[o.KeyR=48]="KeyR",o[o.KeyS=49]="KeyS",o[o.KeyT=50]="KeyT",o[o.KeyU=51]="KeyU",o[o.KeyV=52]="KeyV",o[o.KeyW=53]="KeyW",o[o.KeyX=54]="KeyX",o[o.KeyY=55]="KeyY",o[o.KeyZ=56]="KeyZ",o[o.Meta=57]="Meta",o[o.ContextMenu=58]="ContextMenu",o[o.F1=59]="F1",o[o.F2=60]="F2",o[o.F3=61]="F3",o[o.F4=62]="F4",o[o.F5=63]="F5",o[o.F6=64]="F6",o[o.F7=65]="F7",o[o.F8=66]="F8",o[o.F9=67]="F9",o[o.F10=68]="F10",o[o.F11=69]="F11",o[o.F12=70]="F12",o[o.F13=71]="F13",o[o.F14=72]="F14",o[o.F15=73]="F15",o[o.F16=74]="F16",o[o.F17=75]="F17",o[o.F18=76]="F18",o[o.F19=77]="F19",o[o.F20=78]="F20",o[o.F21=79]="F21",o[o.F22=80]="F22",o[o.F23=81]="F23",o[o.F24=82]="F24",o[o.NumLock=83]="NumLock",o[o.ScrollLock=84]="ScrollLock",o[o.Semicolon=85]="Semicolon",o[o.Equal=86]="Equal",o[o.Comma=87]="Comma",o[o.Minus=88]="Minus",o[o.Period=89]="Period",o[o.Slash=90]="Slash",o[o.Backquote=91]="Backquote",o[o.BracketLeft=92]="BracketLeft",o[o.Backslash=93]="Backslash",o[o.BracketRight=94]="BracketRight",o[o.Quote=95]="Quote",o[o.OEM_8=96]="OEM_8",o[o.IntlBackslash=97]="IntlBackslash",o[o.Numpad0=98]="Numpad0",o[o.Numpad1=99]="Numpad1",o[o.Numpad2=100]="Numpad2",o[o.Numpad3=101]="Numpad3",o[o.Numpad4=102]="Numpad4",o[o.Numpad5=103]="Numpad5",o[o.Numpad6=104]="Numpad6",o[o.Numpad7=105]="Numpad7",o[o.Numpad8=106]="Numpad8",o[o.Numpad9=107]="Numpad9",o[o.NumpadMultiply=108]="NumpadMultiply",o[o.NumpadAdd=109]="NumpadAdd",o[o.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",o[o.NumpadSubtract=111]="NumpadSubtract",o[o.NumpadDecimal=112]="NumpadDecimal",o[o.NumpadDivide=113]="NumpadDivide",o[o.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",o[o.ABNT_C1=115]="ABNT_C1",o[o.ABNT_C2=116]="ABNT_C2",o[o.AudioVolumeMute=117]="AudioVolumeMute",o[o.AudioVolumeUp=118]="AudioVolumeUp",o[o.AudioVolumeDown=119]="AudioVolumeDown",o[o.BrowserSearch=120]="BrowserSearch",o[o.BrowserHome=121]="BrowserHome",o[o.BrowserBack=122]="BrowserBack",o[o.BrowserForward=123]="BrowserForward",o[o.MediaTrackNext=124]="MediaTrackNext",o[o.MediaTrackPrevious=125]="MediaTrackPrevious",o[o.MediaStop=126]="MediaStop",o[o.MediaPlayPause=127]="MediaPlayPause",o[o.LaunchMediaPlayer=128]="LaunchMediaPlayer",o[o.LaunchMail=129]="LaunchMail",o[o.LaunchApp2=130]="LaunchApp2",o[o.Clear=131]="Clear",o[o.MAX_VALUE=132]="MAX_VALUE"})(mA||(mA={}));var _A;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(_A||(_A={}));var bA;(function(o){o[o.Unnecessary=1]="Unnecessary",o[o.Deprecated=2]="Deprecated"})(bA||(bA={}));var CA;(function(o){o[o.Inline=1]="Inline",o[o.Gutter=2]="Gutter"})(CA||(CA={}));var vA;(function(o){o[o.Normal=1]="Normal",o[o.Underlined=2]="Underlined"})(vA||(vA={}));var wA;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.TEXTAREA=1]="TEXTAREA",o[o.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",o[o.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",o[o.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",o[o.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",o[o.CONTENT_TEXT=6]="CONTENT_TEXT",o[o.CONTENT_EMPTY=7]="CONTENT_EMPTY",o[o.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",o[o.CONTENT_WIDGET=9]="CONTENT_WIDGET",o[o.OVERVIEW_RULER=10]="OVERVIEW_RULER",o[o.SCROLLBAR=11]="SCROLLBAR",o[o.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",o[o.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(wA||(wA={}));var SA;(function(o){o[o.AIGenerated=1]="AIGenerated"})(SA||(SA={}));var yA;(function(o){o[o.Invoke=0]="Invoke",o[o.Automatic=1]="Automatic"})(yA||(yA={}));var LA;(function(o){o[o.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",o[o.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",o[o.TOP_CENTER=2]="TOP_CENTER"})(LA||(LA={}));var xA;(function(o){o[o.Left=1]="Left",o[o.Center=2]="Center",o[o.Right=4]="Right",o[o.Full=7]="Full"})(xA||(xA={}));var DA;(function(o){o[o.Word=0]="Word",o[o.Line=1]="Line",o[o.Suggest=2]="Suggest"})(DA||(DA={}));var kA;(function(o){o[o.Left=0]="Left",o[o.Right=1]="Right",o[o.None=2]="None",o[o.LeftOfInjectedText=3]="LeftOfInjectedText",o[o.RightOfInjectedText=4]="RightOfInjectedText"})(kA||(kA={}));var IA;(function(o){o[o.Off=0]="Off",o[o.On=1]="On",o[o.Relative=2]="Relative",o[o.Interval=3]="Interval",o[o.Custom=4]="Custom"})(IA||(IA={}));var EA;(function(o){o[o.None=0]="None",o[o.Text=1]="Text",o[o.Blocks=2]="Blocks"})(EA||(EA={}));var NA;(function(o){o[o.Smooth=0]="Smooth",o[o.Immediate=1]="Immediate"})(NA||(NA={}));var TA;(function(o){o[o.Auto=1]="Auto",o[o.Hidden=2]="Hidden",o[o.Visible=3]="Visible"})(TA||(TA={}));var RA;(function(o){o[o.LTR=0]="LTR",o[o.RTL=1]="RTL"})(RA||(RA={}));var MA;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(MA||(MA={}));var PA;(function(o){o[o.Invoke=1]="Invoke",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange"})(PA||(PA={}));var AA;(function(o){o[o.File=0]="File",o[o.Module=1]="Module",o[o.Namespace=2]="Namespace",o[o.Package=3]="Package",o[o.Class=4]="Class",o[o.Method=5]="Method",o[o.Property=6]="Property",o[o.Field=7]="Field",o[o.Constructor=8]="Constructor",o[o.Enum=9]="Enum",o[o.Interface=10]="Interface",o[o.Function=11]="Function",o[o.Variable=12]="Variable",o[o.Constant=13]="Constant",o[o.String=14]="String",o[o.Number=15]="Number",o[o.Boolean=16]="Boolean",o[o.Array=17]="Array",o[o.Object=18]="Object",o[o.Key=19]="Key",o[o.Null=20]="Null",o[o.EnumMember=21]="EnumMember",o[o.Struct=22]="Struct",o[o.Event=23]="Event",o[o.Operator=24]="Operator",o[o.TypeParameter=25]="TypeParameter"})(AA||(AA={}));var OA;(function(o){o[o.Deprecated=1]="Deprecated"})(OA||(OA={}));var FA;(function(o){o[o.LTR=0]="LTR",o[o.RTL=1]="RTL"})(FA||(FA={}));var WA;(function(o){o[o.Hidden=0]="Hidden",o[o.Blink=1]="Blink",o[o.Smooth=2]="Smooth",o[o.Phase=3]="Phase",o[o.Expand=4]="Expand",o[o.Solid=5]="Solid"})(WA||(WA={}));var BA;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(BA||(BA={}));var HA;(function(o){o[o.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",o[o.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",o[o.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",o[o.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(HA||(HA={}));var VA;(function(o){o[o.None=0]="None",o[o.Same=1]="Same",o[o.Indent=2]="Indent",o[o.DeepIndent=3]="DeepIndent"})(VA||(VA={}));let ZRe=class{static{this.CtrlCmd=2048}static{this.Shift=1024}static{this.Alt=512}static{this.WinCtrl=256}static chord(e,t){return Hi(e,t)}};function GX(){return{editor:void 0,languages:void 0,CancellationTokenSource:Jt,Emitter:P,KeyCode:mA,KeyMod:ZRe,Position:R,Range:D,Selection:le,SelectionDirection:RA,MarkerSeverity:_A,MarkerTag:bA,Uri:be,Token:Tv}}const BV="default",YRe="$initialize";let HV=!1;function zA(o){ic&&(HV||(HV=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(o.message))}class XRe{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.method=n,this.args=s,this.type=0}}class VV{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class QRe{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=n,this.arg=s,this.type=2}}class JRe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class eMe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class tMe{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}async sendMessage(e,t,i){const n=String(++this._lastSentReq);return new Promise((s,r)=>{this._pendingReplies[n]={resolve:s,reject:r},this._send(new XRe(this._workerId,n,e,t,i))})}listen(e,t,i){let n=null;const s=new P({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,s),this._send(new QRe(this._workerId,n,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new eMe(this._workerId,n)),n=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}createProxyToRemoteChannel(e,t){const i={get:(n,s)=>(typeof s=="string"&&!n[s]&&(YX(s)?n[s]=r=>this.listen(e,s,r):ZX(s)?n[s]=this.listen(e,s,void 0):s.charCodeAt(0)===36&&(n[s]=async(...r)=>(await t?.(),this.sendMessage(e,s,r)))),n[s])};return new Proxy(Object.create(null),i)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;if(e.err.$isError){const n=new Error;n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack,i=n}t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(n=>{this._send(new VV(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=jN(n.detail)),this._send(new VV(this._workerId,t,void 0,jN(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(n=>{this._send(new JRe(this._workerId,t,n))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(t)})),this._register(this._worker.onError(t=>{zA(t),Te(t)})),this._protocol=new tMe({sendMessage:(t,i)=>{this._worker.postMessage(t,i)},handleMessage:(t,i,n)=>this._handleMessage(t,i,n),handleEvent:(t,i,n)=>this._handleEvent(t,i,n)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(BV,YRe,[this._worker.getId()]).then(()=>{}),this.proxy=this._protocol.createProxyToRemoteChannel(BV,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(t=>{this._onError("Worker failed to load ",t)})}_handleMessage(e,t,i){const n=this._localChannels.get(e);if(!n)return Promise.reject(new Error(`Missing channel ${e} on main thread`));const s=n[t];if(typeof s!="function")return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(s.apply(n,i))}catch(r){return Promise.reject(r)}}_handleEvent(e,t,i){const n=this._localChannels.get(e);if(!n)throw new Error(`Missing channel ${e} on main thread`);if(YX(t)){const s=n[t];if(typeof s!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);const r=s.call(n,i);if(typeof r!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return r}if(ZX(t)){const s=n[t];if(typeof s!="function")throw new Error(`Missing event ${t} on main thread channel ${e}.`);return s}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function ZX(o){return o[0]==="o"&&o[1]==="n"&&Dl(o.charCodeAt(2))}function YX(o){return/^onDynamic/.test(o)&&Dl(o.charCodeAt(9))}let Jp;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?Jp=globalThis.workerttPolicy:Jp=sc("defaultWorkerFactory",{createScriptURL:o=>o});function nMe(o,e){const t=o.label||"anonymous"+e,i=ZO();if(i){if(typeof i.getWorker=="function")return i.getWorker("workerMain.js",t);if(typeof i.getWorkerUrl=="function"){const s=i.getWorkerUrl("workerMain.js",t);return new Worker(Jp?Jp.createScriptURL(s):s,{name:t,type:"module"})}}const n=o.esmModuleLocation;if(n){const s=sMe(t,n.toString(!0)),r=new Worker(Jp?Jp.createScriptURL(s):s,{name:t,type:"module"});return oMe(r)}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function sMe(o,e){if(!(/^((http:)|(https:)|(file:))/.test(e)&&e.substring(0,globalThis.origin.length)!==globalThis.origin)){const i=e.lastIndexOf("?"),n=e.lastIndexOf("#",i),s=i>0?new URLSearchParams(e.substring(i+1,~n?n:void 0)):new URLSearchParams;sT.addSearchParam(s,!0,!0),s.toString()?e=`${e}?${s.toString()}#${o}`:e=`${e}#${o}`}const t=new Blob([ol([`/*${o}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(eU())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(KO())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(e)}) ?? ${JSON.stringify(e)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${o}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(t)}function oMe(o){return new Promise((e,t)=>{o.onmessage=function(i){i.data.type==="vscode-worker-ready"&&(o.onmessage=null,e(o))},o.onerror=t})}function rMe(o){return!!o&&typeof o.then=="function"}class pW extends F{static{this.LAST_WORKER_ID=0}constructor(e){super(),this._onMessage=this._register(new P),this.onMessage=this._onMessage.event,this._onError=this._register(new P),this.onError=this._onError.event,this.id=++pW.LAST_WORKER_ID;const t=e instanceof Worker||"then"in e?e:nMe(e,this.id);rMe(t)?this.worker=t:this.worker=Promise.resolve(t),this.postMessage("-please-ignore-",[]);const i=n=>{this._onError.fire(n)};this.worker.then(n=>{n.onmessage=s=>{this._onMessage.fire(s.data)},n.onmessageerror=s=>{this._onError.fire(s)},typeof n.addEventListener=="function"&&n.addEventListener("error",i)}),this._register(ge(()=>{this.worker?.then(n=>{n.onmessage=null,n.onmessageerror=null,n.removeEventListener("error",i),n.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){Te(n),Te(new Error("FAILED to post message to worker",{cause:n}))}})}}class aMe{constructor(e,t){this.esmModuleLocation=e,this.label=t}}function lMe(o,e){const t=be.isUri(o)?new aMe(o,e):o;return new iMe(new pW(t))}class cMe{constructor(e,t,i){const n=new Uint8Array(e*t);for(let s=0,r=e*t;st&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const n=new cMe(i,t,0);for(let s=0,r=e.length;s=this._maxCharCode?0:this._states.get(e,t)}}let NN=null;function hMe(){return NN===null&&(NN=new dMe([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),NN}let Pb=null;function uMe(){if(Pb===null){Pb=new P_(0);const o=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=hMe()){const i=uMe(),n=[];for(let s=1,r=e.getLineCount();s<=r;s++){const a=e.getLineContent(s),l=a.length;let c=0,d=0,h=0,u=1,g=!1,f=!1,p=!1,_=!1;for(;c=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}function XX(o){const e=[];for(const t of o){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function _W(o,e,t,i){return{red:o/255,blue:t/255,green:e/255,alpha:i}}function Ab(o,e){const t=e.index,i=e[0].length;if(t===void 0)return;const n=o.positionAt(t);return{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:n.lineNumber,endColumn:n.column+i}}function fMe(o,e){if(!o)return;const t=V.Format.CSS.parseHex(e);if(t)return{range:o,color:_W(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function zV(o,e,t){if(!o||e.length!==1)return;const n=e[0].values(),s=XX(n);return{range:o,color:_W(s[0],s[1],s[2],t?s[3]:1)}}function UV(o,e,t){if(!o||e.length!==1)return;const n=e[0].values(),s=XX(n),r=new V(new oa(s[0],s[1]/100,s[2]/100,t?s[3]:1));return{range:o,color:_W(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function Ob(o,e){return typeof o=="string"?[...o.matchAll(e)]:o.findMatches(e)}function pMe(o){const e=[],i=Ob(o,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const s=n.filter(c=>c!==void 0),r=s[1],a=s[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=zV(Ab(o,n),Ob(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=zV(Ab(o,n),Ob(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=UV(Ab(o,n),Ob(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;l=UV(Ab(o,n),Ob(a,c),!0)}else r==="#"&&(l=fMe(Ab(o,n),r+a));l&&e.push(l)}return e}function mMe(o){return!o||typeof o.getValue!="function"||typeof o.positionAt!="function"?[]:pMe(o)}const _Me=/^-+|-+$/g,$V=100,bMe=5;function CMe(o,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=vMe(o,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=wMe(o,e);t=t.concat(i)}return t}function vMe(o,e){const t=[],i=o.getLineCount();for(let n=1;n<=i;n++){const s=o.getLineContent(n),r=s.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:s.length+1};if(a.endColumn>a.startColumn){const l={range:a,...SMe(s.substring(r[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function wMe(o,e){const t=[],i=o.getLineCount();if(!e.markSectionHeaderRegex||e.markSectionHeaderRegex.trim()==="")return t;const n=Dq(e.markSectionHeaderRegex),s=new RegExp(e.markSectionHeaderRegex,`gdm${n?"s":""}`);if(wU(s))return t;for(let r=1;r<=i;r+=$V-bMe){const a=Math.min(r+$V-1,i),l=[];for(let h=r;h<=a;h++)l.push(o.getLineContent(h));const c=l.join(` +`)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m(1380,"No result.")),n);return r}}async function JDe(o,e,t,i){const n=new H5(e,t,o),s=await n.resolveRenameLocation(Ve.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,Ve.None)}let Rh=class{static{n2=this}static{this.ID="editor.contrib.renameController"}static get(e){return e.getContribution(n2.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new z,this._cts=new qt,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(i2,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new qt,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new H5(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new nd(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const f=i.resolveRenameLocation(n.token);this._progressService.showWhile(f,250),s=await f,e("resolved rename location")}catch(f){f instanceof wr?e("resolve rename location cancelled",JSON.stringify(f,null," ")):(e("resolve rename location failed",f instanceof Error?f:JSON.stringify(f,null," ")),(typeof f=="string"||Vc(f))&&fo.get(this.editor)?.showMessage(f||m(1381,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),fo.get(this.editor)?.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new nd(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async f=>[f,await f.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(f,p)=>{let _=c.slice();return f===ZC.Automatic&&(_=_.filter(([b,C])=>C)),_.map(([b])=>b.provideNewSymbolNames(a,s.range,f,p))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(s.range,s.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const g=hm(i.provideRenameEdits(u.newName,r.token),r.token).then(async f=>{if(!f){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(f.rejectReason){e(`returning early - rejected with reason: ${f.rejectReason}`),this._notificationService.info(f.rejectReason);return}this.editor.setSelection(L.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:m(1382,"Renaming '{0}' to '{1}'",s?.text,u.newName),code:"undoredo.rename",quotableLabel:m(1383,"Renaming {0} to {1}",s?.text,u.newName),respectAutoSaveConfig:!0,reason:jn.rename()}).then(p=>{e("edits applied"),p.ariaSummary&&Is(m(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,u.newName,p.ariaSummary))}).catch(p=>{e(`error when applying edits ${JSON.stringify(p,null," ")}`),this._notificationService.error(m(1385,"Rename failed to apply edits")),this._logService.error(p)})},f=>{e("error when providing rename edits",JSON.stringify(f,null," ")),this._notificationService.error(m(1386,"Rename failed to compute edits")),this._logService.error(f)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(g,250),g}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}};Rh=n2=QDe([ou(1,fe),ou(2,bi),ou(3,Ow),ou(4,id),ou(5,Mt),ou(6,Xk),ou(7,he)],Rh);class eIe extends le{constructor(){super({id:"editor.action.rename",label:H(1388,"Rename Symbol"),precondition:q.and(N.writable,N.hasRenameProvider),kbOpts:{kbExpr:N.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(et),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return _e.isUri(n)&&R.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Ee):super.runCommand(e,t)}run(e,t){const i=e.get(Mt),n=Rh.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}Xe(Rh.ID,Rh,4);se(eIe);const V5=Ki.bindToContribution(Rh.get);re(new V5({id:"acceptRenameInput",precondition:y_,handler:o=>o.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:q.and(N.focus,q.not("isComposing")),primary:3}}));re(new V5({id:"acceptRenameInputWithPreview",precondition:q.and(y_,q.has("config.editor.rename.enablePreview")),handler:o=>o.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:q.and(N.focus,q.not("isComposing")),primary:2051}}));re(new V5({id:"cancelRenameInput",precondition:y_,handler:o=>o.cancelRenameInput(),kbOpts:{weight:199,kbExpr:N.focus,primary:9,secondary:[1033]}}));bt(class extends pn{constructor(){super({id:"focusNextRenameSuggestion",title:{...H(1389,"Focus Next Rename Suggestion")},precondition:y_,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(et).getFocusedCodeEditor();if(!t)return;const i=Rh.get(t);i&&i.focusNextRenameSuggestion()}});bt(class extends pn{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...H(1390,"Focus Previous Rename Suggestion")},precondition:y_,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(et).getFocusedCodeEditor();if(!t)return;const i=Rh.get(t);i&&i.focusPreviousRenameSuggestion()}});Js("_executeDocumentRenameProvider",function(o,e,t,...i){const[n]=i;Je(typeof n=="string");const{renameProvider:s}=o.get(he);return JDe(s,e,t,n)});Js("_executePrepareRename",async function(o,e,t){const{renameProvider:i}=o.get(he),s=await new H5(e,t,i).resolveRenameLocation(Ve.None);if(s?.rejectReason)throw new Error(s.rejectReason);return s});li.as($a.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:m(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var tIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EH=function(o,e){return function(t,i){e(t,i,o)}};let Ix=class extends A{static{this.ID="editor.sectionHeaderDetector"}constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{const s=this.editor.getModel()?.getLanguageId();s&&n.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new St(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!n?.markers))return{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const r=t.validateRange(s.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(s=>s.decorationId),n=e.map(s=>iIe(s));this.editor.changeDecorations(s=>{const r=s.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=r.length;a=this._minimumTimeBetweenRuns&&(this._lastRun=t,e())}}class cC{static create(e,t){return new cC(e,new Ru(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new L(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,s,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new cC(this._startLineNumber,n),new cC(this._startLineNumber+r,s)]}applyEdit(e,t){const[i,n,s]=Lh(t);this.acceptEdit(e,i,n,s,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new R(e.startLineNumber,e.startColumn),t,i,n,s),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const s=i-t;this._startLineNumber-=s;return}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const s=-t;this._startLineNumber-=s,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,s){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,n,s)}reportIfInvalid(e){this._tokens.reportIfInvalid(e,this._startLineNumber)}}class Ru{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;for(;ae||u===e&&f>=t)&&(ue||f===e&&_>=t){if(fs?p-=s-i:p=i;else if(g===t&&f===i)if(g===n&&p>s)p-=s-i;else{d=!0;continue}else if(gs)g=t,f=i,p=f+(p-s);else{d=!0;continue}else if(g>n){if(l===0&&!d){c=a;break}g-=l}else if(g===n&&f>=s)e&&g===0&&(f+=e,p+=e),g-=l,f-=s-i,p-=s-i;else throw new Error("Not possible!");const b=4*c;r[b]=g,r[b+1]=f,r[b+2]=p,r[b+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,n,s,r){const a=i===0&&n===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")}):n>e.getLineCount()?Ru._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")}):this._getEndCharacter(i)>e.getLineLength(n)&&Ru._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")})}}}class NH{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var sIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hE=function(o,e){return function(t,i){e(t,i,o)}};let s2=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Rd}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,n);let r;if(s)r=s.metadata;else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let h=0;c>0&&h>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?1:0)<<11;r|=h|1}if(typeof d.bold<"u"){const h=(d.bold?2:0)<<11;r|=h|2}if(typeof d.underline<"u"){const h=(d.underline?4:0)<<11;r|=h|4}if(typeof d.strikethrough<"u"){const h=(d.strikethrough?8:0)<<11;r|=h|8}if(d.foreground){const h=d.foreground<<15;r|=h|16}r===0&&(r=2147483647)}}else r=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,r)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};s2=sIe([hE(1,ci),hE(2,_i),hE(3,Mt)],s2);function yZ(o,e,t){const i=o.data,n=o.data.length/5|0,s=Math.max(Math.ceil(n/1024),400),r=[];let a=0,l=1,c=0;for(;ad&&i[5*C]===0;)C--;if(C-1===d){let w=h;for(;w+1x)e.warnOverlappingSemanticTokens(S,x+1);else{const F=e.getMetadata(I,T,t);F!==2147483647&&(f===0&&(f=S),u[g]=S-f,u[g+1]=x,u[g+2]=D,u[g+3]=F,g+=4,p=S,_=D)}l=S,c=x,a++}g!==u.length&&(u=u.subarray(0,g));const b=cC.create(f,u);r.push(b)}return r}class oIe{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class Rd{static{this._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143]}constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Rd._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const s=this._elements;this._currentLengthIndex++,this._currentLength=Rd._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?t[0]:[]}async function DZ(o,e,t,i,n){const s=dIe(o,e),r=await Promise.all(s.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){c=d,l=null}return(!l||!Jk(l)&&!LZ(l))&&(l=null),new cIe(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function hIe(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:null}class uIe{constructor(e,t){this.provider=e,this.tokens=t}}function gIe(o,e){return o.has(e)}function IZ(o,e){const t=o.orderedGroups(e);return t.length>0?t[0]:[]}async function z5(o,e,t,i){const n=IZ(o,e),s=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Ri(l),a=null}return(!a||!Jk(a))&&(a=null),new uIe(r,a)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}Ye.registerCommand("_provideDocumentSemanticTokensLegend",async(o,...e)=>{const[t]=e;Je(t instanceof _e);const i=o.get(ei).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(he),s=hIe(n,i);return s?s[0].getLegend():o.get(Pt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Ye.registerCommand("_provideDocumentSemanticTokens",async(o,...e)=>{const[t]=e;Je(t instanceof _e);const i=o.get(ei).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=o.get(he);if(!kZ(n,i))return o.get(Pt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await DZ(n,i,null,null,Ve.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!Jk(a))return;const l=xZ({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});Ye.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(o,...e)=>{const[t,i]=e;Je(t instanceof _e);const n=o.get(ei).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(he),r=IZ(s,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!L.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await z5(s,n,L.lift(i),Ve.None);if(a)return a.provider.getLegend()});Ye.registerCommand("_provideDocumentRangeSemanticTokens",async(o,...e)=>{const[t,i]=e;Je(t instanceof _e),Je(L.isIRange(i));const n=o.get(ei).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=o.get(he),r=await z5(s,n,L.lift(i),Ve.None);if(!(!r||!r.tokens))return xZ({id:0,type:"full",data:r.tokens.data})});const U5="editor.semanticHighlighting";function o0(o,e,t){const i=t.getValue(U5,{overrideIdentifier:o.getLanguageId(),resource:o.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var EZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gl=function(o,e){return function(t,i){e(t,i,o)}},Id;let o2=class extends A{constructor(e,t,i,n,s,r){super(),this._watchers=new ai;const a=d=>{this._watchers.get(d.uri)?.dispose(),this._watchers.set(d.uri,new r2(d,e,i,s,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);o0(d,i,n)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{o0(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{o0(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(U5)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){pt(this._watchers.values()),this._watchers.clear(),super.dispose()}};o2=EZ([gl(0,Qk),gl(1,ei),gl(2,ci),gl(3,Pe),gl(4,Rr),gl(5,he)],o2);let r2=class extends A{static{Id=this}static{this.REQUEST_MIN_DELAY=300}static{this.REQUEST_MAX_DELAY=2e3}constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Id.REQUEST_MIN_DELAY,max:Id.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new St(()=>this._fetchDocumentSemanticTokensNow(),Id.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{pt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),pt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!kZ(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new qt,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=DZ(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],r=this._model.onDidChangeContent(l=>{s.push(l)}),a=new rn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,s)}},l=>{l&&(Xo(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Ee(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let r=0;r{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(LZ(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=s.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const g=t.edits[u];if(g.start>l.length){i.warnInvalidEditStart(s.resultId,t.resultId,u,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const f=d-(g.start+g.deleteCount);f>0&&(Id._copy(l,d-f,c,h-f,f),h-=f),g.data&&(Id._copy(g.data,0,c,h-g.data.length,g.data.length),h-=g.data.length),d=g.start}d>0&&Id._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(Jk(t)){this._currentDocumentResponse=new fIe(e,t.resultId,t.data);const a=yZ(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};r2=Id=EZ([gl(1,Qk),gl(2,ci),gl(3,Rr),gl(4,he)],r2);class fIe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}v_(o2);var pIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z_=function(o,e){return function(t,i){e(t,i,o)}};let Ex=class extends A{static{this.ID="editor.contrib.viewportSemanticTokens"}constructor(e,t,i,n,s,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new St(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){const c=this._editor.getModel();for(const d of this._provider.all(c)){const h=d.onDidChange?.(()=>{this._cancelAll(),a()});h&&this._rangeProvidersChangeListeners.push(h)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(U5)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){pt(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=$i(r=>Promise.resolve(z5(this._provider,e,t,r))),s=new rn(!1);return n.then(r=>{if(this._debounceInformation.update(e,s.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,yZ(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};Ex=pIe([Z_(1,Qk),Z_(2,ci),Z_(3,Pe),Z_(4,Rr),Z_(5,he)],Ex);Xe(Ex.ID,Ex,1);class mIe{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:r}=n,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=s.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if($d(h)&&cl(d))break;d=h}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new L(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var _Ie=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bIe=function(o,e){return function(t,i){e(t,i,o)}},a2;class $5{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new $5(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let zv=class{static{a2=this}static{this.ID="editor.contrib.smartSelectController"}static get(e){return e.getContribution(a2.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await TZ(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(129),Ve.None).then(s=>{if(!(!us(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!jt(this._editor.getSelections(),t,(r,a)=>r.equalsSelection(a)))){for(let r=0;ra.containsPosition(t[r].getStartPosition())&&a.containsPosition(t[r].getEndPosition())),s[r].unshift(t[r]);this._state=s.map(r=>new $5(0,r)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>ae.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};zv=a2=_Ie([bIe(1,he)],zv);class NZ extends le{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=zv.get(t);i&&await i.run(this._forward)}}class CIe extends NZ{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:H(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(1398,"&&Expand Selection"),order:2}})}}Ye.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class vIe extends NZ{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:H(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m(1399,"&&Shrink Selection"),order:3}})}}Xe(zv.ID,zv,4);se(CIe);se(vIe);async function TZ(o,e,t,i,n){const s=o.all(e).concat(new mIe(i.selectSubwords));s.length===1&&s.unshift(new Vr);const r=[],a=[];for(const l of s)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(c=>{if(us(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((u,g)=>R.isBefore(u.getStartPosition(),g.getStartPosition())?1:R.isBefore(g.getStartPosition(),u.getStartPosition())||R.isBefore(u.getEndPosition(),g.getEndPosition())?-1:R.isBefore(g.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||L.containsRange(u,d)&&!L.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;uR.isIPosition(r)));const n=o.get(he).selectionRangeProvider,s=await o.get(fs).createModelReference(t);try{return TZ(n,s.object.textEditorModel,i.map(R.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Ve.None)}finally{s.dispose()}});const l2=Object.freeze({View:H(1638,"View"),Help:H(1639,"Help"),Test:H(1640,"Test"),File:H(1641,"File"),Preferences:H(1642,"Preferences"),Developer:H(1643,"Developer")});class wIe extends sa{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...H(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:m(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:H(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:l2.View,toggled:{condition:q.equals("config.editor.stickyScroll.enabled",!0),title:m(1445,"Sticky Scroll"),mnemonicTitle:m(1446,"&&Sticky Scroll")},menu:[{id:M.CommandPalette},{id:M.MenubarAppearanceMenu,group:"4_editor",order:3},{id:M.StickyScrollContext}]})}async runEditorCommand(e,t){const i=e.get(Pe),n=!i.getValue("editor.stickyScroll.enabled"),s=ia.get(t)?.isFocused();i.updateValue("editor.stickyScroll.enabled",n),s&&t.focus()}}const eD=100;class SIe extends sa{constructor(){super({id:"editor.action.focusStickyScroll",title:{...H(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:m(1447,"&&Focus Editor Sticky Scroll")},precondition:q.and(q.has("config.editor.stickyScroll.enabled"),N.stickyScrollVisible),menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){ia.get(t)?.focus()}}class yIe extends sa{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:H(1451,"Select the next editor sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:eD,primary:18}})}runEditorCommand(e,t){ia.get(t)?.focusNext()}}class xIe extends sa{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:H(1452,"Select the previous sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:eD,primary:16}})}runEditorCommand(e,t){ia.get(t)?.focusPrevious()}}class LIe extends sa{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:H(1453,"Go to the focused sticky scroll line"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:eD,primary:3}})}runEditorCommand(e,t){ia.get(t)?.goToFocused()}}class kIe extends sa{constructor(){super({id:"editor.action.selectEditor",title:H(1454,"Select Editor"),precondition:N.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:eD,primary:9}})}runEditorCommand(e,t){ia.get(t)?.selectEditor()}}Xe(ia.ID,ia,1);bt(wIe);bt(SIe);bt(xIe);bt(yIe);bt(LIe);bt(kIe);var RZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vb=function(o,e){return function(t,i){e(t,i,o)}};class DIe{constructor(e,t,i,n,s,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.gutterMenuLinkAction=r,this.completion=a}}let c2=class extends lQ{constructor(e,t,i,n,s,r){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(Ve.None)}return e}};c2=RZ([vb(5,qk)],c2);let d2=class extends A{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){if(i.selectedSuggestionInfo)return;let s;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){s=g;break}if(!s)return;const r=s.getOption(102);if(Cp.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Cp.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c?.word||(d=this._getTriggerCharacterInfo(e,t)),!c?.word&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new L(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,c)){const g=new X8(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await d5(this._languageFeatureService.completionProvider,e,t,new Gw(void 0,wx.createSuggestFilter(s).itemKind,d?.providers),d&&{triggerKind:1,triggerCharacter:d.ch},n);let f;g.needsClipboard&&(f=await this._clipboardService.readText());const p=new Bd(g.items,t.column,new X8(u,0),al.None,s.getOption(134),s.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},f);h=new c2(e,t.lineNumber,c,p,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Ve.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(L.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))s.triggerCharacters?.includes(i)&&n.add(s);if(n.size!==0)return{providers:n,ch:i}}};d2=RZ([vb(0,he),vb(1,Co),vb(2,qk),vb(3,et)],d2);v_(d2);class IIe extends le{constructor(){super({id:"editor.action.forceRetokenize",label:H(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new rn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}se(IIe);class j5 extends pn{static{this.ID="editor.action.toggleTabFocusMode"}constructor(){super({id:j5.ID,title:H(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:H(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!_m.getTabFocusMode();_m.setTabFocusMode(t),Is(t?m(1528,"Pressing Tab will now move focus to the next focusable element"):m(1529,"Pressing Tab will now insert the tab character"))}}bt(j5);class q5{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),r=new TH(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${EIe(Array.from(a))}`,"g");const c=new gp(null,l),d=[];let h=!1,u,g=0,f=0,p=0;e:for(let _=n,b=s;_<=b;_++){const C=e.getLineContent(_),w=C.length;c.reset(0);do if(u=c.next(C),u){let v=u.index,S=u.index+u[0].length;if(v>0){const I=C.charCodeAt(v-1);Vi(I)&&v--}if(S+1=1e3){h=!0;break e}d.push(new L(_,v+1,_,S+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:g,invisibleCharacterCount:f,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new TH(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(s),a=jd.getLocales().filter(l=>!jd.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function EIe(o,e){return`[${_o(o.map(i=>String.fromCodePoint(i)).join(""))}]`}class TH{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=jd.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Oc.codePoints)RH(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=hw(r);n=n||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Oc.isInvisibleCharacter(a)&&(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!RH(e)&&Oc.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function RH(o){return o===" "||o===` +`||o===" "}var NIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},MH=function(o,e){return function(t,i){e(t,i,o)}};let h2=class extends A{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Z(e,J("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??zl("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new mt(this.el,"click")),a=this._register(new mt(this.el,"keypress")),l=te.chain(a.event,h=>h.map(u=>new yt(u)).filter(u=>u.keyCode===3)),c=this._register(new mt(this.el,Rt.Tap)).event;this._register(Xt.addTarget(this.el));const d=te.any(r.event,l,c);this._register(d(h=>{this.enabled&&(nt.stop(h,!0),i?.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};h2=NIe([MH(3,Ms),MH(4,gd)],h2);var MZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},u2=function(o,e){return function(t,i){e(t,i,o)}};const TIe=26;let g2=class extends A{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(f2))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,TIe)}};g2=MZ([u2(1,fe)],g2);let f2=class extends A{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=J("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=J("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){xn(this.element)}show(e){xn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Z(this.element,J("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(J(`div${Se.asCSSSelector(e.icon)}`));const n=Z(this.element,J("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Z(this.element,J("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(h2,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=Z(this.element,J("div.action-container"));this.actionBar=this._register(new qs(s)),this.actionBar.push(this._register(new Uo("banner.close",m(1533,"Close Banner"),Se.asClassName(qj),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};f2=MZ([u2(0,fe),u2(1,aa)],f2);const PZ=We("workspaceTrustManagementService");var K5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},dC=function(o,e){return function(t,i){e(t,i,o)}};const RIe=Ht("extensions-warning-message",G.warning,m(1534,"Icon shown with a warning message in the extensions editor."));let Uv=class extends A{static{this.ID="editor.contrib.unicodeHighlighter"}constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const r=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let a;if(s.nonBasicAsciiCharacterCount>=r)a={message:m(1535,"This document contains many non-basic ASCII unicode characters"),command:new Yw};else if(s.ambiguousCharacterCount>=r)a={message:m(1536,"This document contains many ambiguous unicode characters"),command:new wf};else if(s.invisibleCharacterCount>=r)a={message:m(1537,"This document contains many invisible unicode characters"),command:new Zw};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:RIe,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(g2,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=MIe(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?rf.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?jX:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new p2(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new PIe(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Uv=K5([dC(1,eo),dC(2,PZ),dC(3,fe)],Uv);function MIe(o,e){return{nonBasicASCII:e.nonBasicASCII===No?!o:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===No?!o:e.includeComments,includeStrings:e.includeStrings===No?!o:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let p2=class extends A{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new St(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:tD.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!i4(t,e))return null;const i=t.getValueInRange(e.range);return{reason:OZ(i,this._options),inComment:n4(t,e),inString:s4(t,e)}}};p2=K5([dC(3,eo)],p2);class PIe extends A{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new St(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const s=q5.computeUnicodeHighlights(this._model,this._options,n);for(const r of s.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:tD.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return i4(t,e)?{reason:OZ(i,this._options),inComment:n4(t,e),inString:s4(t,e)}:null}}const AZ=m(1538,"Configure Unicode Highlight Options");let m2=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(Uv.ID);if(!n)return[];const s=[],r=new Set;let a=300;for(const l of t){const c=n.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=uE(h);let g;switch(c.reason.kind){case 0:{hw(c.reason.confusableWith)?g=m(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,uE(c.reason.confusableWith.codePointAt(0))):g=m(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,uE(c.reason.confusableWith.codePointAt(0)));break}case 1:g=m(1541,"The character {0} is invisible.",u);break;case 2:g=m(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(g))continue;r.add(g);const f={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m(1543,"Adjust settings"),_=fj(iD.ID,f),b=new Kn("",!0).appendMarkdown(g).appendText(" ").appendLink(_,p,AZ);s.push(new Gr(this,l.range,[b],!1,a++))}return s}renderHoverParts(e,t){return dve(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` +`)}};m2=K5([dC(1,aa)],m2);function _2(o){return`U+${o.toString(16).padStart(4,"0")}`}function uE(o){let e=`\`${_2(o)}\``;return Oc.isInvisibleCharacter(o)||(e+=` "${`${AIe(o)}`}"`),e}function AIe(o){return o===96?"`` ` ``":"`"+String.fromCodePoint(o)+"`"}function OZ(o,e){return q5.computeUnicodeHighlightReason(o,e)}class tD{constructor(){this.map=new Map}static{this.instance=new tD}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Te.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}class OIe extends le{constructor(){super({id:wf.ID,label:H(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(Pe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Vs.includeComments,!1,2)}}class FIe extends le{constructor(){super({id:wf.ID,label:H(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(Pe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Vs.includeStrings,!1,2)}}class wf extends pn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters"}constructor(){super({id:wf.ID,title:H(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(Pe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Vs.ambiguousCharacters,!1,2)}}class Zw extends pn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters"}constructor(){super({id:Zw.ID,title:H(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(Pe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Vs.invisibleCharacters,!1,2)}}class Yw extends pn{static{this.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters"}constructor(){super({id:Yw.ID,title:H(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(Pe);n&&this.runAction(n)}async runAction(e){await e.updateValue(Vs.nonBasicASCII,!1,2)}}class iD extends pn{static{this.ID="editor.action.unicodeHighlight.showExcludeOptions"}constructor(){super({id:iD.ID,title:H(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:s,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(Jn),c=e.get(Pe);function d(f){return Oc.isInvisibleCharacter(f)?m(1549,"Exclude {0} (invisible character) from being highlighted",_2(f)):m(1550,"Exclude {0} from being highlighted",`${_2(f)} "${a}"`)}const h=[];if(n.kind===0)for(const f of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{BIe(c,[f])}});if(h.push({label:d(i),run:()=>WIe(c,[i])}),r){const f=new OIe;h.push({label:f.label,run:async()=>f.runAction(c)})}else if(s){const f=new FIe;h.push({label:f.label,run:async()=>f.runAction(c)})}function u(f){return typeof f.desc.title=="string"?f.desc.title:f.desc.title.value}if(n.kind===0){const f=new wf;h.push({label:u(f),run:async()=>f.runAction(c)})}else if(n.kind===1){const f=new Zw;h.push({label:u(f),run:async()=>f.runAction(c)})}else if(n.kind===2){const f=new Yw;h.push({label:u(f),run:async()=>f.runAction(c)})}else HIe(n);const g=await l.pick(h,{title:AZ});g&&await g.run()}}async function WIe(o,e){const t=o.getValue(Vs.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await o.updateValue(Vs.allowedCharacters,i,2)}async function BIe(o,e){const t=o.inspect(Vs.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await o.updateValue(Vs.allowedLocales,i,2)}function HIe(o){throw new Error(`Unexpected value: ${o}`)}bt(wf);bt(Zw);bt(Yw);bt(iD);Xe(Uv.ID,Uv,1);mf.register(m2);const Xw=We("dialogService");var VIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PH=function(o,e){return function(t,i){e(t,i,o)}};const FZ="ignoreUnusualLineTerminators";function zIe(o,e,t){o.setModelProperty(e.uri,FZ,t)}function UIe(o,e){return o.getModelProperty(e.uri,FZ)}let Nx=class extends A{static{this.ID="editor.contrib.unusualLineTerminatorsDetector"}constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||UIe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Lr(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){zIe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};Nx=VIe([PH(1,Xw),PH(2,et)],Nx);Xe(Nx.ID,Nx,1);const cS="**",AH="/",r0="[/\\\\]",a0="[^/\\\\]",$Ie=/\//g;function OH(o,e){switch(o){case 0:return"";case 1:return`${a0}*?`;default:return`(?:${r0}|${a0}+${r0}${e?`|${r0}${a0}+`:""})*?`}}function FH(o,e){if(!o)return[];const t=[];let i=!1,n=!1,s="";for(const r of o){switch(r){case e:if(!i&&!n){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}s+=r}return s&&t.push(s),t}function WZ(o){if(!o)return"";let e="";const t=FH(o,AH);if(t.every(i=>i===cS))e=".*";else{let i=!1;t.forEach((n,s)=>{if(n===cS){if(i)return;e+=OH(2,s===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!c?h="^":d===AH?h="":h=_o(d),c+=h;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const u=`(?:${FH(a,",").map(g=>WZ(g)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=a0;continue;case"*":e+=OH(1);continue;default:e+=_o(d)}}sl===c,endsWith:i?RQ:(l,c)=>l.endsWith(c),isEqualOrParent:(l,c)=>aN(l,c,!Gs||i)},s=`${i?t.toLowerCase():t}_${!!e.trimForExclusions}_${i}`;let r=WH.get(s);if(r)return HH(r,o,n);let a;return jIe.test(t)?r=XIe(t.substring(4),t,n):(a=qIe.exec(gE(t,n)))?r=QIe(a[1],t,n):(e.trimForExclusions?GIe:KIe).test(t)?r=JIe(t,n):(a=ZIe.exec(gE(t,n)))?r=VH(a[1].substring(1),t,!0,n):(a=YIe.exec(gE(t,n)))?r=VH(a[1],t,!1,n):r=eEe(t,n),WH.set(s,r),HH(r,o,n)}function HH(o,e,t){if(typeof e=="string")return o;const i=function(n,s){return t.isEqualOrParent(n,e.base)?o(dw(n.substring(e.base.length),Da),s):null};return i.allBasenames=o.allBasenames,i.allPaths=o.allPaths,i.basenames=o.basenames,i.patterns=o.patterns,i}function gE(o,e){return e.trimForExclusions&&o.endsWith("/**")?o.substring(0,o.length-2):o}function XIe(o,e,t){return function(i,n){return typeof i=="string"&&t.endsWith(i,o)?e:null}}function QIe(o,e,t){const i=`/${o}`,n=`\\${o}`,s=function(a,l){return typeof a!="string"?null:l?t.equals(l,o)?e:null:t.equals(a,o)||t.endsWith(a,i)||t.endsWith(a,n)?e:null},r=[o];return s.basenames=r,s.patterns=[e],s.allBasenames=r,s}function JIe(o,e){const t=HZ(o.slice(1,-1).split(",").map(a=>G5(a,e)).filter(a=>a!==kl),o),i=t.length;if(!i)return kl;if(i===1)return t[0];const n=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);s&&(n.allBasenames=s.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function VH(o,e,t,i){const n=Da===Ai.sep,s=n?o:o.replace($Ie,Da),r=Da+s,a=Ai.sep+o;let l;return t?l=function(c,d){return typeof c=="string"&&(i.equals(c,s)||i.endsWith(c,r)||!n&&(i.equals(c,o)||i.endsWith(c,a)))?e:null}:l=function(c,d){return typeof c=="string"&&(i.equals(c,s)||!n&&i.equals(c,o))?e:null},l.allPaths=[(t?"*/":"./")+o],l}function eEe(o,e){try{const t=new RegExp(`^${WZ(o)}$`,e.ignoreCase?"i":void 0);return function(i){return t.lastIndex=0,typeof i=="string"&&t.test(i)?o:null}}catch{return kl}}function tEe(o,e,t){return!o||typeof e!="string"?!1:BZ(o,t)(e)}function BZ(o,e={}){if(!o)return BH;if(typeof o=="string"||iEe(o)){const t=G5(o,e);if(t===kl)return BH;const i=function(n,s){return!!t(n,s)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return nEe(o,e)}function iEe(o){const e=o;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function nEe(o,e){const t=HZ(Object.getOwnPropertyNames(o).map(a=>sEe(a,o[a],e)).filter(a=>a!==kl)),i=t.length;if(!i)return kl;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,h){let u;for(let g=0,f=t.length;g{for(const g of u){const f=await g;if(typeof f=="string")return f}return null})():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const n=function(a,l,c){let d,h;for(let u=0,g=t.length;u{for(const u of h){const g=await u;if(typeof g=="string")return g}return null})():null},s=t.find(a=>!!a.allBasenames);s&&(n.allBasenames=s.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function sEe(o,e,t){if(e===!1)return kl;const i=G5(o,t);if(i===kl)return kl;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const s=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=n.replace("$(basename)",()=>l),h=c(d);return zE(h)?h.then(u=>u?o:null):h?o:null};return s.requiresSiblings=!0,s}}return i}function HZ(o,e){const t=o.filter(a=>!!a.basenames);if(t.length<2)return o;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const s=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const h=a.charCodeAt(d-1);if(h===47||h===92)break}l=a.substring(d)}const c=i.indexOf(l);return c!==-1?n[c]:null};s.basenames=i,s.patterns=n,s.allBasenames=i;const r=o.filter(a=>!a.basenames);return r.push(s),r}function Z5(o,e,t,i,n,s){if(Array.isArray(o)){let r=0;for(const a of o){const l=Z5(a,e,t,i,n,s);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof o=="string")return i?o==="*"?5:o===t?10:0:0;if(o){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=o;if(!i&&!c)return 0;d&&n&&(e=n);let h=0;if(l)if(l===e.scheme)h=10;else if(l==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===s)h=10;else if(d==="*"&&s!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:$V(a.base)},u===e.fsPath||tEe(u,e.fsPath))h=10;else return 0}return h}else return 0}}var oEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rEe=function(o,e){return function(t,i){e(t,i,o)}};class zH{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,O0,!1).map(a=>({range:a.range,kind:Dm.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const s=new ai,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(s);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,O0,!1).map(d=>({range:d.range,kind:Dm.Text}));c&&s.set(a.uri,c)}return s}}let b2=class extends A{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new zH)),this._register(e.multiDocumentHighlightProvider.register("*",new zH))}};b2=oEe([rEe(0,he)],b2);var VZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fl=function(o,e){return function(t,i){e(t,i,o)}},di,C2;const Y5=new oe("hasWordHighlights",!1);function zZ(o,e,t,i){const n=o.ordered(e);return qA(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,Ri)),s=>s!=null).then(s=>{if(s){const r=new ai;return r.set(e.uri,s),r}return new ai})}function aEe(o,e,t,i,n){const s=o.ordered(e);return qA(s.map(r=>()=>{const a=n.filter(l=>Bz(l)).filter(l=>Z5(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Ri)}),r=>r!=null)}class UZ{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=$i(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new L(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class lEe extends UZ{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return zZ(this._providers,e,t.getPosition(),n).then(s=>s||new ai)}}class cEe extends UZ{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return aEe(this._providers,e,t.getPosition(),n,this._otherModels).then(s=>s||new ai)}}function dEe(o,e,t,i){return new lEe(e,t,i,o)}function hEe(o,e,t,i,n){return new cEe(e,t,i,o,n)}Js("_executeDocumentHighlights",async(o,e,t)=>{const i=o.get(he);return(await zZ(i.documentHighlightProvider,e,t,Ve.None))?.get(e.uri)});let v2=class{static{di=this}static{this.storedDecorationIDs=new ai}static{this.query=null}constructor(e,t,i,n,s,r,a,l){this.toUnhook=new z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ai,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new yr(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=s,this.configurationService=a,this.logService=l,this._hasWordHighlights=Y5.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{lL(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():di.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll(di.query?.modelInfo?.modelURI);break;case"multiFile":di.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{const c=this.codeEditorService.getFocusedCodeEditor();c?c.getModel()?.uri.scheme===Le.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==Le.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,di.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(L.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Is(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const r=this.editor.getModel().getLineContent(n.startLineNumber);Is(`${r}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=di.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),di.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||wh(n.getModel().uri,e))continue;const s=di.storedDecorationIDs.get(n.getModel().uri);if(!s)continue;n.removeDecorations(s),i.push(n.getModel().uri);const r=Mh.get(n);r?.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)di.storedDecorationIDs.delete(n)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==Le.vscodeNotebookCell&&di.query?.modelInfo?.modelURI.scheme!==Le.vscodeNotebookCell?(di.query=null,this._run()):di.query?.modelInfo&&(di.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Le.vscodeNotebookCell){const s=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Le.vscodeNotebookCell&&s.push(l)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!EF(s))continue;const r=s.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const s of n){const r=s.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){if(this.editor.hasTextFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){di.query=null,this._stopAll();return}const s=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>s||a.endColumn{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Ee)}catch(a){this.logService.error("Unexpected error during occurrence request. Log: ",a)}finally{r.dispose()}}else if(this.model.uri.scheme===Le.vscodeNotebookCell){const n=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!di.query||!di.query.modelInfo)return;const s=await this.textModelService.createModelReference(di.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(s.object.textEditorModel,di.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(r=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Ee)}catch(r){this.logService.error("Unexpected error during occurrence request. Log: ",r)}finally{s.dispose()}}}computeWithModel(e,t,i){return i.length?hEe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):dEe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const t of e){const i=Mh.get(t);if(!i)continue;const n=[],s=t.getModel()?.uri;if(s&&this.workerRequestValue.has(s)){const r=di.storedDecorationIDs.get(s),a=this.workerRequestValue.get(s);if(a)for(const c of a)c.range&&n.push({range:c.range,options:wDe(c.kind)});let l=[];t.changeDecorations(c=>{l=c.deltaDecorations(r??[],n)}),di.storedDecorationIDs=di.storedDecorationIDs.set(s,l),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};v2=di=VZ([fl(4,fs),fl(5,et),fl(6,Pe),fl(7,Mt)],v2);let Mh=class extends A{static{C2=this}static{this.ID="editor.contrib.wordHighlighter"}static get(e){return e.getContribution(C2.ID)}constructor(e,t,i,n,s,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Le.accessibleView&&(this._wordHighlighter=new v2(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s,n,r,a))};this._register(e.onDidChangeModel(c=>{this._wordHighlighter&&(!c.newModelUrl&&c.oldModelUrl?.scheme!==Le.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};Mh=C2=VZ([fl(1,Ie),fl(2,he),fl(3,et),fl(4,fs),fl(5,Pe),fl(6,Mt)],Mh);class $Z extends le{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Mh.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class uEe extends $Z{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:H(1572,"Go to Next Symbol Highlight"),precondition:Y5,kbOpts:{kbExpr:N.editorTextFocus,primary:65,weight:100}})}}class gEe extends $Z{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:H(1573,"Go to Previous Symbol Highlight"),precondition:Y5,kbOpts:{kbExpr:N.editorTextFocus,primary:1089,weight:100}})}}class fEe extends le{constructor(){super({id:"editor.action.wordHighlight.trigger",label:H(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:N.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Mh.get(t);n&&n.restoreViewState(!0)}}Xe(Mh.ID,Mh,0);se(uEe);se(gEe);se(fEe);v_(b2);class nD extends Ki{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=kr(t.getOption(148),t.getOption(147)),s=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new R(c.positionLineNumber,c.positionColumn),h=this._move(n,s,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>tt.fromModelSelection(c))),l.length===1){const c=new R(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new ae(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ae(t.lineNumber,t.column,t.lineNumber,t.column)}}class $h extends nD{_move(e,t,i,n,s){return ft.moveWordLeft(e,t,i,n,s)}}class jh extends nD{_move(e,t,i,n,s){return ft.moveWordRight(e,t,i,n)}}class pEe extends $h{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class mEe extends $h{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class _Ee extends $h{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:q.and(N.textInputFocus,q.and(a_,kk)?.negate()),primary:2063,mac:{primary:527},weight:100}})}}class bEe extends $h{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class CEe extends $h{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class vEe extends $h{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:q.and(N.textInputFocus,q.and(a_,kk)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class wEe extends $h{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,s){return super._move(kr(rs.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class SEe extends $h{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(kr(rs.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class yEe extends jh{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class xEe extends jh{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:q.and(N.textInputFocus,q.and(a_,kk)?.negate()),primary:2065,mac:{primary:529},weight:100}})}}class LEe extends jh{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class kEe extends jh{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class DEe extends jh{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:q.and(N.textInputFocus,q.and(a_,kk)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class IEe extends jh{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class EEe extends jh{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,s){return super._move(kr(rs.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class NEe extends jh{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(kr(rs.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class sD extends Ki{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e?.get(ti);if(!t.hasModel()||!n)return;const s=kr(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(g=>{const f=this._delete({wordSeparators:s,model:r,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Fn(f,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class X5 extends sD{_delete(e,t){const i=ft.deleteWordLeft(e,t);return i||new L(1,1,1,1)}}class Q5 extends sD{_delete(e,t){const i=ft.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new L(n,s,n,s)}}class TEe extends X5{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:N.writable})}}class REe extends X5{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:N.writable})}}class MEe extends X5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class PEe extends Q5{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:N.writable})}}class AEe extends Q5{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:N.writable})}}class OEe extends Q5{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class FEe extends le{constructor(){super({id:"deleteInsideWord",precondition:N.writable,label:H(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=kr(t.getOption(148),t.getOption(147)),s=t.getModel(),a=t.getSelections().map(l=>{const c=ft.deleteInsideWord(n,s,l);return new Fn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}re(new pEe);re(new mEe);re(new _Ee);re(new bEe);re(new CEe);re(new vEe);re(new yEe);re(new xEe);re(new LEe);re(new kEe);re(new DEe);re(new IEe);re(new wEe);re(new SEe);re(new EEe);re(new NEe);re(new TEe);re(new REe);re(new MEe);re(new PEe);re(new AEe);re(new OEe);se(FEe);class WEe extends sD{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=IL.deleteWordPartLeft(e);return i||new L(1,1,1,1)}}class BEe extends sD{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:N.writable,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=IL.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new L(n,s,n,s)}}class jZ extends nD{_move(e,t,i,n,s){return IL.moveWordPartLeft(e,t,i,s)}}class HEe extends jZ{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Ye.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class VEe extends jZ{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Ye.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class qZ extends nD{_move(e,t,i,n,s){return IL.moveWordPartRight(e,t,i)}}class zEe extends qZ{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class UEe extends qZ{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:N.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}re(new WEe);re(new BEe);re(new HEe);re(new VEe);re(new zEe);re(new UEe);class UH extends A{static{this.ID="editor.contrib.readOnlyMessageController"}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=fo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new Kn(m(1378,"Cannot edit in read-only input")):t=new Kn(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}Xe(UH.ID,UH,2);var $Ee=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$H=function(o,e){return function(t,i){e(t,i,o)}};let w2=class extends A{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=De(this,void 0);const n=ao("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=ao("_textModel.onDidChangeContent",te.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Xn(async(r,a)=>{n.read(r),s.read(r);const l=a.add(new gpe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return n.sort(ez(Bn(s=>s.range.endLineNumber-s.range.startLineNumber,uo))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};w2=$Ee([$H(1,he),$H(2,qw)],w2);Ty.setBreadcrumbsSourceFactory((o,e)=>e.createInstance(w2,o));var jEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fE=function(o,e){return function(t,i){e(t,i,o)}};let Tx=class extends A{static{this.ID="editor.contrib.floatingToolbar"}constructor(e,t,i,n){super();const s=this._register(Jt(e)),r=this._register(n.createMenu(M.EditorContent,e.contextKeyService)),a=dt(this,r.onDidChange,()=>r.getActions().length===0);this._register(xe(l=>{if(a.read(l))return;const d=Qe("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(pv,d.root,M.EditorContent,{actionViewItemProvider:(u,g)=>{if(!(u instanceof $o))return;const f=i.lookupKeybinding(u.id);if(f)return t.createInstance(class extends Eh{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${f.getLabel()})`)}},u,{...g,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(xe(u=>{const g=s.model.read(u);h.context=g?.uri})),l.store.add(s.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:Nt(0),position:Nt({preference:1})}))}))}};Tx=jEe([fE(1,fe),fE(2,st),fE(3,Er)],Tx);Xe(Tx.ID,Tx,1);var S2;(function(o){o.inspectTokensAction=m(786,"Developer: Inspect Tokens")})(S2||(S2={}));var Rx;(function(o){o.gotoLineActionLabel=m(787,"Go to Line/Column...")})(Rx||(Rx={}));var y2;(function(o){o.helpQuickAccessActionLabel=m(788,"Show all Quick Access Providers")})(y2||(y2={}));var Mx;(function(o){o.quickCommandActionLabel=m(789,"Command Palette"),o.quickCommandHelp=m(790,"Show And Run Commands")})(Mx||(Mx={}));var $v;(function(o){o.quickOutlineActionLabel=m(791,"Go to Symbol..."),o.quickOutlineByCategoryActionLabel=m(792,"Go to Symbol by Category...")})($v||($v={}));var x2;(function(o){o.editorViewAccessibleLabel=m(793,"Editor content")})(x2||(x2={}));var L2;(function(o){o.toggleHighContrast=m(794,"Toggle High Contrast Theme")})(L2||(L2={}));var k2;(function(o){o.bulkEditServiceSummary=m(795,"Made {0} edits in {1} files")})(k2||(k2={}));class jH extends A{static{this.ID="editor.contrib.iPadShowKeyboard"}constructor(e){super(),this.editor=e,this.widget=null,Sr&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new J5(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}class J5 extends A{static{this.ID="editor.contrib.ShowKeyboardWidget"}constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(W(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(W(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return J5.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}Xe(jH.ID,jH,3);const er=We("themeService");var qEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qH=function(o,e){return function(t,i){e(t,i,o)}},D2;let jv=class extends A{static{D2=this}static{this.ID="editor.contrib.inspectTokens"}static get(e){return e.getContribution(D2.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(ui.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new e3(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};jv=D2=qEe([qH(1,er),qH(2,_i)],jv);class KEe extends le{constructor(){super({id:"editor.action.inspectTokens",label:S2.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){jv.get(t)?.launch()}}function GEe(o){let e="";for(let t=0,i=o.length;tIm,tokenize:(n,s,r)=>w4(e,r),tokenizeEncoded:(n,s,r)=>sk(i,r)}}class e3 extends A{static{this._ID="editor.contrib.inspectTokensWidget"}constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=ZEe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return e3._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const s=this._model.getLineContent(e.lineNumber);let r="";if(ii.prefix.length-t.prefix.length),ue(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Ua([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}li.add(Sf.Quickaccess,new YEe);var XEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KH=function(o,e){return function(t,i){e(t,i,o)}},wb;let E2=class{static{wb=this}static{this.PREFIX="?"}constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=li.as(Sf.Quickaccess)}provide(e){const t=new z;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(wb.PREFIX.length));n&&n.prefix&&n.prefix!==wb.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==wb.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}};E2=wb=XEe([KH(0,Jn),KH(1,st)],E2);li.as(Sf.Quickaccess).registerQuickAccessProvider({ctor:E2,prefix:"",helpEntries:[{description:y2.helpQuickAccessActionLabel}]});class KZ{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new ut);return s.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new z,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const r={editor:s},a=EK(s);if(a){let l=s.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=s.saveViewState()??void 0})),r.restoreViewState=()=>{l&&s===this.activeTextEditorControl&&s.restoreViewState(l)},n.add(yg(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(ue(()=>this.clearDecorations(s))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Pa(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return EF(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:hi(YU),position:jo.Full}}}],[r,a]=i.deltaDecorations(n,s);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class hC extends KZ{static{this.PREFIX=":"}static{this.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset"}constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(hC.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(hC.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,A.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new z;s.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(hC.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:g}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:g}],t.ariaLabel=g,!h){this.clearDecorations(n);return}const f=this.toRange(h,u);n.revealRangeInCenter(f,0),this.addDecorations(n,f)},a=new fd({title:m(1336,"Use Zero-Based Offset"),icon:G.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:Q(_w),inputActiveOptionForeground:Q(bw),inputActiveOptionBackground:Q(d_)});s.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),s.add(t.onDidChangeValue(()=>r()));const l=EK(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),s.add(ue(()=>l.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let n=parseInt(t.substring(1),10);const s=i.getValueLength();if(isNaN(n))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",s-1):m(1339,"Type a character position to go to (from 1 to {0}).",s)};{const r=n<0;this.useZeroBasedOffset||(n-=Math.sign(n)),r&&(n+=s);const a=i.getPositionAt(n);return{...a,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",a.lineNumber,a.column)}}}else{const n=t.split(/,|:|#/),s=i.getLineCount();let r=parseInt(n[0]?.trim(),10);if(n.length<1||isNaN(r))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",s)};r=r>=0?r:s+1+r,r=Math.min(Math.max(1,r),s);const a=i.getLineMaxColumn(r);let l=parseInt(n[1]?.trim(),10);return n.length<2||isNaN(l)?{lineNumber:r,column:1,label:n.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",r):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",r,a)}:(l=l>=0?l:a+l,l=Math.min(Math.max(1,l),a),{lineNumber:r,column:l,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",r,l)})}}}var QEe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GH=function(o,e){return function(t,i){e(t,i,o)}};let qv=class extends hC{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=te.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};qv=QEe([GH(0,et),GH(1,ps)],qv);let GZ=class ZZ extends le{static{this.ID="editor.action.gotoLine"}constructor(){super({id:ZZ.ID,label:Rx.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:N.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Jn).quickAccess.show(qv.PREFIX)}};se(GZ);li.as(Sf.Quickaccess).registerQuickAccessProvider({ctor:qv,prefix:qv.PREFIX,helpEntries:[{description:Rx.gotoLineActionLabel,commandId:GZ.ID}]});const YZ=[void 0,[]];function pE(o,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?JEe(o,n.values,t,i):XZ(o,e,t,i)}function JEe(o,e,t,i){let n=0;const s=[];for(const r of e){const[a,l]=XZ(o,r,t,i);if(typeof a!="number")return YZ;n+=a,s.push(...l)}return[n,eNe(s)]}function XZ(o,e,t,i){const n=Og(e.original,e.originalLowercase,t,o,o.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Lw(n)]:YZ}function eNe(o){const e=o.sort((n,s)=>n.start-s.start),t=[];let i;for(const n of e)!i||!tNe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function tNe(o,e){return!(o.end=0,r=ZH(o);let a;const l=o.split(QZ);if(l.length>1)for(const c of l){const d=ZH(c),{pathNormalized:h,normalized:u,normalizedLowercase:g}=YH(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:g,expectContiguousMatch:d}))}return{original:o,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function YH(o){let e;Ln?e=o.replace(/\//g,Da):e=o.replace(/\\/g,Da);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function XH(o){return Array.isArray(o)?N2(o.map(e=>e.original).join(QZ)):N2(o.original)}var iNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QH=function(o,e){return function(t,i){e(t,i,o)}},l0;let mg=class extends KZ{static{l0=this}static{this.PREFIX="@"}static{this.SCOPE_PREFIX=":"}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),A.None}provideWithTextEditor(e,t,i,n){const s=e.editor,r=this.getModel(s);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):A.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new z;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||n.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new tf,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(ue(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,s){const r=e.editor,a=new z;a.add(i.onDidAccept(h=>{const[u]=i.selectedItems;u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,preserveFocus:h.inBackground}),s?.handleAccept?.(u,h.inBackground),h.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:h})=>{h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new ut),d=async h=>{c?.value?.cancel(),i.busy=!1,c.value=new qt,i.busy=!0;try{const u=N2(i.value.substr(l0.PREFIX.length).trim()),g=await this.doGetSymbolPicks(l,u,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(g.length>0){if(i.items=g,h&&u.original.length===0){const f=$C(g,p=>!!(p.type!=="separator"&&p.range&&L.containsPosition(p.range.decoration,h)));f&&(i.activeItems=[f])}}else u.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d(r.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(r.revealRangeInCenter(h.range.selection,0),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,s){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(l0.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=XH(t.values[0]),d=XH(t.values.slice(1))):c=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?Se.asClassName(G.splitHorizontal):Se.asClassName(G.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const g=[];for(let _=0;_l){let F=!1;if(c!==t&&([x,k]=pE(w,{...t,values:void 0},l,v),typeof x=="number"&&(F=!0)),typeof x!="number"&&([x,k]=pE(w,c,l,v),typeof x!="number"))continue;if(!F&&d){if(S&&d.original.length>0&&([D,I]=pE(S,d)),typeof D!="number")continue;typeof x=="number"&&(x+=D)}}const T=b.tags&&b.tags.indexOf(1)>=0;g.push({index:_,kind:b.kind,score:x,label:w,ariaLabel:Gae(b.name,b.kind),description:S,highlights:T?void 0:{label:k,description:I},range:{selection:L.collapseToStart(b.selectionRange),decoration:b.range},uri:s.uri,symbolName:C,strikethrough:T,buttons:h})}const f=g.sort((_,b)=>a?this.compareByKindAndScore(_,b):this.compareByScore(_,b));let p=[];if(a){let w=function(){b&&typeof _=="number"&&C>0&&(b.label=Lg(_E[_]||mE,C))},_,b,C=0;for(const v of f)_!==v.kind?(w(),_=v.kind,C=1,b={type:"separator"},p.push(b)):C++,p.push(v);w()}else f.length>0&&(p=[{label:m(1351,"symbols ({0})",g.length),type:"separator"},...f]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=_E[e.kind]||mE,n=_E[t.kind]||mE,s=i.localeCompare(n);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}};mg=l0=iNe([QH(0,he),QH(1,qw)],mg);const mE=m(1352,"properties ({0})"),_E={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var nNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bE=function(o,e){return function(t,i){e(t,i,o)}};let T2=class extends mg{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=te.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};T2=nNe([bE(0,et),bE(1,he),bE(2,qw)],T2);class oD extends le{static{this.ID="editor.action.quickOutline"}constructor(){super({id:oD.ID,label:$v.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:N.hasDocumentSymbolProvider,kbOpts:{kbExpr:N.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Jn).quickAccess.show(mg.PREFIX,{itemActivation:_a.NONE})}}se(oD);li.as(Sf.Quickaccess).registerQuickAccessProvider({ctor:T2,prefix:mg.PREFIX,helpEntries:[{description:$v.quickOutlineActionLabel,prefix:mg.PREFIX,commandId:oD.ID},{description:$v.quickOutlineByCategoryActionLabel,prefix:mg.PREFIX_BY_CATEGORY}]});function sNe(o){const e=new Map;for(const t of o)e.set(t,(e.get(t)??0)+1);return e}class uC{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&s.push({key:r,score:c})}}return s}static termFrequencies(e){return sNe(uC.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&/\p{Letter}{3,}/gu.test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const s=uC.termFrequencies(n);for(const r of s.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=uC.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function oNe(o){const e=o.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var Sp;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(Sp||(Sp={}));function CE(o){return Array.isArray(o.items)}function JH(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class rNe extends A{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const r=n.add(new ut),a=async()=>{s?.dispose(!0),e.busy=!1;const c=r.value=new z;s=c.add(new qt(t));const d=s.token;let h=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(h=h.trim());const u=this._getPicks(h,c,d,i),g=(p,_)=>{let b,C;if(CE(p)?(b=p.items,C=p.active):b=p,b.length===0){if(_)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(wg(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},f=async p=>{let _=!1,b=!1;await Promise.all([(async()=>{typeof p.mergeDelay=="number"&&(await El(p.mergeDelay),d.isCancellationRequested)||b||(_=g(p.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await p.additionalPicks;if(d.isCancellationRequested)return;let w,v;CE(p.picks)?(w=p.picks.items,v=p.picks.active):w=p.picks;let S,x;if(CE(C)?(S=C.items,x=C.active):S=C,S.length>0||!_){let k;if(!v&&!x){const D=e.activeItems[0];D&&w.indexOf(D)!==-1&&(k=D)}g({items:[...w,...S],active:v||x||k})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})()])};if(u!==null)if(JH(u))await f(u);else if(!(u instanceof Promise))g(u);else{e.busy=!0;try{const p=await u;if(d.isCancellationRequested)return;JH(p)?await f(p):g(p)}finally{d.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(c=>{if(i?.handleAccept){c.inBackground||e.hide(),i.handleAccept?.(e.activeItems[0],c.inBackground);return}const[d]=e.selectedItems;typeof d?.accept=="function"&&(c.inBackground||e.hide(),d.accept(e.keyMods,c))}));const l=async(c,d)=>{if(typeof d.trigger!="function")return;const h=d.buttons?.indexOf(c)??-1;if(h>=0){const u=d.trigger(h,e.keyMods),g=typeof u=="number"?u:await u;if(t.isCancellationRequested)return;switch(g){case Sp.NO_ACTION:break;case Sp.CLOSE_PICKER:e.hide();break;case Sp.REFRESH_PICKER:a();break;case Sp.REMOVE_ITEM:{const f=e.items.indexOf(d);if(f!==-1){const p=e.items.slice(),_=p.splice(f,1),b=e.activeItems.filter(w=>w!==_[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=p,b&&(e.activeItems=b),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:c,item:d})=>l(c,d))),n.add(e.onDidTriggerSeparatorButton(({button:c,separator:d})=>l(c,d))),n}}new na(1e4);const aNe=new na(1e4);function lNe(o){return dNe(o,"NFD",aNe)}const cNe=/[^\u0000-\u0080]/;function dNe(o,e,t){if(!o)return o;const i=t.get(o);if(i)return i;let n;return cNe.test(o)?n=o.normalize(e):n=o,t.set(o,n),n}const hNe=(function(){const o=/[\u0300-\u036f]/g;return function(e){return lNe(e).replace(o,"")}})();var JZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hd=function(o,e){return function(t,i){e(t,i,o)}},mu,Hi;let R2=class extends rNe{static{mu=this}static{this.PREFIX=">"}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=E4(av,Xue,nj)}constructor(e,t,i,n,s,r){super(mu.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(M2)),this.options=e}async _getPicks(e,t,i,n){const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=yg(()=>{const f=new uC;f.updateDocuments(s.map(_=>({key:_.commandId,textChunks:[this.getTfIdfChunk(_)]})));const p=f.calculateScores(e,i);return oNe(p).filter(_=>_.score>mu.TFIDF_THRESHOLD).slice(0,mu.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const f of s){f.labelNoAccents??=this.normalizeForFiltering(f.label);const p=mu.WORD_FILTER(a,f.labelNoAccents)??void 0;let _;if(f.commandAlias&&(f.aliasNoAccents??=this.normalizeForFiltering(f.commandAlias),_=mu.WORD_FILTER(a,f.aliasNoAccents)??void 0),p||_)f.highlights={label:p,detail:this.options.showAlias?_:void 0},l.push(f);else if(e===f.commandId)l.push(f);else if(e.length>=3){const b=r();if(i.isCancellationRequested)return[];const C=b.find(w=>w.key===f.commandId);C&&(f.tfIdfScore=C.score,l.push(f))}}const c=new Map;for(const f of l){const p=c.get(f.label);p?(f.description=f.commandId,p.description=p.commandId):c.set(f.label,f)}l.sort((f,p)=>{if(f.tfIdfScore&&p.tfIdfScore)return f.tfIdfScore===p.tfIdfScore?f.label.localeCompare(p.label):p.tfIdfScore-f.tfIdfScore;if(f.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const _=this.commandsHistory.peek(f.commandId),b=this.commandsHistory.peek(p.commandId);if(_&&b)return _>b?-1:1;if(_)return-1;if(b)return 1;if(this.options.suggestedCommandIds){const v=this.options.suggestedCommandIds.has(f.commandId),S=this.options.suggestedCommandIds.has(p.commandId);if(v&&S)return 0;if(v)return-1;if(S)return 1}const C=f.commandCategory===l2.Developer.value,w=p.commandCategory===l2.Developer.value;return C&&!w?1:!C&&w?-1:f.label.localeCompare(p.label)});const d=[];let h=!1,u=!0,g=!!this.options.suggestedCommandIds;for(let f=0;f{const f=await this.getAdditionalCommandPicks(s,l,e,i);if(i.isCancellationRequested)return[];const p=f.map(_=>this.toCommandPick(_,n));return u&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:m(1744,"similar commands")}),p})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(s){Xo(s)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),By(s))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=hNe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}};R2=mu=JZ([Hd(1,fe),Hd(2,st),Hd(3,Pt),Hd(4,ts),Hd(5,Xw)],R2);let M2=class extends A{static{Hi=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE="commandPalette.mru.cache"}static{this.PREF_KEY_COUNTER="commandPalette.mru.counter"}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===gh.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Hi.getConfiguredCommandHistoryLength(this.configurationService),Hi.cache&&Hi.cache.limit!==this.configuredCommandsHistoryLength&&(Hi.cache.limit=this.configuredCommandsHistoryLength,Hi.hasChanges=!0))}load(){const e=this.storageService.get(Hi.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Hi.cache=new na(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}Hi.counter=this.storageService.getNumber(Hi.PREF_KEY_COUNTER,0,Hi.counter)}push(e){Hi.cache&&(Hi.cache.set(e,Hi.counter++),Hi.hasChanges=!0)}peek(e){return Hi.cache?.peek(e)}saveState(){if(!Hi.cache||!Hi.hasChanges)return;const e={usesLRU:!0,entries:[]};Hi.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Hi.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Hi.PREF_KEY_COUNTER,Hi.counter,0,0),Hi.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:Hi.DEFAULT_COMMANDS_HISTORY_LENGTH}};M2=Hi=JZ([Hd(0,ps),Hd(1,Pe),Hd(2,Mt)],M2);class uNe extends R2{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(_me(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:O4(i.label)||i.id})}return t}}var gNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$f=function(o,e){return function(t,i){e(t,i,o)}};let Kv=class extends uNe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Kv=gNe([$f(0,fe),$f(1,et),$f(2,st),$f(3,Pt),$f(4,ts),$f(5,Xw)],Kv);class rD extends le{static{this.ID="editor.action.quickCommand"}constructor(){super({id:rD.ID,label:Mx.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:N.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Jn).quickAccess.show(Kv.PREFIX)}}se(rD);li.as(Sf.Quickaccess).registerQuickAccessProvider({ctor:Kv,prefix:Kv.PREFIX,helpEntries:[{description:Mx.quickCommandHelp,commandId:rD.ID}]});var fNe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jf=function(o,e){return function(t,i){e(t,i,o)}};let P2=class extends Yg{constructor(e,t,i,n,s,r,a){super(!0,e,t,i,n,s,r,a)}};P2=fNe([jf(1,Ie),jf(2,et),jf(3,bi),jf(4,fe),jf(5,ps),jf(6,Pe)],P2);Xe(Yg.ID,P2,4);class pNe{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}function mNe(o){if(!o||!Array.isArray(o))return[];const e=[];let t=0;for(let i=0,n=o.length;i{const u=SNe(d.token,h.token);return u!==0?u:d.index-h.index});let t=0,i="000000",n="ffffff";for(;o.length>=1&&o[0].token==="";){const d=o.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const s=new CNe;for(const d of e)s.getId(d);const r=s.getId(i),a=s.getId(n),l=new t3(t,r,a),c=new i3(l);for(let d=0,h=o.length;d"u"){const n=this._match(t),s=wNe(t);i=(n.metadata|s<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const vNe=/\b(comment|string|regex|regexp)\b/;function wNe(o){const e=o.match(vNe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function SNe(o,e){return oe?1:0}class t3{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new t3(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class i3{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const s=this._children.get(i);return typeof s<"u"?s.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const s=e.indexOf(".");let r,a;s===-1?(r=e,a=""):(r=e.substring(0,s),a=e.substring(s+1));let l=this._children.get(r);typeof l>"u"&&(l=new i3(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}}function yNe(o){const e=[];for(let t=1,i=o.length;tt.fire())),o&&e.add(o.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=o?o.getProductIconTheme():new tY,s={},r=new dI,a=new dI;for(const l of i.getIcons()){const c=n.getIcon(l);if(!c)continue;const d=c.font,h=io`--vscode-icon-${x1(l.id)}-font-family`,u=io`--vscode-icon-${x1(l.id)}-content`;d?(s[d.id]=d.definition,a.push(io`${h}: ${Cd(d.id)};`,io`${u}: ${Cd(c.fontCharacter)};`),r.push(io`.codicon-${x1(l.id)}:before { content: ${Cd(c.fontCharacter)}; font-family: ${Cd(d.id)}; }`)):(a.push(io`${u}: ${Cd(c.fontCharacter)}; ${h}: 'codicon';`),r.push(io`.codicon-${x1(l.id)}:before { content: ${Cd(c.fontCharacter)}; }`))}for(const l in s){const c=s[l],d=c.weight?io`font-weight: ${d9(c.weight)};`:io``,h=c.style?io`font-style: ${d9(c.style)};`:io``,u=new dI;for(const g of c.src)u.push(io`${Ml(g.location)} format(${Cd(g.format)})`);r.push(io`@font-face { src: ${u.join(", ")}; font-family: ${Cd(l)};${d}${h} font-display: block; }`)}return r.push(io`:root { ${a.join(" ")} }`),r.join(` +`)}}}class tY{getIcon(e){const t=Uj();let i=e.defaults;for(;Se.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const xc="vs",im="vs-dark",_g="hc-black",bg="hc-light",iY=li.as(dU.ColorContribution),ENe=li.as(jU.ThemingContribution);class nY{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(c0(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,V.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=A2(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,V.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=iY.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case xc:return _r.LIGHT;case _g:return _r.HIGH_CONTRAST_DARK;case bg:return _r.HIGH_CONTRAST_LIGHT;default:return _r.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=A2(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=eY.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=qn.getForeground(s),a=qn.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}get tokenColorMap(){return[]}}function c0(o){return o===xc||o===im||o===_g||o===bg}function A2(o){switch(o){case xc:return xNe;case im:return LNe;case _g:return kNe;case bg:return DNe}}function dS(o){const e=A2(o);return new nY(o,e)}class NNe extends A{constructor(){super(),this._onColorThemeChange=this._register(new P),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new P),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new tY,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(xc,dS(xc)),this._knownThemes.set(im,dS(im)),this._knownThemes.set(_g,dS(_g)),this._knownThemes.set(bg,dS(bg));const e=this._register(INe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(xc),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),_V(wt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return N0(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Ir(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),A.None}_registerShadowDomContainer(e){const t=Ir(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(xc),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=wt.matchMedia("(forced-colors: active)").matches;if(e!==Na(this._theme.type)){let t;td(this._theme.type)?t=e?_g:im:t=e?bg:xc,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};ENe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of iY.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${AO(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` +`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(yNe(s)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join(` +`),this._updateCSS(),ui.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}class TNe extends le{constructor(){super({id:"editor.action.toggleHighContrast",label:L2.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(er),n=i.getColorTheme();Na(n.type)?(i.setTheme(this._originalThemeName||(td(n.type)?im:xc)),this._originalThemeName=null):(i.setTheme(td(n.type)?_g:bg),this._originalThemeName=n.themeName)}}se(TNe);var O2;(function(o){o[o.Unknown=0]="Unknown",o[o.Disabled=1]="Disabled",o[o.Enabled=2]="Enabled"})(O2||(O2={}));var F2;(function(o){o[o.Invoke=1]="Invoke",o[o.Auto=2]="Auto"})(F2||(F2={}));var W2;(function(o){o[o.None=0]="None",o[o.KeepWhitespace=1]="KeepWhitespace",o[o.InsertAsSnippet=4]="InsertAsSnippet"})(W2||(W2={}));var B2;(function(o){o[o.Method=0]="Method",o[o.Function=1]="Function",o[o.Constructor=2]="Constructor",o[o.Field=3]="Field",o[o.Variable=4]="Variable",o[o.Class=5]="Class",o[o.Struct=6]="Struct",o[o.Interface=7]="Interface",o[o.Module=8]="Module",o[o.Property=9]="Property",o[o.Event=10]="Event",o[o.Operator=11]="Operator",o[o.Unit=12]="Unit",o[o.Value=13]="Value",o[o.Constant=14]="Constant",o[o.Enum=15]="Enum",o[o.EnumMember=16]="EnumMember",o[o.Keyword=17]="Keyword",o[o.Text=18]="Text",o[o.Color=19]="Color",o[o.File=20]="File",o[o.Reference=21]="Reference",o[o.Customcolor=22]="Customcolor",o[o.Folder=23]="Folder",o[o.TypeParameter=24]="TypeParameter",o[o.User=25]="User",o[o.Issue=26]="Issue",o[o.Tool=27]="Tool",o[o.Snippet=28]="Snippet"})(B2||(B2={}));var H2;(function(o){o[o.Deprecated=1]="Deprecated"})(H2||(H2={}));var V2;(function(o){o[o.Invoke=0]="Invoke",o[o.TriggerCharacter=1]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(V2||(V2={}));var z2;(function(o){o[o.EXACT=0]="EXACT",o[o.ABOVE=1]="ABOVE",o[o.BELOW=2]="BELOW"})(z2||(z2={}));var U2;(function(o){o[o.NotSet=0]="NotSet",o[o.ContentFlush=1]="ContentFlush",o[o.RecoverFromMarkers=2]="RecoverFromMarkers",o[o.Explicit=3]="Explicit",o[o.Paste=4]="Paste",o[o.Undo=5]="Undo",o[o.Redo=6]="Redo"})(U2||(U2={}));var $2;(function(o){o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})($2||($2={}));var j2;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(j2||(j2={}));var q2;(function(o){o[o.None=0]="None",o[o.Keep=1]="Keep",o[o.Brackets=2]="Brackets",o[o.Advanced=3]="Advanced",o[o.Full=4]="Full"})(q2||(q2={}));var K2;(function(o){o[o.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",o[o.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",o[o.accessibilitySupport=2]="accessibilitySupport",o[o.accessibilityPageSize=3]="accessibilityPageSize",o[o.allowOverflow=4]="allowOverflow",o[o.allowVariableLineHeights=5]="allowVariableLineHeights",o[o.allowVariableFonts=6]="allowVariableFonts",o[o.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",o[o.ariaLabel=8]="ariaLabel",o[o.ariaRequired=9]="ariaRequired",o[o.autoClosingBrackets=10]="autoClosingBrackets",o[o.autoClosingComments=11]="autoClosingComments",o[o.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",o[o.autoClosingDelete=13]="autoClosingDelete",o[o.autoClosingOvertype=14]="autoClosingOvertype",o[o.autoClosingQuotes=15]="autoClosingQuotes",o[o.autoIndent=16]="autoIndent",o[o.autoIndentOnPaste=17]="autoIndentOnPaste",o[o.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",o[o.automaticLayout=19]="automaticLayout",o[o.autoSurround=20]="autoSurround",o[o.bracketPairColorization=21]="bracketPairColorization",o[o.guides=22]="guides",o[o.codeLens=23]="codeLens",o[o.codeLensFontFamily=24]="codeLensFontFamily",o[o.codeLensFontSize=25]="codeLensFontSize",o[o.colorDecorators=26]="colorDecorators",o[o.colorDecoratorsLimit=27]="colorDecoratorsLimit",o[o.columnSelection=28]="columnSelection",o[o.comments=29]="comments",o[o.contextmenu=30]="contextmenu",o[o.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",o[o.cursorBlinking=32]="cursorBlinking",o[o.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",o[o.cursorStyle=34]="cursorStyle",o[o.cursorSurroundingLines=35]="cursorSurroundingLines",o[o.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",o[o.cursorWidth=37]="cursorWidth",o[o.cursorHeight=38]="cursorHeight",o[o.disableLayerHinting=39]="disableLayerHinting",o[o.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",o[o.domReadOnly=41]="domReadOnly",o[o.dragAndDrop=42]="dragAndDrop",o[o.dropIntoEditor=43]="dropIntoEditor",o[o.editContext=44]="editContext",o[o.emptySelectionClipboard=45]="emptySelectionClipboard",o[o.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",o[o.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",o[o.extraEditorClassName=48]="extraEditorClassName",o[o.fastScrollSensitivity=49]="fastScrollSensitivity",o[o.find=50]="find",o[o.fixedOverflowWidgets=51]="fixedOverflowWidgets",o[o.folding=52]="folding",o[o.foldingStrategy=53]="foldingStrategy",o[o.foldingHighlight=54]="foldingHighlight",o[o.foldingImportsByDefault=55]="foldingImportsByDefault",o[o.foldingMaximumRegions=56]="foldingMaximumRegions",o[o.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",o[o.fontFamily=58]="fontFamily",o[o.fontInfo=59]="fontInfo",o[o.fontLigatures=60]="fontLigatures",o[o.fontSize=61]="fontSize",o[o.fontWeight=62]="fontWeight",o[o.fontVariations=63]="fontVariations",o[o.formatOnPaste=64]="formatOnPaste",o[o.formatOnType=65]="formatOnType",o[o.glyphMargin=66]="glyphMargin",o[o.gotoLocation=67]="gotoLocation",o[o.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",o[o.hover=69]="hover",o[o.inDiffEditor=70]="inDiffEditor",o[o.inlineSuggest=71]="inlineSuggest",o[o.letterSpacing=72]="letterSpacing",o[o.lightbulb=73]="lightbulb",o[o.lineDecorationsWidth=74]="lineDecorationsWidth",o[o.lineHeight=75]="lineHeight",o[o.lineNumbers=76]="lineNumbers",o[o.lineNumbersMinChars=77]="lineNumbersMinChars",o[o.linkedEditing=78]="linkedEditing",o[o.links=79]="links",o[o.matchBrackets=80]="matchBrackets",o[o.minimap=81]="minimap",o[o.mouseStyle=82]="mouseStyle",o[o.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",o[o.mouseWheelZoom=84]="mouseWheelZoom",o[o.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",o[o.multiCursorModifier=86]="multiCursorModifier",o[o.mouseMiddleClickAction=87]="mouseMiddleClickAction",o[o.multiCursorPaste=88]="multiCursorPaste",o[o.multiCursorLimit=89]="multiCursorLimit",o[o.occurrencesHighlight=90]="occurrencesHighlight",o[o.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",o[o.overtypeCursorStyle=92]="overtypeCursorStyle",o[o.overtypeOnPaste=93]="overtypeOnPaste",o[o.overviewRulerBorder=94]="overviewRulerBorder",o[o.overviewRulerLanes=95]="overviewRulerLanes",o[o.padding=96]="padding",o[o.pasteAs=97]="pasteAs",o[o.parameterHints=98]="parameterHints",o[o.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",o[o.placeholder=100]="placeholder",o[o.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",o[o.quickSuggestions=102]="quickSuggestions",o[o.quickSuggestionsDelay=103]="quickSuggestionsDelay",o[o.readOnly=104]="readOnly",o[o.readOnlyMessage=105]="readOnlyMessage",o[o.renameOnType=106]="renameOnType",o[o.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",o[o.renderControlCharacters=108]="renderControlCharacters",o[o.renderFinalNewline=109]="renderFinalNewline",o[o.renderLineHighlight=110]="renderLineHighlight",o[o.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",o[o.renderValidationDecorations=112]="renderValidationDecorations",o[o.renderWhitespace=113]="renderWhitespace",o[o.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",o[o.roundedSelection=115]="roundedSelection",o[o.rulers=116]="rulers",o[o.scrollbar=117]="scrollbar",o[o.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",o[o.scrollBeyondLastLine=119]="scrollBeyondLastLine",o[o.scrollPredominantAxis=120]="scrollPredominantAxis",o[o.selectionClipboard=121]="selectionClipboard",o[o.selectionHighlight=122]="selectionHighlight",o[o.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",o[o.selectionHighlightMultiline=124]="selectionHighlightMultiline",o[o.selectOnLineNumbers=125]="selectOnLineNumbers",o[o.showFoldingControls=126]="showFoldingControls",o[o.showUnused=127]="showUnused",o[o.snippetSuggestions=128]="snippetSuggestions",o[o.smartSelect=129]="smartSelect",o[o.smoothScrolling=130]="smoothScrolling",o[o.stickyScroll=131]="stickyScroll",o[o.stickyTabStops=132]="stickyTabStops",o[o.stopRenderingLineAfter=133]="stopRenderingLineAfter",o[o.suggest=134]="suggest",o[o.suggestFontSize=135]="suggestFontSize",o[o.suggestLineHeight=136]="suggestLineHeight",o[o.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",o[o.suggestSelection=138]="suggestSelection",o[o.tabCompletion=139]="tabCompletion",o[o.tabIndex=140]="tabIndex",o[o.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",o[o.unicodeHighlighting=142]="unicodeHighlighting",o[o.unusualLineTerminators=143]="unusualLineTerminators",o[o.useShadowDOM=144]="useShadowDOM",o[o.useTabStops=145]="useTabStops",o[o.wordBreak=146]="wordBreak",o[o.wordSegmenterLocales=147]="wordSegmenterLocales",o[o.wordSeparators=148]="wordSeparators",o[o.wordWrap=149]="wordWrap",o[o.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",o[o.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",o[o.wordWrapColumn=152]="wordWrapColumn",o[o.wordWrapOverride1=153]="wordWrapOverride1",o[o.wordWrapOverride2=154]="wordWrapOverride2",o[o.wrappingIndent=155]="wrappingIndent",o[o.wrappingStrategy=156]="wrappingStrategy",o[o.showDeprecated=157]="showDeprecated",o[o.inertialScroll=158]="inertialScroll",o[o.inlayHints=159]="inlayHints",o[o.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",o[o.effectiveCursorStyle=161]="effectiveCursorStyle",o[o.editorClassName=162]="editorClassName",o[o.pixelRatio=163]="pixelRatio",o[o.tabFocusMode=164]="tabFocusMode",o[o.layoutInfo=165]="layoutInfo",o[o.wrappingInfo=166]="wrappingInfo",o[o.defaultColorDecorators=167]="defaultColorDecorators",o[o.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",o[o.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",o[o.effectiveEditContext=170]="effectiveEditContext",o[o.scrollOnMiddleClick=171]="scrollOnMiddleClick",o[o.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"})(K2||(K2={}));var G2;(function(o){o[o.TextDefined=0]="TextDefined",o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})(G2||(G2={}));var Z2;(function(o){o[o.LF=0]="LF",o[o.CRLF=1]="CRLF"})(Z2||(Z2={}));var Y2;(function(o){o[o.Left=1]="Left",o[o.Center=2]="Center",o[o.Right=3]="Right"})(Y2||(Y2={}));var X2;(function(o){o[o.Increase=0]="Increase",o[o.Decrease=1]="Decrease"})(X2||(X2={}));var Q2;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(Q2||(Q2={}));var J2;(function(o){o[o.Both=0]="Both",o[o.Right=1]="Right",o[o.Left=2]="Left",o[o.None=3]="None"})(J2||(J2={}));var eP;(function(o){o[o.Type=1]="Type",o[o.Parameter=2]="Parameter"})(eP||(eP={}));var tP;(function(o){o[o.Accepted=0]="Accepted",o[o.Rejected=1]="Rejected",o[o.Ignored=2]="Ignored"})(tP||(tP={}));var iP;(function(o){o[o.Code=1]="Code",o[o.Label=2]="Label"})(iP||(iP={}));var nP;(function(o){o[o.Automatic=0]="Automatic",o[o.Explicit=1]="Explicit"})(nP||(nP={}));var sP;(function(o){o[o.DependsOnKbLayout=-1]="DependsOnKbLayout",o[o.Unknown=0]="Unknown",o[o.Backspace=1]="Backspace",o[o.Tab=2]="Tab",o[o.Enter=3]="Enter",o[o.Shift=4]="Shift",o[o.Ctrl=5]="Ctrl",o[o.Alt=6]="Alt",o[o.PauseBreak=7]="PauseBreak",o[o.CapsLock=8]="CapsLock",o[o.Escape=9]="Escape",o[o.Space=10]="Space",o[o.PageUp=11]="PageUp",o[o.PageDown=12]="PageDown",o[o.End=13]="End",o[o.Home=14]="Home",o[o.LeftArrow=15]="LeftArrow",o[o.UpArrow=16]="UpArrow",o[o.RightArrow=17]="RightArrow",o[o.DownArrow=18]="DownArrow",o[o.Insert=19]="Insert",o[o.Delete=20]="Delete",o[o.Digit0=21]="Digit0",o[o.Digit1=22]="Digit1",o[o.Digit2=23]="Digit2",o[o.Digit3=24]="Digit3",o[o.Digit4=25]="Digit4",o[o.Digit5=26]="Digit5",o[o.Digit6=27]="Digit6",o[o.Digit7=28]="Digit7",o[o.Digit8=29]="Digit8",o[o.Digit9=30]="Digit9",o[o.KeyA=31]="KeyA",o[o.KeyB=32]="KeyB",o[o.KeyC=33]="KeyC",o[o.KeyD=34]="KeyD",o[o.KeyE=35]="KeyE",o[o.KeyF=36]="KeyF",o[o.KeyG=37]="KeyG",o[o.KeyH=38]="KeyH",o[o.KeyI=39]="KeyI",o[o.KeyJ=40]="KeyJ",o[o.KeyK=41]="KeyK",o[o.KeyL=42]="KeyL",o[o.KeyM=43]="KeyM",o[o.KeyN=44]="KeyN",o[o.KeyO=45]="KeyO",o[o.KeyP=46]="KeyP",o[o.KeyQ=47]="KeyQ",o[o.KeyR=48]="KeyR",o[o.KeyS=49]="KeyS",o[o.KeyT=50]="KeyT",o[o.KeyU=51]="KeyU",o[o.KeyV=52]="KeyV",o[o.KeyW=53]="KeyW",o[o.KeyX=54]="KeyX",o[o.KeyY=55]="KeyY",o[o.KeyZ=56]="KeyZ",o[o.Meta=57]="Meta",o[o.ContextMenu=58]="ContextMenu",o[o.F1=59]="F1",o[o.F2=60]="F2",o[o.F3=61]="F3",o[o.F4=62]="F4",o[o.F5=63]="F5",o[o.F6=64]="F6",o[o.F7=65]="F7",o[o.F8=66]="F8",o[o.F9=67]="F9",o[o.F10=68]="F10",o[o.F11=69]="F11",o[o.F12=70]="F12",o[o.F13=71]="F13",o[o.F14=72]="F14",o[o.F15=73]="F15",o[o.F16=74]="F16",o[o.F17=75]="F17",o[o.F18=76]="F18",o[o.F19=77]="F19",o[o.F20=78]="F20",o[o.F21=79]="F21",o[o.F22=80]="F22",o[o.F23=81]="F23",o[o.F24=82]="F24",o[o.NumLock=83]="NumLock",o[o.ScrollLock=84]="ScrollLock",o[o.Semicolon=85]="Semicolon",o[o.Equal=86]="Equal",o[o.Comma=87]="Comma",o[o.Minus=88]="Minus",o[o.Period=89]="Period",o[o.Slash=90]="Slash",o[o.Backquote=91]="Backquote",o[o.BracketLeft=92]="BracketLeft",o[o.Backslash=93]="Backslash",o[o.BracketRight=94]="BracketRight",o[o.Quote=95]="Quote",o[o.OEM_8=96]="OEM_8",o[o.IntlBackslash=97]="IntlBackslash",o[o.Numpad0=98]="Numpad0",o[o.Numpad1=99]="Numpad1",o[o.Numpad2=100]="Numpad2",o[o.Numpad3=101]="Numpad3",o[o.Numpad4=102]="Numpad4",o[o.Numpad5=103]="Numpad5",o[o.Numpad6=104]="Numpad6",o[o.Numpad7=105]="Numpad7",o[o.Numpad8=106]="Numpad8",o[o.Numpad9=107]="Numpad9",o[o.NumpadMultiply=108]="NumpadMultiply",o[o.NumpadAdd=109]="NumpadAdd",o[o.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",o[o.NumpadSubtract=111]="NumpadSubtract",o[o.NumpadDecimal=112]="NumpadDecimal",o[o.NumpadDivide=113]="NumpadDivide",o[o.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",o[o.ABNT_C1=115]="ABNT_C1",o[o.ABNT_C2=116]="ABNT_C2",o[o.AudioVolumeMute=117]="AudioVolumeMute",o[o.AudioVolumeUp=118]="AudioVolumeUp",o[o.AudioVolumeDown=119]="AudioVolumeDown",o[o.BrowserSearch=120]="BrowserSearch",o[o.BrowserHome=121]="BrowserHome",o[o.BrowserBack=122]="BrowserBack",o[o.BrowserForward=123]="BrowserForward",o[o.MediaTrackNext=124]="MediaTrackNext",o[o.MediaTrackPrevious=125]="MediaTrackPrevious",o[o.MediaStop=126]="MediaStop",o[o.MediaPlayPause=127]="MediaPlayPause",o[o.LaunchMediaPlayer=128]="LaunchMediaPlayer",o[o.LaunchMail=129]="LaunchMail",o[o.LaunchApp2=130]="LaunchApp2",o[o.Clear=131]="Clear",o[o.MAX_VALUE=132]="MAX_VALUE"})(sP||(sP={}));var oP;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(oP||(oP={}));var rP;(function(o){o[o.Unnecessary=1]="Unnecessary",o[o.Deprecated=2]="Deprecated"})(rP||(rP={}));var aP;(function(o){o[o.Inline=1]="Inline",o[o.Gutter=2]="Gutter"})(aP||(aP={}));var lP;(function(o){o[o.Normal=1]="Normal",o[o.Underlined=2]="Underlined"})(lP||(lP={}));var cP;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.TEXTAREA=1]="TEXTAREA",o[o.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",o[o.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",o[o.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",o[o.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",o[o.CONTENT_TEXT=6]="CONTENT_TEXT",o[o.CONTENT_EMPTY=7]="CONTENT_EMPTY",o[o.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",o[o.CONTENT_WIDGET=9]="CONTENT_WIDGET",o[o.OVERVIEW_RULER=10]="OVERVIEW_RULER",o[o.SCROLLBAR=11]="SCROLLBAR",o[o.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",o[o.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(cP||(cP={}));var dP;(function(o){o[o.AIGenerated=1]="AIGenerated"})(dP||(dP={}));var hP;(function(o){o[o.Invoke=0]="Invoke",o[o.Automatic=1]="Automatic"})(hP||(hP={}));var uP;(function(o){o[o.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",o[o.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",o[o.TOP_CENTER=2]="TOP_CENTER"})(uP||(uP={}));var gP;(function(o){o[o.Left=1]="Left",o[o.Center=2]="Center",o[o.Right=4]="Right",o[o.Full=7]="Full"})(gP||(gP={}));var fP;(function(o){o[o.Word=0]="Word",o[o.Line=1]="Line",o[o.Suggest=2]="Suggest"})(fP||(fP={}));var pP;(function(o){o[o.Left=0]="Left",o[o.Right=1]="Right",o[o.None=2]="None",o[o.LeftOfInjectedText=3]="LeftOfInjectedText",o[o.RightOfInjectedText=4]="RightOfInjectedText"})(pP||(pP={}));var mP;(function(o){o[o.Off=0]="Off",o[o.On=1]="On",o[o.Relative=2]="Relative",o[o.Interval=3]="Interval",o[o.Custom=4]="Custom"})(mP||(mP={}));var _P;(function(o){o[o.None=0]="None",o[o.Text=1]="Text",o[o.Blocks=2]="Blocks"})(_P||(_P={}));var bP;(function(o){o[o.Smooth=0]="Smooth",o[o.Immediate=1]="Immediate"})(bP||(bP={}));var CP;(function(o){o[o.Auto=1]="Auto",o[o.Hidden=2]="Hidden",o[o.Visible=3]="Visible"})(CP||(CP={}));var vP;(function(o){o[o.LTR=0]="LTR",o[o.RTL=1]="RTL"})(vP||(vP={}));var wP;(function(o){o.Off="off",o.OnCode="onCode",o.On="on"})(wP||(wP={}));var SP;(function(o){o[o.Invoke=1]="Invoke",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange"})(SP||(SP={}));var yP;(function(o){o[o.File=0]="File",o[o.Module=1]="Module",o[o.Namespace=2]="Namespace",o[o.Package=3]="Package",o[o.Class=4]="Class",o[o.Method=5]="Method",o[o.Property=6]="Property",o[o.Field=7]="Field",o[o.Constructor=8]="Constructor",o[o.Enum=9]="Enum",o[o.Interface=10]="Interface",o[o.Function=11]="Function",o[o.Variable=12]="Variable",o[o.Constant=13]="Constant",o[o.String=14]="String",o[o.Number=15]="Number",o[o.Boolean=16]="Boolean",o[o.Array=17]="Array",o[o.Object=18]="Object",o[o.Key=19]="Key",o[o.Null=20]="Null",o[o.EnumMember=21]="EnumMember",o[o.Struct=22]="Struct",o[o.Event=23]="Event",o[o.Operator=24]="Operator",o[o.TypeParameter=25]="TypeParameter"})(yP||(yP={}));var xP;(function(o){o[o.Deprecated=1]="Deprecated"})(xP||(xP={}));var LP;(function(o){o[o.LTR=0]="LTR",o[o.RTL=1]="RTL"})(LP||(LP={}));var kP;(function(o){o[o.Hidden=0]="Hidden",o[o.Blink=1]="Blink",o[o.Smooth=2]="Smooth",o[o.Phase=3]="Phase",o[o.Expand=4]="Expand",o[o.Solid=5]="Solid"})(kP||(kP={}));var DP;(function(o){o[o.Line=1]="Line",o[o.Block=2]="Block",o[o.Underline=3]="Underline",o[o.LineThin=4]="LineThin",o[o.BlockOutline=5]="BlockOutline",o[o.UnderlineThin=6]="UnderlineThin"})(DP||(DP={}));var IP;(function(o){o[o.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",o[o.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",o[o.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",o[o.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(IP||(IP={}));var EP;(function(o){o[o.None=0]="None",o[o.Same=1]="Same",o[o.Indent=2]="Indent",o[o.DeepIndent=3]="DeepIndent"})(EP||(EP={}));let RNe=class{static{this.CtrlCmd=2048}static{this.Shift=1024}static{this.Alt=512}static{this.WinCtrl=256}static chord(e,t){return Mi(e,t)}};function sY(){return{editor:void 0,languages:void 0,CancellationTokenSource:qt,Emitter:P,KeyCode:sP,KeyMod:RNe,Position:R,Range:L,Selection:ae,SelectionDirection:vP,MarkerSeverity:oP,MarkerTag:rP,Uri:_e,Token:KC}}const e6="default",MNe="$initialize";let t6=!1;function NP(o){Bl&&(t6||(t6=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(o.message))}class PNe{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.method=n,this.args=s,this.type=0}}class i6{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class ANe{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=n,this.arg=s,this.type=2}}class ONe{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class FNe{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class WNe{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}async sendMessage(e,t,i){const n=String(++this._lastSentReq);return new Promise((s,r)=>{this._pendingReplies[n]={resolve:s,reject:r},this._send(new PNe(this._workerId,n,e,t,i))})}listen(e,t,i){let n=null;const s=new P({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,s),this._send(new ANe(this._workerId,n,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new FNe(this._workerId,n)),n=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}createProxyToRemoteChannel(e,t){const i={get:(n,s)=>(typeof s=="string"&&!n[s]&&(rY(s)?n[s]=r=>this.listen(e,s,r):oY(s)?n[s]=this.listen(e,s,void 0):s.charCodeAt(0)===36&&(n[s]=async(...r)=>(await t?.(),this.sendMessage(e,s,r)))),n[s])};return new Proxy(Object.create(null),i)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;if(e.err.$isError){const n=new Error;n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack,i=n}t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(n=>{this._send(new i6(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=AE(n.detail)),this._send(new i6(this._workerId,t,void 0,AE(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(n=>{this._send(new ONe(this._workerId,t,n))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(t)})),this._register(this._worker.onError(t=>{NP(t),Ee(t)})),this._protocol=new WNe({sendMessage:(t,i)=>{this._worker.postMessage(t,i)},handleMessage:(t,i,n)=>this._handleMessage(t,i,n),handleEvent:(t,i,n)=>this._handleEvent(t,i,n)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(e6,MNe,[this._worker.getId()]).then(()=>{}),this.proxy=this._protocol.createProxyToRemoteChannel(e6,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(t=>{this._onError("Worker failed to load ",t)})}_handleMessage(e,t,i){const n=this._localChannels.get(e);if(!n)return Promise.reject(new Error(`Missing channel ${e} on main thread`));const s=n[t];if(typeof s!="function")return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(s.apply(n,i))}catch(r){return Promise.reject(r)}}_handleEvent(e,t,i){const n=this._localChannels.get(e);if(!n)throw new Error(`Missing channel ${e} on main thread`);if(rY(t)){const s=n[t];if(typeof s!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);const r=s.call(n,i);if(typeof r!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return r}if(oY(t)){const s=n[t];if(typeof s!="function")throw new Error(`Missing event ${t} on main thread channel ${e}.`);return s}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function oY(o){return o[0]==="o"&&o[1]==="n"&&cl(o.charCodeAt(2))}function rY(o){return/^onDynamic/.test(o)&&cl(o.charCodeAt(9))}let yp;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?yp=globalThis.workerttPolicy:yp=Vl("defaultWorkerFactory",{createScriptURL:o=>o});function HNe(o,e){const t=o.label||"anonymous"+e,i=FA();if(i){if(typeof i.getWorker=="function")return i.getWorker("workerMain.js",t);if(typeof i.getWorkerUrl=="function"){const s=i.getWorkerUrl("workerMain.js",t);return new Worker(yp?yp.createScriptURL(s):s,{name:t,type:"module"})}}const n=o.esmModuleLocation;if(n){const s=VNe(t,n.toString(!0)),r=new Worker(yp?yp.createScriptURL(s):s,{name:t,type:"module"});return zNe(r)}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function VNe(o,e){if(!(/^((http:)|(https:)|(file:))/.test(e)&&e.substring(0,globalThis.origin.length)!==globalThis.origin)){const i=e.lastIndexOf("?"),n=e.lastIndexOf("#",i),s=i>0?new URLSearchParams(e.substring(i+1,~n?n:void 0)):new URLSearchParams;GE.addSearchParam(s,!0,!0),s.toString()?e=`${e}?${s.toString()}#${o}`:e=`${e}#${o}`}const t=new Blob([Ua([`/*${o}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(pV())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(AA())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(e)}) ?? ${JSON.stringify(e)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${o}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(t)}function zNe(o){return new Promise((e,t)=>{o.onmessage=function(i){i.data.type==="vscode-worker-ready"&&(o.onmessage=null,e(o))},o.onerror=t})}function UNe(o){return!!o&&typeof o.then=="function"}class n3 extends A{static{this.LAST_WORKER_ID=0}constructor(e){super(),this._onMessage=this._register(new P),this.onMessage=this._onMessage.event,this._onError=this._register(new P),this.onError=this._onError.event,this.id=++n3.LAST_WORKER_ID;const t=e instanceof Worker||"then"in e?e:HNe(e,this.id);UNe(t)?this.worker=t:this.worker=Promise.resolve(t),this.postMessage("-please-ignore-",[]);const i=n=>{this._onError.fire(n)};this.worker.then(n=>{n.onmessage=s=>{this._onMessage.fire(s.data)},n.onmessageerror=s=>{this._onError.fire(s)},typeof n.addEventListener=="function"&&n.addEventListener("error",i)}),this._register(ue(()=>{this.worker?.then(n=>{n.onmessage=null,n.onmessageerror=null,n.removeEventListener("error",i),n.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){Ee(n),Ee(new Error("FAILED to post message to worker",{cause:n}))}})}}class $Ne{constructor(e,t){this.esmModuleLocation=e,this.label=t}}function jNe(o,e){const t=_e.isUri(o)?new $Ne(o,e):o;return new BNe(new n3(t))}class qNe{constructor(e,t,i){const n=new Uint8Array(e*t);for(let s=0,r=e*t;st&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const n=new qNe(i,t,0);for(let s=0,r=e.length;s=this._maxCharCode?0:this._states.get(e,t)}}let vE=null;function GNe(){return vE===null&&(vE=new KNe([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),vE}let Y_=null;function ZNe(){if(Y_===null){Y_=new s_(0);const o=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=GNe()){const i=ZNe(),n=[];for(let s=1,r=e.getLineCount();s<=r;s++){const a=e.getLineContent(s),l=a.length;let c=0,d=0,h=0,u=1,g=!1,f=!1,p=!1,_=!1;for(;c=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}function aY(o){const e=[];for(const t of o){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function o3(o,e,t,i){return{red:o/255,blue:t/255,green:e/255,alpha:i}}function X_(o,e){const t=e.index,i=e[0].length;if(t===void 0)return;const n=o.positionAt(t);return{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:n.lineNumber,endColumn:n.column+i}}function XNe(o,e){if(!o)return;const t=V.Format.CSS.parseHex(e);if(t)return{range:o,color:o3(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function n6(o,e,t){if(!o||e.length!==1)return;const n=e[0].values(),s=aY(n);return{range:o,color:o3(s[0],s[1],s[2],t?s[3]:1)}}function s6(o,e,t){if(!o||e.length!==1)return;const n=e[0].values(),s=aY(n),r=new V(new jr(s[0],s[1]/100,s[2]/100,t?s[3]:1));return{range:o,color:o3(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function Q_(o,e){return typeof o=="string"?[...o.matchAll(e)]:o.findMatches(e)}function QNe(o){const e=[],i=Q_(o,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const s=n.filter(c=>c!==void 0),r=s[1],a=s[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=n6(X_(o,n),Q_(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=n6(X_(o,n),Q_(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=s6(X_(o,n),Q_(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;l=s6(X_(o,n),Q_(a,c),!0)}else r==="#"&&(l=XNe(X_(o,n),r+a));l&&e.push(l)}return e}function JNe(o){return!o||typeof o.getValue!="function"||typeof o.positionAt!="function"?[]:QNe(o)}const eTe=/^-+|-+$/g,o6=100,tTe=5;function iTe(o,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=nTe(o,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=sTe(o,e);t=t.concat(i)}return t}function nTe(o,e){const t=[],i=o.getLineCount();for(let n=1;n<=i;n++){const s=o.getLineContent(n),r=s.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:s.length+1};if(a.endColumn>a.startColumn){const l={range:a,...oTe(s.substring(r[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function sTe(o,e){const t=[],i=o.getLineCount();if(!e.markSectionHeaderRegex||e.markSectionHeaderRegex.trim()==="")return t;const n=V$(e.markSectionHeaderRegex),s=new RegExp(e.markSectionHeaderRegex,`gdm${n?"s":""}`);if(OV(s))return t;for(let r=1;r<=i;r+=o6-tTe){const a=Math.min(r+o6-1,i),l=[];for(let h=r;h<=a;h++)l.push(o.getLineContent(h));const c=l.join(` `);s.lastIndex=0;let d;for(;(d=s.exec(c))!==null;){const h=c.substring(0,d.index),u=(h.match(/\n/g)||[]).length,g=r+u,f=d[0].split(` `),p=f.length,_=g+p-1,b=h.lastIndexOf(` -`)+1,C=d.index-b+1,w=f[f.length-1],v=p===1?C+d[0].length:w.length+1,S={startLineNumber:g,startColumn:C,endLineNumber:_,endColumn:v},L=(d.groups??{}).label??"",x=((d.groups??{}).separator??"")!=="",k={range:S,text:L,hasSeparatorLine:x,shouldBeInComments:!0};(k.text||k.hasSeparatorLine)&&(t.length===0||t[t.length-1].range.endLineNumberthis._checkStopModelSync(),Math.round(jV/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)vt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>jV&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const s=new z;s.add(i.onDidChangeContent(r=>{this._proxy.$acceptModelChanged(n.toString(),r)})),s.add(i.onWillDispose(()=>{this._stopModelSync(n)})),s.add(ge(()=>{this._proxy.$acceptRemovedModel(n)})),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],vt(t)}}class xMe{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}$acceptNewModel(e){this._models[e.url]=new DMe(be.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class DMe extends yMe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const s=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>s&&(i=s,n=!0)}return n?{lineNumber:t,column:i}:e}}class XC{constructor(e=null){this._foreignModule=e,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new xMe}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?sW.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?CMe(i,t):[]}async $computeDiff(e,t,i,n){const s=this._getModel(e),r=this._getModel(t);return!s||!r?null:XC.computeDiff(s,r,i,n)}static computeDiff(e,t,i,n){const s=n==="advanced"?E2.getDefault():E2.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=s.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])])}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let s=1;s<=i;s++){const r=e.getLineContent(s),a=t.getLineContent(s);if(r!==a)return!1}return!0}static{this._diffLimit=1e5}async $computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const s=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return D.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,h=c.range?0:1;return d-h});let a=0;for(let l=1;lXC._diffLimit){s.push({range:l,text:c});continue}const u=cSe(h,c,i),g=n.offsetAt(D.lift(l).getStartPosition());for(const f of u){const p=n.positionAt(g+f.originalStart),_=n.positionAt(g+f.originalStart+f.originalLength),b={text:c.substr(f.modifiedStart,f.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};n.getValueInRange(b.range)!==b.text&&s.push(b)}}return typeof r=="number"&&s.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(e){const t=this._getModel(e);return t?gMe(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?mMe(t):null}static{this._suggestionsLimit=1e4}async $textualSuggest(e,t,i,n){const s=new fn,r=new RegExp(i,n),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>XC._suggestionsLimit))break e}}return{words:Array.from(a),duration:s.elapsed()}}async $computeWordRanges(e,t,i,n){const s=this._getModel(e);if(!s)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let l=t.startLineNumber;l=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ig=function(o,e){return function(t,i){e(t,i,o)}};const qV=300*1e3;function ng(o,e){const t=o.getModel(e);return!(!t||t.isTooLargeForSyncing())}let UA=class extends F{constructor(e,t,i,n,s,r){super(),this._languageConfigurationService=s,this._modelService=t,this._workerManager=this._register(new $A(e,this._modelService)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(a,l)=>{if(!ng(this._modelService,a.uri))return Promise.resolve({links:[]});const d=await(await this._workerWithResources([a.uri])).$computeLinks(a.uri.toString());return d&&{links:d}}})),this._register(r.completionProvider.register("*",new kMe(this._workerManager,i,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return ng(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,n){const r=await(await this._workerWithResources([e,t],!0)).$computeDiff(e.toString(),t.toString(),i,n);if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:l(r.changes),moves:r.moves.map(c=>new FY(new _s(new Ce(c[0],c[1]),new Ce(c[2],c[3])),l(c[4])))};function l(c){return c.map(d=>new ar(new Ce(d[0],d[1]),new Ce(d[2],d[3]),d[4]?.map(h=>new Ms(new D(h[0],h[1],h[2],h[3]),new D(h[4],h[5],h[6],h[7])))))}}async computeMoreMinimalEdits(e,t,i=!1){if(ws(t)){if(!ng(this._modelService,e))return Promise.resolve(t);const n=fn.create(),s=this._workerWithResources([e]).then(r=>r.$computeMoreMinimalEdits(e.toString(),t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([s,ql(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return ng(this._modelService,e)}async navigateValueSet(e,t,i){const n=this._modelService.getModel(e);if(!n)return null;const s=this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=s.source,a=s.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,r,a)}canComputeWordRanges(e){return ng(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const n=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),s=n.source,r=n.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,s,r)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(e,t)}};UA=bW([ig(1,ri),ig(2,qk),ig(3,Ht),ig(4,ai),ig(5,ue)],UA);class kMe{constructor(e,t,i,n,s){this.languageConfigurationService=n,this.logService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const n=[];if(i.wordBasedSuggestions==="currentDocument")ng(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())ng(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&n.push(h.uri));if(n.length===0)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new D(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):D.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${r?.word||""}", wordDef: "${s}", replace: [${a.toString()}], insert: [${l.toString()}]`);const d=await(await this._workerManager.withWorker()).textualSuggest(n,r?.word,s);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:18,label:h,insertText:h,range:{insert:l,replace:a}}))}}}let $A=class extends F{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new D4).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(qV/2),kt),this._register(this._modelService.onModelRemoved(n=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>qV&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Tx(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};$A=bW([ig(1,ri)],$A);class IMe{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}}let Tx=class extends F{constructor(e,t,i){super(),this._workerDescriptorOrWorker=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(lMe(this._workerDescriptorOrWorker)),Nx.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){zA(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return zA(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new IMe(new XC(null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new LMe(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(NJ());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const n=await this.workerWithSyncedResources(e),s=i.source,r=i.flags;return n.$textualSuggest(e.map(a=>a.toString()),t,s,r)}dispose(){super.dispose(),this._disposed=!0}};Tx=bW([ig(2,ri)],Tx);function EMe(o,e){return new NMe(o,e)}class NMe extends Tx{constructor(e,t){super(t.worker,t.keepIdleModels||!1,e),this._foreignModuleHost=t.host||null,this._foreignProxy=this._getProxy().then(i=>new Proxy({},{get(n,s,r){if(s!=="then"){if(typeof s!="string")throw new Error("Not supported");return(...a)=>i.$fmr(s,a)}}}))}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}getProxy(){return this._foreignProxy}withSyncedResources(e){return this.workerWithSyncedResources(e).then(t=>this.getProxy())}}function TMe(o){return Array.isArray(o)}function RMe(o){return!TMe(o)}function QX(o){return typeof o=="string"}function KV(o){return!QX(o)}function sg(o){return!o}function ud(o,e){return o.ignoreCase&&e?e.toLowerCase():e}function GV(o){return o.replace(/[&<>'"_]/g,"-")}function MMe(o,e){console.log(`${o.languageId}: ${e}`)}function Zt(o,e){return new Error(`${o.languageId}: ${e}`)}function lh(o,e,t,i,n){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(s,function(a,l,c,d,h,u,g,f,p){return sg(c)?sg(d)?!sg(h)&&h0;){const i=o.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function AMe(o,e){let t=e;for(;t&&t.length>0;){if(o.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var OMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},FMe=function(o,e){return function(t,i){e(t,i,o)}},jA;const JX=5;class Rw{static{this._INSTANCE=new Rw(JX)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new Mm(e,t);let i=Mm.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new Mm(e,t),this._entries[i]=n,n)}}class Mm{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return Mm._equals(this,e)}push(e){return Rw.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Rw.create(this.parent,e)}}class em{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new em(this.languageId,this.state)}}class ch{static{this._INSTANCE=new ch(JX)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new QC(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new QC(e,t);const i=Mm.getStackElementId(e);let n=this._entries[i];return n||(n=new QC(e,null),this._entries[i]=n,n)}}class QC{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:ch.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof QC)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class WMe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Tv(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,r=i.state,a=bi.get(s);if(!a)return this.enterLanguage(s),this.emit(n,""),r;const l=a.tokenize(e,t,r);if(n!==0)for(const c of l.tokens)this._tokens.push(new Tv(c.offset+n,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new gF(this._tokens,e)}}class Rx{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,s=t.length,r=i!==null?i.length:0;if(n===0&&s===0&&r===0)return new Uint32Array(0);if(n===0&&s===0)return i;if(s===0&&r===0)return e;const a=new Uint32Array(n+s+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=bi.get(t);if(i){if(i instanceof jA){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}bi.isResolved(t)||e.push(bi.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=Rw.create(null,this._lexer.start);return ch.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return MF(this._languageId,i);const n=new WMe,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return JD(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Rx(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=o0(this._lexer,t.stack.state),!i))throw Zt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(const r of i){if(!KV(r.action)||!(r.action.nextEmbedded==="@pop"||r.action.hasEmbeddedEndInCases))continue;s=!0;let a=r.resolveRegex(t.stack.state);const l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(n===-1||c0&&s.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const l=e.substring(r);return this._myTokenize(l,t,i,n+r,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,g=!0;for(;g||h=l)break;g=!1;let I=this._lexer.tokenizer[b];if(!I&&(I=o0(this._lexer,b),!I))throw Zt(this._lexer,"tokenizer state is not defined: "+b);const T=a.substr(h);for(const A of I)if((h===0||!A.matchOnlyAtLineStart)&&(C=T.match(A.resolveRegex(b)),C)){w=C[0],v=A.action;break}}if(C||(C=[""],w=""),v||(h=this._lexer.maxStack)throw Zt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(v.next==="@pop"){if(d.depth<=1)throw Zt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(v.next==="@popall")d=d.popall();else{let I=lh(this._lexer,v.next,w,C,b);if(I[0]==="@"&&(I=I.substr(1)),o0(this._lexer,I))d=d.push(I);else throw Zt(this._lexer,"trying to set a next state '"+I+"' that is undefined in rule: "+this._safeRuleName(S))}}v.log&&typeof v.log=="string"&&MMe(this._lexer,this._lexer.languageId+": "+lh(this._lexer,v.log,w,C,b))}if(x===null)throw Zt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const k=I=>{const T=this._languageService.getLanguageIdByLanguageName(I)||this._languageService.getLanguageIdByMimeType(I)||I,A=this._getNestedEmbeddedLanguageData(T);if(h0)throw Zt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(C.length!==x.length+1)throw Zt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let I=0;for(let T=1;To});class CW{static colorizeElement(e,t,i,n){n=n||{};const s=n.theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(s);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;const c=d=>{const h=HMe?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,l||"",a,n).then(c,d=>console.error(d))}static async colorize(e,t,i,n){const s=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),g4(t)&&(t=t.substr(1));const a=No(t);if(!e.isRegisteredLanguageId(i))return ZV(a,r,s);const l=await bi.getOrCreate(i);return l?VMe(a,r,l,s):ZV(a,r,s)}static colorizeLine(e,t,i,n,s=4){const r=cr.isBasicASCII(e,t),a=cr.containsRTL(e,r,i);return HD(new Nd(!1,!0,e,!1,r,a,0,n,[],s,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function VMe(o,e,t,i){return new Promise((n,s)=>{const r=()=>{const a=zMe(o,e,t,i);if(t instanceof Mw){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,s);return}}n(a)};r()})}function ZV(o,e,t){let i=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let r=0,a=o.length;r")}return i.join("")}function zMe(o,e,t,i){let n=[],s=t.getInitialState();for(let r=0,a=o.length;r"),s=c.endState}return n.join("")}var UMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$Me=function(o,e){return function(t,i){e(t,i,o)}};let qA=class extends F{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new P),this._onCodeEditorAdd=this._register(new P),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new P),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new P),this._onDiffEditorAdd=this._register(new P),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new P),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new bs,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const s=await n(e,t,i);if(s!==null)return s}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return ge(t)}};qA=UMe([$Me(0,pi)],qA);var jMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},YV=function(o,e){return function(t,i){e(t,i,o)}};let Mx=class extends qA{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,n,s)=>n?this.doOpenEditor(n,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const s=t.resource.scheme;if(s===Ie.http||s===Ie.https)return i$(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,1);else{const s={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(s),e.revealPositionInCenter(s,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};Mx=jMe([YV(0,Ne),YV(1,pi)],Mx);Ge(at,Mx,0);var eQ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tQ=function(o,e){return function(t,i){e(t,i,o)}};let Px=class{get mainContainer(){return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode()??kt.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return Hh(this.mainContainer)}get activeContainerDimension(){return Hh(this.activeContainer)}get containers(){return ol(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=se.None,this.onDidLayoutActiveContainer=se.None,this.onDidLayoutContainer=se.None,this.onDidChangeActiveContainer=se.None,this.onDidAddContainer=se.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};Px=eQ([tQ(0,at)],Px);let KA=class extends Px{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};KA=eQ([tQ(1,at)],KA);Ge(rc,Px,1);var qMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},XV=function(o,e){return function(t,i){e(t,i,o)}};function r0(o){return o.scheme===Ie.file?o.fsPath:o.path}let iQ=0;class a0{constructor(e,t,i,n,s,r,a){this.id=++iQ,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class QV{constructor(e,t){this.resourceLabel=e,this.reason=t}}class JV{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===0?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(m(2030,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m(2031,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` -`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class KMe{constructor(e,t,i,n,s,r,a){this.id=++iQ,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new JV),this.removedResources.has(t)||this.removedResources.set(t,new QV(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new JV),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new QV(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class nQ{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` -`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new Mq(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class TN{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof sh){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Te(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return F.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?F.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(F.None);const i=e.actual.prepareUndoRedo();return i?Lf(i)?t(i):i.then(n=>t(n)):t(F.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||sQ);return new TN(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new l0(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new l0}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m(2032,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m(2033,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&s.push(a.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,m(2034,"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m(2035,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m(2036,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:ci.Info,message:m(2037,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m(2038,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m(2039,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;n=!0}let s;try{s=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=m(2040,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new TN([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof sh){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),s=n.getClosestPastElement();if(!s)return;if(s.groupId){const[a,l]=this._findClosestUndoElementInGroup(s.groupId);if(s!==a&&l)return this._undo(l,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return s.type===1?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:m(2041,"Would you like to undo '{0}'?",i.label),primaryButton:m(2042,"&&Yes"),cancelButton:m(2043,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m(2046,"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m(2047,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m(2048,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m(2049,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new TN([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},RN=function(o,e){return function(t,i){e(t,i,o)}};let ZA=class extends F{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new mP(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};ZA=GMe([RN(0,pi),RN(1,Ht),RN(2,yi)],ZA);Ge(Kk,ZA,1);function oQ(o){return typeof o=="string"?!1:Array.isArray(o)?o.every(oQ):!!o.exclusive}class ez{constructor(e,t,i,n,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class li{get onDidChange(){return this._onDidChange.event}constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new P}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),ge(()=>{if(i){const n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,s=>{i&&n===s._score?i.push(s.provider):(n=s._score,i=[s.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new ez(e.uri,e.getLanguageId(),i.uri,i.type,t):new ez(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const s of this._entries)if(s._score=aW(s.selector,n.uri,n.languageId,L$(e),n.notebookUri,n.notebookType),oQ(s.selector)&&s._score>0)if(t)s._score=0;else{for(const r of this._entries)r._score=0;s._score=1e3;break}this._entries.sort(li._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:rC(e.selector)&&!rC(t.selector)?1:!rC(e.selector)&&rC(t.selector)?-1:e._timet._time?-1:0}}function rC(o){return typeof o=="string"?!1:Array.isArray(o)?o.some(rC):!!o.isBuiltin}class ZMe{constructor(){this.referenceProvider=new li(this._score.bind(this)),this.renameProvider=new li(this._score.bind(this)),this.newSymbolNamesProvider=new li(this._score.bind(this)),this.codeActionProvider=new li(this._score.bind(this)),this.definitionProvider=new li(this._score.bind(this)),this.typeDefinitionProvider=new li(this._score.bind(this)),this.declarationProvider=new li(this._score.bind(this)),this.implementationProvider=new li(this._score.bind(this)),this.documentSymbolProvider=new li(this._score.bind(this)),this.inlayHintsProvider=new li(this._score.bind(this)),this.colorProvider=new li(this._score.bind(this)),this.codeLensProvider=new li(this._score.bind(this)),this.documentFormattingEditProvider=new li(this._score.bind(this)),this.documentRangeFormattingEditProvider=new li(this._score.bind(this)),this.onTypeFormattingEditProvider=new li(this._score.bind(this)),this.signatureHelpProvider=new li(this._score.bind(this)),this.hoverProvider=new li(this._score.bind(this)),this.documentHighlightProvider=new li(this._score.bind(this)),this.multiDocumentHighlightProvider=new li(this._score.bind(this)),this.selectionRangeProvider=new li(this._score.bind(this)),this.foldingRangeProvider=new li(this._score.bind(this)),this.linkProvider=new li(this._score.bind(this)),this.inlineCompletionsProvider=new li(this._score.bind(this)),this.completionProvider=new li(this._score.bind(this)),this.linkedEditingRangeProvider=new li(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new li(this._score.bind(this)),this.documentSemanticTokensProvider=new li(this._score.bind(this)),this.documentDropEditProvider=new li(this._score.bind(this)),this.documentPasteEditProvider=new li(this._score.bind(this))}_score(e){return this._notebookTypeResolver?.(e)}}Ge(ue,ZMe,1);var YMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},c0=function(o,e){return function(t,i){e(t,i,o)}};const fl=ee;let YA=class extends Oo{get _targetWindow(){return me(this._target.targetElements[0])}get _targetDocumentElement(){return me(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,s){if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=n,this._accessibilityService=s,this._messageListeners=new z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new P),this._onRequestLayout=this._register(new P),this._linkHandler=e.linkHandler,this._target="targetElements"in e.target?e.target:new XMe(e.target),e.style)switch(e.style){case 1:{e.appearance??={},e.appearance.compact??=!0,e.appearance.showPointer??=!0;break}case 2:{e.appearance??={},e.appearance.compact??=!0;break}}this._hoverPointer=e.appearance?.showPointer?fl("div.workbench-hover-pointer"):void 0,this._hover=this._register(new P5(!e.appearance?.skipFadeInAnimation)),this._hover.containerDomNode.classList.add("workbench-hover"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const r=e.appearance?.maxHeightRatio;r!==void 0&&r>0&&r<=1&&(this._maxHeightRatioRelativeToWindow=r),this._hoverPosition=e.position?.hoverPosition===void 0?3:gd(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(9)&&this.dispose()}),this._register(B(this._targetWindow,"blur",()=>this.dispose()));const a=fl("div.hover-row.markdown-hover"),l=fl("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(Si(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const u=e.content,{element:g}=this._register(this._markdownRenderer.render(u,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));l.appendChild(g)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=fl("div.hover-row.status-bar"),g=fl("div.actions");e.actions.forEach(f=>{const p=this._keybindingService.lookupKeybinding(f.commandId),_=p?p.getLabel():null;this._register(_k.render(g,{label:f.label,commandId:f.commandId,run:b=>{f.run(b),this.dispose()},iconClass:f.iconClass},_))}),u.appendChild(g),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=fl("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:e.persistence?.hideOnHover===void 0?c=typeof e.content=="string"||ld(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):c=e.persistence.hideOnHover,e.appearance?.showHoverHint){const u=fl("div.hover-row.status-bar"),g=fl("div.info");g.textContent=m(1699,"Hold {0} key to mouse over",je?"Option":"Alt"),u.appendChild(g),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];c||d.push(this._hoverContainer);const h=this._register(new tz(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new tz(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=cD(this._hoverContainer,fl("div")),n=Y(this._hoverContainer,fl("div"));i.tabIndex=0,n.tabIndex=0,this._register(B(n,"focus",s=>{e.focus(),s.preventDefault()})),this._register(B(i,"focus",s=>{t.focus(),s.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return s}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&qG(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Ya(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=XU(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:n,bottom:s,left:r}=t[0],a=n-r,l=s-i,c={top:i,right:n,bottom:s,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._target.dispose?.(),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};YA=YMe([c0(1,dt),c0(2,Oe),c0(3,Sa),c0(4,Mn)],YA);class tz extends Oo{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new _t),this._onMouseOut=this._register(new P);for(const i of this._elements)this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new Io(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class XMe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}function QMe(o){const e=o;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Ih;(function(o){o[o.AVOID=0]="AVOID",o[o.ALIGN=1]="ALIGN"})(Ih||(Ih={}));function tm(o,e,t){const i=t.mode===Ih.ALIGN?t.offset:t.offset+t.size,n=t.mode===Ih.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=o-i?i:e<=n?n-e:Math.max(o-e,0):e<=n?n-e:e<=o-i?i:0}class Ax extends F{static{this.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"]}static{this.BUBBLE_DOWN_EVENTS=["click"]}constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=F.None,this.toDisposeOnSetContainer=F.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ee(".context-view"),Rs(this.view),this.setContainer(e,t),this._register(ge(()=>this.setContainer(null,1)))}setContainer(e,t){this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=ee(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=JMe,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ee("slot"))}else this.container.appendChild(this.view);const n=new z;Ax.BUBBLE_UP_EVENTS.forEach(s=>{n.add(Ti(this.container,s,r=>{this.onDOMEvent(r,!1)}))}),Ax.BUBBLE_DOWN_EVENTS.forEach(s=>{n.add(Ti(this.container,s,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Tn(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Co(this.view),this.toDisposeOnClean=e.render(this.view)||F.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Or&&qw.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Si(e)){const f=wi(e),p=XU(e);t={top:f.top*p,left:f.left*p,width:f.width*p,height:f.height*p}}else QMe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=_o(this.view),n=Gc(this.view),s=this.delegate.anchorPosition??0,r=this.delegate.anchorAlignment??0,a=this.delegate.anchorAxisAlignment??0;let l,c;const d=St();if(a===0){const f={offset:t.top-d.pageYOffset,size:t.height,position:s===0?0:1},p={offset:t.left,size:t.width,position:r===0?0:1,mode:Ih.ALIGN};l=tm(d.innerHeight,n,f)+d.pageYOffset,Xn.intersects({start:l,end:l+n},{start:f.offset,end:f.offset+f.size})&&(p.mode=Ih.AVOID),c=tm(d.innerWidth,i,p)}else{const f={offset:t.left,size:t.width,position:r===0?0:1},p={offset:t.top,size:t.height,position:s===0?0:1,mode:Ih.ALIGN};c=tm(d.innerWidth,i,f),Xn.intersects({start:c,end:c+i},{start:f.offset,end:f.offset+f.size})&&(p.mode=Ih.AVOID),l=tm(d.innerHeight,n,p)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(s===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=wi(this.container),u=this.container.scrollTop||0,g=this.container.scrollLeft||0;this.view.style.top=`${l-(this.useFixedPosition?wi(this.view).top:h.top)+u}px`,this.view.style.left=`${c-(this.useFixedPosition?wi(this.view).left:h.left)+g}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Rs(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,me(e).document.activeElement):t&&!un(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}const JMe=` +`)+1,C=d.index-b+1,w=f[f.length-1],v=p===1?C+d[0].length:w.length+1,S={startLineNumber:g,startColumn:C,endLineNumber:_,endColumn:v},x=(d.groups??{}).label??"",k=((d.groups??{}).separator??"")!=="",D={range:S,text:x,hasSeparatorLine:k,shouldBeInComments:!0};(D.text||D.hasSeparatorLine)&&(t.length===0||t[t.length-1].range.endLineNumberthis._checkStopModelSync(),Math.round(r6/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)pt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>r6&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const s=new z;s.add(i.onDidChangeContent(r=>{this._proxy.$acceptModelChanged(n.toString(),r)})),s.add(i.onWillDispose(()=>{this._stopModelSync(n)})),s.add(ue(()=>{this._proxy.$acceptRemovedModel(n)})),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],pt(t)}}class lTe{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}$acceptNewModel(e){this._models[e.url]=new cTe(_e.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class cTe extends rTe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const s=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>s&&(i=s,n=!0)}return n?{lineNumber:t,column:i}:e}}class gC{constructor(e=null){this._foreignModule=e,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new lTe}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?q5.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?iTe(i,t):[]}async $computeDiff(e,t,i,n){const s=this._getModel(e),r=this._getModel(t);return!s||!r?null:gC.computeDiff(s,r,i,n)}static computeDiff(e,t,i,n){const s=n==="advanced"?_M.getDefault():_M.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=s.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,u.innerChanges?.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])])}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let s=1;s<=i;s++){const r=e.getLineContent(s),a=t.getLineContent(s);if(r!==a)return!1}return!0}static{this._diffLimit=1e5}async $computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const s=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return L.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,h=c.range?0:1;return d-h});let a=0;for(let l=1;lgC._diffLimit){s.push({range:l,text:c});continue}const u=qve(h,c,i),g=n.offsetAt(L.lift(l).getStartPosition());for(const f of u){const p=n.positionAt(g+f.originalStart),_=n.positionAt(g+f.originalStart+f.originalLength),b={text:c.substr(f.modifiedStart,f.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};n.getValueInRange(b.range)!==b.text&&s.push(b)}}return typeof r=="number"&&s.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(e){const t=this._getModel(e);return t?YNe(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?JNe(t):null}static{this._suggestionsLimit=1e4}async $textualSuggest(e,t,i,n){const s=new rn,r=new RegExp(i,n),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>gC._suggestionsLimit))break e}}return{words:Array.from(a),duration:s.elapsed()}}async $computeWordRanges(e,t,i,n){const s=this._getModel(e);if(!s)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let l=t.startLineNumber;l=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Mu=function(o,e){return function(t,i){e(t,i,o)}};const a6=300*1e3;function Pu(o,e){const t=o.getModel(e);return!(!t||t.isTooLargeForSyncing())}let TP=class extends A{constructor(e,t,i,n,s,r){super(),this._languageConfigurationService=s,this._modelService=t,this._workerManager=this._register(new RP(e,this._modelService)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(a,l)=>{if(!Pu(this._modelService,a.uri))return Promise.resolve({links:[]});const d=await(await this._workerWithResources([a.uri])).$computeLinks(a.uri.toString());return d&&{links:d}}})),this._register(r.completionProvider.register("*",new dTe(this._workerManager,i,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Pu(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,n){const r=await(await this._workerWithResources([e,t],!0)).$computeDiff(e.toString(),t.toString(),i,n);if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:l(r.changes),moves:r.moves.map(c=>new KG(new ls(new be(c[0],c[1]),new be(c[2],c[3])),l(c[4])))};function l(c){return c.map(d=>new Ko(new be(d[0],d[1]),new be(d[2],d[3]),d[4]?.map(h=>new ys(new L(h[0],h[1],h[2],h[3]),new L(h[4],h[5],h[6],h[7])))))}}async computeMoreMinimalEdits(e,t,i=!1){if(us(t)){if(!Pu(this._modelService,e))return Promise.resolve(t);const n=rn.create(),s=this._workerWithResources([e]).then(r=>r.$computeMoreMinimalEdits(e.toString(),t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([s,El(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Pu(this._modelService,e)}async navigateValueSet(e,t,i){const n=this._modelService.getModel(e);if(!n)return null;const s=this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=s.source,a=s.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,r,a)}canComputeWordRanges(e){return Pu(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const n=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),s=n.source,r=n.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,s,r)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(e,t)}};TP=r3([Mu(1,ei),Mu(2,Xk),Mu(3,Mt),Mu(4,ti),Mu(5,he)],TP);class dTe{constructor(e,t,i,n,s){this.languageConfigurationService=n,this.logService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const n=[];if(i.wordBasedSuggestions==="currentDocument")Pu(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())Pu(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&n.push(h.uri));if(n.length===0)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new L(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):L.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${r?.word||""}", wordDef: "${s}", replace: [${a.toString()}], insert: [${l.toString()}]`);const d=await(await this._workerManager.withWorker()).textualSuggest(n,r?.word,s);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:18,label:h,insertText:h,range:{insert:l,replace:a}}))}}}let RP=class extends A{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new fO).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(a6/2),wt),this._register(this._modelService.onModelRemoved(n=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>a6&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Ox(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};RP=r3([Mu(1,ei)],RP);class hTe{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}}let Ox=class extends A{constructor(e,t,i){super(),this._workerDescriptorOrWorker=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(jNe(this._workerDescriptorOrWorker)),Ax.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){NP(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return NP(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new hTe(new gC(null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new aTe(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(PX());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const n=await this.workerWithSyncedResources(e),s=i.source,r=i.flags;return n.$textualSuggest(e.map(a=>a.toString()),t,s,r)}dispose(){super.dispose(),this._disposed=!0}};Ox=r3([Mu(2,ei)],Ox);function uTe(o,e){return new gTe(o,e)}class gTe extends Ox{constructor(e,t){super(t.worker,t.keepIdleModels||!1,e),this._foreignModuleHost=t.host||null,this._foreignProxy=this._getProxy().then(i=>new Proxy({},{get(n,s,r){if(s!=="then"){if(typeof s!="string")throw new Error("Not supported");return(...a)=>i.$fmr(s,a)}}}))}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}getProxy(){return this._foreignProxy}withSyncedResources(e){return this.workerWithSyncedResources(e).then(t=>this.getProxy())}}function fTe(o){return Array.isArray(o)}function pTe(o){return!fTe(o)}function lY(o){return typeof o=="string"}function l6(o){return!lY(o)}function Au(o){return!o}function jc(o,e){return o.ignoreCase&&e?e.toLowerCase():e}function c6(o){return o.replace(/[&<>'"_]/g,"-")}function mTe(o,e){console.log(`${o.languageId}: ${e}`)}function zt(o,e){return new Error(`${o.languageId}: ${e}`)}function Vd(o,e,t,i,n){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(s,function(a,l,c,d,h,u,g,f,p){return Au(c)?Au(d)?!Au(h)&&h0;){const i=o.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function bTe(o,e){let t=e;for(;t&&t.length>0;){if(o.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var CTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},vTe=function(o,e){return function(t,i){e(t,i,o)}},MP;const cY=5;class Gv{static{this._INSTANCE=new Gv(cY)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new nm(e,t);let i=nm.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new nm(e,t),this._entries[i]=n,n)}}class nm{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return nm._equals(this,e)}push(e){return Gv.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Gv.create(this.parent,e)}}class xp{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new xp(this.languageId,this.state)}}class zd{static{this._INSTANCE=new zd(cY)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new fC(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new fC(e,t);const i=nm.getStackElementId(e);let n=this._entries[i];return n||(n=new fC(e,null),this._entries[i]=n,n)}}class fC{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:zd.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof fC)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class wTe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new KC(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,r=i.state,a=ui.get(s);if(!a)return this.enterLanguage(s),this.emit(n,""),r;const l=a.tokenize(e,t,r);if(n!==0)for(const c of l.tokens)this._tokens.push(new KC(c.offset+n,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new t4(this._tokens,e)}}class Fx{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,s=t.length,r=i!==null?i.length:0;if(n===0&&s===0&&r===0)return new Uint32Array(0);if(n===0&&s===0)return i;if(s===0&&r===0)return e;const a=new Uint32Array(n+s+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=ui.get(t);if(i){if(i instanceof MP){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}ui.isResolved(t)||e.push(ui.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=Gv.create(null,this._lexer.start);return zd.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return w4(this._languageId,i);const n=new wTe,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return sk(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Fx(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=hS(this._lexer,t.stack.state),!i))throw zt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(const r of i){if(!l6(r.action)||!(r.action.nextEmbedded==="@pop"||r.action.hasEmbeddedEndInCases))continue;s=!0;let a=r.resolveRegex(t.stack.state);const l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(n===-1||c0&&s.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const l=e.substring(r);return this._myTokenize(l,t,i,n+r,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,g=!0;for(;g||h=l)break;g=!1;let I=this._lexer.tokenizer[b];if(!I&&(I=hS(this._lexer,b),!I))throw zt(this._lexer,"tokenizer state is not defined: "+b);const T=a.substr(h);for(const F of I)if((h===0||!F.matchOnlyAtLineStart)&&(C=T.match(F.resolveRegex(b)),C)){w=C[0],v=F.action;break}}if(C||(C=[""],w=""),v||(h=this._lexer.maxStack)throw zt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(v.next==="@pop"){if(d.depth<=1)throw zt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(v.next==="@popall")d=d.popall();else{let I=Vd(this._lexer,v.next,w,C,b);if(I[0]==="@"&&(I=I.substr(1)),hS(this._lexer,I))d=d.push(I);else throw zt(this._lexer,"trying to set a next state '"+I+"' that is undefined in rule: "+this._safeRuleName(S))}}v.log&&typeof v.log=="string"&&mTe(this._lexer,this._lexer.languageId+": "+Vd(this._lexer,v.log,w,C,b))}if(k===null)throw zt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const D=I=>{const T=this._languageService.getLanguageIdByLanguageName(I)||this._languageService.getLanguageIdByMimeType(I)||I,F=this._getNestedEmbeddedLanguageData(T);if(h0)throw zt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(C.length!==k.length+1)throw zt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let I=0;for(let T=1;To});class a3{static colorizeElement(e,t,i,n){n=n||{};const s=n.theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(s);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;const c=d=>{const h=yTe?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,l||"",a,n).then(c,d=>console.error(d))}static async colorize(e,t,i,n){const s=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),tO(t)&&(t=t.substr(1));const a=bo(t);if(!e.isRegisteredLanguageId(i))return d6(a,r,s);const l=await ui.getOrCreate(i);return l?xTe(a,r,l,s):d6(a,r,s)}static colorizeLine(e,t,i,n,s=4){const r=Zo.isBasicASCII(e,t),a=Zo.containsRTL(e,r,i);return jL(new cd(!1,!0,e,!1,r,a,0,n,[],s,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function xTe(o,e,t,i){return new Promise((n,s)=>{const r=()=>{const a=LTe(o,e,t,i);if(t instanceof Zv){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,s);return}}n(a)};r()})}function d6(o,e,t){let i=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let r=0,a=o.length;r")}return i.join("")}function LTe(o,e,t,i){let n=[],s=t.getInitialState();for(let r=0,a=o.length;r"),s=c.endState}return n.join("")}var kTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},DTe=function(o,e){return function(t,i){e(t,i,o)}};let PP=class extends A{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new P),this._onCodeEditorAdd=this._register(new P),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new P),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new P),this._onDiffEditorAdd=this._register(new P),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new P),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new cs,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const s=await n(e,t,i);if(s!==null)return s}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return ue(t)}};PP=kTe([DTe(0,ci)],PP);var ITe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},h6=function(o,e){return function(t,i){e(t,i,o)}};let Wx=class extends PP{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,n,s)=>n?this.doOpenEditor(n,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const s=t.resource.scheme;if(s===Le.http||s===Le.https)return _z(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,1);else{const s={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(s),e.revealPositionInCenter(s,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};Wx=ITe([h6(0,Ie),h6(1,ci)],Wx);$e(et,Wx,0);var dY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hY=function(o,e){return function(t,i){e(t,i,o)}};let Bx=class{get mainContainer(){return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode()??wt.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return Ch(this.mainContainer)}get activeContainerDimension(){return Ch(this.activeContainer)}get containers(){return Ua(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=te.None,this.onDidLayoutActiveContainer=te.None,this.onDidLayoutContainer=te.None,this.onDidChangeActiveContainer=te.None,this.onDidAddContainer=te.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};Bx=dY([hY(0,et)],Bx);let AP=class extends Bx{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};AP=dY([hY(1,et)],AP);$e(Ul,Bx,1);var ETe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},u6=function(o,e){return function(t,i){e(t,i,o)}};function uS(o){return o.scheme===Le.file?o.fsPath:o.path}let uY=0;class gS{constructor(e,t,i,n,s,r,a){this.id=++uY,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class g6{constructor(e,t){this.resourceLabel=e,this.reason=t}}class f6{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===0?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(m(2030,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m(2031,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class NTe{constructor(e,t,i,n,s,r,a){this.id=++uY,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new f6),this.removedResources.has(t)||this.removedResources.set(t,new g6(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new f6),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new g6(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class gY{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new G$(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class wE{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Fd){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Ee(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return A.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?A.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(A.None);const i=e.actual.prepareUndoRedo();return i?ef(i)?t(i):i.then(n=>t(n)):t(A.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||fY);return new wE(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new fS(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new fS}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m(2032,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m(2033,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&s.push(a.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,m(2034,"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m(2035,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m(2036,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:ni.Info,message:m(2037,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m(2038,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m(2039,"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;n=!0}let s;try{s=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=m(2040,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new wE([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Fd){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),s=n.getClosestPastElement();if(!s)return;if(s.groupId){const[a,l]=this._findClosestUndoElementInGroup(s.groupId);if(s!==a&&l)return this._undo(l,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return s.type===1?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:m(2041,"Would you like to undo '{0}'?",i.label),primaryButton:m(2042,"&&Yes"),cancelButton:m(2043,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m(2046,"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m(2047,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m(2048,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m(2049,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new wE([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},SE=function(o,e){return function(t,i){e(t,i,o)}};let FP=class extends A{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new s2(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};FP=TTe([SE(0,ci),SE(1,Mt),SE(2,_i)],FP);$e(Qk,FP,1);function pY(o){return typeof o=="string"?!1:Array.isArray(o)?o.every(pY):!!o.exclusive}class p6{constructor(e,t,i,n,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class ii{get onDidChange(){return this._onDidChange.event}constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new P}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),ue(()=>{if(i){const n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,s=>{i&&n===s._score?i.push(s.provider):(n=s._score,i=[s.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new p6(e.uri,e.getLanguageId(),i.uri,i.type,t):new p6(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const s of this._entries)if(s._score=Z5(s.selector,n.uri,n.languageId,Bz(e),n.notebookUri,n.notebookType),pY(s.selector)&&s._score>0)if(t)s._score=0;else{for(const r of this._entries)r._score=0;s._score=1e3;break}this._entries.sort(ii._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Sb(e.selector)&&!Sb(t.selector)?1:!Sb(e.selector)&&Sb(t.selector)?-1:e._timet._time?-1:0}}function Sb(o){return typeof o=="string"?!1:Array.isArray(o)?o.some(Sb):!!o.isBuiltin}class RTe{constructor(){this.referenceProvider=new ii(this._score.bind(this)),this.renameProvider=new ii(this._score.bind(this)),this.newSymbolNamesProvider=new ii(this._score.bind(this)),this.codeActionProvider=new ii(this._score.bind(this)),this.definitionProvider=new ii(this._score.bind(this)),this.typeDefinitionProvider=new ii(this._score.bind(this)),this.declarationProvider=new ii(this._score.bind(this)),this.implementationProvider=new ii(this._score.bind(this)),this.documentSymbolProvider=new ii(this._score.bind(this)),this.inlayHintsProvider=new ii(this._score.bind(this)),this.colorProvider=new ii(this._score.bind(this)),this.codeLensProvider=new ii(this._score.bind(this)),this.documentFormattingEditProvider=new ii(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ii(this._score.bind(this)),this.onTypeFormattingEditProvider=new ii(this._score.bind(this)),this.signatureHelpProvider=new ii(this._score.bind(this)),this.hoverProvider=new ii(this._score.bind(this)),this.documentHighlightProvider=new ii(this._score.bind(this)),this.multiDocumentHighlightProvider=new ii(this._score.bind(this)),this.selectionRangeProvider=new ii(this._score.bind(this)),this.foldingRangeProvider=new ii(this._score.bind(this)),this.linkProvider=new ii(this._score.bind(this)),this.inlineCompletionsProvider=new ii(this._score.bind(this)),this.completionProvider=new ii(this._score.bind(this)),this.linkedEditingRangeProvider=new ii(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ii(this._score.bind(this)),this.documentSemanticTokensProvider=new ii(this._score.bind(this)),this.documentDropEditProvider=new ii(this._score.bind(this)),this.documentPasteEditProvider=new ii(this._score.bind(this))}_score(e){return this._notebookTypeResolver?.(e)}}$e(he,RTe,1);var MTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pS=function(o,e){return function(t,i){e(t,i,o)}};const Xa=J;let WP=class extends So{get _targetWindow(){return pe(this._target.targetElements[0])}get _targetDocumentElement(){return pe(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,s){if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=n,this._accessibilityService=s,this._messageListeners=new z,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new P),this._onRequestLayout=this._register(new P),this._linkHandler=e.linkHandler,this._target="targetElements"in e.target?e.target:new PTe(e.target),e.style)switch(e.style){case 1:{e.appearance??={},e.appearance.compact??=!0,e.appearance.showPointer??=!0;break}case 2:{e.appearance??={},e.appearance.compact??=!0;break}}this._hoverPointer=e.appearance?.showPointer?Xa("div.workbench-hover-pointer"):void 0,this._hover=this._register(new SF(!e.appearance?.skipFadeInAnimation)),this._hover.containerDomNode.classList.add("workbench-hover"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const r=e.appearance?.maxHeightRatio;r!==void 0&&r>0&&r<=1&&(this._maxHeightRatioRelativeToWindow=r),this._hoverPosition=e.position?.hoverPosition===void 0?3:qc(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(9)&&this.dispose()}),this._register(W(this._targetWindow,"blur",()=>this.dispose()));const a=Xa("div.hover-row.markdown-hover"),l=Xa("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(mi(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const u=e.content,{element:g}=this._register(this._markdownRenderer.render(u,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));l.appendChild(g)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const u=Xa("div.hover-row.status-bar"),g=Xa("div.actions");e.actions.forEach(f=>{const p=this._keybindingService.lookupKeybinding(f.commandId),_=p?p.getLabel():null;this._register(Sk.render(g,{label:f.label,commandId:f.commandId,run:b=>{f.run(b),this.dispose()},iconClass:f.iconClass},_))}),u.appendChild(g),this._hover.containerDomNode.appendChild(u)}this._hoverContainer=Xa("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:e.persistence?.hideOnHover===void 0?c=typeof e.content=="string"||Vc(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):c=e.persistence.hideOnHover,e.appearance?.showHoverHint){const u=Xa("div.hover-row.status-bar"),g=Xa("div.info");g.textContent=m(1699,"Hold {0} key to mouse over",ze?"Option":"Alt"),u.appendChild(g),this._hover.containerDomNode.appendChild(u)}const d=[...this._target.targetElements];c||d.push(this._hoverContainer);const h=this._register(new m6(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new m6(u)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=fL(this._hoverContainer,Xa("div")),n=Z(this._hoverContainer,Xa("div"));i.tabIndex=0,n.tabIndex=0,this._register(W(n,"focus",s=>{e.focus(),s.preventDefault()})),this._register(W(i,"focus",s=>{t.focus(),s.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return s}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&iK(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Pa(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=uz(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:n,bottom:s,left:r}=t[0],a=n-r,l=s-i,c={top:i,right:n,bottom:s,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._target.dispose?.(),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};WP=MTe([pS(1,st),pS(2,Pe),pS(3,aa),pS(4,kn)],WP);class m6 extends So{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new ut),this._onMouseOut=this._register(new P);for(const i of this._elements)this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new mo(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class PTe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}function ATe(o){const e=o;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var ah;(function(o){o[o.AVOID=0]="AVOID",o[o.ALIGN=1]="ALIGN"})(ah||(ah={}));function Lp(o,e,t){const i=t.mode===ah.ALIGN?t.offset:t.offset+t.size,n=t.mode===ah.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=o-i?i:e<=n?n-e:Math.max(o-e,0):e<=n?n-e:e<=o-i?i:0}class Hx extends A{static{this.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"]}static{this.BUBBLE_DOWN_EVENTS=["click"]}constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=A.None,this.toDisposeOnSetContainer=A.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=J(".context-view"),Ss(this.view),this.setContainer(e,t),this._register(ue(()=>this.setContainer(null,1)))}setContainer(e,t){this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=J(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const s=document.createElement("style");s.textContent=OTe,this.shadowRoot.appendChild(s),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(J("slot"))}else this.container.appendChild(this.view);const n=new z;Hx.BUBBLE_UP_EVENTS.forEach(s=>{n.add(Li(this.container,s,r=>{this.onDOMEvent(r,!1)}))}),Hx.BUBBLE_DOWN_EVENTS.forEach(s=>{n.add(Li(this.container,s,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),xn(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",ro(this.view),this.toDisposeOnClean=e.render(this.view)||A.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Sr&&lw.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(mi(e)){const f=pi(e),p=uz(e);t={top:f.top*p,left:f.left*p,width:f.width*p,height:f.height*p}}else ATe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=so(this.view),n=Dc(this.view),s=this.delegate.anchorPosition??0,r=this.delegate.anchorAlignment??0,a=this.delegate.anchorAxisAlignment??0;let l,c;const d=_t();if(a===0){const f={offset:t.top-d.pageYOffset,size:t.height,position:s===0?0:1},p={offset:t.left,size:t.width,position:r===0?0:1,mode:ah.ALIGN};l=Lp(d.innerHeight,n,f)+d.pageYOffset,Un.intersects({start:l,end:l+n},{start:f.offset,end:f.offset+f.size})&&(p.mode=ah.AVOID),c=Lp(d.innerWidth,i,p)}else{const f={offset:t.left,size:t.width,position:r===0?0:1},p={offset:t.top,size:t.height,position:s===0?0:1,mode:ah.ALIGN};c=Lp(d.innerWidth,i,f),Un.intersects({start:c,end:c+i},{start:f.offset,end:f.offset+f.size})&&(p.mode=ah.AVOID),l=Lp(d.innerHeight,n,p)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(s===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=pi(this.container),u=this.container.scrollTop||0,g=this.container.scrollLeft||0;this.view.style.top=`${l-(this.useFixedPosition?pi(this.view).top:h.top)+u}px`,this.view.style.left=`${c-(this.useFixedPosition?pi(this.view).left:h.left)+g}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Ss(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,pe(e).document.activeElement):t&&!sn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}const OTe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -509,16 +508,16 @@ ${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}ge :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var e2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},t2e=function(o,e){return function(t,i){e(t,i,o)}};let Ox=class extends F{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Ax(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(me(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};Ox=e2e([t2e(0,rc)],Ox);class i2e extends Ox{getContextViewElement(){return this.contextView.getViewElement()}}function rQ(o){const e=o;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class n2e{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(hn(e)||Si(e)||e===void 0)n=e;else{this._cancellationTokenSource=new Jt;const s=this._cancellationTokenSource.token;let r;if(rQ(e)?$g(e.markdown)?r=e.markdown(s).then(a=>a??e.markdownNotSupportedFallback):r=e.markdown??e.markdownNotSupportedFallback:r=e.element(s),r instanceof Promise?(this._hoverWidget||this.show(m(1700,"Loading..."),t,i),n=await r):n=r,this.isDisposed||s.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n?.dispose()}hasContent(e){return e?ld(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var s2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sp=function(o,e){return function(t,i){e(t,i,o)}};let XA=class extends F{constructor(e,t,i,n,s,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=s,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new Ox(this._layoutService)),this._register(Sn.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:Hi(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){const s=this._createHover(e,i);if(s)return this._showHover(s,e,t),s}showDelayedHover(e,t){if(e.id===void 0&&(e.id=iz(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(zd(this._currentHoverOptions)===zd(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&zd(this._currentHoverOptions)===zd(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);if(!i){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,ql(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i}setupDelayedHover(e,t,i){const n=()=>({...typeof t=="function"?t():t,target:e});return this._setupDelayedHover(e,n,i)}setupDelayedHoverAtMouse(e,t,i){const n=s=>({...typeof t=="function"?t():t,target:{targetElements:[e],x:s!==void 0?s.x+10:void 0}});return this._setupDelayedHover(e,n,i)}_setupDelayedHover(e,t,i){const n=new z;return n.add(B(e,te.MOUSE_OVER,s=>{this.showDelayedHover(t(s),{groupId:i?.groupId})})),i?.setupKeyboardEvents&&n.add(B(e,te.KEY_DOWN,s=>{const r=new Et(s);(r.equals(10)||r.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:s=>{this.showInstantHover(t(),s)}}),n.add(ge(()=>this._delayedHovers.delete(e))),n}_createHover(e,t){if(this._currentDelayedHover=void 0,e.content===""||this._currentHover?.isLocked||(e.id===void 0&&(e.id=iz(e.content)),zd(this._currentHoverOptions)===zd(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),n=Ji();t||(i&&n?n.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=n):this._lastFocusedElementBeforeOpen=void 0);const s=new z,r=this._instantiationService.createInstance(YA,e);if(e.persistence?.sticky&&(r.isLocked=!0),e.position?.hoverPosition&&!gd(e.position.hoverPosition)&&(e.target={targetElements:Si(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),r.onDispose(()=>{this._currentHover?.domNode&&JU(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),zd(this._currentHoverOptions)===zd(e)&&this.doHideHover(),s.dispose()},void 0,s),!e.container){const a=Si(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(me(a))}if(r.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,s),e.persistence?.sticky)s.add(B(me(e.container).document,te.MOUSE_DOWN,a=>{un(a.target,r.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)s.add(B(l,te.CLICK,()=>this.hideHover()));else s.add(B(e.target,te.CLICK,()=>this.hideHover()));const a=Ji();if(a){const l=me(a).document;s.add(B(a,te.KEY_DOWN,c=>this._keyDown(c,r,!!e.persistence?.hideOnKeyDown))),s.add(B(l,te.KEY_DOWN,c=>this._keyDown(c,r,!!e.persistence?.hideOnKeyDown))),s.add(B(a,te.KEY_UP,c=>this._keyUp(c,r))),s.add(B(l,te.KEY_UP,c=>this._keyUp(c,r)))}}if("IntersectionObserver"in kt){const a=new IntersectionObserver(c=>this._intersectionChange(c,r),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;a.observe(l),s.add(ge(()=>a.disconnect()))}return this._currentHover=r,r}_showHover(e,t,i){this._contextViewHandler.showContextView(new r2e(e,i),t.container)}hideHover(e){!e&&this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=Ji();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const n=new Et(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(n,n.target).kind!==0||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){if(e.showNativeHover)return o2e(t,i);t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let s,r;const a=(g,f)=>{const p=r!==void 0;g&&(r?.dispose(),r=void 0),f&&(s?.dispose(),s=void 0),p&&(e.onDidHideHover?.(),r=void 0)},l=(g,f,p,_)=>new Io(async()=>{(!r||r.isDisposed)&&(r=new n2e(e,p||t,g>0),await r.update(typeof i=="function"?i():i,f,{...n,trapFocus:_}))},g),c=new z;let d=!1;c.add(B(t,te.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0)),c.add(B(t,te.MOUSE_UP,()=>{d=!1},!0)),c.add(B(t,te.MOUSE_LEAVE,g=>{d=!1,a(!1,g.fromElement===t)},!0)),c.add(B(t,te.MOUSE_OVER,g=>{if(s)return;const f=new z,p={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const _=b=>{p.x=b.x+10,MN(b,t)||a(!0,!0)};f.add(B(t,te.MOUSE_MOVE,_,!0))}s=f,MN(g,t)&&f.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,p))},!0));const h=g=>{if(d||s||!MN(g,t))return;const f={targetElements:[t],dispose:()=>{}},p=new z,_=()=>a(!0,!0);p.add(B(t,te.BLUR,_,!0)),p.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,f)),s=p};$a(t)||c.add(B(t,te.FOCUS,h,!0));const u={show:g=>{a(!1,!0),l(0,g,void 0,g)},hide:()=>{a(!0,!0)},update:async(g,f)=>{i=g,await r?.update(i,void 0,f)},dispose:()=>{this._managedHovers.delete(t),c.dispose(),a(!0,!0)}};return this._managedHovers.set(t,u),u}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};XA=s2e([Sp(0,pe),Sp(1,Oe),Sp(2,gr),Sp(3,dt),Sp(4,rc),Sp(5,Mn)],XA);function zd(o){if(o!==void 0)return o?.id??o}function iz(o){if(!Si(o))return typeof o=="string"?o.toString():o.value}function nz(o){const e=typeof o=="function"?o():o;if(hn(e))return GF(e);if(rQ(e))return e.markdownNotSupportedFallback}function o2e(o,e){function t(i){i?o.setAttribute("title",i):o.removeAttribute("title")}return t(nz(e)),{update:i=>t(nz(i)),show:()=>{},hide:()=>{},dispose:()=>t(void 0)}}class r2e{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function MN(o,e){return Si(o.target)&&a2e(o.target,e)===e}function a2e(o,e){for(e=e??me(o).document.body;!o.hasAttribute("custom-hover")&&o!==e;)o=o.parentElement;return o}Ge(Us,XA,1);jr((o,e)=>{const t=o.getColor(Y4);t&&(e.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});function d0(o){return Object.isFrozen(o)?o:une(o)}class En{static createEmptyModel(e){return new En({},[],[],void 0,e)}constructor(e,t,i,n,s){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof En)return t;const i=new l2e("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?K7(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return d0(i.rawConfiguration.getValue(e))},get override(){return t?d0(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return d0(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:s,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new En(s,a,[],void 0,i.logService).getValue(e);l!==void 0&&n.push({identifiers:r,value:l})}return n.length?d0(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?K7(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=kl(this.contents),i=kl(this.overrides),n=[...this.keys],s=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const r of e)if(s.push(...r.raw?Array.isArray(r.raw)?r.raw:[r.raw]:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[l]=i.filter(c=>Qt(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=bd(l.keys)):i.push(kl(a))}for(const a of r.keys)n.indexOf(a)===-1&&n.push(a)}return new En(t,n,i,!s.length||s.every(r=>r instanceof En)?void 0:s,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const n of bd([...Object.keys(this.contents),...Object.keys(t)])){let s=this.contents[n];const r=t[n];r&&(typeof s=="object"&&typeof r=="object"?(s=kl(s),this.mergeContents(s,r)):s=r),i[n]=s}return new En(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Xi(e[i])&&Xi(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=kl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=s=>{s&&(i?this.mergeContents(i,s):i=kl(s))};for(const s of this.overrides)s.identifiers.length===1&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&n(s.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Tne(this.contents,e),jh.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Qt(i.identifiers,Py(e))),1))}updateValue(e,t,i){if(N$(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),jh.test(e)){const n=Py(e),s={identifiers:n,keys:Object.keys(this.contents[e]),contents:wT(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>Qt(a.identifiers,n));r!==-1?this.overrides[r]=s:this.overrides.push(s)}}}class l2e{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||En.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:s,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new En(i,n,s,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=fi.as(rl.Configuration),n=i.getConfigurationProperties(),s=i.getExcludedConfigurationProperties(),r=this.filter(e,n,s,!0,t);e=r.raw;const a=wT(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(e),c=this.toOverrides(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,n,s){let r=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.skipUnregistered&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};const a={},l=[];for(const c in e)if(jh.test(c)&&n){const d=this.filter(e[c],t,i,!1,s);a[c]=d.raw,r=r||d.hasExcludedProperties,l.push(...d.restricted)}else{const d=t[c];d?.restricted&&l.push(c),this.shouldInclude(c,d,i,s)?a[c]=e[c]:r=!0}return{raw:a,restricted:l,hasExcludedProperties:r}}shouldInclude(e,t,i,n){if(n.exclude?.includes(e))return!1;if(n.include?.includes(e))return!0;if(n.skipRestricted&&t?.restricted||n.skipUnregistered&&!t)return!1;const s=t??i[e],r=s?typeof s.scope<"u"?s.scope:4:void 0;return r===void 0||n.scopes===void 0?!0:n.scopes.includes(r)}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(jh.test(n)){const s={};for(const r in e[n])s[r]=e[n][r];i.push({identifiers:Py(n),keys:Object.keys(s),contents:wT(s,t)})}return i}}class c2e{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=g}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class iI{constructor(e,t,i,n,s,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new gi,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=En.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of n.overrides)for(const c of l.identifiers)n.getOverrideValue(e,c)!==void 0&&a.add(c);return new c2e(e,t,n.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,s||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new En(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){n=n.merge();for(const s of this._policyConfiguration.keys)n.setValue(s,this._policyConfiguration.getValue(s))}return n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),s=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((d,h)=>(d.set(be.revive(h[0]),this.parseConfigurationModel(h[1],t)),d),new gi);return new iI(i,n,s,r,a,l,c,En.createEmptyModel(t),new gi,t)}static parseConfigurationModel(e,t){return new En(e.contents,e.keys,e.overrides,e.raw,t)}}class d2e{constructor(e,t,i,n,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=s,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=iI.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!xo(a,l)}return!0}}const Fx={kind:0},h2e={kind:1};function u2e(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class JC{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const s=n.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=JC.handleRemovals([].concat(e).concat(t));for(let n=0,s=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i"u"||n.length===0)return null;if(n.length===1&&!i)return n[0];for(let s=n.length-1;s>=0;s--){const r=n[s];if(t.contextMatchesRules(r.when))return r}return i?null:n[n.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),Fx;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,c=s.length;ld.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const n=t[i];if(JC._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function sz(o){return o?`${o.serialize()}`:"no when condition"}function oz(o){return o.extensionId?o.isBuiltinExtension?`built-in extension ${o.extensionId}`:`user extension ${o.extensionId}`:o.isDefault?"built-in":"user"}const g2e=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class f2e extends F{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:se.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new P),this._currentChords=[],this._currentChordChecker=new o4,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=im.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Io,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),Fx;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),Fx;const s=this._contextKeyService.getContext(t),r=this._currentChords.map((({keypress:a})=>a));return this._getResolver().resolve(s,r,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw hy("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(m(1702,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),Vl.enabled&&Vl.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],Vl.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=im.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=im.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[s]=i.getChords();return this._ignoreSingleModifiers=new im(s),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();s=d,r=d?[d]:[]}else[s]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,r,s);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(m(1703,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}return n}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(s,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(m(1704,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(n=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}g2e.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class im{static{this.EMPTY=new im(null)}constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}class rz{constructor(e,t,i,n,s,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?QA(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=QA(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=r,this.isBuiltinExtension=a}}function QA(o){const e=[];for(let t=0,i=o.length;tthis._getLabel(e))}getAriaLabel(){return Nbe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Tbe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Rbe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new GJ(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class Pw extends p2e{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Vc.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Vc.toString(e.keyCode)}_getElectronAccelerator(e){return Vc.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Vc.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return Pw.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Vc.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=t4[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof fd)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new fd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=QA(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new Pw(i,t)]:[]}}let L_=[],vW=[],aQ=[];function h0(o,e=!1){m2e(o,!1,e)}function m2e(o,e,t){const i=_2e(o,e);L_.push(i),i.userConfigured?aQ.push(i):vW.push(i),t&&!i.userConfigured&&L_.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function _2e(o,e){return{id:o.id,mime:o.mime,filename:o.filename,extension:o.extension,filepattern:o.filepattern,firstline:o.firstline,userConfigured:e,filenameLowercase:o.filename?o.filename.toLowerCase():void 0,extensionLowercase:o.extension?o.extension.toLowerCase():void 0,filepatternLowercase:o.filepattern?EX(o.filepattern.toLowerCase()):void 0,filepatternOnPath:o.filepattern?o.filepattern.indexOf(zi.sep)>=0:!1}}function b2e(){L_=L_.filter(o=>o.userConfigured),vW=[]}function C2e(o,e){return v2e(o,e).map(t=>t.id)}function v2e(o,e){let t;if(o)switch(o.scheme){case Ie.file:t=o.fsPath;break;case Ie.data:{t=Uh.parseMetaData(o).get(Uh.META_DATA_LABEL);break}case Ie.vscodeNotebookCell:t=void 0;break;default:t=o.path}if(!t)return[{id:"unknown",mime:Di.unknown}];t=t.toLowerCase();const i=sd(t),n=az(t,i,aQ);if(n)return[n,{id:rr,mime:Di.text}];const s=az(t,i,vW);if(s)return[s,{id:rr,mime:Di.text}];if(e){const r=w2e(e);if(r)return[r,{id:rr,mime:Di.text}]}return[{id:"unknown",mime:Di.unknown}]}function az(o,e,t){let i,n,s;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const l=a.filepatternOnPath?o:e;a.filepatternLowercase?.(l)&&(n=a)}a.extension&&(!s||a.extension.length>s.extension.length)&&e.endsWith(a.extensionLowercase)&&(s=a)}if(i)return i;if(n)return n;if(s)return s}function w2e(o){if(g4(o)&&(o=o.substr(1)),o.length>0)for(let e=L_.length-1;e>=0;e--){const t=L_[e];if(!t.firstline)continue;const i=o.match(t.firstline);if(i&&i.length>0)return t}}const u0=Object.prototype.hasOwnProperty,lz="vs.editor.nullLanguage";class S2e{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(lz,0),this._register(rr,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||lz}}class Wx extends F{static{this.instanceCount=0}constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,Wx.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new S2e,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(qm.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Wx.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},b2e();const e=[].concat(qm.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),fi.as(rl.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;u0.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)h0({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)h0({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)h0({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);wU(l)||h0({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let s=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?s=[null]:s=t.aliases),s!==null)for(const a of s)!a||a.length===0||e.aliases.push(a);const r=s!==null&&s.length>0;if(!(r&&s[0]===null)){const a=(r?s[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?u0.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return u0.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&u0.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:C2e(e,t)}}class Bx extends F{static{this.instanceCount=0}constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new P),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new P),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new P({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Bx.instanceCount++,this._registry=this._register(new Wx(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Bx.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new cz(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new cz(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=rr),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),bi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}class cz{constructor(e,t){this._value=pt(this,e,()=>t()),this.onDidChange=se.fromObservable(this._value)}get languageId(){return this._value.get()}}const JA=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,PN=/(&)?(&)([^\s&])/g;var Hx;(function(o){o[o.Right=0]="Right",o[o.Left=1]="Left"})(Hx||(Hx={}));var eO;(function(o){o[o.Above=0]="Above",o[o.Below=1]="Below"})(eO||(eO={}));class Pm extends no{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...je||oo?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(ni.addTarget(s)),this._register(B(s,te.KEY_DOWN,c=>{new Et(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(B(s,te.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){ct.stop(c,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof dz&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(c)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),oo&&this._register(B(s,te.KEY_DOWN,c=>{const d=new Et(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),ct.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),ct.stop(c,!0))})),this._register(B(this.domNode,te.MOUSE_OUT,c=>{const d=c.relatedTarget;un(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(B(this.actionsList,te.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!un(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(ni.addTarget(this.actionsList)),this._register(B(this.actionsList,Bt.Tap,c=>{let d=c.initialTarget;if(!(!d||!un(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new o1(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(B(s,Bt.Change,c=>{ct.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(B(a,te.MOUSE_UP,c=>{c.preventDefault()}));const l=me(e);s.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>i.submenuIds?.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof $i&&(d===t.length-1||d===0||t[d-1]instanceof $i))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof hz)).forEach((c,d,h)=>{c.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(xy(e)?this.styleSheet=zr(e):(Pm.globalStyleSheet||(Pm.globalStyleSheet=zr()),this.styleSheet=Pm.globalStyleSheet)),this.styleSheet.textContent=L2e(t,xy(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",s=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=s,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(B(this.element,te.MOUSE_UP,s=>{if(ct.stop(s,!0),so){if(new qn(me(this.element),s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register(B(this.element,te.CONTEXT_MENU,s=>{ct.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Y(this.element,ee("a.action-menu-item")),this._action.id===$i.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Y(this.item,ee("span.menu-item-check"+ye.asCSSSelector(Z.menuSelection))),this.check.setAttribute("role","none"),this.label=Y(this.item,ee("span.action-label")),this.options.label&&this.options.keybinding&&(Y(this.item,ee("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Tn(this.label);let e=GF(this.action.label);if(e){const t=y2e(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=JA.exec(e);if(i){e=ha(e),PN.lastIndex=0;let n=PN.exec(e);for(;n&&n[1];)n=PN.exec(e);const s=r=>r.replace(/&&/g,"&");n?this.label.append(Gw(s(e.substr(0,n.index))," "),ee("u",{"aria-hidden":"true"},n[3]),CU(s(e.substr(n.index+n[0].length))," ")):this.label.textContent=s(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.textContent=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=t??"")}}class dz extends lQ{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new z),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:Hx.Right,vertical:eO.Below},this.showScheduler=new It(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new It(()=>{this.element&&!un(Ji(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Y(this.item,ee("span.submenu-indicator"+ye.asCSSSelector(Z.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(B(this.element,te.KEY_UP,t=>{const i=new Et(t);(i.equals(17)||i.equals(3))&&(ct.stop(t,!0),this.createSubmenu(!0))})),this._register(B(this.element,te.KEY_DOWN,t=>{const i=new Et(t);Ji()===this.item&&(i.equals(17)||i.equals(3))&&ct.stop(t,!0)})),this._register(B(this.element,te.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(B(this.element,te.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(B(this.element,te.FOCUS_OUT,t=>{this.element&&!un(Ji(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){ct.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const s={top:0,left:0};return s.left=tm(e.width,t.width,{position:n.horizontal===Hx.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left{new Et(d).equals(15)&&(ct.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(B(this.submenuContainer,te.KEY_DOWN,d=>{new Et(d).equals(15)&&ct.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class hz extends r_{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function y2e(o){const e=JA,t=e.exec(o);if(!t)return o;const i=!t[1];return o.replace(e,i?"$2$3":"").trim()}function uz(o){const e=r$()[o.id];return`.codicon-${o.id}:before { content: '\\${e.toString(16)}'; }`}function L2e(o,e){let t=` +`;var FTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},WTe=function(o,e){return function(t,i){e(t,i,o)}};let Vx=class extends A{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Hx(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(pe(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};Vx=FTe([WTe(0,Ul)],Vx);class BTe extends Vx{getContextViewElement(){return this.contextView.getViewElement()}}function mY(o){const e=o;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class HTe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(nn(e)||mi(e)||e===void 0)n=e;else{this._cancellationTokenSource=new qt;const s=this._cancellationTokenSource.token;let r;if(mY(e)?wg(e.markdown)?r=e.markdown(s).then(a=>a??e.markdownNotSupportedFallback):r=e.markdown??e.markdownNotSupportedFallback:r=e.element(s),r instanceof Promise?(this._hoverWidget||this.show(m(1700,"Loading..."),t,i),n=await r):n=r,this.isDisposed||s.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n?.dispose()}hasContent(e){return e?Vc(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var VTe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qf=function(o,e){return function(t,i){e(t,i,o)}};let BP=class extends A{constructor(e,t,i,n,s,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=s,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new Vx(this._layoutService)),this._register(fn.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:Mi(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){const s=this._createHover(e,i);if(s)return this._showHover(s,e,t),s}showDelayedHover(e,t){if(e.id===void 0&&(e.id=_6(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(wd(this._currentHoverOptions)===wd(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&wd(this._currentHoverOptions)===wd(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);if(!i){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,El(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i}setupDelayedHover(e,t,i){const n=()=>({...typeof t=="function"?t():t,target:e});return this._setupDelayedHover(e,n,i)}setupDelayedHoverAtMouse(e,t,i){const n=s=>({...typeof t=="function"?t():t,target:{targetElements:[e],x:s!==void 0?s.x+10:void 0}});return this._setupDelayedHover(e,n,i)}_setupDelayedHover(e,t,i){const n=new z;return n.add(W(e,ee.MOUSE_OVER,s=>{this.showDelayedHover(t(s),{groupId:i?.groupId})})),i?.setupKeyboardEvents&&n.add(W(e,ee.KEY_DOWN,s=>{const r=new yt(s);(r.equals(10)||r.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:s=>{this.showInstantHover(t(),s)}}),n.add(ue(()=>this._delayedHovers.delete(e))),n}_createHover(e,t){if(this._currentDelayedHover=void 0,e.content===""||this._currentHover?.isLocked||(e.id===void 0&&(e.id=_6(e.content)),wd(this._currentHoverOptions)===wd(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),n=ji();t||(i&&n?n.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=n):this._lastFocusedElementBeforeOpen=void 0);const s=new z,r=this._instantiationService.createInstance(WP,e);if(e.persistence?.sticky&&(r.isLocked=!0),e.position?.hoverPosition&&!qc(e.position.hoverPosition)&&(e.target={targetElements:mi(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),r.onDispose(()=>{this._currentHover?.domNode&&fz(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),wd(this._currentHoverOptions)===wd(e)&&this.doHideHover(),s.dispose()},void 0,s),!e.container){const a=mi(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(pe(a))}if(r.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,s),e.persistence?.sticky)s.add(W(pe(e.container).document,ee.MOUSE_DOWN,a=>{sn(a.target,r.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)s.add(W(l,ee.CLICK,()=>this.hideHover()));else s.add(W(e.target,ee.CLICK,()=>this.hideHover()));const a=ji();if(a){const l=pe(a).document;s.add(W(a,ee.KEY_DOWN,c=>this._keyDown(c,r,!!e.persistence?.hideOnKeyDown))),s.add(W(l,ee.KEY_DOWN,c=>this._keyDown(c,r,!!e.persistence?.hideOnKeyDown))),s.add(W(a,ee.KEY_UP,c=>this._keyUp(c,r))),s.add(W(l,ee.KEY_UP,c=>this._keyUp(c,r)))}}if("IntersectionObserver"in wt){const a=new IntersectionObserver(c=>this._intersectionChange(c,r),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;a.observe(l),s.add(ue(()=>a.disconnect()))}return this._currentHover=r,r}_showHover(e,t,i){this._contextViewHandler.showContextView(new UTe(e,i),t.container)}hideHover(e){!e&&this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=ji();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,i){if(e.key==="Alt"){t.isLocked=!0;return}const n=new yt(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(n,n.target).kind!==0||i&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){if(e.showNativeHover)return zTe(t,i);t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let s,r;const a=(g,f)=>{const p=r!==void 0;g&&(r?.dispose(),r=void 0),f&&(s?.dispose(),s=void 0),p&&(e.onDidHideHover?.(),r=void 0)},l=(g,f,p,_)=>new mo(async()=>{(!r||r.isDisposed)&&(r=new HTe(e,p||t,g>0),await r.update(typeof i=="function"?i():i,f,{...n,trapFocus:_}))},g),c=new z;let d=!1;c.add(W(t,ee.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0)),c.add(W(t,ee.MOUSE_UP,()=>{d=!1},!0)),c.add(W(t,ee.MOUSE_LEAVE,g=>{d=!1,a(!1,g.fromElement===t)},!0)),c.add(W(t,ee.MOUSE_OVER,g=>{if(s)return;const f=new z,p={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const _=b=>{p.x=b.x+10,yE(b,t)||a(!0,!0)};f.add(W(t,ee.MOUSE_MOVE,_,!0))}s=f,yE(g,t)&&f.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,p))},!0));const h=g=>{if(d||s||!yE(g,t))return;const f={targetElements:[t],dispose:()=>{}},p=new z,_=()=>a(!0,!0);p.add(W(t,ee.BLUR,_,!0)),p.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,f)),s=p};Ia(t)||c.add(W(t,ee.FOCUS,h,!0));const u={show:g=>{a(!1,!0),l(0,g,void 0,g)},hide:()=>{a(!0,!0)},update:async(g,f)=>{i=g,await r?.update(i,void 0,f)},dispose:()=>{this._managedHovers.delete(t),c.dispose(),a(!0,!0)}};return this._managedHovers.set(t,u),u}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};BP=VTe([qf(0,fe),qf(1,Pe),qf(2,Jo),qf(3,st),qf(4,Ul),qf(5,kn)],BP);function wd(o){if(o!==void 0)return o?.id??o}function _6(o){if(!mi(o))return typeof o=="string"?o.toString():o.value}function b6(o){const e=typeof o=="function"?o():o;if(nn(e))return O4(e);if(mY(e))return e.markdownNotSupportedFallback}function zTe(o,e){function t(i){i?o.setAttribute("title",i):o.removeAttribute("title")}return t(b6(e)),{update:i=>t(b6(i)),show:()=>{},hide:()=>{},dispose:()=>t(void 0)}}class UTe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function yE(o,e){return mi(o.target)&&$Te(o.target,e)===e}function $Te(o,e){for(e=e??pe(o).document.body;!o.hasAttribute("custom-hover")&&o!==e;)o=o.parentElement;return o}$e(Ms,BP,1);Tr((o,e)=>{const t=o.getColor(WO);t&&(e.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});function mS(o){return Object.isFrozen(o)?o:mte(o)}class Sn{static createEmptyModel(e){return new Sn({},[],[],void 0,e)}constructor(e,t,i,n,s){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof Sn)return t;const i=new jTe("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?m7(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return mS(i.rawConfiguration.getValue(e))},get override(){return t?mS(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return mS(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:s,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new Sn(s,a,[],void 0,i.logService).getValue(e);l!==void 0&&n.push({identifiers:r,value:l})}return n.length?mS(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?m7(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=dl(this.contents),i=dl(this.overrides),n=[...this.keys],s=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const r of e)if(s.push(...r.raw?Array.isArray(r.raw)?r.raw:[r.raw]:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[l]=i.filter(c=>jt(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Xc(l.keys)):i.push(dl(a))}for(const a of r.keys)n.indexOf(a)===-1&&n.push(a)}return new Sn(t,n,i,!s.length||s.every(r=>r instanceof Sn)?void 0:s,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const n of Xc([...Object.keys(this.contents),...Object.keys(t)])){let s=this.contents[n];const r=t[n];r&&(typeof s=="object"&&typeof r=="object"?(s=dl(s),this.mergeContents(s,r)):s=r),i[n]=s}return new Sn(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ui(e[i])&&Ui(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=dl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=s=>{s&&(i?this.mergeContents(i,s):i=dl(s))};for(const s of this.overrides)s.identifiers.length===1&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&n(s.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Ate(this.contents,e),xh.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>jt(i.identifiers,B0(e))),1))}updateValue(e,t,i){if(jz(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),xh.test(e)){const n=B0(e),s={identifiers:n,keys:Object.keys(this.contents[e]),contents:hN(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>jt(a.identifiers,n));r!==-1?this.overrides[r]=s:this.overrides.push(s)}}}class jTe{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Sn.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:s,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Sn(i,n,s,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=li.as($a.Configuration),n=i.getConfigurationProperties(),s=i.getExcludedConfigurationProperties(),r=this.filter(e,n,s,!0,t);e=r.raw;const a=hN(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(e),c=this.toOverrides(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,n,s){let r=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.skipUnregistered&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};const a={},l=[];for(const c in e)if(xh.test(c)&&n){const d=this.filter(e[c],t,i,!1,s);a[c]=d.raw,r=r||d.hasExcludedProperties,l.push(...d.restricted)}else{const d=t[c];d?.restricted&&l.push(c),this.shouldInclude(c,d,i,s)?a[c]=e[c]:r=!0}return{raw:a,restricted:l,hasExcludedProperties:r}}shouldInclude(e,t,i,n){if(n.exclude?.includes(e))return!1;if(n.include?.includes(e))return!0;if(n.skipRestricted&&t?.restricted||n.skipUnregistered&&!t)return!1;const s=t??i[e],r=s?typeof s.scope<"u"?s.scope:4:void 0;return r===void 0||n.scopes===void 0?!0:n.scopes.includes(r)}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(xh.test(n)){const s={};for(const r in e[n])s[r]=e[n][r];i.push({identifiers:B0(n),keys:Object.keys(s),contents:hN(s,t)})}return i}}class qTe{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=g}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class aD{constructor(e,t,i,n,s,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ai,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=Sn.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of n.overrides)for(const c of l.identifiers)n.getOverrideValue(e,c)!==void 0&&a.add(c);return new qTe(e,t,n.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,s||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Sn(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){n=n.merge();for(const s of this._policyConfiguration.keys)n.setValue(s,this._policyConfiguration.getValue(s))}return n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),s=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((d,h)=>(d.set(_e.revive(h[0]),this.parseConfigurationModel(h[1],t)),d),new ai);return new aD(i,n,s,r,a,l,c,Sn.createEmptyModel(t),new ai,t)}static parseConfigurationModel(e,t){return new Sn(e.contents,e.keys,e.overrides,e.raw,t)}}class KTe{constructor(e,t,i,n,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=s,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=aD.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!go(a,l)}return!0}}const zx={kind:0},GTe={kind:1};function ZTe(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class pC{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const s=n.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=pC.handleRemovals([].concat(e).concat(t));for(let n=0,s=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i"u"||n.length===0)return null;if(n.length===1&&!i)return n[0];for(let s=n.length-1;s>=0;s--){const r=n[s];if(t.contextMatchesRules(r.when))return r}return i?null:n[n.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),zx;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,c=s.length;ld.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const n=t[i];if(pC._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function C6(o){return o?`${o.serialize()}`:"no when condition"}function v6(o){return o.extensionId?o.isBuiltinExtension?`built-in extension ${o.extensionId}`:`user extension ${o.extensionId}`:o.isDefault?"built-in":"user"}const YTe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class XTe extends A{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:te.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new P),this._currentChords=[],this._currentChordChecker=new KA,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=kp.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new mo,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),zx;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),zx;const s=this._contextKeyService.getContext(t),r=this._currentChords.map((({keypress:a})=>a));return this._getResolver().resolve(s,r,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw m0("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(m(1702,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),xl.enabled&&xl.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],xl.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=kp.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=kp.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[s]=i.getChords();return this._ignoreSingleModifiers=new kp(s),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();s=d,r=d?[d]:[]}else[s]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,r,s);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(m(1703,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}return n}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(s,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(m(1704,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(n=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}YTe.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class kp{static{this.EMPTY=new kp(null)}constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}class w6{constructor(e,t,i,n,s,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?HP(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=HP(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=r,this.isBuiltinExtension=a}}function HP(o){const e=[];for(let t=0,i=o.length;tthis._getLabel(e))}getAriaLabel(){return gme.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:fme.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return pme.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new QX(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class Yv extends QTe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return vc.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":vc.toString(e.keyCode)}_getElectronAccelerator(e){return vc.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=vc.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return Yv.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=vc.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=UA[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Kc)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Kc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=HP(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new Yv(i,t)]:[]}}let Gm=[],l3=[],_Y=[];function _S(o,e=!1){JTe(o,!1,e)}function JTe(o,e,t){const i=eRe(o,e);Gm.push(i),i.userConfigured?_Y.push(i):l3.push(i),t&&!i.userConfigured&&Gm.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function eRe(o,e){return{id:o.id,mime:o.mime,filename:o.filename,extension:o.extension,filepattern:o.filepattern,firstline:o.firstline,userConfigured:e,filenameLowercase:o.filename?o.filename.toLowerCase():void 0,extensionLowercase:o.extension?o.extension.toLowerCase():void 0,filepatternLowercase:o.filepattern?BZ(o.filepattern.toLowerCase()):void 0,filepatternOnPath:o.filepattern?o.filepattern.indexOf(Ai.sep)>=0:!1}}function tRe(){Gm=Gm.filter(o=>o.userConfigured),l3=[]}function iRe(o,e){return nRe(o,e).map(t=>t.id)}function nRe(o,e){let t;if(o)switch(o.scheme){case Le.file:t=o.fsPath;break;case Le.data:{t=Sh.parseMetaData(o).get(Sh.META_DATA_LABEL);break}case Le.vscodeNotebookCell:t=void 0;break;default:t=o.path}if(!t)return[{id:"unknown",mime:vi.unknown}];t=t.toLowerCase();const i=Fc(t),n=S6(t,i,_Y);if(n)return[n,{id:qo,mime:vi.text}];const s=S6(t,i,l3);if(s)return[s,{id:qo,mime:vi.text}];if(e){const r=sRe(e);if(r)return[r,{id:qo,mime:vi.text}]}return[{id:"unknown",mime:vi.unknown}]}function S6(o,e,t){let i,n,s;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const l=a.filepatternOnPath?o:e;a.filepatternLowercase?.(l)&&(n=a)}a.extension&&(!s||a.extension.length>s.extension.length)&&e.endsWith(a.extensionLowercase)&&(s=a)}if(i)return i;if(n)return n;if(s)return s}function sRe(o){if(tO(o)&&(o=o.substr(1)),o.length>0)for(let e=Gm.length-1;e>=0;e--){const t=Gm[e];if(!t.firstline)continue;const i=o.match(t.firstline);if(i&&i.length>0)return t}}const bS=Object.prototype.hasOwnProperty,y6="vs.editor.nullLanguage";class oRe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(y6,0),this._register(qo,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||y6}}class Ux extends A{static{this.instanceCount=0}constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new P),this.onDidChange=this._onDidChange.event,Ux.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new oRe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(mm.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Ux.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},tRe();const e=[].concat(mm.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),li.as($a.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;bS.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)_S({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)_S({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)_S({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);OV(l)||_S({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let s=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?s=[null]:s=t.aliases),s!==null)for(const a of s)!a||a.length===0||e.aliases.push(a);const r=s!==null&&s.length>0;if(!(r&&s[0]===null)){const a=(r?s[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?bS.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return bS.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&bS.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:iRe(e,t)}}class $x extends A{static{this.instanceCount=0}constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new P),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new P),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new P({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,$x.instanceCount++,this._registry=this._register(new Ux(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){$x.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new x6(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new x6(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=qo),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),ui.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}class x6{constructor(e,t){this._value=dt(this,e,()=>t()),this.onDidChange=te.fromObservable(this._value)}get languageId(){return this._value.get()}}const VP=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,xE=/(&)?(&)([^\s&])/g;var jx;(function(o){o[o.Right=0]="Right",o[o.Left=1]="Left"})(jx||(jx={}));var zP;(function(o){o[o.Above=0]="Above",o[o.Below=1]="Below"})(zP||(zP={}));class sm extends qs{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...ze||Gs?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(Xt.addTarget(s)),this._register(W(s,ee.KEY_DOWN,c=>{new yt(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(W(s,ee.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){nt.stop(c,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof L6&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(c)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),Gs&&this._register(W(s,ee.KEY_DOWN,c=>{const d=new yt(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),nt.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),nt.stop(c,!0))})),this._register(W(this.domNode,ee.MOUSE_OUT,c=>{const d=c.relatedTarget;sn(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(W(this.actionsList,ee.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!sn(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(Xt.addTarget(this.actionsList)),this._register(W(this.actionsList,Rt.Tap,c=>{let d=c.initialTarget;if(!(!d||!sn(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new ww(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(W(s,Rt.Change,c=>{nt.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(W(a,ee.MOUSE_UP,c=>{c.preventDefault()}));const l=pe(e);s.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>i.submenuIds?.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof Fi&&(d===t.length-1||d===0||t[d-1]instanceof Fi))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof k6)).forEach((c,d,h)=>{c.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(N0(e)?this.styleSheet=Ir(e):(sm.globalStyleSheet||(sm.globalStyleSheet=Ir()),this.styleSheet=sm.globalStyleSheet)),this.styleSheet.textContent=aRe(t,N0(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",s=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=s,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(W(this.element,ee.MOUSE_UP,s=>{if(nt.stop(s,!0),Ks){if(new Wn(pe(this.element),s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register(W(this.element,ee.CONTEXT_MENU,s=>{nt.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Z(this.element,J("a.action-menu-item")),this._action.id===Fi.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Z(this.item,J("span.menu-item-check"+Se.asCSSSelector(G.menuSelection))),this.check.setAttribute("role","none"),this.label=Z(this.item,J("span.action-label")),this.options.label&&this.options.keybinding&&(Z(this.item,J("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){xn(this.label);let e=O4(this.action.label);if(e){const t=rRe(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=VP.exec(e);if(i){e=Xr(e),xE.lastIndex=0;let n=xE.exec(e);for(;n&&n[1];)n=xE.exec(e);const s=r=>r.replace(/&&/g,"&");n?this.label.append(dw(s(e.substr(0,n.index))," "),J("u",{"aria-hidden":"true"},n[3]),PV(s(e.substr(n.index+n[0].length))," ")):this.label.textContent=s(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.textContent=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=t??"")}}class L6 extends bY{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new z),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:jx.Right,vertical:zP.Below},this.showScheduler=new St(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new St(()=>{this.element&&!sn(ji(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Z(this.item,J("span.submenu-indicator"+Se.asCSSSelector(G.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(W(this.element,ee.KEY_UP,t=>{const i=new yt(t);(i.equals(17)||i.equals(3))&&(nt.stop(t,!0),this.createSubmenu(!0))})),this._register(W(this.element,ee.KEY_DOWN,t=>{const i=new yt(t);ji()===this.item&&(i.equals(17)||i.equals(3))&&nt.stop(t,!0)})),this._register(W(this.element,ee.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(W(this.element,ee.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(W(this.element,ee.FOCUS_OUT,t=>{this.element&&!sn(ji(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){nt.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const s={top:0,left:0};return s.left=Lp(e.width,t.width,{position:n.horizontal===jx.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left{new yt(d).equals(15)&&(nt.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(W(this.submenuContainer,ee.KEY_DOWN,d=>{new yt(d).equals(15)&&nt.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class k6 extends Nm{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function rRe(o){const e=VP,t=e.exec(o);if(!t)return o;const i=!t[1];return o.replace(e,i?"$2$3":"").trim()}function D6(o){const e=wz()[o.id];return`.codicon-${o.id}:before { content: '\\${e.toString(16)}'; }`}function aRe(o,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${uz(Z.menuSelection)} -${uz(Z.menuSubmenu)} +${D6(G.menuSelection)} +${D6(G.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -880,29 +879,29 @@ ${uz(Z.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class x2e{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Ji();let i;const n=Si(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:s=>{this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(ee(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=B(this.block,te.MOUSE_DOWN,d=>d.stopPropagation()));const a=new z,l=e.actionRunner||a.add(new Zg);l.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Pm(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Ube),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=me(s);return a.add(B(c,te.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(B(c,te.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new qn(c,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===s)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),da(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{e.onHide?.(!!s),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Ji()===this.lastContainer||un(Ji(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!hr(e.error)&&this.notificationService.error(e.error)}}var D2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yp=function(o,e){return function(t,i){e(t,i,o)}};let tO=class extends F{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new x2e(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new P),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new P),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=iO.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Zc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};tO=D2e([yp(0,cs),yp(1,Li),yp(2,Md),yp(3,dt),yp(4,Ur),yp(5,Ne)],tO);var iO;(function(o){function e(i){return i&&i.menuId instanceof M}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{let c=[];if(r){const d=n.getMenuActions(r,l??s,a);c=Kbe(d)}return i.getActions?$i.join(i.getActions(),c):c}}}o.transform=t})(iO||(iO={}));var Vx;(function(o){o[o.API=0]="API",o[o.USER=1]="USER"})(Vx||(Vx={}));var wW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zx=function(o,e){return function(t,i){e(t,i,o)}};let nO=class{constructor(e){this._commandService=e}async open(e,t){if(!nD(e,Ie.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=be.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=DR(decodeURIComponent(e.query))}catch{try{i=DR(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};nO=wW([zx(0,Vt)],nO);let sO=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=be.parse(e));const{selection:i,uri:n}=HCe(e);return e=n,e.scheme===Ie.file&&(e=$ie(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?Vx.USER:Vx.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};sO=wW([zx(0,at)],sO);let oO=class{constructor(e,t){this._openers=new bs,this._validators=new bs,this._resolvers=new bs,this._resolvedUriTargets=new gi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new bs,this._defaultExternalOpener={openExternal:async i=>(nT(i,Ie.http,Ie.https)?i$(i):kt.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||nT(i,Ie.mailto,Ie.http,Ie.https,Ie.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new nO(t)),this._openers.push(new sO(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!t?.skipValidation){const i=typeof e=="string"?be.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const s of this._validators)if(!await s.shouldOpen(n,t))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?be.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let s;if(typeof e=="string"&&i.toString()===n.toString()?s=e:s=encodeURI(n.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(s,{sourceUri:i,preferredOpenerId:r},$e.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},$e.None)}dispose(){this._validators.clear()}};oO=wW([zx(0,at),zx(1,Vt)],oO);var k2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gz=function(o,e){return function(t,i){e(t,i,o)}};let rO=class extends F{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new P),this._suppressedRanges=new gi,this._markerDecorations=new gi,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new I2e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ie.inMemory||e.uri.scheme===Ie.internal||e.uri.scheme===Ie.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(n=>!Je.some(i,s=>D.areIntersectingOrTouching(s,n)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};rO=k2e([gz(0,ri),gz(1,ac)],rO);class I2e extends F{constructor(e){super(),this.model=e,this._map=new Wie,this._register(ge(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=age(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,s);for(const a of i)this._map.delete(a);for(let a=0;a=n)return i;const s=e.getWordAtPosition(i.getStartPosition());s&&(i=new D(i.startLineNumber,s.startColumn,i.endLineNumber,s.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var E2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},g0=function(o,e){return function(t,i){e(t,i,o)}},Tp;function Eu(o){return o.toString()}class N2e{constructor(e,t,i){this.model=e,this._modelEventListeners=new z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const T2e=oo||je?1:2;class R2e{constructor(e,t,i,n,s,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let aO=class extends F{static{Tp=this}static{this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024}constructor(e,t,i,n){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=n,this._onModelAdded=this._register(new P),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new P),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new P),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=zn.tabSize;e.editor&&typeof e.editor.tabSize<"u"&&(i=Fc(e.editor.tabSize,zn.tabSize,1,100));let n="tabSize";e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"&&(n=Fc(e.editor.indentSize,"tabSize",1,100));let s=zn.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=T2e;const a=e.eol;a===`\r + `)}return t}class lRe{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=ji();let i;const n=mi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:s=>{this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(J(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=W(this.block,ee.MOUSE_DOWN,d=>d.stopPropagation()));const a=new z,l=e.actionRunner||a.add(new kg);l.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new sm(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},kme),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=pe(s);return a.add(W(c,ee.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(W(c,ee.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Wn(c,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===s)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),Yr(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{e.onHide?.(!!s),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(ji()===this.lastContainer||sn(ji(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Xo(e.error)&&this.notificationService.error(e.error)}}var cRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kf=function(o,e){return function(t,i){e(t,i,o)}};let UP=class extends A{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new lRe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new P),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new P),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=$P.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Ic.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};UP=cRe([Kf(0,ts),Kf(1,bi),Kf(2,ud),Kf(3,st),Kf(4,Er),Kf(5,Ie)],UP);var $P;(function(o){function e(i){return i&&i.menuId instanceof M}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{let c=[];if(r){const d=n.getMenuActions(r,l??s,a);c=Nme(d)}return i.getActions?Fi.join(i.getActions(),c):c}}}o.transform=t})($P||($P={}));var qx;(function(o){o[o.API=0]="API",o[o.USER=1]="USER"})(qx||(qx={}));var c3=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kx=function(o,e){return function(t,i){e(t,i,o)}};let jP=class{constructor(e){this._commandService=e}async open(e,t){if(!lL(e,Le.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=_e.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=mT(decodeURIComponent(e.query))}catch{try{i=mT(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};jP=c3([Kx(0,Pt)],jP);let qP=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=_e.parse(e));const{selection:i,uri:n}=y_e(e);return e=n,e.scheme===Le.file&&(e=Gee(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?qx.USER:qx.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};qP=c3([Kx(0,et)],qP);let KP=class{constructor(e,t){this._openers=new cs,this._validators=new cs,this._resolvers=new cs,this._resolvedUriTargets=new ai(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new cs,this._defaultExternalOpener={openExternal:async i=>(KE(i,Le.http,Le.https)?_z(i):wt.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||KE(i,Le.mailto,Le.http,Le.https,Le.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new jP(t)),this._openers.push(new qP(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!t?.skipValidation){const i=typeof e=="string"?_e.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const s of this._validators)if(!await s.shouldOpen(n,t))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?_e.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let s;if(typeof e=="string"&&i.toString()===n.toString()?s=e:s=encodeURI(n.toString(!0)),t?.allowContributedOpeners){const r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(s,{sourceUri:i,preferredOpenerId:r},Ve.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},Ve.None)}dispose(){this._validators.clear()}};KP=c3([Kx(0,et),Kx(1,Pt)],KP);var dRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},I6=function(o,e){return function(t,i){e(t,i,o)}};let GP=class extends A{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new P),this._suppressedRanges=new ai,this._markerDecorations=new ai,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new hRe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Le.inMemory||e.uri.scheme===Le.internal||e.uri.scheme===Le.vscode)&&this._markerService?.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(n=>!Ke.some(i,s=>L.areIntersectingOrTouching(s,n)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};GP=dRe([I6(0,ei),I6(1,$l)],GP);class hRe extends A{constructor(e){super(),this.model=e,this._map=new zee,this._register(ue(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=hhe(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,s);for(const a of i)this._map.delete(a);for(let a=0;a=n)return i;const s=e.getWordAtPosition(i.getStartPosition());s&&(i=new L(i.startLineNumber,s.startColumn,i.endLineNumber,s.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var uRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CS=function(o,e){return function(t,i){e(t,i,o)}},tp;function ru(o){return o.toString()}class gRe{constructor(e,t,i){this.model=e,this._modelEventListeners=new z,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const fRe=Gs||ze?1:2;class pRe{constructor(e,t,i,n,s,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let ZP=class extends A{static{tp=this}static{this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024}constructor(e,t,i,n){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=n,this._onModelAdded=this._register(new P),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new P),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new P),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=Pn.tabSize;e.editor&&typeof e.editor.tabSize<"u"&&(i=mc(e.editor.tabSize,Pn.tabSize,1,100));let n="tabSize";e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"&&(n=mc(e.editor.indentSize,"tabSize",1,100));let s=Pn.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=fRe;const a=e.eol;a===`\r `?r=2:a===` -`&&(r=1);let l=zn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=zn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=zn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=zn.bracketPairColorizationOptions;if(e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"){const u=e.editor.bracketPairColorization;h={enabled:!!u.enabled,independentColorPoolPerBracketType:!!u.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:wo===3||wo===2?` +`&&(r=1);let l=Pn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Pn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Pn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Pn.bracketPairColorizationOptions;if(e.editor?.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"){const u=e.editor.bracketPairColorization;h={enabled:!!u.enabled,independentColorPoolPerBracketType:!!u.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:lo===3||lo===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=Tp._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(nf,e,t,s,i);if(i&&this._disposedModels.has(Eu(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const g of d.past)Bc(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of d.future)Bc(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>Bc(g)&&g.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Eu(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new N2e(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,rr,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||c.future.length>0){for(const d of c.past)Bc(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Bc(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=Tp.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(s)if(!n&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Bc(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new R2e(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);Tp._setModelOptionsForModel(e,r,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new SW}};aO=Tp=E2e([g0(0,Oe),g0(1,uX),g0(2,OF),g0(3,pe)],aO);class SW{static{this.MAX_MODEL_SIZE=10*1024*1024}canComputeSHA1(e){return e.getValueLength()<=SW.MAX_MODEL_SIZE}computeSHA1(e){const t=new p4,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}var M2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fz=function(o,e){return function(t,i){e(t,i,o)}};let lO=class extends F{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=fi.as(jf.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(ge(()=>{for(const i of this.mapProviderToDescriptor.values())Lf(i)&&i.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[n,s]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&s&&a===s){e!==s.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,s,i);return}if(s&&!i?.preserveValue){let f;if(r&&a&&a!==s){const p=r.value.substr(a.prefix.length);p&&(f=`${s.prefix}${p}`)}if(!f){const p=n?.defaultFilterValue;p===HP.LAST?f=this.lastAcceptedPickerValues.get(s):typeof p=="string"&&(f=`${s.prefix}${p}`)}typeof f=="string"&&(e=f)}const l=r?.picker?.valueSelection,c=r?.picker?.value,d=new z,h=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));h.value=e,this.adjustValueSelection(h,s,i),h.placeholder=i?.placeholder??s?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??Ma.SECOND),h.contextKey=s?.contextKey,h.filterValue=f=>f.substring(s?s.prefix.length:0);let u;t&&(u=new xf,d.add(se.once(h.onWillAccept)(f=>{f.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,s,e,i));const g=d.add(new Jt);if(n&&d.add(n.provide(h,g.token,i?.providerOptions)),se.once(h.onDidHide)(()=>{h.selectedItems.length===0&&g.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),l&&c===e&&(h.valueSelection=l),t)return u?.p}adjustValueSelection(e,t,i){let n;i?.preserveValue?n=[e.value.length,e.value.length]:n=[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,s){const r=new z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add(ge(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,s?.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:s?.enabledProviderPrefixes,preserveValue:!0,providerOptions:s?.providerOptions}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};lO=M2e([fz(0,as),fz(1,pe)],lO);var P2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class cQ{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}P2e([Ii],cQ.prototype,"toString",null);const A2e=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function O2e(o){const e=[];let t=0,i;for(;i=A2e.exec(o);){i.index-t>0&&e.push(o.substring(t,i.index));const[,n,s,,r]=i;r?e.push({label:n,href:s,title:r}):e.push({label:n,href:s}),t=i.index+i[0].length}return t{Jte(g)&&ct.stop(g,!0),t.callback(s.href)},c=t.disposables.add(new wt(a,te.CLICK)).event,d=t.disposables.add(new wt(a,te.KEY_DOWN)).event,h=se.chain(d,g=>g.filter(f=>{const p=new Et(f);return p.equals(10)||p.equals(3)}));t.disposables.add(ni.addTarget(a));const u=t.disposables.add(new wt(a,Bt.Tap)).event;se.any(c,u,h)(l,null,t.disposables),e.appendChild(a)}}var H2e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pz=function(o,e){return function(t,i){e(t,i,o)}};const dQ="inQuickInput",V2e=new re(dQ,!1,m(1748,"Whether keyboard focus is inside the quick input control")),nI=K.has(dQ),z2e="quickInputAlignment",U2e=new re(z2e,"top",m(1749,"The alignment of the quick input")),Aw="quickInputType",$2e=new re(Aw,void 0,m(1750,"The type of the currently visible quick input")),hQ="cursorAtEndOfQuickInputBox",j2e=new re(hQ,!1,m(1751,"Whether the cursor in the quick input is at the end of the input box")),q2e=K.has(hQ),cO={iconClass:ye.asClassName(Z.quickInputBack),tooltip:m(1752,"Back")};class Ow extends F{static{this.noPromptMessage=m(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel")}constructor(e){super(),this.ui=e,this._visible=Ee("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=Ow.noPromptMessage,this._severity=ci.Ignore,this.onDidTriggerButtonEmitter=this._register(new P),this.onDidHideEmitter=this._register(new P),this.onWillHideEmitter=this._register(new P),this.onDisposeEmitter=this._register(new P),this.visibleDisposables=this._register(new z),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Or;this._ignoreFocusOut=e&&!Or,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===cO),this._rightButtons=e.filter(t=>t!==cO&&t.location!==EL.Inline),this._inlineButtons=e.filter(t=>t.location===EL.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=ew.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=ew.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?gn(this.ui.widget,this._widget):gn(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Io,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const n=this._leftButtons.map((a,l)=>Am(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const s=this._rightButtons.map((a,l)=>Am(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(s,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const r=this._inlineButtons.map((a,l)=>Am(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(r,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(r=>r instanceof Ad)??[];this.ui.inputBox.toggles=n;const s=n.length*22;this.ui.countContainer.style.right=s>0?`${4+s}px`:"4px",this.ui.visibleCountContainer.style.right=s>0?`${4+s}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,gn(this.ui.message),i&&B2e(i,this.ui.message,{callback:n=>{this.ui.linkOpenerDelegate(n)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==ci.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class ev extends Ow{static{this.DEFAULT_ARIA_LABEL=m(1755,"Type to narrow down results.")}constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new P),this.onWillAcceptEmitter=this._register(new P),this.onDidAcceptEmitter=this._register(new P),this.onDidCustomEmitter=this._register(new P),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Ma.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new P),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new P),this.onDidTriggerItemButtonEmitter=this._register(new P),this.onDidTriggerSeparatorButtonEmitter=this._register(new P),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Kw,this.type="quickPick",this.filterValue=t=>t,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?NCe:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??m(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(zt.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Qt(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany&&!e.some(i=>i.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Qt(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(k4(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&Qt(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return B(this.ui.container,te.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Et(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder,this.title&&(n=n?`${n} - ${this.title}`:this.title),n||(n=ev.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case Ma.NONE:this._itemActivation=Ma.FIRST;break;case Ma.SECOND:this.ui.list.focus(zt.Second),this._itemActivation=Ma.FIRST;break;case Ma.LAST:this.ui.list.focus(zt.Last),this._itemActivation=Ma.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(zt.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}}class K2e extends Ow{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new P),this.onDidAcceptEmitter=this._register(new P),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?m(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):Ow.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}}let dO=class extends a_{constructor(e,t){super("mouse",void 0,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Si(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};dO=H2e([pz(0,Oe),pz(1,Us)],dO);const mz="done",_z="active",ON="infinite",FN="infinite-long-running",bz="discrete";class yW extends F{static{this.LONG_RUNNING_INFINITE_THRESHOLD=1e4}constructor(e,t){super(),this.progressSignal=this._register(new _t),this.workedVal=0,this.showDelayedScheduler=this._register(new It(()=>Co(this.element),0)),this.longRunningScheduler=this._register(new It(()=>this.infiniteLongRunning(),yW.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(_z,ON,FN,bz),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(mz),this.element.classList.contains(ON)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(bz,mz,FN),this.element.classList.add(_z,ON),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(FN)}getContainer(){return this.element}}const G2e=ee;class Z2e extends F{constructor(e,t,i){super(),this.parent=e,this.onDidChange=s=>this.findInput.onDidChange(s),this.container=Y(this.parent,G2e(".quick-input-box")),this.findInput=this._register(new oZ(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===ci.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===ci.Info?1:e===ci.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===ci.Info?1:e===ci.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const Cz=new $n(()=>{const o=Ef.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:o,collatorIsNumeric:o.resolvedOptions().numeric}});new $n(()=>({collator:Ef.Collator(void 0,{numeric:!0}).value}));new $n(()=>({collator:Ef.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function Y2e(o,e,t=!1){const i=o||"",n=e||"",s=Cz.value.collator.compare(i,n);return Cz.value.collatorIsNumeric&&s===0&&i!==n?in.length)return 1}return 0}var sI=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hO=function(o,e){return function(t,i){e(t,i,o)}},uO;const vl=ee;class uQ{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new $n(()=>{const n=i.label??"",s=_g(n).text.trim(),r=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>Qq(a)).filter(a=>!!a).join(", ");return{saneLabel:n,saneSortLabel:s,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class Bn extends uQ{constructor(e,t,i,n,s,r,a){super(e,i,r),this.childIndex=t,this.fireButtonTriggered=n,this._onChecked=s,this.item=r,this._separator=a,this._checked=!1,this.onChecked=i?se.map(se.filter(this._onChecked.event,l=>l.element===this),l=>l.checked):se.None,this._saneDetail=r.detail,this._labelHighlights=r.highlights?.label,this._descriptionHighlights=r.highlights?.description,this._detailHighlights=r.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var xl;(function(o){o[o.NONE=0]="NONE",o[o.MOUSE_HOVER=1]="MOUSE_HOVER",o[o.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(xl||(xl={}));class Hu extends uQ{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=xl.NONE}}class J2e{getHeight(e){return e instanceof Hu?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Bn?Ux.ID:oI.ID}}class ePe{getWidgetAriaLabel(){return m(1770,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Bn)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class gQ{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new z,t.toDisposeTemplate=new z,t.entry=Y(e,vl(".quick-input-list-entry"));const i=Y(t.entry,vl("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new _t),t.toDisposeTemplate.add(Ti(i,te.CLICK,c=>{if(t.checkbox.value&&!c.defaultPrevented&&t.checkbox.value.enabled){const d=!t.checkbox.value.checked;t.checkbox.value.checked=d,t.element.checked=d}}));const n=Y(i,vl(".quick-input-list-rows")),s=Y(n,vl(".quick-input-list-row")),r=Y(n,vl(".quick-input-list-row"));t.label=new hw(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=cD(t.label.element,vl(".quick-input-list-icon"));const a=Y(s,vl(".quick-input-list-entry-keybinding"));t.keybinding=new Z_(a,wo),t.toDisposeTemplate.add(t.keybinding);const l=Y(r,vl(".quick-input-list-label-meta"));return t.detail=new hw(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=Y(t.entry,vl(".quick-input-list-separator")),t.actionBar=new no(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}let Ux=class extends gQ{static{uO=this}static{this.ID="quickpickitem"}constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return uO.ID}ensureCheckbox(e,t){if(!e.hasCheckbox){t.checkbox.value?.domNode.remove(),t.checkbox.clear();return}let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new XG(e.saneLabel,e.checked,{...p5,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(n=>i.checked=n)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const s=n.item;n.element.classList.toggle("not-pickable",n.item.pickable===!1),this.ensureCheckbox(n,i);const{labelHighlights:r,descriptionHighlights:a,detailHighlights:l}=n;if(s.iconPath){const u=Sd(this.themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,g=be.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Yl(g)}else i.icon.style.backgroundImage="",i.icon.className=s.iconClass?`quick-input-list-icon ${s.iconClass}`:"";let c;!n.saneTooltip&&n.saneDescription&&(c={markdown:{value:ha(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:r||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=s.iconClasses,d.italic=s.italic,d.strikethrough=s.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(s.keybinding),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:ha(n.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:l,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator&&n.childIndex!==0);const h=s.buttons;h&&h.length?(i.actionBar.push(h.map((u,g)=>Am(u,`id-${g}`,()=>n.fireButtonTriggered({button:u,item:n.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};Ux=uO=sI([hO(1,pi)],Ux);class oI extends gQ{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}static{this.ID="quickpickseparator"}get templateId(){return oI.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const s=n.separator,{labelHighlights:r,descriptionHighlights:a}=n;i.icon.style.backgroundImage="",i.icon.className="";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:ha(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const c={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,c),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=s.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>Am(h,`id-${u}`,()=>n.fireSeparatorButtonTriggered({button:h,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}}let Fw=class extends F{constructor(e,t,i,n,s,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new P,this._onLeave=new P,this.onLeave=this._onLeave.event,this._visibleCountObservable=Ee("VisibleCount",0),this.onChangedVisibleCount=se.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Ee("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=se.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Ee("CheckedCount",0),this.onChangedCheckedCount=se.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=SC({equalsFn:Qt},new Array),this.onChangedCheckedElements=se.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new P,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new P,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new P,this._elementCheckedEventBufferer=new Kw,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new z),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=Y(this.parent,vl(".quick-input-list")),this._separatorRenderer=new oI(t),this._itemRenderer=s.createInstance(Ux,t),this._tree=this._register(s.createInstance(JL,"QuickInput",this._container,new J2e,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof Hu?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return iPe(a,l,c)}},accessibilityProvider:new ePe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:_f.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return se.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof Bn).map(t=>t.item),this._store)}get onDidChangeSelection(){return se.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof Bn).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new Et(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(B(this._container,te.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(B(this._container,te.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new pU(typeof this.hoverDelegate.delay=="function"?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(I7(t.browserEvent.target)){e.cancel();return}if(!(!I7(t.browserEvent.relatedTarget)&&un(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof Bn&&this.showHover(t.element)})}catch(i){if(!hr(i))throw i}})),this._register(this._tree.onMouseOut(t=>{un(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const n=i===t;!!(i.focusInsideSeparator&xl.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=xl.ACTIVE_ITEM:i.focusInsideSeparator&=~xl.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&xl.MOUSE_HOVER)||(i.focusInsideSeparator|=xl.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&xl.MOUSE_HOVER)&&(i.focusInsideSeparator&=~xl.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof Bn);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof Hu&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&t.item.pickable!==!1&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,n,s)=>{let r;if(n.type==="separator"){if(!n.buttons)return i;t=new Hu(s,a=>this._onSeparatorButtonTriggered.fire(a),n),r=t}else{const a=s>0?e[s-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(l=a);const c=new Bn(s,t?.children?t.children.length:s,this._hasCheckboxes&&n.pickable!==!1,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,l);if(this._itemElements.push(c),t)return t.children.push(c),i;r=c}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),n=i?.parentNode;if(i&&n){const s=i.nextSibling;i.remove(),n.insertBefore(i,s)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){if(this._itemElements.length)switch(e===zt.Second&&this._itemElements.length<2&&(e=zt.First),e){case zt.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof Bn);break;case zt.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof Bn?t?!0:(t=!t,!1):!1);break}case zt.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof Bn);break;case zt.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof Bn?(this._tree.reveal(n.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&this._onLeave.fire();break}case zt.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,n=>{if(!(n.element instanceof Bn))return!1;const s=this._tree.getParentElement(n.element);return s===null||s.children[0]!==n.element?this._tree.reveal(n.element):this._tree.reveal(s),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&this._onLeave.fire();break}case zt.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof Bn?(this._tree.reveal(t.element),!0):!1);break;case zt.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof Bn))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case zt.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,s=>{if(t)return!0;if(s.element instanceof Hu)t=!0,this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element.children[0]):this._tree.reveal(s.element,0);else if(s.element instanceof Bn){if(s.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),!0;if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1});const n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,s=>s.element instanceof Bn));break}case zt.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof Hu)i?t||(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element.children[0]):i=!0;else if(n.element instanceof Bn&&!t){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const n=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=n&&n.type==="separator"&&!n.buttons?n:void 0)});else{let i;this._itemElements.forEach(n=>{let s;this.matchOnLabelMode==="fuzzy"?s=this.matchOnLabel?kC(e,_g(n.saneLabel))??void 0:void 0:s=this.matchOnLabel?tPe(t,_g(n.saneLabel))??void 0:void 0;const r=this.matchOnDescription?kC(e,_g(n.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?kC(e,_g(n.saneDetail||""))??void 0:void 0;if(s||r||a?(n.labelHighlights=s,n.descriptionHighlights=r,n.detailHighlights=a,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=n.item?!n.item.alwaysShow:!0),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const l=n.index&&this._inputElements[n.index-1]||void 0;l?.type==="separator"&&!l.buttons&&(i=l),i&&!n.hidden&&(n.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof Bn),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof Bn))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof Bn&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof Hu?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(n=>({element:n,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:t=>{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};sI([Ii],Fw.prototype,"onDidChangeFocus",null);sI([Ii],Fw.prototype,"onDidChangeSelection",null);Fw=sI([hO(4,pe),hO(5,Mn)],Fw);function tPe(o,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return vz(o,t);const n=Gw(t," "),s=t.length-n.length,r=vz(o,n);if(r)for(const a of r){const l=i[a.start+s]+s;a.start+=l,a.end+=l}return r}function vz(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t!==-1?[{start:t,end:t+o.length}]:null}function iPe(o,e,t){const i=o.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:X2e(o.saneSortLabel,e.saneSortLabel,t)}function nPe(o,e={}){Sn.registerCommandAndKeybindingRule({weight:200,when:nI,metadata:{description:m(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...o,secondary:LW(o.primary,o.secondary??[],e)})}function Xs(o,e={}){Sn.registerCommandAndKeybindingRule({weight:200,when:K.and(K.or(K.equals(Aw,"quickPick"),K.equals(Aw,"quickTree")),nI),metadata:{description:m(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...o,secondary:LW(o.primary,o.secondary??[],e)})}const Ww=je?256:2048;function LW(o,e,t={}){return t.withAltMod&&e.push(512+o),t.withCtrlMod&&(e.push(Ww+o),t.withAltMod&&e.push(512+Ww+o)),t.withCmdMod&&je&&(e.push(2048+o),t.withCtrlMod&&e.push(2304+o),t.withAltMod&&(e.push(2560+o),t.withCtrlMod&&e.push(2816+o))),e}function Zo(o,e){return t=>{const i=t.get(as).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(o)}}Xs({id:"quickInput.pageNext",primary:12,handler:Zo(zt.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Xs({id:"quickInput.pagePrevious",primary:11,handler:Zo(zt.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Xs({id:"quickInput.first",primary:Ww+14,handler:Zo(zt.First)},{withAltMod:!0,withCmdMod:!0});Xs({id:"quickInput.last",primary:Ww+13,handler:Zo(zt.Last)},{withAltMod:!0,withCmdMod:!0});Xs({id:"quickInput.next",primary:18,handler:Zo(zt.Next)},{withCtrlMod:!0});Xs({id:"quickInput.previous",primary:16,handler:Zo(zt.Previous)},{withCtrlMod:!0});const wz=m(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),Sz=m(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");je?(Xs({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:Zo(zt.NextSeparator,zt.Next),metadata:{description:wz}}),Xs({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:Zo(zt.NextSeparator)},{withCtrlMod:!0}),Xs({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:Zo(zt.PreviousSeparator,zt.Previous),metadata:{description:Sz}}),Xs({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:Zo(zt.PreviousSeparator)},{withCtrlMod:!0})):(Xs({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:Zo(zt.NextSeparator,zt.Next),metadata:{description:wz}}),Xs({id:"quickInput.nextSeparator",primary:2578,handler:Zo(zt.NextSeparator)}),Xs({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:Zo(zt.PreviousSeparator,zt.Previous),metadata:{description:Sz}}),Xs({id:"quickInput.previousSeparator",primary:2576,handler:Zo(zt.PreviousSeparator)}));Sn.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:K.and(K.notEquals(Aw,"quickWidget"),nI,K.not("isComposing")),metadata:{description:m(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:o=>{o.get(as).currentQuickInput?.accept()},secondary:LW(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})});Xs({id:"quickInput.acceptInBackground",when:K.and(nI,K.equals(Aw,"quickPick"),K.or(Q5.negate(),q2e)),primary:17,weight:250,handler:o=>{o.get(as).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});nPe({id:"quickInput.hide",primary:9,handler:o=>{o.get(as).currentQuickInput?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Xs({id:"quickInput.toggleHover",primary:Ww|10,handler:o=>{o.get(as).toggleHover()}});var sPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oPe=function(o,e){return function(t,i){e(t,i,o)}},gO;const Fb=ee;let $x=class extends F{static{gO=this}static{this.ID="quickInputTreeElement"}constructor(e,t,i,n){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=n,this.templateId=gO.ID}renderTemplate(e){const t=new z,i=Y(e,Fb(".quick-input-tree-entry")),n=t.add(new QG("",!1,{...p5,size:15}));i.appendChild(n.domNode);const s=Y(i,Fb("label.quick-input-tree-label")),r=Y(s,Fb(".quick-input-tree-rows")),a=Y(r,Fb(".quick-input-tree-row")),l=cD(a,Fb(".quick-input-tree-icon")),c=t.add(new hw(a,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),d=t.add(new no(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return d.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:n,icon:l,label:c,actionBar:d,toDisposeElement:new z}}renderElement(e,t,i,n){const s=i.toDisposeElement,r=e.element;if(r.pickable===!1?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=r.checked??!1,s.add(se.filter(this.onCheckedEvent,h=>h.item===r)(h=>i.checkbox.checked=h.checked)),r.disabled&&i.checkbox.disable()),r.iconPath){const h=Sd(this._themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,u=be.revive(h);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=Yl(u)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-tree-icon ${r.iconClass}`:"";const{labelHighlights:a,descriptionHighlights:l}=e.filterData||{};let c;r.description&&(c={markdown:{value:ha(r.description),supportThemeIcons:!0},markdownNotSupportedFallback:r.description}),i.label.setLabel(r.label,r.description,{matches:a,descriptionMatches:l,extraClasses:r.iconClasses,italic:r.italic,strikethrough:r.strikethrough,labelEscapeNewLines:!0,descriptionTitle:c});const d=r.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>Am(h,`tree-${u}`,()=>this._buttonTriggeredEmitter.fire({item:r,button:h}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,n){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}};$x=gO=sPe([oPe(3,pi)],$x);class rPe{getHeight(e){return 22}getTemplateId(e){return $x.ID}}function aPe(o){let e=!1,t=!1,i=!1;for(const s of o){switch(s.element?.checked){case"mixed":i=!0;break;case!0:e=!0;break;default:t=!0;break}if(e&&t&&i)break}return t?i||e?"mixed":!1:i?"mixed":e}class lPe{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return m(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(t=>Qq(t)).filter(t=>!!t).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return e.checked==="mixed"?"mixed":!!e.checked},onDidChange:t=>se.filter(this.onCheckedEvent,i=>i.item===e)(i=>t())}}}class cPe{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?kC(this.filterValue,_g(e.label))??void 0:void 0,n=this.matchOnDescription?kC(this.filterValue,_g(e.description||""))??void 0:void 0;return{visibility:t===1||i||n?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:n}}}}class dPe extends F{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.labelt.label)return 1;if(e.description&&t.description){if(e.descriptiont.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}}var hPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},uPe=function(o,e){return function(t,i){e(t,i,o)}};const gPe=ee;let fO=class extends F{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new P),this._onDidChangeCheckboxState=this._register(new P),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new P),this._onLeave=new P,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new P),this.onDidAccept=this._onDidAccept.event,this._container=Y(e,gPe(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance($x,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(cPe),this._sorter=this._register(new dPe),this._tree=this._register(this.instantiationService.createInstance(JL,"QuickInputTree",this._container,new rPe,[this._renderer],{accessibilityProvider:new lPe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:_f.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){e.matchOnLabel!==void 0&&(this._filter.matchOnLabel=e.matchOnLabel),e.matchOnDescription!==void 0&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{const t=e.element;if(!t||t.disabled)return;if(t.pickable===!1){this._tree.setFocus([t]),this._onDidAccept.fire();return}const i=t.checked!==!0;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const n=new Set,s=[...this._tree.getNode(t).children];for(;s.length;){const a=s.shift();a?.element&&!n.has(a.element)&&(n.add(a.element),(a.element.checked??!1)!==t.checked&&(a.element.checked=t.checked,this._tree.rerender(a.element)),s.push(...a.children))}let r=this._tree.getParentElement(t);for(;r;){const a=[...this._tree.getNode(r).children],l=aPe(a);(r.checked??!1)!==l&&(r.checked=l,this._tree.rerender(r)),r=this._tree.getParentElement(r)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const n=t.shift();!n?.element||e.has(n.element)||n.element.checked&&(e.add(n.element),t.push(...n.children),n.element.children||i.push(n.element))}return i}};fO=hPe([uPe(2,pe)],fO);var fQ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xg=function(o,e){return function(t,i){e(t,i,o)}},pO;const Bo=ee,WN="workbench.quickInput.viewState";let mO=class extends F{static{pO=this}static{this.MAX_WIDTH=600}get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new P),this.onDidCustomEmitter=this._register(new P),this.onDidTriggerButtonEmitter=this._register(new P),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new P),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new P),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=V2e.bindTo(n),this.quickInputTypeContext=$2e.bindTo(n),this.endOfQuickInputBoxContext=j2e.bindTo(n),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(se.runAndSubscribe(Xw,({window:r,disposables:a})=>this.registerKeyModsListeners(r,a),{window:kt,disposables:this._store})),this._register(Ute(r=>{this.ui&&me(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[te.KEY_DOWN,te.KEY_UP,te.MOUSE_DOWN])t.add(B(e,n,i,!0))}getUI(e){if(this.ui)return e&&me(this._container)!==me(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Y(this._container,Bo(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=zr(t),n=Y(t,Bo(".quick-input-titlebar")),s=this._register(new no(n,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");const r=Y(n,Bo(".quick-input-title")),a=this._register(new no(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Y(t,Bo(".quick-input-header")),c=this._register(new QG(m(1763,"Toggle all checkboxes"),!1,{...p5,size:15}));Y(l,c.domNode),this._register(c.onChange(()=>{const q=c.checked;O.setAllVisibleChecked(q===!0)})),this._register(B(c.domNode,te.CLICK,q=>{(q.x||q.y)&&g.setFocus()}));const d=Y(l,Bo(".quick-input-description")),h=Y(l,Bo(".quick-input-and-message")),u=Y(h,Bo(".quick-input-filter")),g=this._register(new Z2e(u,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const f=Y(u,Bo(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const p=this._register(new AM(f,{countFormat:m(1764,"{0} Results")},this.styles.countBadge)),_=Y(u,Bo(".quick-input-count"));_.setAttribute("aria-live","polite");const b=this._register(new AM(_,{countFormat:m(1765,"{0} Selected")},this.styles.countBadge)),C=this._register(new no(l,{hoverDelegate:this.options.hoverDelegate}));C.domNode.classList.add("quick-input-inline-action-bar");const w=Y(l,Bo(".quick-input-action")),v=this._register(new ML(w,this.styles.button));v.label=m(1766,"OK"),this._register(v.onDidClick(q=>{this.onDidAcceptEmitter.fire()}));const S=Y(l,Bo(".quick-input-action")),L=this._register(new ML(S,{...this.styles.button,supportIcons:!0}));L.label=m(1767,"Custom"),this._register(L.onDidClick(q=>{this.onDidCustomEmitter.fire()}));const x=Y(h,Bo(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new yW(t,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const I=Y(t,Bo(".quick-input-html-widget"));I.tabIndex=-1;const T=Y(t,Bo(".quick-input-description")),A=this.idPrefix+"list",O=this._register(this.instantiationService.createInstance(Fw,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,A));g.setAttribute("aria-controls",A),this._register(O.onDidChangeFocus(()=>{g.hasFocus()&&g.setAttribute("aria-activedescendant",O.getActiveDescendant()??"")})),this._register(O.onChangedAllVisibleChecked(q=>{c.checked=q})),this._register(O.onChangedVisibleCount(q=>{p.setCount(q)})),this._register(O.onChangedCheckedCount(q=>{jw(()=>b.setCount(q))})),this._register(O.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),this.controller instanceof ev&&this.controller.canSelectMany&&O.clearFocus())},0)}));const W=this._register(this.instantiationService.createInstance(fO,t,this.options.hoverDelegate));this._register(W.tree.onDidChangeFocus(()=>{g.hasFocus()&&g.setAttribute("aria-activedescendant",W.getActiveDescendant()??"")})),this._register(W.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),W.tree.setFocus([]))},0)})),this._register(W.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(W.tree.onDidChangeContentHeight(()=>this.updateLayout()));const U=Wr(t);return this._register(U),this._register(B(t,te.FOCUS,q=>{const ie=this.getUI();if(un(q.relatedTarget,ie.inputContainer)){const Q=ie.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==Q&&this.endOfQuickInputBoxContext.set(Q)}un(q.relatedTarget,ie.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Si(q.relatedTarget)?q.relatedTarget:void 0)},!0)),this._register(U.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(ew.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(g.onKeyDown(q=>{const ie=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ie&&this.endOfQuickInputBoxContext.set(ie),g.removeAttribute("aria-activedescendant")})),this._register(B(t,te.FOCUS,q=>{g.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(_O,this._container,t,[{node:n,includeChildren:!0},{node:l,includeChildren:!1}],this.viewState)),this._register(ke(q=>{const ie=this.dndController?.dndViewState.read(q);ie&&(ie.top!==void 0&&ie.left!==void 0?this.viewState={...this.viewState,top:ie.top,left:ie.left}:this.viewState=void 0,this.updateLayout(),ie.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:n,title:r,description1:T,description2:d,widget:I,rightActionBar:a,inlineActionBar:C,checkAll:c,inputContainer:h,filterContainer:u,inputBox:g,visibleCountContainer:f,visibleCount:p,countContainer:_,count:b,okContainer:w,ok:v,message:x,customButtonContainer:S,customButton:L,list:O,tree:W,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:q=>this.show(q),hide:()=>this.hide(),setVisibilities:q=>this.setVisibilities(q),setEnabled:q=>this.setEnabled(q),setContextKey:q=>this.options.setContextKey(q),linkOpenerDelegate:q=>this.options.linkOpenerDelegate(q)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Y(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},i=$e.None){return new Promise((n,s)=>{let r=d=>{r=n,t.onKeyMods?.(a.keyMods),n(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),g=u.splice(h,1),f=a.activeItems.filter(_=>_!==g[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,f&&(a.activeItems=f),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{vt(c),r(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.prompt=t.prompt,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,t.sortByLabel!==void 0&&(a.sortByLabel=t.sortByLabel),a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{l=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{s(d),a.hide()})})}setValidationOnInput(e,t){t&&hn(t)?(e.severity=ci.Error,e.validationMessage=t):t&&!hn(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=ci.Ignore,e.validationMessage=void 0)}input(e={},t=$e.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),s=e.validateInput||(()=>Promise.resolve(void 0)),r=se.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",l=Promise.resolve(s(a));const c=[n,r(d=>{d!==a&&(l=Promise.resolve(s(d)),a=d),l.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(l=Promise.resolve(s(d)),a=d),l.then(h=>{!h||!hn(h)&&h.severity!==ci.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{vt(c),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new ev(t)}createInputBox(){const e=this.getUI(!0);return new K2e(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",gn(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(ci.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),gn(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();cO.tooltip=n?m(1768,"Back ({0})",n):m(1769,"Back"),t.container.style.display="",this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,n=i&&!JU(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let s=this.previousFocusElement;for(;s&&!s.offsetParent;)s=s.parentElement??void 0;s?.offsetParent?(s.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof ev&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,pO.MAX_WIDTH);e.width=t+"px",e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(WN,-1,"{}"));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e!==void 0?this.storageService.store(WN,JSON.stringify(e),-1,1):this.storageService.remove(WN,-1))}};mO=pO=fQ([xg(1,rc),xg(2,pe),xg(3,Ne),xg(4,Ls)],mO);let _O=class extends F{constructor(e,t,i,n,s,r,a){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=s,this.configurationService=a,this.dndViewState=Ee(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=U2e.bindTo(r);const l=qbe(this.configurationService)==="custom";this._controlsOnLeft=l&&yI===1,this._controlsOnRight=l&&(yI===3||yI===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){const n=Math.round(t.left*100)/100,s=e.width,r=i.width,a=n*s-r/2;this._layout(t.top*e.height,a)}}_registerLayoutListener(){this._register(se.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(k7(e,t=>{const i=new qn(me(e),t);i.detail===2&&this._quickInputDragAreas.some(({node:n,includeChildren:s})=>s?un(i.target,n):i.target===n)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(ZU(e,t=>{const i=me(this._layoutService.activeContainer),n=new qn(i,t);if(!this._quickInputDragAreas.some(({node:h,includeChildren:u})=>u?un(n.target,h):n.target===h))return;const s=this._quickInputContainer.getBoundingClientRect(),r=n.browserEvent.clientX-s.left,a=n.browserEvent.clientY-s.top;let l=!1;const c=Gte(i,h=>{new qn(i,h).preventDefault(),l||(l=!0),this._layout(h.clientY-a,h.clientX-r)}),d=k7(i,h=>{if(l){const u=this.dndViewState.get();this.dndViewState.set({top:u?.top,left:u?.left,done:!0},void 0)}c.dispose(),d.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),s=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Wb=function(o,e){return function(t,i){e(t,i,o)}};let bO=class extends Mle{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(lO))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new P),this._onHide=this._register(new P),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(Pd).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(dO))},n=this._register(this.instantiationService.createInstance(mO,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{me(e.activeContainer)===me(n.container)&&n.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new re(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=$e.None){return this.controller.pick(e,t,i)}input(e={},t=$e.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:J(GI),quickInputForeground:J(Sae),quickInputTitleBackground:J(yae),widgetBorder:J(J4),widgetShadow:J(B_)},inputBox:yL,toggle:SL,countBadge:$K,button:Bbe,progressBar:Hbe,keybindingLabel:UK,list:Of({listBackground:GI,listFocusBackground:Dv,listFocusForeground:xv,listInactiveFocusForeground:xv,listInactiveSelectionIconForeground:oF,listInactiveFocusBackground:Dv,listFocusOutline:ti,listInactiveFocusOutline:ti,treeStickyScrollBackground:GI}),pickerGroup:{pickerGroupBorder:J(Lae),pickerGroupForeground:J(uj)}}}};bO=fPe([Wb(0,pe),Wb(1,Ne),Wb(2,pi),Wb(3,rc),Wb(4,Oe)],bO);var pQ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},og=function(o,e){return function(t,i){e(t,i,o)}};let CO=class extends bO{constructor(e,t,i,n,s,r){super(t,i,n,new KA(e.getContainerDomNode(),s),r),this.host=void 0;const a=Bw.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return se.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return se.None},get onDidAddContainer(){return se.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};CO=pQ([og(1,pe),og(2,Ne),og(3,pi),og(4,at),og(5,Oe)],CO);let vO=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(CO,e);this.mapEditorToService.set(e,t),qg(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=$e.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};vO=pQ([og(0,pe),og(1,at)],vO);class Bw{static{this.ID="editor.controller.quickInput"}static get(e){return e.getContribution(Bw.ID)}constructor(e){this.editor=e,this.widget=new xW(this.editor)}dispose(){this.widget.dispose()}}class xW{static{this.ID="editor.contrib.quickInputWidget"}constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return xW.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}}nt(Bw.ID,Bw,4);var pPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},BN=function(o,e){return function(t,i){e(t,i,o)}};let wO=class extends F{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new P,this._onDidChangeReducedMotion=new P,this._onDidChangeLinkUnderline=new P,this._accessibilityModeEnabledContext=F_.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=kt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(B(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",i),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};wO=pPe([BN(0,Ne),BN(1,rc),BN(2,Oe)],wO);var mPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yz=function(o,e){return function(t,i){e(t,i,o)}},SO;const Lz="application/vnd.code.resources";let yO=class extends F{static{SO=this}constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Ug||nU)&&this.installWebKitWriteTextWorkaround(),this._register(se.runAndSubscribe(Xw,({window:i,disposables:n})=>{n.add(B(i.document,"copy",()=>this.clearResourcesState()))},{window:kt,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const t=new xf;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,St().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(se.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(B(t,"click",e)),i.add(B(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await St().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=Qw(),i=t.activeElement,n=t.body.appendChild(ee("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),Si(i)&&i.focus(),n.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const t=await St().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}static{this.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3}async readResources(){try{const t=await St().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${Lz}`)){const n=await i.getType(`web ${Lz}`);return JSON.parse(await n.text()).map(r=>be.from(r))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return Yw(e.substring(0,SO.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}};yO=SO=mPe([yz(0,rc),yz(1,Ht)],yO);var _Pe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bPe=function(o,e){return function(t,i){e(t,i,o)}};const tv="data-keybinding-context";class DW{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class x_ extends DW{static{this.INSTANCE=new x_}constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}class jx extends DW{static{this._keyPrefix="config."}constructor(e,t,i){super(e,null),this._configurationService=t,this._values=vm.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===7){const s=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new Dz(s))}else{const s=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(s.push(...Je.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(s.push(a),this._values.delete(a))}i.fire(new Dz(s))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(jx._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(jx._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}class CPe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class xz{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Dz{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class vPe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function wPe(o,e){return o.allKeysContainedIn(new Set(Object.keys(e)))}class mQ extends F{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new Kg({merge:t=>new vPe(t)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new CPe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new SPe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new xz(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new xz(e))}getContext(e){return this._isDisposed?x_.INSTANCE:this.getContextValuesContainer(yPe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let LO=class extends mQ{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=Q5.bindTo(this);const t=this._register(new jx(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(se.runAndSubscribe(Xw,({window:i,disposables:n})=>{const s=n.add(new _t);n.add(B(i,te.FOCUS_IN,()=>{s.value=new z,this.updateInputContextKeys(i.document,s.value)},!0))},{window:kt,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&$a(e.activeElement)}const n=i();if(this.inputFocusedContext.set(n),n){const s=t.add(Wr(e.activeElement));se.once(s.onDidBlur)(()=>{St().document===e&&this.inputFocusedContext.set(i()),s.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?x_.INSTANCE:this._contexts.get(e)||x_.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new DW(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};LO=_Pe([bPe(0,Oe)],LO);class SPe extends mQ{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new _t),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(tv)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(tv,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;wPe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(tv),super.dispose())}getContextValuesContainer(e){return this._isDisposed?x_.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function yPe(o){for(;o;){if(o.hasAttribute(tv)){const e=o.getAttribute(tv);return e?parseInt(e,10):NaN}o=o.parentElement}return 0}function LPe(o,e,t){o.get(Ne).createKey(String(e),xPe(t))}function xPe(o){return y$(o,e=>{if(typeof e=="object"&&e.$mid===1)return be.revive(e).toString();if(e instanceof be)return e.toString()})}it.registerCommand("_setContext",LPe);it.registerCommand({id:"getContextKeyInfo",handler(){return[...re.all()].sort((o,e)=>o.key.localeCompare(e.key))},metadata:{description:m(1674,"A command that returns information about context keys"),args:[]}});it.registerCommand("_generateContextKeyInfo",function(){const o=[],e=new Set;for(const t of re.all())e.has(t.key)||(e.add(t.key),o.push(t));o.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(o,void 0,2))});let DPe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class kz{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new DPe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=tp._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(Mg,e,t,s,i);if(i&&this._disposedModels.has(ru(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const g of d.past)bc(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of d.future)bc(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>bc(g)&&g.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=ru(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new gRe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,qo,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||c.future.length>0){for(const d of c.past)bc(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)bc(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=tp.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(s)if(!n&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>bc(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new pRe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);tp._setModelOptionsForModel(e,r,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new d3}};ZP=tp=uRe([CS(0,Pe),CS(1,SZ),CS(2,x4),CS(3,fe)],ZP);class d3{static{this.MAX_MODEL_SIZE=10*1024*1024}canComputeSHA1(e){return e.getValueLength()<=d3.MAX_MODEL_SIZE}computeSHA1(e){const t=new nO,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}var mRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E6=function(o,e){return function(t,i){e(t,i,o)}};let YP=class extends A{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=li.as(Sf.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(ue(()=>{for(const i of this.mapProviderToDescriptor.values())ef(i)&&i.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[n,s]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r?.descriptor;if(r&&s&&a===s){e!==s.prefix&&!i?.preserveValue&&(r.picker.value=e),this.adjustValueSelection(r.picker,s,i);return}if(s&&!i?.preserveValue){let f;if(r&&a&&a!==s){const p=r.value.substr(a.prefix.length);p&&(f=`${s.prefix}${p}`)}if(!f){const p=n?.defaultFilterValue;p===I2.LAST?f=this.lastAcceptedPickerValues.get(s):typeof p=="string"&&(f=`${s.prefix}${p}`)}typeof f=="string"&&(e=f)}const l=r?.picker?.valueSelection,c=r?.picker?.value,d=new z,h=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));h.value=e,this.adjustValueSelection(h,s,i),h.placeholder=i?.placeholder??s?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??_a.SECOND),h.contextKey=s?.contextKey,h.filterValue=f=>f.substring(s?s.prefix.length:0);let u;t&&(u=new tf,d.add(te.once(h.onWillAccept)(f=>{f.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,s,e,i));const g=d.add(new qt);if(n&&d.add(n.provide(h,g.token,i?.providerOptions)),te.once(h.onDidHide)(()=>{h.selectedItems.length===0&&g.cancel(),d.dispose(),u?.complete(h.selectedItems.slice(0))}),h.show(),l&&c===e&&(h.valueSelection=l),t)return u?.p}adjustValueSelection(e,t,i){let n;i?.preserveValue?n=[e.value.length,e.value.length]:n=[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,s){const r=new z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add(ue(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,s?.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:s?.enabledProviderPrefixes,preserveValue:!0,providerOptions:s?.providerOptions}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};YP=mRe([E6(0,Jn),E6(1,fe)],YP);var _Re=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};class CY{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}_Re([Si],CY.prototype,"toString",null);const bRe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function CRe(o){const e=[];let t=0,i;for(;i=bRe.exec(o);){i.index-t>0&&e.push(o.substring(t,i.index));const[,n,s,,r]=i;r?e.push({label:n,href:s,title:r}):e.push({label:n,href:s}),t=i.index+i[0].length}return t{nee(g)&&nt.stop(g,!0),t.callback(s.href)},c=t.disposables.add(new mt(a,ee.CLICK)).event,d=t.disposables.add(new mt(a,ee.KEY_DOWN)).event,h=te.chain(d,g=>g.filter(f=>{const p=new yt(f);return p.equals(10)||p.equals(3)}));t.disposables.add(Xt.addTarget(a));const u=t.disposables.add(new mt(a,Rt.Tap)).event;te.any(c,u,h)(l,null,t.disposables),e.appendChild(a)}}var yRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},N6=function(o,e){return function(t,i){e(t,i,o)}};const vY="inQuickInput",xRe=new oe(vY,!1,m(1748,"Whether keyboard focus is inside the quick input control")),lD=q.has(vY),LRe="quickInputAlignment",kRe=new oe(LRe,"top",m(1749,"The alignment of the quick input")),Xv="quickInputType",DRe=new oe(Xv,void 0,m(1750,"The type of the currently visible quick input")),wY="cursorAtEndOfQuickInputBox",IRe=new oe(wY,!1,m(1751,"Whether the cursor in the quick input is at the end of the input box")),ERe=q.has(wY),XP={iconClass:Se.asClassName(G.quickInputBack),tooltip:m(1752,"Back")};class Qv extends A{static{this.noPromptMessage=m(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel")}constructor(e){super(),this.ui=e,this._visible=De("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=Qv.noPromptMessage,this._severity=ni.Ignore,this.onDidTriggerButtonEmitter=this._register(new P),this.onDidHideEmitter=this._register(new P),this.onWillHideEmitter=this._register(new P),this.onDisposeEmitter=this._register(new P),this.visibleDisposables=this._register(new z),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Sr;this._ignoreFocusOut=e&&!Sr,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===XP),this._rightButtons=e.filter(t=>t!==XP&&t.location!==Py.Inline),this._inlineButtons=e.filter(t=>t.location===Py.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=mv.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=mv.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?on(this.ui.widget,this._widget):on(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new mo,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const n=this._leftButtons.map((a,l)=>om(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const s=this._rightButtons.map((a,l)=>om(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(s,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const r=this._inlineButtons.map((a,l)=>om(a,`id-${l}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(r,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(r=>r instanceof fd)??[];this.ui.inputBox.toggles=n;const s=n.length*22;this.ui.countContainer.style.right=s>0?`${4+s}px`:"4px",this.ui.visibleCountContainer.style.right=s>0?`${4+s}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,on(this.ui.message),i&&SRe(i,this.ui.message,{callback:n=>{this.ui.linkOpenerDelegate(n)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==ni.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class mC extends Qv{static{this.DEFAULT_ARIA_LABEL=m(1755,"Type to narrow down results.")}constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new P),this.onWillAcceptEmitter=this._register(new P),this.onDidAcceptEmitter=this._register(new P),this.onDidCustomEmitter=this._register(new P),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=_a.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new P),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new P),this.onDidTriggerItemButtonEmitter=this._register(new P),this.onDidTriggerSeparatorButtonEmitter=this._register(new P),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new cw,this.type="quickPick",this.filterValue=t=>t,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?g_e:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??m(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(At.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&jt(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany&&!e.some(i=>i.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&jt(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(pO(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&jt(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return W(this.ui.container,ee.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new yt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder,this.title&&(n=n?`${n} - ${this.title}`:this.title),n||(n=mC.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case _a.NONE:this._itemActivation=_a.FIRST;break;case _a.SECOND:this.ui.list.focus(At.Second),this._itemActivation=_a.FIRST;break;case _a.LAST:this.ui.list.focus(At.Last),this._itemActivation=_a.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(At.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}}class NRe extends Qv{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new P),this.onDidAcceptEmitter=this._register(new P),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?m(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):Qv.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}}let QP=class extends Tm{constructor(e,t){super("mouse",void 0,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(mi(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};QP=yRe([N6(0,Pe),N6(1,Ms)],QP);const T6="done",R6="active",kE="infinite",DE="infinite-long-running",M6="discrete";class h3 extends A{static{this.LONG_RUNNING_INFINITE_THRESHOLD=1e4}constructor(e,t){super(),this.progressSignal=this._register(new ut),this.workedVal=0,this.showDelayedScheduler=this._register(new St(()=>ro(this.element),0)),this.longRunningScheduler=this._register(new St(()=>this.infiniteLongRunning(),h3.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(R6,kE,DE,M6),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(T6),this.element.classList.contains(kE)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(M6,T6,DE),this.element.classList.add(R6,kE),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(DE)}getContainer(){return this.element}}const TRe=J;class RRe extends A{constructor(e,t,i){super(),this.parent=e,this.onDidChange=s=>this.findInput.onDidChange(s),this.container=Z(this.parent,TRe(".quick-input-box")),this.findInput=this._register(new pK(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===ni.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===ni.Info?1:e===ni.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===ni.Info?1:e===ni.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const P6=new On(()=>{const o=rf.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:o,collatorIsNumeric:o.resolvedOptions().numeric}});new On(()=>({collator:rf.Collator(void 0,{numeric:!0}).value}));new On(()=>({collator:rf.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function MRe(o,e,t=!1){const i=o||"",n=e||"",s=P6.value.collator.compare(i,n);return P6.value.collatorIsNumeric&&s===0&&i!==n?in.length)return 1}return 0}var cD=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},JP=function(o,e){return function(t,i){e(t,i,o)}},eA;const nl=J;class SY{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new On(()=>{const n=i.label??"",s=Gu(n).text.trim(),r=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>gj(a)).filter(a=>!!a).join(", ");return{saneLabel:n,saneSortLabel:s,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class Tn extends SY{constructor(e,t,i,n,s,r,a){super(e,i,r),this.childIndex=t,this.fireButtonTriggered=n,this._onChecked=s,this.item=r,this._separator=a,this._checked=!1,this.onChecked=i?te.map(te.filter(this._onChecked.event,l=>l.element===this),l=>l.checked):te.None,this._saneDetail=r.detail,this._labelHighlights=r.highlights?.label,this._descriptionHighlights=r.highlights?.description,this._detailHighlights=r.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var ll;(function(o){o[o.NONE=0]="NONE",o[o.MOUSE_HOVER=1]="MOUSE_HOVER",o[o.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(ll||(ll={}));class _u extends SY{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=ll.NONE}}class ORe{getHeight(e){return e instanceof _u?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Tn?Gx.ID:dD.ID}}class FRe{getWidgetAriaLabel(){return m(1770,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Tn)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class yY{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new z,t.toDisposeTemplate=new z,t.entry=Z(e,nl(".quick-input-list-entry"));const i=Z(t.entry,nl("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new ut),t.toDisposeTemplate.add(Li(i,ee.CLICK,c=>{if(t.checkbox.value&&!c.defaultPrevented&&t.checkbox.value.enabled){const d=!t.checkbox.value.checked;t.checkbox.value.checked=d,t.element.checked=d}}));const n=Z(i,nl(".quick-input-list-rows")),s=Z(n,nl(".quick-input-list-row")),r=Z(n,nl(".quick-input-list-row"));t.label=new Dv(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=fL(t.label.element,nl(".quick-input-list-icon"));const a=Z(s,nl(".quick-input-list-entry-keybinding"));t.keybinding=new C_(a,lo),t.toDisposeTemplate.add(t.keybinding);const l=Z(r,nl(".quick-input-list-label-meta"));return t.detail=new Dv(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=Z(t.entry,nl(".quick-input-list-separator")),t.actionBar=new qs(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}let Gx=class extends yY{static{eA=this}static{this.ID="quickpickitem"}constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return eA.ID}ensureCheckbox(e,t){if(!e.hasCheckbox){t.checkbox.value?.domNode.remove(),t.checkbox.clear();return}let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new aK(e.saneLabel,e.checked,{...nF,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(n=>i.checked=n)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const s=n.item;n.element.classList.toggle("not-pickable",n.item.pickable===!1),this.ensureCheckbox(n,i);const{labelHighlights:r,descriptionHighlights:a,detailHighlights:l}=n;if(s.iconPath){const u=td(this.themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,g=_e.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Ml(g)}else i.icon.style.backgroundImage="",i.icon.className=s.iconClass?`quick-input-list-icon ${s.iconClass}`:"";let c;!n.saneTooltip&&n.saneDescription&&(c={markdown:{value:Xr(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:r||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=s.iconClasses,d.italic=s.italic,d.strikethrough=s.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(s.keybinding),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:Xr(n.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:l,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator&&n.childIndex!==0);const h=s.buttons;h&&h.length?(i.actionBar.push(h.map((u,g)=>om(u,`id-${g}`,()=>n.fireButtonTriggered({button:u,item:n.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};Gx=eA=cD([JP(1,ci)],Gx);class dD extends yY{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}static{this.ID="quickpickseparator"}get templateId(){return dD.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const s=n.separator,{labelHighlights:r,descriptionHighlights:a}=n;i.icon.style.backgroundImage="",i.icon.className="";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:Xr(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const c={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,c),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=s.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>om(h,`id-${u}`,()=>n.fireSeparatorButtonTriggered({button:h,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}}let Jv=class extends A{constructor(e,t,i,n,s,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new P,this._onLeave=new P,this.onLeave=this._onLeave.event,this._visibleCountObservable=De("VisibleCount",0),this.onChangedVisibleCount=te.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=De("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=te.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=De("CheckedCount",0),this.onChangedCheckedCount=te.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=Wb({equalsFn:jt},new Array),this.onChangedCheckedElements=te.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new P,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new P,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new P,this._elementCheckedEventBufferer=new cw,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new z),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=Z(this.parent,nl(".quick-input-list")),this._separatorRenderer=new dD(t),this._itemRenderer=s.createInstance(Gx,t),this._tree=this._register(s.createInstance(sx,"QuickInput",this._container,new ORe,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof _u?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return BRe(a,l,c)}},accessibilityProvider:new FRe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Kg.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return te.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof Tn).map(t=>t.item),this._store)}get onDidChangeSelection(){return te.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof Tn).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new yt(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(W(this._container,ee.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(W(this._container,ee.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new NV(typeof this.hoverDelegate.delay=="function"?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(X3(t.browserEvent.target)){e.cancel();return}if(!(!X3(t.browserEvent.relatedTarget)&&sn(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof Tn&&this.showHover(t.element)})}catch(i){if(!Xo(i))throw i}})),this._register(this._tree.onMouseOut(t=>{sn(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const n=i===t;!!(i.focusInsideSeparator&ll.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=ll.ACTIVE_ITEM:i.focusInsideSeparator&=~ll.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&ll.MOUSE_HOVER)||(i.focusInsideSeparator|=ll.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&ll.MOUSE_HOVER)&&(i.focusInsideSeparator&=~ll.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof Tn);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof _u&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&t.item.pickable!==!1&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,n,s)=>{let r;if(n.type==="separator"){if(!n.buttons)return i;t=new _u(s,a=>this._onSeparatorButtonTriggered.fire(a),n),r=t}else{const a=s>0?e[s-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(l=a);const c=new Tn(s,t?.children?t.children.length:s,this._hasCheckboxes&&n.pickable!==!1,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,l);if(this._itemElements.push(c),t)return t.children.push(c),i;r=c}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),n=i?.parentNode;if(i&&n){const s=i.nextSibling;i.remove(),n.insertBefore(i,s)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){if(this._itemElements.length)switch(e===At.Second&&this._itemElements.length<2&&(e=At.First),e){case At.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof Tn);break;case At.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof Tn?t?!0:(t=!t,!1):!1);break}case At.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof Tn);break;case At.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof Tn?(this._tree.reveal(n.element),!0):!1);const i=this._tree.getFocus();t.length&&t[0]===i[0]&&this._onLeave.fire();break}case At.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,n=>{if(!(n.element instanceof Tn))return!1;const s=this._tree.getParentElement(n.element);return s===null||s.children[0]!==n.element?this._tree.reveal(n.element):this._tree.reveal(s),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&this._onLeave.fire();break}case At.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof Tn?(this._tree.reveal(t.element),!0):!1);break;case At.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof Tn))return!1;const i=this._tree.getParentElement(t.element);return i===null||i.children[0]!==t.element?this._tree.reveal(t.element):this._tree.reveal(i),!0});break;case At.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,s=>{if(t)return!0;if(s.element instanceof _u)t=!0,this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element.children[0]):this._tree.reveal(s.element,0);else if(s.element instanceof Tn){if(s.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),!0;if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1});const n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,s=>s.element instanceof Tn));break}case At.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof _u)i?t||(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element.children[0]):i=!0;else if(n.element instanceof Tn&&!t){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.element,0),!0}return!1}),t&&this._tree.setFocus([t]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const n=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=n&&n.type==="separator"&&!n.buttons?n:void 0)});else{let i;this._itemElements.forEach(n=>{let s;this.matchOnLabelMode==="fuzzy"?s=this.matchOnLabel?Ub(e,Gu(n.saneLabel))??void 0:void 0:s=this.matchOnLabel?WRe(t,Gu(n.saneLabel))??void 0:void 0;const r=this.matchOnDescription?Ub(e,Gu(n.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?Ub(e,Gu(n.saneDetail||""))??void 0:void 0;if(s||r||a?(n.labelHighlights=s,n.descriptionHighlights=r,n.detailHighlights=a,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=n.item?!n.item.alwaysShow:!0),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const l=n.index&&this._inputElements[n.index-1]||void 0;l?.type==="separator"&&!l.buttons&&(i=l),i&&!n.hidden&&(n.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof Tn),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof Tn))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new z;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof Tn&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof _u?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(n=>({element:n,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:t=>{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};cD([Si],Jv.prototype,"onDidChangeFocus",null);cD([Si],Jv.prototype,"onDidChangeSelection",null);Jv=cD([JP(4,fe),JP(5,kn)],Jv);function WRe(o,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return A6(o,t);const n=dw(t," "),s=t.length-n.length,r=A6(o,n);if(r)for(const a of r){const l=i[a.start+s]+s;a.start+=l,a.end+=l}return r}function A6(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t!==-1?[{start:t,end:t+o.length}]:null}function BRe(o,e,t){const i=o.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:PRe(o.saneSortLabel,e.saneSortLabel,t)}function HRe(o,e={}){fn.registerCommandAndKeybindingRule({weight:200,when:lD,metadata:{description:m(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...o,secondary:u3(o.primary,o.secondary??[],e)})}function Hs(o,e={}){fn.registerCommandAndKeybindingRule({weight:200,when:q.and(q.or(q.equals(Xv,"quickPick"),q.equals(Xv,"quickTree")),lD),metadata:{description:m(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...o,secondary:u3(o.primary,o.secondary??[],e)})}const ew=ze?256:2048;function u3(o,e,t={}){return t.withAltMod&&e.push(512+o),t.withCtrlMod&&(e.push(ew+o),t.withAltMod&&e.push(512+ew+o)),t.withCmdMod&&ze&&(e.push(2048+o),t.withCtrlMod&&e.push(2304+o),t.withAltMod&&(e.push(2560+o),t.withCtrlMod&&e.push(2816+o))),e}function Ao(o,e){return t=>{const i=t.get(Jn).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(o)}}Hs({id:"quickInput.pageNext",primary:12,handler:Ao(At.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Hs({id:"quickInput.pagePrevious",primary:11,handler:Ao(At.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Hs({id:"quickInput.first",primary:ew+14,handler:Ao(At.First)},{withAltMod:!0,withCmdMod:!0});Hs({id:"quickInput.last",primary:ew+13,handler:Ao(At.Last)},{withAltMod:!0,withCmdMod:!0});Hs({id:"quickInput.next",primary:18,handler:Ao(At.Next)},{withCtrlMod:!0});Hs({id:"quickInput.previous",primary:16,handler:Ao(At.Previous)},{withCtrlMod:!0});const O6=m(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),F6=m(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");ze?(Hs({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:Ao(At.NextSeparator,At.Next),metadata:{description:O6}}),Hs({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:Ao(At.NextSeparator)},{withCtrlMod:!0}),Hs({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:Ao(At.PreviousSeparator,At.Previous),metadata:{description:F6}}),Hs({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:Ao(At.PreviousSeparator)},{withCtrlMod:!0})):(Hs({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:Ao(At.NextSeparator,At.Next),metadata:{description:O6}}),Hs({id:"quickInput.nextSeparator",primary:2578,handler:Ao(At.NextSeparator)}),Hs({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:Ao(At.PreviousSeparator,At.Previous),metadata:{description:F6}}),Hs({id:"quickInput.previousSeparator",primary:2576,handler:Ao(At.PreviousSeparator)}));fn.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:q.and(q.notEquals(Xv,"quickWidget"),lD,q.not("isComposing")),metadata:{description:m(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:o=>{o.get(Jn).currentQuickInput?.accept()},secondary:u3(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})});Hs({id:"quickInput.acceptInBackground",when:q.and(lD,q.equals(Xv,"quickPick"),q.or(HF.negate(),ERe)),primary:17,weight:250,handler:o=>{o.get(Jn).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});HRe({id:"quickInput.hide",primary:9,handler:o=>{o.get(Jn).currentQuickInput?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Hs({id:"quickInput.toggleHover",primary:ew|10,handler:o=>{o.get(Jn).toggleHover()}});var VRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zRe=function(o,e){return function(t,i){e(t,i,o)}},tA;const J_=J;let Zx=class extends A{static{tA=this}static{this.ID="quickInputTreeElement"}constructor(e,t,i,n){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=n,this.templateId=tA.ID}renderTemplate(e){const t=new z,i=Z(e,J_(".quick-input-tree-entry")),n=t.add(new lK("",!1,{...nF,size:15}));i.appendChild(n.domNode);const s=Z(i,J_("label.quick-input-tree-label")),r=Z(s,J_(".quick-input-tree-rows")),a=Z(r,J_(".quick-input-tree-row")),l=fL(a,J_(".quick-input-tree-icon")),c=t.add(new Dv(a,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),d=t.add(new qs(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return d.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:n,icon:l,label:c,actionBar:d,toDisposeElement:new z}}renderElement(e,t,i,n){const s=i.toDisposeElement,r=e.element;if(r.pickable===!1?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=r.checked??!1,s.add(te.filter(this.onCheckedEvent,h=>h.item===r)(h=>i.checkbox.checked=h.checked)),r.disabled&&i.checkbox.disable()),r.iconPath){const h=td(this._themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,u=_e.revive(h);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=Ml(u)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-tree-icon ${r.iconClass}`:"";const{labelHighlights:a,descriptionHighlights:l}=e.filterData||{};let c;r.description&&(c={markdown:{value:Xr(r.description),supportThemeIcons:!0},markdownNotSupportedFallback:r.description}),i.label.setLabel(r.label,r.description,{matches:a,descriptionMatches:l,extraClasses:r.iconClasses,italic:r.italic,strikethrough:r.strikethrough,labelEscapeNewLines:!0,descriptionTitle:c});const d=r.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>om(h,`tree-${u}`,()=>this._buttonTriggeredEmitter.fire({item:r,button:h}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,n){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}};Zx=tA=VRe([zRe(3,ci)],Zx);class URe{getHeight(e){return 22}getTemplateId(e){return Zx.ID}}function $Re(o){let e=!1,t=!1,i=!1;for(const s of o){switch(s.element?.checked){case"mixed":i=!0;break;case!0:e=!0;break;default:t=!0;break}if(e&&t&&i)break}return t?i||e?"mixed":!1:i?"mixed":e}class jRe{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return m(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(t=>gj(t)).filter(t=>!!t).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return e.checked==="mixed"?"mixed":!!e.checked},onDidChange:t=>te.filter(this.onCheckedEvent,i=>i.item===e)(i=>t())}}}class qRe{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?Ub(this.filterValue,Gu(e.label))??void 0:void 0,n=this.matchOnDescription?Ub(this.filterValue,Gu(e.description||""))??void 0:void 0;return{visibility:t===1||i||n?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:n}}}}class KRe extends A{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.labelt.label)return 1;if(e.description&&t.description){if(e.descriptiont.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}}var GRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ZRe=function(o,e){return function(t,i){e(t,i,o)}};const YRe=J;let iA=class extends A{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new P),this._onDidChangeCheckboxState=this._register(new P),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new P),this._onLeave=new P,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new P),this.onDidAccept=this._onDidAccept.event,this._container=Z(e,YRe(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(Zx,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(qRe),this._sorter=this._register(new KRe),this._tree=this._register(this.instantiationService.createInstance(sx,"QuickInputTree",this._container,new URe,[this._renderer],{accessibilityProvider:new jRe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Kg.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){e.matchOnLabel!==void 0&&(this._filter.matchOnLabel=e.matchOnLabel),e.matchOnDescription!==void 0&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{const t=e.element;if(!t||t.disabled)return;if(t.pickable===!1){this._tree.setFocus([t]),this._onDidAccept.fire();return}const i=t.checked!==!0;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const n=new Set,s=[...this._tree.getNode(t).children];for(;s.length;){const a=s.shift();a?.element&&!n.has(a.element)&&(n.add(a.element),(a.element.checked??!1)!==t.checked&&(a.element.checked=t.checked,this._tree.rerender(a.element)),s.push(...a.children))}let r=this._tree.getParentElement(t);for(;r;){const a=[...this._tree.getNode(r).children],l=$Re(a);(r.checked??!1)!==l&&(r.checked=l,this._tree.rerender(r)),r=this._tree.getParentElement(r)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const n=t.shift();!n?.element||e.has(n.element)||n.element.checked&&(e.add(n.element),t.push(...n.children),n.element.children||i.push(n.element))}return i}};iA=GRe([ZRe(2,fe)],iA);var xY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ig=function(o,e){return function(t,i){e(t,i,o)}},nA;const Lo=J,IE="workbench.quickInput.viewState";let sA=class extends A{static{nA=this}static{this.MAX_WIDTH=600}get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new P),this.onDidCustomEmitter=this._register(new P),this.onDidTriggerButtonEmitter=this._register(new P),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new P),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new P),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=xRe.bindTo(n),this.quickInputTypeContext=DRe.bindTo(n),this.endOfQuickInputBoxContext=IRe.bindTo(n),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(te.runAndSubscribe(gw,({window:r,disposables:a})=>this.registerKeyModsListeners(r,a),{window:wt,disposables:this._store})),this._register(KJ(r=>{this.ui&&pe(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[ee.KEY_DOWN,ee.KEY_UP,ee.MOUSE_DOWN])t.add(W(e,n,i,!0))}getUI(e){if(this.ui)return e&&pe(this._container)!==pe(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Z(this._container,Lo(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=Ir(t),n=Z(t,Lo(".quick-input-titlebar")),s=this._register(new qs(n,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");const r=Z(n,Lo(".quick-input-title")),a=this._register(new qs(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Z(t,Lo(".quick-input-header")),c=this._register(new lK(m(1763,"Toggle all checkboxes"),!1,{...nF,size:15}));Z(l,c.domNode),this._register(c.onChange(()=>{const K=c.checked;O.setAllVisibleChecked(K===!0)})),this._register(W(c.domNode,ee.CLICK,K=>{(K.x||K.y)&&g.setFocus()}));const d=Z(l,Lo(".quick-input-description")),h=Z(l,Lo(".quick-input-and-message")),u=Z(h,Lo(".quick-input-filter")),g=this._register(new RRe(u,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const f=Z(u,Lo(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const p=this._register(new yR(f,{countFormat:m(1764,"{0} Results")},this.styles.countBadge)),_=Z(u,Lo(".quick-input-count"));_.setAttribute("aria-live","polite");const b=this._register(new yR(_,{countFormat:m(1765,"{0} Selected")},this.styles.countBadge)),C=this._register(new qs(l,{hoverDelegate:this.options.hoverDelegate}));C.domNode.classList.add("quick-input-inline-action-bar");const w=Z(l,Lo(".quick-input-action")),v=this._register(new Wy(w,this.styles.button));v.label=m(1766,"OK"),this._register(v.onDidClick(K=>{this.onDidAcceptEmitter.fire()}));const S=Z(l,Lo(".quick-input-action")),x=this._register(new Wy(S,{...this.styles.button,supportIcons:!0}));x.label=m(1767,"Custom"),this._register(x.onDidClick(K=>{this.onDidCustomEmitter.fire()}));const k=Z(h,Lo(`#${this.idPrefix}message.quick-input-message`)),D=this._register(new h3(t,this.styles.progressBar));D.getContainer().classList.add("quick-input-progress");const I=Z(t,Lo(".quick-input-html-widget"));I.tabIndex=-1;const T=Z(t,Lo(".quick-input-description")),F=this.idPrefix+"list",O=this._register(this.instantiationService.createInstance(Jv,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,F));g.setAttribute("aria-controls",F),this._register(O.onDidChangeFocus(()=>{g.hasFocus()&&g.setAttribute("aria-activedescendant",O.getActiveDescendant()??"")})),this._register(O.onChangedAllVisibleChecked(K=>{c.checked=K})),this._register(O.onChangedVisibleCount(K=>{p.setCount(K)})),this._register(O.onChangedCheckedCount(K=>{aw(()=>b.setCount(K))})),this._register(O.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),this.controller instanceof mC&&this.controller.canSelectMany&&O.clearFocus())},0)}));const B=this._register(this.instantiationService.createInstance(iA,t,this.options.hoverDelegate));this._register(B.tree.onDidChangeFocus(()=>{g.hasFocus()&&g.setAttribute("aria-activedescendant",B.getActiveDescendant()??"")})),this._register(B.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),B.tree.setFocus([]))},0)})),this._register(B.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(B.tree.onDidChangeContentHeight(()=>this.updateLayout()));const U=xr(t);return this._register(U),this._register(W(t,ee.FOCUS,K=>{const ie=this.getUI();if(sn(K.relatedTarget,ie.inputContainer)){const X=ie.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==X&&this.endOfQuickInputBoxContext.set(X)}sn(K.relatedTarget,ie.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=mi(K.relatedTarget)?K.relatedTarget:void 0)},!0)),this._register(U.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(mv.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(g.onKeyDown(K=>{const ie=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ie&&this.endOfQuickInputBoxContext.set(ie),g.removeAttribute("aria-activedescendant")})),this._register(W(t,ee.FOCUS,K=>{g.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(oA,this._container,t,[{node:n,includeChildren:!0},{node:l,includeChildren:!1}],this.viewState)),this._register(xe(K=>{const ie=this.dndController?.dndViewState.read(K);ie&&(ie.top!==void 0&&ie.left!==void 0?this.viewState={...this.viewState,top:ie.top,left:ie.left}:this.viewState=void 0,this.updateLayout(),ie.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:n,title:r,description1:T,description2:d,widget:I,rightActionBar:a,inlineActionBar:C,checkAll:c,inputContainer:h,filterContainer:u,inputBox:g,visibleCountContainer:f,visibleCount:p,countContainer:_,count:b,okContainer:w,ok:v,message:k,customButtonContainer:S,customButton:x,list:O,tree:B,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:K=>this.show(K),hide:()=>this.hide(),setVisibilities:K=>this.setVisibilities(K),setEnabled:K=>this.setEnabled(K),setContextKey:K=>this.options.setContextKey(K),linkOpenerDelegate:K=>this.options.linkOpenerDelegate(K)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Z(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},i=Ve.None){return new Promise((n,s)=>{let r=d=>{r=n,t.onKeyMods?.(a.keyMods),n(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),g=u.splice(h,1),f=a.activeItems.filter(_=>_!==g[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,f&&(a.activeItems=f),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(d=>t.onDidTriggerSeparatorButton?.(d)),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{pt(c),r(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.prompt=t.prompt,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,t.sortByLabel!==void 0&&(a.sortByLabel=t.sortByLabel),a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{l=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{s(d),a.hide()})})}setValidationOnInput(e,t){t&&nn(t)?(e.severity=ni.Error,e.validationMessage=t):t&&!nn(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=ni.Ignore,e.validationMessage=void 0)}input(e={},t=Ve.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),s=e.validateInput||(()=>Promise.resolve(void 0)),r=te.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",l=Promise.resolve(s(a));const c=[n,r(d=>{d!==a&&(l=Promise.resolve(s(d)),a=d),l.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(l=Promise.resolve(s(d)),a=d),l.then(h=>{!h||!nn(h)&&h.severity!==ni.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{pt(c),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new mC(t)}createInputBox(){const e=this.getUI(!0);return new NRe(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",on(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(ni.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),on(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();XP.tooltip=n?m(1768,"Back ({0})",n):m(1769,"Back"),t.container.style.display="",this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,n=i&&!fz(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let s=this.previousFocusElement;for(;s&&!s.offsetParent;)s=s.parentElement??void 0;s?.offsetParent?(s.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof mC&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,nA.MAX_WIDTH);e.width=t+"px",e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(IE,-1,"{}"));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e!==void 0?this.storageService.store(IE,JSON.stringify(e),-1,1):this.storageService.remove(IE,-1))}};sA=nA=xY([ig(1,Ul),ig(2,fe),ig(3,Ie),ig(4,ps)],sA);let oA=class extends A{constructor(e,t,i,n,s,r,a){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=s,this.configurationService=a,this.dndViewState=De(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=kRe.bindTo(r);const l=Eme(this.configurationService)==="custom";this._controlsOnLeft=l&&CD===1,this._controlsOnRight=l&&(CD===3||CD===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){const n=Math.round(t.left*100)/100,s=e.width,r=i.width,a=n*s-r/2;this._layout(t.top*e.height,a)}}_registerLayoutListener(){this._register(te.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(Y3(e,t=>{const i=new Wn(pe(e),t);i.detail===2&&this._quickInputDragAreas.some(({node:n,includeChildren:s})=>s?sn(i.target,n):i.target===n)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(dz(e,t=>{const i=pe(this._layoutService.activeContainer),n=new Wn(i,t);if(!this._quickInputDragAreas.some(({node:h,includeChildren:u})=>u?sn(n.target,h):n.target===h))return;const s=this._quickInputContainer.getBoundingClientRect(),r=n.browserEvent.clientX-s.left,a=n.browserEvent.clientY-s.top;let l=!1;const c=QJ(i,h=>{new Wn(i,h).preventDefault(),l||(l=!0),this._layout(h.clientY-a,h.clientX-r)}),d=Y3(i,h=>{if(l){const u=this.dndViewState.get();this.dndViewState.set({top:u?.top,left:u?.left,done:!0},void 0)}c.dispose(),d.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),s=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eb=function(o,e){return function(t,i){e(t,i,o)}};let rA=class extends Fre{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(YP))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new P),this._onHide=this._register(new P),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(gd).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(QP))},n=this._register(this.instantiationService.createInstance(sA,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{pe(e.activeContainer)===pe(n.container)&&n.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new oe(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=Ve.None){return this.controller.pick(e,t,i)}input(e={},t=Ve.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Q($D),quickInputForeground:Q(koe),quickInputTitleBackground:Q(Doe),widgetBorder:Q(VO),widgetShadow:Q(c_)},inputBox:Iy,toggle:Dy,countBadge:eq,button:Sme,progressBar:yme,keybindingLabel:Jj,list:gf({listBackground:$D,listFocusBackground:zC,listFocusForeground:VC,listInactiveFocusForeground:VC,listInactiveSelectionIconForeground:KO,listInactiveFocusBackground:zC,listFocusOutline:Gt,listInactiveFocusOutline:Gt,treeStickyScrollBackground:$D}),pickerGroup:{pickerGroupBorder:Q(Ioe),pickerGroupForeground:Q(DU)}}}};rA=XRe([eb(0,fe),eb(1,Ie),eb(2,ci),eb(3,Ul),eb(4,Pe)],rA);var LY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ou=function(o,e){return function(t,i){e(t,i,o)}};let aA=class extends rA{constructor(e,t,i,n,s,r){super(t,i,n,new AP(e.getContainerDomNode(),s),r),this.host=void 0;const a=tw.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return te.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return te.None},get onDidAddContainer(){return te.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};aA=LY([Ou(1,fe),Ou(2,Ie),Ou(3,ci),Ou(4,et),Ou(5,Pe)],aA);let lA=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(aA,e);this.mapEditorToService.set(e,t),yg(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=Ve.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};lA=LY([Ou(0,fe),Ou(1,et)],lA);class tw{static{this.ID="editor.controller.quickInput"}static get(e){return e.getContribution(tw.ID)}constructor(e){this.editor=e,this.widget=new g3(this.editor)}dispose(){this.widget.dispose()}}class g3{static{this.ID="editor.contrib.quickInputWidget"}constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return g3.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Xe(tw.ID,tw,4);var QRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},EE=function(o,e){return function(t,i){e(t,i,o)}};let cA=class extends A{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new P,this._onDidChangeReducedMotion=new P,this._onDidChangeLinkUnderline=new P,this._accessibilityModeEnabledContext=a_.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=wt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(W(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",i),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};cA=QRe([EE(0,Ie),EE(1,Ul),EE(2,Pe)],cA);var JRe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},W6=function(o,e){return function(t,i){e(t,i,o)}},dA;const B6="application/vnd.code.resources";let hA=class extends A{static{dA=this}constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(vg||bV)&&this.installWebKitWriteTextWorkaround(),this._register(te.runAndSubscribe(gw,({window:i,disposables:n})=>{n.add(W(i.document,"copy",()=>this.clearResourcesState()))},{window:wt,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const t=new tf;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,_t().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(te.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(W(t,"click",e)),i.add(W(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await _t().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=fw(),i=t.activeElement,n=t.body.appendChild(J("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),mi(i)&&i.focus(),n.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const t=await _t().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}static{this.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3}async readResources(){try{const t=await _t().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${B6}`)){const n=await i.getType(`web ${B6}`);return JSON.parse(await n.text()).map(r=>_e.from(r))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return uw(e.substring(0,dA.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}};hA=dA=JRe([W6(0,Ul),W6(1,Mt)],hA);var eMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tMe=function(o,e){return function(t,i){e(t,i,o)}};const _C="data-keybinding-context";class f3{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class Zm extends f3{static{this.INSTANCE=new Zm}constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}class Yx extends f3{static{this._keyPrefix="config."}constructor(e,t,i){super(e,null),this._configurationService=t,this._values=$p.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===7){const s=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new V6(s))}else{const s=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(s.push(...Ke.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(s.push(a),this._values.delete(a))}i.fire(new V6(s))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Yx._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Yx._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}class iMe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class H6{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class V6{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class nMe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function sMe(o,e){return o.allKeysContainedIn(new Set(Object.keys(e)))}class kY extends A{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new xg({merge:t=>new nMe(t)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new iMe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new oMe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new H6(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new H6(e))}getContext(e){return this._isDisposed?Zm.INSTANCE:this.getContextValuesContainer(rMe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let uA=class extends kY{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=HF.bindTo(this);const t=this._register(new Yx(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(te.runAndSubscribe(gw,({window:i,disposables:n})=>{const s=n.add(new ut);n.add(W(i,ee.FOCUS_IN,()=>{s.value=new z,this.updateInputContextKeys(i.document,s.value)},!0))},{window:wt,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&Ia(e.activeElement)}const n=i();if(this.inputFocusedContext.set(n),n){const s=t.add(xr(e.activeElement));te.once(s.onDidBlur)(()=>{_t().document===e&&this.inputFocusedContext.set(i()),s.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?Zm.INSTANCE:this._contexts.get(e)||Zm.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new f3(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};uA=eMe([tMe(0,Pe)],uA);class oMe extends kY{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new ut),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(_C)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(_C,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;sMe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(_C),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Zm.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function rMe(o){for(;o;){if(o.hasAttribute(_C)){const e=o.getAttribute(_C);return e?parseInt(e,10):NaN}o=o.parentElement}return 0}function aMe(o,e,t){o.get(Ie).createKey(String(e),lMe(t))}function lMe(o){return Wz(o,e=>{if(typeof e=="object"&&e.$mid===1)return _e.revive(e).toString();if(e instanceof _e)return e.toString()})}Ye.registerCommand("_setContext",aMe);Ye.registerCommand({id:"getContextKeyInfo",handler(){return[...oe.all()].sort((o,e)=>o.key.localeCompare(e.key))},metadata:{description:m(1674,"A command that returns information about context keys"),args:[]}});Ye.registerCommand("_generateContextKeyInfo",function(){const o=[],e=new Set;for(const t of oe.all())e.has(t.key)||(e.add(t.key),o.push(t));o.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(o,void 0,2))});let cMe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class z6{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new cMe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const kPe=!1;class Iz extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class qx{constructor(e=new $_,t=!1,i,n=kPe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(pe,this),this._globalGraph=n?i?._globalGraph??new kz(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,vt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Lf(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends qx{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=_r.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw hy("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a},getIfExists:r=>{if(n)throw hy("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(r,i)}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof Il?(i=_r.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=_r.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Ha.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Il)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Il?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new kz(l=>l.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const l=r.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),n.lookupOrInsertNode(l),s++>1e3)throw new Iz(n);for(const c of Ha.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),d instanceof Il){const h={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};n.insertEdge(l,h),r.push(h)}}}}for(;;){const l=n.roots();if(l.length===0){if(!n.isEmpty())throw new Iz(n);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Il){const h=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,h)}n.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof Il)return this._createServiceInstance(e,t,i,n,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s,r){if(n){const a=new qx(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new Cee(()=>{const d=a._createInstance(t,i,s);for(const[h,u]of l){const g=d[h];if(typeof g=="function")for(const f of u)f.disposable=g.apply(d,f.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!c.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let f=l.get(h);return f||(f=new bs,l.set(h,f)),(_,b,C)=>{if(c.isInitialized)return c.value[h](_,b,C);{const w={listener:[_,b,C],disposable:void 0},v=f.push(w);return ge(()=>{v(),w.disposable?.dispose()})}}}if(h in d)return d[h];const u=c.value;let g=u[h];return typeof g!="function"||(g=g.bind(u),d[h]=g),g},set(d,h,u){return c.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,s);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class _r{static{this.all=new Set}static{this._None=new class extends _r{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,t){return e?new _r(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const dMe=!1;class U6 extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class Xx{constructor(e=new f_,t=!1,i,n=dMe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(fe,this),this._globalGraph=n?i?._globalGraph??new z6(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,pt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)ef(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends Xx{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=nr.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw m0("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a},getIfExists:r=>{if(n)throw m0("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(r,i)}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof hl?(i=nr.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=nr.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=xa.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof hl)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof hl?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new z6(l=>l.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const l=r.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),n.lookupOrInsertNode(l),s++>1e3)throw new U6(n);for(const c of xa.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),d instanceof hl){const h={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};n.insertEdge(l,h),r.push(h)}}}}for(;;){const l=n.roots();if(l.length===0){if(!n.isEmpty())throw new U6(n);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof hl){const h=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,h)}n.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof hl)return this._createServiceInstance(e,t,i,n,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s,r){if(n){const a=new Xx(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new yQ(()=>{const d=a._createInstance(t,i,s);for(const[h,u]of l){const g=d[h];if(typeof g=="function")for(const f of u)f.disposable=g.apply(d,f.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!c.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let f=l.get(h);return f||(f=new cs,l.set(h,f)),(_,b,C)=>{if(c.isInitialized)return c.value[h](_,b,C);{const w={listener:[_,b,C],disposable:void 0},v=f.push(w);return ue(()=>{v(),w.disposable?.dispose()})}}}if(h in d)return d[h];const u=c.value;let g=u[h];return typeof g!="function"||(g=g.bind(u),d[h]=g),g},set(d,h,u){return c.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,s);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class nr{static{this.all=new Set}static{this._None=new class extends nr{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,t){return e?new nr(2,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):_r._None}static traceCreation(e,t){return e?new _r(1,t.name):_r._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new _r(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;_r._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(` -`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${_r._totals.toFixed(2)}ms)`];(e>2||t)&&_r.all.add(n.join(` -`))}}const IPe=new Set([Ie.inMemory,Ie.vscodeSourceControl,Ie.walkThrough,Ie.walkThroughSnippet,Ie.vscodeChatCodeBlock,Ie.vscodeTerminal]);class EPe{constructor(){this._byResource=new gi,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new gi,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??Je.empty():be.isUri(e)?this._byResource.get(e)?.values()??Je.empty():Je.map(Je.concat(...this._byOwner.values()),t=>t[1])}}class NPe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new gi,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(IPe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ui.Error?t.errors+=1:i===ui.Warning?t.warnings+=1:i===ui.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class rg{constructor(){this._onMarkerChanged=new uU({delay:0,merge:rg._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new EPe,this._stats=new NPe(this),this._filteredResources=new gi}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(OU(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=rg._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g,origin:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g,origin:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=Je.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(ws(t)){const s=new gi;for(const{resource:r,marker:a}of t){const l=rg._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=t.length===1?m(1738,'Problems are paused because: "{0}"',t[0]):m(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:ui.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r?.length)return[this._createFilteredMarker(i,r)];const a=this._data.get(i,t);if(!a)return[];const l=[];for(const c of a){if(s>0&&l.length===s)break;const d=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);d?.length?l.push(this._createFilteredMarker(i,d)):rg._accept(c,n)&&l.push(c)}return l}else{const r=!t&&!i?this._data.values():this._data.values(i??t),a=[],l=new Aie;for(const c of r)for(const d of c){if(l.has(d.resource))continue;if(s>0&&a.length===s)break;const h=e.ignoreResourceFilters?void 0:this._filteredResources.get(d.resource);h?.length?(a.push(this._createFilteredMarker(d.resource,h)),l.add(d.resource)):rg._accept(d,n)&&a.push(d)}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new gi;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class TPe extends F{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=En.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=En.createEmptyModel(this.logService);const e=fi.as(rl.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const s=i[n],r=t[n];s!==void 0?this._configurationModel.setValue(n,s):r?this._configurationModel.setValue(n,kl(r.default)):this._configurationModel.removeValue(n)}}}class RPe extends F{constructor(e,t=[]){super(),this.logger=new Kie([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}class MPe{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}}var cc=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Wi=function(o,e){return function(t,i){e(t,i,o)}};class PPe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new P}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let xO=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new oee(new PPe(t))):Promise.reject(new Error("Model not found"))}};xO=cc([Wi(0,ri)],xO);class kW{static{this.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}}}show(){return kW.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}class APe{withProgress(e,t,i){return t({report:()=>{}})}}class OPe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class FPe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` +`)):nr._None}static traceCreation(e,t){return e?new nr(1,t.name):nr._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new nr(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;nr._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${nr._totals.toFixed(2)}ms)`];(e>2||t)&&nr.all.add(n.join(` +`))}}const hMe=new Set([Le.inMemory,Le.vscodeSourceControl,Le.walkThrough,Le.walkThroughSnippet,Le.vscodeChatCodeBlock,Le.vscodeTerminal]);class uMe{constructor(){this._byResource=new ai,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new ai,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??Ke.empty():_e.isUri(e)?this._byResource.get(e)?.values()??Ke.empty():Ke.map(Ke.concat(...this._byOwner.values()),t=>t[1])}}class gMe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ai,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(hMe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ri.Error?t.errors+=1:i===ri.Warning?t.warnings+=1:i===ri.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Fu{constructor(){this._onMarkerChanged=new DV({delay:0,merge:Fu._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new uMe,this._stats=new gMe(this),this._filteredResources=new ai}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(XV(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=Fu._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g,origin:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g,origin:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=Ke.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(us(t)){const s=new ai;for(const{resource:r,marker:a}of t){const l=Fu._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=t.length===1?m(1738,'Problems are paused because: "{0}"',t[0]):m(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:ri.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r?.length)return[this._createFilteredMarker(i,r)];const a=this._data.get(i,t);if(!a)return[];const l=[];for(const c of a){if(s>0&&l.length===s)break;const d=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);d?.length?l.push(this._createFilteredMarker(i,d)):Fu._accept(c,n)&&l.push(c)}return l}else{const r=!t&&!i?this._data.values():this._data.values(i??t),a=[],l=new Bee;for(const c of r)for(const d of c){if(l.has(d.resource))continue;if(s>0&&a.length===s)break;const h=e.ignoreResourceFilters?void 0:this._filteredResources.get(d.resource);h?.length?(a.push(this._createFilteredMarker(d.resource,h)),l.add(d.resource)):Fu._accept(d,n)&&a.push(d)}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new ai;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class fMe extends A{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Sn.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Sn.createEmptyModel(this.logService);const e=li.as($a.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const s=i[n],r=t[n];s!==void 0?this._configurationModel.setValue(n,s):r?this._configurationModel.setValue(n,dl(r.default)):this._configurationModel.removeValue(n)}}}class pMe extends A{constructor(e,t=[]){super(),this.logger=new Xee([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}class mMe{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}}var ql=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ti=function(o,e){return function(t,i){e(t,i,o)}};class _Me{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new P}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let gA=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new cQ(new _Me(t))):Promise.reject(new Error("Model not found"))}};gA=ql([Ti(0,ei)],gA);class p3{static{this.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}}}show(){return p3.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}class bMe{withProgress(e,t,i){return t({report:()=>{}})}}class CMe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class vMe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),kt.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:ci.Error,message:e,detail:t})}}class Kx{static{this.NO_OP=new kde}info(e){return this.notify({severity:ci.Info,message:e})}warn(e){return this.notify({severity:ci.Warning,message:e})}error(e){return this.notify({severity:ci.Error,message:e})}notify(e){switch(e.severity){case ci.Error:console.error(e.message);break;case ci.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Kx.NO_OP}prompt(e,t,i,n){return Kx.NO_OP}status(e,t){return{close:()=>{}}}}let DO=class{constructor(e){this._onWillExecuteCommand=new P,this._onDidExecuteCommand=new P,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=it.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};DO=cc([Wi(0,pe)],DO);let D_=class extends f2e{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new z;f.add(B(g,te.KEY_DOWN,p=>{const _=new Et(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add(B(g,te.KEY_UP,p=>{const _=new Et(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new WPe(g,f))},l=g=>{for(let f=0;f{g.getOption(70)||a(g.getContainerDomNode())},d=g=>{g.getOption(70)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return da(it.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:YN(i.keybinding,wo),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),ge(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return kt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new rz(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=Pw.resolveKeybinding(a,wo);for(const c of l)i[n++]=new rz(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new fd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Pw([t],wo)}};D_=cc([Wi(0,Ne),Wi(1,Vt),Wi(2,cs),Wi(3,Li),Wi(4,Ht),Wi(5,at)],D_);class WPe extends F{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Ez(o){return!!o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof be)}let Gx=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new P,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new TPe(e);this._configuration=new iI(t.reload(),En.createEmptyModel(e),En.createEmptyModel(e),En.createEmptyModel(e),En.createEmptyModel(e),En.createEmptyModel(e),new gi,En.createEmptyModel(e),new gi,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=Ez(e)?e:Ez(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[s,r]=n;this.getValue(s)!==r&&(this._configuration.updateValue(s,r),i.push(s))}if(i.length>0){const n=new d2e({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=8,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};Gx=cc([Wi(0,Ht)],Gx);let kO=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new P,this.configurationService.onDidChangeConfiguration(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(s,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=R.isIPosition(t)?t:null,s=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):void 0;return typeof s>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};kO=cc([Wi(0,Oe),Wi(1,ri),Wi(2,yi)],kO);let IO=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:oo||je?` +`+t),wt.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:ni.Error,message:e,detail:t})}}class Qx{static{this.NO_OP=new Tle}info(e){return this.notify({severity:ni.Info,message:e})}warn(e){return this.notify({severity:ni.Warning,message:e})}error(e){return this.notify({severity:ni.Error,message:e})}notify(e){switch(e.severity){case ni.Error:console.error(e.message);break;case ni.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Qx.NO_OP}prompt(e,t,i,n){return Qx.NO_OP}status(e,t){return{close:()=>{}}}}let fA=class{constructor(e){this._onWillExecuteCommand=new P,this._onDidExecuteCommand=new P,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Ye.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};fA=ql([Ti(0,fe)],fA);let Ym=class extends XTe{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new z;f.add(W(g,ee.KEY_DOWN,p=>{const _=new yt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add(W(g,ee.KEY_UP,p=>{const _=new yt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new wMe(g,f))},l=g=>{for(let f=0;f{g.getOption(70)||a(g.getContainerDomNode())},d=g=>{g.getOption(70)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return Yr(Ye.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:HE(i.keybinding,lo),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),ue(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return wt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new w6(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=Yv.resolveKeybinding(a,lo);for(const c of l)i[n++]=new w6(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Kc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Yv([t],lo)}};Ym=ql([Ti(0,Ie),Ti(1,Pt),Ti(2,ts),Ti(3,bi),Ti(4,Mt),Ti(5,et)],Ym);class wMe extends A{constructor(e,t){super(),this.domNode=e,this._register(t)}}function $6(o){return!!o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof _e)}let Jx=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new P,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new fMe(e);this._configuration=new aD(t.reload(),Sn.createEmptyModel(e),Sn.createEmptyModel(e),Sn.createEmptyModel(e),Sn.createEmptyModel(e),Sn.createEmptyModel(e),new ai,Sn.createEmptyModel(e),new ai,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=$6(e)?e:$6(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[s,r]=n;this.getValue(s)!==r&&(this._configuration.updateValue(s,r),i.push(s))}if(i.length>0){const n=new KTe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=8,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};Jx=ql([Ti(0,Mt)],Jx);let pA=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new P,this.configurationService.onDidChangeConfiguration(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(s,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=R.isIPosition(t)?t:null,s=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):void 0;return typeof s>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};pA=ql([Ti(0,Pe),Ti(1,ei),Ti(2,_i)],pA);let mA=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Gs||ze?` `:`\r -`}};IO=cc([Wi(0,Oe)],IO);class BPe{publicLog2(){}}class Zx{static{this.SCHEME="inmemory"}constructor(){const e=be.from({scheme:Zx.SCHEME,authority:"model",path:"/"});this.workspace={id:uG,folders:[new eve({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Zx.SCHEME?this.workspace.folders[0]:null}}function Yx(o,e,t){if(!e||!(o instanceof Gx))return;const i=[];Object.keys(e).forEach(n=>{bve(n)&&i.push([`editor.${n}`,e[n]]),t&&Cve(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let EO=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:C5.convert(e),n=new Map;for(const a of i){if(!(a instanceof Ah))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(Ci.replaceMove(D.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:Gg(WP.bulkEditServiceSummary,s,r),isApplied:s>0}}};EO=cc([Wi(0,ri)],EO);class HPe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Br(e)}}let NO=class extends i2e{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};NO=cc([Wi(0,rc),Wi(1,at)],NO);class VPe{constructor(){this._neverEmitter=new P,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class zPe extends Bx{constructor(){super()}}class UPe extends RPe{constructor(){super(new qie)}}let TO=class extends tO{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};TO=cc([Wi(0,cs),Wi(1,Li),Wi(2,Md),Wi(3,dt),Wi(4,Ur),Wi(5,Ne)],TO);const $Pe={esmModuleLocation:void 0,label:"editorWorkerService"};let RO=class extends UA{constructor(e,t,i,n,s){super($Pe,e,t,i,n,s)}};RO=cc([Wi(0,ri),Wi(1,qk),Wi(2,Ht),Wi(3,ai),Wi(4,ue)],RO);class jPe{async playSignal(e,t){}}Ge(Ht,UPe,0);Ge(Oe,Gx,0);Ge(qk,kO,0);Ge(uX,IO,0);Ge(xd,Zx,0);Ge(Cf,HPe,0);Ge(cs,BPe,0);Ge(A1,FPe,0);Ge(N5,OPe,0);Ge(Li,Kx,0);Ge(ac,rg,0);Ge(yi,zPe,0);Ge(fr,KRe,0);Ge(ri,aO,0);Ge(j4,rO,0);Ge(Ne,LO,0);Ge(Bq,APe,0);Ge(yd,kW,0);Ge(Ls,Fbe,0);Ge(uo,RO,0);Ge(v1,EO,0);Ge(LX,VPe,0);Ge(ys,xO,0);Ge(Mn,wO,0);Ge(Kr,jSe,0);Ge(Vt,DO,0);Ge(dt,D_,0);Ge(as,vO,0);Ge(Md,NO,0);Ge(Pd,oO,0);Ge(Mo,yO,0);Ge(gr,TO,0);Ge(Ur,KR,0);Ge(Td,jPe,0);Ge(PF,MPe,0);Ge(g$,Yie,0);Ge(x3,axe,0);var Re;(function(o){const e=new $_;for(const[l,c]of G7())e.set(l,c);const t=new qx(e,!0);e.set(pe,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Il?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new P;function r(l){if(n)return t;n=!0;for(const[d,h]of G7())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=Ve(d);e.get(h)instanceof Il&&e.set(h,l[d])}const c=ewe();for(const d of c)try{t.createInstance(d)}catch(h){Te(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new z,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(Re||(Re={}));var qPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nz=function(o,e){return function(t,i){e(t,i,o)}},oy;let MO=class{static{oy=this}static{this._ttpTokenizer=sc("tokenizeToString",{createHTML(e){return e}})}constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){const n=il(i.context)?i.context:void 0;let s;e?s=this._languageService.getLanguageIdByLanguageName(e):n&&(s=n.getModel()?.getLanguageId()),s||(s=rr);const r=await Jge(this._languageService,t,s),a=oy._ttpTokenizer?oy._ttpTokenizer.createHTML(r)??r:r,l=document.createElement("span");l.innerHTML=a;const c=l.querySelector(".monaco-tokenized-source");return Si(c)?(wn(c,this.getFontInfo(n)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):Eoe({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}};MO=oy=qPe([Nz(0,Oe),Nz(1,yi)],MO);var IW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Pt=function(o,e){return function(t,i){e(t,i,o)}};let KPe=0,Tz=!1;function GPe(o){if(!o){if(Tz)return;Tz=!0}hie(o||kt.document.body)}let Xx=class extends sf{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f){const p={...t};p.ariaLabel=p.ariaLabel||OP.editorViewAccessibleLabel,super(e,p,{},i,n,s,r,c,d,h,u,g),l instanceof D_?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,GPe(p.ariaContainerElement),Bfe((_,b)=>i.createInstance(a_,_,{instantHover:b},{})),Zme(a),f.setDefaultCodeBlockRenderer(i.createInstance(MO))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++KPe,s=K.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),F.None;const t=e.id,i=e.label,n=K.and(K.equals("editorId",this.getId()),K.deserialize(e.precondition)),s=e.keybindings,r=K.and(n,K.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...f)=>Promise.resolve(e.run(this,...f)),d=new z,h=this.getId()+":"+t;if(d.add(it.registerCommand(h,c)),a){const g={command:{id:h,title:i},when:n,group:a,order:l};d.add(vn.appendMenuItem(M.EditorContext,g))}if(Array.isArray(s))for(const g of s)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,g,c,r));const u=new cq(h,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,u),d.add(ge(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof Mx)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Xx=IW([Pt(2,pe),Pt(3,at),Pt(4,Vt),Pt(5,Ne),Pt(6,Us),Pt(7,dt),Pt(8,pi),Pt(9,Li),Pt(10,Mn),Pt(11,ai),Pt(12,ue),Pt(13,Sa)],Xx);let PO=class extends Xx{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b){const C={...t};Yx(h,C,!1);const w=c.registerEditorContainer(e);typeof C.theme=="string"&&c.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!C.autoDetectHighContrast);const v=C.model;delete C.model,super(e,C,i,n,s,r,a,l,c,d,u,p,_,b),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let S;if(typeof v>"u"){const L=f.getLanguageIdByMimeType(C.language)||C.language||rr;S=_Q(g,f,C.value||"",L,void 0),this._ownsModel=!0}else S=v,this._ownsModel=!1;if(this._attachModel(S),S){const L={oldModelUrl:null,newModelUrl:S.uri};this._onDidChangeModel.fire(L)}}dispose(){super.dispose()}updateOptions(e){Yx(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};PO=IW([Pt(2,pe),Pt(3,at),Pt(4,Vt),Pt(5,Ne),Pt(6,Us),Pt(7,dt),Pt(8,fr),Pt(9,Li),Pt(10,Oe),Pt(11,Mn),Pt(12,ri),Pt(13,yi),Pt(14,ai),Pt(15,ue),Pt(16,Sa)],PO);let AO=class extends Xl{constructor(e,t,i,n,s,r,a,l,c,d,h,u){const g={...t};Yx(l,g,!0);const f=r.registerEditorContainer(e);typeof g.theme=="string"&&r.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},n,i,s,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){Yx(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Xx,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};AO=IW([Pt(2,pe),Pt(3,Ne),Pt(4,at),Pt(5,fr),Pt(6,Li),Pt(7,Oe),Pt(8,gr),Pt(9,yd),Pt(10,Mo),Pt(11,Td)],AO);function _Q(o,e,t,i,n){if(t=t||"",!i){const s=t.indexOf(` -`);let r=t;return s!==-1&&(r=t.substring(0,s)),Rz(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return Rz(o,t,e.createById(i),n)}function Rz(o,e,t,i){return o.createModel(e,t,i)}E("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},m(142,"The background color of the diff editor's header"));E("multiDiffEditor.background",Ri,m(143,"The background color of the multi file diff editor"));E("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},m(144,"The border color of the multi file diff editor"));var ZPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Mz=function(o,e){return function(t,i){e(t,i,o)}};class YPe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let OO=class extends F{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Ee(this,void 0),this._collapsed=$(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Ee(this,500),this.contentHeight=$(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ee(this,0),this._modifiedWidth=Ee(this,0),this._originalContentWidth=Ee(this,0),this._originalWidth=Ee(this,0),this.maxScroll=$(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=ot("div.multiDiffEntry",[ot("div.header@header",[ot("div.header-content",[ot("div.collapse-button@collapseButton"),ot("div.file-path",[ot("div.title.modified.show-file-icons@primaryPath",[]),ot("div.status.deleted@status",["R"]),ot("div.title.original.show-file-icons@secondaryPath",[])]),ot("div.actions@actions")])]),ot("div.editorParent",[ot("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Xl,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=oi(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=oi(this.editor.getOriginalEditor()).isFocused,this.isFocused=$(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new z),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new ML(this._elements.collapseButton,{});this._register(ke(l=>{r.element.className="",r.icon=this._collapsed.read(l)?Z.chevronRight:Z.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ke(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{Bb(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(ke(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new $_([Ne,this._contextKeyService])));this._register(a.createInstance(Jv,this._elements.actions,M.MultiDiffEditorFileToolbar,{actionRunner:this._register(new QK(()=>this._viewModel.get()?.modifiedUri??this._viewModel.get()?.originalUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>_5(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){Bb(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(Bb(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let s=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,this._resourceLabel2?.setUri(s?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,s]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,s)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const s=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,Bb(a=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};OO=ZPe([Mz(3,pe),Mz(4,Ne)],OO);class XPe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(n=>this._itemData.get(n).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var QPe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Pz=function(o,e){return function(t,i){e(t,i,o)}};let FO=class extends F{constructor(e,t,i,n,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=r,this._scrollableElements=ot("div.scrollContent",[ot("div@content",{style:{overflow:"hidden"}}),ot("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new z_({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>ro(me(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new zD(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=ot("div.monaco-component.multiDiffEditor",{},[ot("div",{},[this._scrollableElement.getDomNode()]),ot("div.placeholder@placeholder",{},[ot("div")])]),this._sizeObserver=this._register(new RK(this._element,void 0)),this._objectPool=this._register(new XPe(c=>{const d=this._instantiationService.createInstance(OO,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=pt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=pt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=$(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:f=>{throw new ve}};const h=d.items.read(c),u=new Map;return{items:h.map(f=>{const p=c.store.add(new eAe(f,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),_=this._lastDocStates?.[p.getKey()];return _&&At(b=>{p.setViewState(_,b)}),u.set(f,p),p}),getItem:f=>u.get(f)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=$(this,c=>{const d=this._viewModel.read(c)?.activeDiffItem.read(c);return d?this._viewItemsInfo.read(c).getItem(d).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new $_([Ne,this._contextKeyService]))),this._contextKeyService.createKey(N.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(os((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,g]of Object.entries(h.contextKeys)){const f=this._contextKeyService.createKey(u,void 0);f.set(g),d.add(ge(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(N.multiDiffEditorAllCollapsed.key,!1);this._register(ke(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(ke(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=$(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?m(145,"Loading..."):m(146,"No Changed Files")});this._register(ke(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(ke(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let g=u;const f=this._viewItems.read(c),p=hF(f,Kn(_=>_.maxScroll.read(c).maxScroll,Lo));if(p){const _=p.maxScroll.read(c);g=u+_.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:g})})),e.replaceChildren(this._elements.root),this._register(ge(()=>{e.replaceChildren()})),this._register(ke(c=>{const d=this._viewModel.read(c);if(d&&!d.isLoading.read(c)){if(d.items.read(c).length===0||d.activeDiffItem.read(c))return;this.goToNextChange()}})),this._register(this._register(ke(c=>{Bb(d=>{this.render(c)})})))}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(c=>c.viewModel.originalUri?.toString()===e.original?.toString()&&c.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new ve("Resource not found in diff editor");const s=i[n];this._viewModel.get().activeDiffItem.setCache(s.viewModel,void 0);let r=0;for(let c=0;cl.viewModel===i):-1;if(n===-1){this._goToFile(0,"first");return}const s=t[n];s.viewModel.collapsed.get()&&s.viewModel.collapsed.set(!1,void 0);const r=s.template.get()?.editor;if(r?.getDiffComputationResult()?.changes2?.length){const l=r.getModifiedEditor().getPosition()?.lineNumber||1,c=r.getDiffComputationResult().changes2;if(e==="next"?c.some(h=>h.modified.startLineNumber>l):c.some(h=>h.modified.endLineNumberExclusive<=l)){r.goToDiff(e);return}}const a=(n+(e==="next"?1:-1)+t.length)%t.length;this._goToFile(a,e==="next"?"first":"last")}_goToFile(e,t){const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const n=i.template.get()?.editor;if(n?.getDiffComputationResult()?.changes2?.length)if(t==="first")n.revealFirstDiff();else{const s=n.getDiffComputationResult().changes2.at(-1),r=n.getModifiedEditor();r.setPosition({lineNumber:s.modified.startLineNumber,column:1}),r.revealLineInCenter(s.modified.startLineNumber)}n?.focus()}render(e){const t=this.scrollTop.read(e);let i=0,n=0,s=0;const r=this._sizeObserver.height.read(e),a=fe.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=fe.ofStartAndLength(n,h),g=fe.ofStartAndLength(s,d);if(g.isBefore(a))i-=d-h,c.hide();else if(g.isAfter(a))c.hide();else{const f=Math.max(0,Math.min(a.start-g.start,d-h));i-=f;const p=fe.ofStartAndLength(t+i,r);c.render(u,f,l,p)}n+=h+this._spaceBetweenPx,s+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};FO=QPe([Pz(4,Ne),Pz(5,pe)],FO);function JPe(o,e){const t=o.getModel(),i=o.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{o.getModel()===t&&i.clear()},350)}class eAe extends F{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(x4(this,void 0)),this.contentHeight=$(this,s=>this._templateRef.read(s)?.object.contentHeight?.read(s)??this.viewModel.lastTemplateData.read(s).contentHeight),this.maxScroll=$(this,s=>this._templateRef.read(s)?.object.maxScroll.read(s)??{maxScroll:0,scrollWidth:0}),this.template=$(this,s=>this._templateRef.read(s)?.object),this._isHidden=Ee(this,!1),this._isFocused=$(this,s=>this.template.read(s)?.isFocused.read(s)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ke(s=>{const r=this._scrollLeft.read(s);this._templateRef.read(s)?.object.setScrollLeft(r)})),this._register(ke(s=>{const r=this._templateRef.read(s);!r||!this._isHidden.read(s)||r.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(le.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const s=this._templateRef.get();s&&n&&s.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&At(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new YPe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&s.object.editor.setSelections(r)}s.object.render(e,i,t,n)}}var tAe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iAe=function(o,e){return function(t,i){e(t,i,o)}};let WO=class extends F{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Ee(this,void 0),this._viewModel=Ee(this,void 0),this._widgetImpl=$(this,n=>n.store.add(this._instantiationService.createInstance(kc(FO),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register($m(this._widgetImpl))}};WO=tAe([iAe(2,pe)],WO);function nAe(o,e,t){return Re.initialize(t||{}).createInstance(PO,o,e)}function sAe(o){return Re.get(at).onCodeEditorAdd(t=>{o(t)})}function oAe(o){return Re.get(at).onDiffEditorAdd(t=>{o(t)})}function rAe(){return Re.get(at).listCodeEditors()}function aAe(){return Re.get(at).listDiffEditors()}function lAe(o,e,t){return Re.initialize(t||{}).createInstance(AO,o,e)}function cAe(o,e){const t=Re.initialize(e||{});return new WO(o,{},t)}function dAe(o){if(typeof o.id!="string"||typeof o.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return it.registerCommand(o.id,o.run)}function hAe(o){if(typeof o.id!="string"||typeof o.label!="string"||typeof o.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=K.deserialize(o.precondition),t=(n,...s)=>tn.runEditorCommand(n,s,e,(r,a,l)=>Promise.resolve(o.run(a,...l))),i=new z;if(i.add(it.registerCommand(o.id,t)),o.contextMenuGroupId){const n={command:{id:o.id,title:o.label},when:e,group:o.contextMenuGroupId,order:o.contextMenuOrder||0};i.add(vn.appendMenuItem(M.EditorContext,n))}if(Array.isArray(o.keybindings)){const n=Re.get(dt);if(!(n instanceof D_))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=K.and(e,K.deserialize(o.keybindingContext));i.add(n.addDynamicKeybindings(o.keybindings.map(r=>({keybinding:r,command:o.id,when:s}))))}}return i}function uAe(o){return bQ([o])}function bQ(o){const e=Re.get(dt);return e instanceof D_?e.addDynamicKeybindings(o.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:K.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),F.None)}function gAe(o,e,t){const i=Re.get(yi),n=i.getLanguageIdByMimeType(e)||e;return _Q(Re.get(ri),i,o,n,t)}function fAe(o,e){const t=Re.get(yi),i=t.getLanguageIdByMimeType(e)||e||rr;o.setLanguage(t.createById(i))}function pAe(o,e,t){o&&Re.get(ac).changeOne(e,o.uri,t)}function mAe(o){Re.get(ac).changeAll(o,[])}function _Ae(o){return Re.get(ac).read(o)}function bAe(o){return Re.get(ac).onMarkerChanged(o)}function CAe(o){return Re.get(ri).getModel(o)}function vAe(){return Re.get(ri).getModels()}function wAe(o){return Re.get(ri).onModelAdded(o)}function SAe(o){return Re.get(ri).onModelRemoved(o)}function yAe(o){return Re.get(ri).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function LAe(o){return EMe(Re.get(ri),o)}function xAe(o,e){const t=Re.get(yi),i=Re.get(fr);return CW.colorizeElement(i,t,o,e).then(()=>{i.registerEditorContainer(o)})}function DAe(o,e,t){const i=Re.get(yi);return Re.get(fr).registerEditorContainer(kt.document.body),CW.colorize(i,o,e,t)}function kAe(o,e,t=4){return Re.get(fr).registerEditorContainer(kt.document.body),CW.colorizeModelLine(o,e,t)}function IAe(o){const e=bi.get(o);return e||{getInitialState:()=>s_,tokenize:(t,i,n)=>MF(o,n)}}function EAe(o,e){bi.getOrCreate(e);const t=IAe(e),i=No(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const s=t.options?.selection;let r;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?r=s:s&&(r={lineNumber:s.startLineNumber,column:s.startColumn}),await o.openCodeEditor(i,t.resource,r)?i:null})}function OAe(){return{create:nAe,getEditors:rAe,getDiffEditors:aAe,onDidCreateEditor:sAe,onDidCreateDiffEditor:oAe,createDiffEditor:lAe,addCommand:dAe,addEditorAction:hAe,addKeybindingRule:uAe,addKeybindingRules:bQ,createModel:gAe,setModelLanguage:fAe,setModelMarkers:pAe,getModelMarkers:_Ae,removeAllMarkers:mAe,onDidChangeMarkers:bAe,getModels:vAe,getModel:CAe,onDidCreateModel:wAe,onWillDisposeModel:SAe,onDidChangeModelLanguage:yAe,createWebWorker:LAe,colorizeElement:xAe,colorize:DAe,colorizeModelLine:kAe,tokenize:EAe,defineTheme:NAe,setTheme:TAe,remeasureFonts:RAe,registerCommand:MAe,registerLinkOpener:PAe,registerEditorOpener:AAe,AccessibilitySupport:GP,ContentWidgetPositionPreference:eA,CursorChangeReason:tA,DefaultEndOfLine:iA,EditorAutoIndentStrategy:sA,EditorOption:oA,EndOfLinePreference:rA,EndOfLineSequence:aA,MinimapPosition:CA,MinimapSectionHeaderStyle:vA,MouseTargetType:wA,OverlayWidgetPositionPreference:LA,OverviewRulerLane:xA,GlyphMarginLane:lA,RenderLineNumbersType:IA,RenderMinimap:EA,ScrollbarVisibility:TA,ScrollType:NA,TextEditorCursorBlinkingStyle:WA,TextEditorCursorStyle:BA,TrackedRangeStickiness:HA,WrappingIndent:VA,InjectedTextCursorStops:hA,PositionAffinity:kA,ShowLightbulbIconMode:MA,TextDirection:FA,ConfigurationChangedEvent:$$,BareFontInfo:Xg,FontInfo:Wy,TextModelResolvedOptions:I0,FindMatch:_v,ApplyUpdateResult:hC,EditorZoom:xr,createMultiFileDiffEditor:cAe,EditorType:l1,EditorOptions:ps}}function FAe(o,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!o(t))return!1;return!0}function f0(o,e){return typeof o=="boolean"?o:e}function Az(o,e){return typeof o=="string"?o:e}function WAe(o){const e={};for(const t of o)e[t]=!0;return e}function Oz(o,e=!1){e&&(o=o.map(function(i){return i.toLowerCase()}));const t=WAe(o);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function BO(o,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof o[a]=="string")l=o[a];else if(o[a]&&o[a]instanceof RegExp)l=o[a].source;else throw o[a]===void 0?Zt(o,"language definition does not contain attribute '"+a+"', used at: "+e):Zt(o,"attribute reference '"+a+"' must be a string, used at: "+e);return sg(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const s=(o.ignoreCase?"i":"")+(o.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(PMe(o,e,c),s)),l)}return new RegExp(e,s)}function BAe(o,e,t,i){if(i<0)return o;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Zt(o,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Zt(o,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!AMe(o,lh(o,n,"",[],""))))throw Zt(o,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,o.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,s=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=BO(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=HO(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function CQ(o,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:o,includeLF:f0(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:f0(e.ignoreCase,!1),unicode:f0(e.unicode,!1),tokenPostfix:Az(e.tokenPostfix,"."+o),defaultToken:Az(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=o,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Zt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Zt(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new VAe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw Zt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw Zt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=f0(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Zt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Zt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Zt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:ud(t,a.open),close:ud(t,a.close)});else throw Zt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function zAe(o){qm.registerLanguage(o)}function UAe(){let o=[];return o=o.concat(qm.getLanguages()),o}function $Ae(o){return Re.get(yi).languageIdCodec.encodeLanguageId(o)}function jAe(o,e){return Re.withServices(()=>{const i=Re.get(yi).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function qAe(o,e){return Re.withServices(()=>{const i=Re.get(yi).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function KAe(o,e){if(!Re.get(yi).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Re.get(ai).register(o,e,100)}class GAe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Hw.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new GD(n.tokens,n.endState)}}class Hw{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g{const i=await Promise.resolve(e.create());return i?ZAe(i)?wQ(o,i):new Mw(Re.get(yi),Re.get(fr),o,CQ(o,i),Re.get(Oe)):null});return bi.registerFactory(o,t)}function QAe(o,e){if(!Re.get(yi).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return vQ(e)?EW(o,{create:()=>e}):bi.register(o,wQ(o,e))}function JAe(o,e){const t=i=>new Mw(Re.get(yi),Re.get(fr),o,CQ(o,i),Re.get(Oe));return vQ(e)?EW(o,{create:()=>e}):bi.register(o,t(e))}function eOe(o,e){return Re.get(ue).referenceProvider.register(o,e)}function tOe(o,e){return Re.get(ue).renameProvider.register(o,e)}function iOe(o,e){return Re.get(ue).newSymbolNamesProvider.register(o,e)}function nOe(o,e){return Re.get(ue).signatureHelpProvider.register(o,e)}function sOe(o,e){return Re.get(ue).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new D(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new D(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function oOe(o,e){return Re.get(ue).documentSymbolProvider.register(o,e)}function rOe(o,e){return Re.get(ue).documentHighlightProvider.register(o,e)}function aOe(o,e){return Re.get(ue).linkedEditingRangeProvider.register(o,e)}function lOe(o,e){return Re.get(ue).definitionProvider.register(o,e)}function cOe(o,e){return Re.get(ue).implementationProvider.register(o,e)}function dOe(o,e){return Re.get(ue).typeDefinitionProvider.register(o,e)}function hOe(o,e){return Re.get(ue).codeLensProvider.register(o,e)}function uOe(o,e,t){return Re.get(ue).codeActionProvider.register(o,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,s,r,a)=>{const c=Re.get(ac).read({resource:n.uri}).filter(d=>D.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function gOe(o,e){return Re.get(ue).documentFormattingEditProvider.register(o,e)}function fOe(o,e){return Re.get(ue).documentRangeFormattingEditProvider.register(o,e)}function pOe(o,e){return Re.get(ue).onTypeFormattingEditProvider.register(o,e)}function mOe(o,e){return Re.get(ue).linkProvider.register(o,e)}function _Oe(o,e){return Re.get(ue).completionProvider.register(o,e)}function bOe(o,e){return Re.get(ue).colorProvider.register(o,e)}function COe(o,e){return Re.get(ue).foldingRangeProvider.register(o,e)}function vOe(o,e){return Re.get(ue).declarationProvider.register(o,e)}function wOe(o,e){return Re.get(ue).selectionRangeProvider.register(o,e)}function SOe(o,e){return Re.get(ue).documentSemanticTokensProvider.register(o,e)}function yOe(o,e){return Re.get(ue).documentRangeSemanticTokensProvider.register(o,e)}function LOe(o,e){return Re.get(ue).inlineCompletionsProvider.register(o,e)}function xOe(o,e){return Re.get(ue).inlayHintsProvider.register(o,e)}function DOe(){return{register:zAe,getLanguages:UAe,onLanguage:jAe,onLanguageEncountered:qAe,getEncodedLanguageId:$Ae,setLanguageConfiguration:KAe,setColorMap:XAe,registerTokensProviderFactory:EW,setTokensProvider:QAe,setMonarchTokensProvider:JAe,registerReferenceProvider:eOe,registerRenameProvider:tOe,registerNewSymbolNameProvider:iOe,registerCompletionItemProvider:_Oe,registerSignatureHelpProvider:nOe,registerHoverProvider:sOe,registerDocumentSymbolProvider:oOe,registerDocumentHighlightProvider:rOe,registerLinkedEditingRangeProvider:aOe,registerDefinitionProvider:lOe,registerImplementationProvider:cOe,registerTypeDefinitionProvider:dOe,registerCodeLensProvider:hOe,registerCodeActionProvider:uOe,registerDocumentFormattingEditProvider:gOe,registerDocumentRangeFormattingEditProvider:fOe,registerOnTypeFormattingEditProvider:pOe,registerLinkProvider:mOe,registerColorProvider:bOe,registerFoldingRangeProvider:COe,registerDeclarationProvider:vOe,registerSelectionRangeProvider:wOe,registerDocumentSemanticTokensProvider:SOe,registerDocumentRangeSemanticTokensProvider:yOe,registerInlineCompletionsProvider:LOe,registerInlayHintsProvider:xOe,DocumentHighlightKind:nA,CompletionItemKind:XP,CompletionItemTag:QP,CompletionItemInsertTextRule:YP,SymbolKind:AA,SymbolTag:OA,IndentAction:dA,CompletionTriggerKind:JP,SignatureHelpTriggerKind:PA,InlayHintKind:uA,InlineCompletionTriggerKind:pA,CodeActionTriggerType:ZP,NewSymbolNameTag:SA,NewSymbolNameTriggerKind:yA,PartialAcceptTriggerKind:DA,HoverVerbosityAction:cA,InlineCompletionEndOfLifeReasonKind:gA,InlineCompletionHintStyle:fA,FoldingRangeKind:Mf,SelectedSuggestionInfo:Gj,EditDeltaInfo:Uv}}ps.wrappingIndent.defaultValue=0;ps.glyphMargin.defaultValue=!1;ps.autoIndent.defaultValue=3;ps.overviewRulerLanes.defaultValue=2;__.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const js=GX();js.editor=OAe();js.languages=DOe();const SQ=js.CancellationTokenSource,tu=js.Emitter,yQ=js.KeyCode,LQ=js.KeyMod,Wd=js.Position,eb=js.Range,xQ=js.Selection,DQ=js.SelectionDirection,ca=js.MarkerSeverity,Qx=js.MarkerTag,rI=js.Uri,kQ=js.Token,$l=js.editor,he=js.languages,kOe=ZO(),Om=globalThis;(kOe?.globalAPI||typeof Om.define=="function"&&Om.define.amd)&&(Om.monaco=js);typeof Om.require<"u"&&typeof Om.require.config=="function"&&Om.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const IOe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:SQ,Emitter:tu,KeyCode:yQ,KeyMod:LQ,MarkerSeverity:ca,MarkerTag:Qx,Position:Wd,Range:eb,Selection:xQ,SelectionDirection:DQ,Token:kQ,Uri:rI,editor:$l,languages:he},Symbol.toStringTag,{value:"Module"}));let NW=class{constructor(e,t,i){this._onDidChange=new tu,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const TW={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},RW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},IQ=new NW("css",TW,RW),EQ=new NW("scss",TW,RW),NQ=new NW("less",TW,RW);function MW(){return Se(()=>import("./cssMode-9bWh8C7-.js"),__vite__mapDeps([0,1,2,3]))}he.onLanguage("less",()=>{MW().then(o=>o.setupMode(NQ))});he.onLanguage("scss",()=>{MW().then(o=>o.setupMode(EQ))});he.onLanguage("css",()=>{MW().then(o=>o.setupMode(IQ))});const TQ=Object.freeze(Object.defineProperty({__proto__:null,cssDefaults:IQ,lessDefaults:NQ,scssDefaults:EQ},Symbol.toStringTag,{value:"Module"}));let EOe=class{constructor(e,t,i){this._onDidChange=new tu,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const NOe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},aI={format:NOe,suggest:{},data:{useDefaultDataProvider:!0}};function lI(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===iv,documentFormattingEdits:o===iv,documentRangeFormattingEdits:o===iv}}const iv="html",Fz="handlebars",Wz="razor",RQ=cI(iv,aI,lI(iv)),TOe=RQ.defaults,MQ=cI(Fz,aI,lI(Fz)),ROe=MQ.defaults,PQ=cI(Wz,aI,lI(Wz)),MOe=PQ.defaults;function POe(){return Se(()=>import("./htmlMode-DzKTVOy0.js"),__vite__mapDeps([4,1,2,3]))}function cI(o,e=aI,t=lI(o)){const i=new EOe(o,e,t);let n;const s=he.onLanguage(o,async()=>{n=(await POe()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}const AQ=Object.freeze(Object.defineProperty({__proto__:null,handlebarDefaults:ROe,handlebarLanguageService:MQ,htmlDefaults:TOe,htmlLanguageService:RQ,razorDefaults:MOe,razorLanguageService:PQ,registerHTMLLanguageService:cI},Symbol.toStringTag,{value:"Module"}));let AOe=class{constructor(e,t,i){this._onDidChange=new tu,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const OOe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},FOe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},OQ=new AOe("json",OOe,FOe),WOe=()=>FQ().then(o=>o.getWorker());function FQ(){return Se(()=>import("./jsonMode-BWwbZhu8.js"),__vite__mapDeps([5,1,2,3]))}he.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});he.onLanguage("json",()=>{FQ().then(o=>o.setupMode(OQ))});const WQ=Object.freeze(Object.defineProperty({__proto__:null,getWorker:WOe,jsonDefaults:OQ},Symbol.toStringTag,{value:"Module"})),BOe="5.9.3";var BQ=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(BQ||{}),HQ=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(HQ||{}),VQ=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(VQ||{}),zQ=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(zQ||{}),UQ=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(UQ||{});class $Q{constructor(e,t,i,n,s){this._onDidChange=new tu,this._onDidExtraLibsChange=new tu,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(n),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let i;if(typeof t>"u"?i=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:i=t,this._extraLibs[i]&&this._extraLibs[i].content===e)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[i]&&(n=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(n=this._extraLibs[i].version+1),this._extraLibs[i]={content:e,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[i];s&&s.version===n&&(delete this._extraLibs[i],this._removedExtraLibs[i]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const i=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=t.content;let s=1;this._removedExtraLibs[i]&&(s=this._removedExtraLibs[i]+1),this._extraLibs[i]={content:n,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(void 0)}}const HOe=BOe,jQ={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},qQ=new $Q({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},jQ),KQ=new $Q({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},jQ),VOe=()=>dI().then(o=>o.getTypeScriptWorker()),zOe=()=>dI().then(o=>o.getJavaScriptWorker());function dI(){return Se(()=>import("./tsMode-D0gNUxS2.js"),__vite__mapDeps([6,2,3]))}he.onLanguage("typescript",()=>dI().then(o=>o.setupTypeScript(qQ)));he.onLanguage("javascript",()=>dI().then(o=>o.setupJavaScript(KQ)));const GQ=Object.freeze(Object.defineProperty({__proto__:null,JsxEmit:HQ,ModuleKind:BQ,ModuleResolutionKind:UQ,NewLineKind:VQ,ScriptTarget:zQ,getJavaScriptWorker:zOe,getTypeScriptWorker:VOe,javascriptDefaults:KQ,typescriptDefaults:qQ,typescriptVersion:HOe},Symbol.toStringTag,{value:"Module"})),ZQ={},HN={};class PW{static getOrCreate(e){return HN[e]||(HN[e]=new PW(e)),HN[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,ZQ[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function xe(o){const e=o.id;ZQ[e]=o,he.register(o);const t=PW.getOrCreate(e);he.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),he.onLanguageEncountered(e,async()=>{const i=await t.load();he.setLanguageConfiguration(e,i.conf)})}xe({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Se(()=>import("./abap-DLDM7-KI.js"),[])});xe({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Se(()=>import("./apex-DNDY2TF8.js"),[])});xe({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Se(()=>import("./azcli-Y6nb8tq_.js"),[])});xe({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Se(()=>import("./bat-BwHxbl9M.js"),[])});xe({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Se(()=>import("./bicep-CFznDFnq.js"),[])});xe({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Se(()=>import("./cameligo-Bf6VGUru.js"),[])});xe({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Se(()=>import("./clojure-Dnu-v4kV.js"),[])});xe({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Se(()=>import("./coffee-Bd8akH9Z.js"),[])});xe({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Se(()=>import("./cpp-BbWJElDN.js"),[])});xe({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Se(()=>import("./cpp-BbWJElDN.js"),[])});xe({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Se(()=>import("./csharp-Co3qMtFm.js"),[])});xe({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>Se(()=>import("./csp-D-4FJmMZ.js"),[])});xe({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Se(()=>import("./css-DdJfP1eB.js"),[])});xe({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Se(()=>import("./cypher-cTPe9QuQ.js"),[])});xe({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Se(()=>import("./dart-BOtBlQCF.js"),[])});xe({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Se(()=>import("./dockerfile-BG73LgW2.js"),[])});xe({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Se(()=>import("./ecl-BEgZUVRK.js"),[])});xe({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Se(()=>import("./elixir-BkW5O-1t.js"),[])});xe({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Se(()=>import("./flow9-BeJ5waoc.js"),[])});xe({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Se(()=>import("./fsharp-PahG7c26.js"),[])});xe({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagAutoInterpolationDollar)});xe({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagAngleInterpolationDollar)});xe({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagBracketInterpolationDollar)});xe({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagAngleInterpolationBracket)});xe({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagBracketInterpolationBracket)});xe({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagAutoInterpolationDollar)});xe({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Se(()=>import("./freemarker2-C_dr9LiI.js"),__vite__mapDeps([7,2,3])).then(o=>o.TagAutoInterpolationBracket)});xe({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Se(()=>import("./go-acbASCJo.js"),[])});xe({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Se(()=>import("./graphql-BxJiqAUM.js"),[])});xe({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Se(()=>import("./handlebars-C3vjJ5wA.js"),__vite__mapDeps([8,2,3]))});xe({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Se(()=>import("./hcl-DtV1sZF8.js"),[])});xe({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Se(()=>import("./html-BG3YQOlK.js"),__vite__mapDeps([9,2,3]))});xe({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Se(()=>import("./ini-Kd9XrMLS.js"),[])});xe({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Se(()=>import("./java-CXBNlu9o.js"),[])});xe({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Se(()=>import("./javascript-Dkp43T8T.js"),__vite__mapDeps([10,11,2,3]))});xe({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Se(()=>import("./julia-cl7-CwDS.js"),[])});xe({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Se(()=>import("./kotlin-s7OhZKlX.js"),[])});xe({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Se(()=>import("./less-9HpZscsL.js"),[])});xe({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Se(()=>import("./lexon-OrD6JF1K.js"),[])});xe({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Se(()=>import("./lua-Cyyb5UIc.js"),[])});xe({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Se(()=>import("./liquid-C_k_bMvD.js"),__vite__mapDeps([12,2,3]))});xe({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Se(()=>import("./m3-B8OfTtLu.js"),[])});xe({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Se(()=>import("./markdown-BFxVWTOG.js"),[])});xe({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Se(()=>import("./mdx-B0qq4UAz.js"),__vite__mapDeps([13,2,3]))});xe({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Se(()=>import("./mips-CiqrrVzr.js"),[])});xe({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Se(()=>import("./msdax-DmeGPVcC.js"),[])});xe({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Se(()=>import("./mysql-C_tMU-Nz.js"),[])});xe({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Se(()=>import("./objective-c-BDtDVThU.js"),[])});xe({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Se(()=>import("./pascal-vHIfCaH5.js"),[])});xe({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Se(()=>import("./pascaligo-DtZ0uQbO.js"),[])});xe({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Se(()=>import("./perl-Ub6l9XKa.js"),[])});xe({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Se(()=>import("./pgsql-BlNEE0v7.js"),[])});xe({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Se(()=>import("./php-BBUBE1dy.js"),[])});xe({id:"pla",extensions:[".pla"],loader:()=>Se(()=>import("./pla-DSh2-awV.js"),[])});xe({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Se(()=>import("./postiats-CocnycG-.js"),[])});xe({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Se(()=>import("./powerquery-tScXyioY.js"),[])});xe({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Se(()=>import("./powershell-COWaemsV.js"),[])});xe({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Se(()=>import("./protobuf-Brw8urJB.js"),[])});xe({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Se(()=>import("./pug-8SOpv6rk.js"),[])});xe({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Se(()=>import("./python-BQPyZP7x.js"),__vite__mapDeps([14,2,3]))});xe({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Se(()=>import("./qsharp-Bw9ernYp.js"),[])});xe({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Se(()=>import("./r-j7ic8hl3.js"),[])});xe({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Se(()=>import("./razor-CW3YV4Fr.js"),__vite__mapDeps([15,2,3]))});xe({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Se(()=>import("./redis-Bu5POkcn.js"),[])});xe({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Se(()=>import("./redshift-Bs9aos_-.js"),[])});xe({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Se(()=>import("./restructuredtext-CqXO7rUv.js"),[])});xe({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Se(()=>import("./ruby-zBfavPgS.js"),[])});xe({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Se(()=>import("./rust-BzKRNQWT.js"),[])});xe({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Se(()=>import("./sb-BBc9UKZt.js"),[])});xe({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Se(()=>import("./scala-D9hQfWCl.js"),[])});xe({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Se(()=>import("./scheme-BPhDTwHR.js"),[])});xe({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Se(()=>import("./scss-CBJaRo0y.js"),[])});xe({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Se(()=>import("./shell-DiJ1NA_G.js"),[])});xe({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Se(()=>import("./solidity-Db0IVjzk.js"),[])});xe({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Se(()=>import("./sophia-CnS9iZB_.js"),[])});xe({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Se(()=>import("./sparql-CJmd_6j2.js"),[])});xe({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Se(()=>import("./sql-ClhHkBeG.js"),[])});xe({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Se(()=>import("./st-CHwy0fLd.js"),[])});xe({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Se(()=>import("./swift-Bqt4WxQ4.js"),[])});xe({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Se(()=>import("./systemverilog-Bs9z6M-B.js"),[])});xe({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Se(()=>import("./systemverilog-Bs9z6M-B.js"),[])});xe({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Se(()=>import("./tcl-Dm6ycUr_.js"),[])});xe({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Se(()=>import("./twig-Csy3S7wG.js"),[])});xe({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Se(()=>import("./typescript-DPgjF7mr.js"),__vite__mapDeps([11,2,3]))});xe({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>Se(()=>import("./typespec-Btyra-wh.js"),[])});xe({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Se(()=>import("./vb-Db0cS2oM.js"),[])});xe({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Se(()=>import("./wgsl-DumH7NcR.js"),[])});xe({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Se(()=>import("./xml-DnfXpm1w.js"),__vite__mapDeps([16,2,3]))});xe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Se(()=>import("./yaml-C7wg11Lz.js"),__vite__mapDeps([17,2,3]))});var UOe=Object.defineProperty,$Oe=(o,e,t)=>e in o?UOe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,we=(o,e,t)=>$Oe(o,typeof e!="symbol"?e+"":e,t),p0,Bz,m0,VN,_0;function jOe(o){return o.method!==void 0}var Hz;(function(o){function e(t){return t}o.create=e})(Hz||(Hz={}));var aa;(function(o){o.parseError=-32700,o.invalidRequest=-32600,o.methodNotFound=-32601,o.invalidParams=-32602,o.internalError=-32603;function e(s){return-32099<=s&&s<=-32e3}o.isServerError=e;function t(s){if(!e(s))throw new Error("Invalid range for a server error.");return s}o.serverError=t,o.unexpectedServerError=-32e3;function i(s){return!0}o.isApplicationError=i;function n(s){return s}o.applicationError=n,o.genericApplicationError=-320100})(aa||(aa={}));var AW=class{constructor(){we(this,"listeners",new Set),we(this,"event",o=>(this.listeners.add(o),{dispose:()=>{this.listeners.delete(o)}}))}fire(o){this.listeners.forEach(e=>e(o))}},qOe=class{constructor(o){we(this,"_value"),we(this,"eventEmitter"),this._value=o,this.eventEmitter=new AW}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this.eventEmitter.fire(o))}get onChange(){return this.eventEmitter.event}};function KOe(o,e){const t=setTimeout(e,o);return{dispose:()=>clearTimeout(t)}}function zN(o,e,t){return o instanceof Set?(o.add(e),{dispose:()=>o.delete(e)}):(o.set(e,t),{dispose:()=>o.delete(e)})}var GOe=class{constructor(){we(this,"_state","none"),we(this,"promise"),we(this,"resolve",()=>{}),we(this,"reject",()=>{}),this.promise=new Promise((o,e)=>{this.resolve=o,this.reject=e})}get state(){return this._state}},YQ=(p0=class{constructor(){we(this,"_unprocessedMessages",[]),we(this,"_messageListener"),we(this,"id",p0.id++),we(this,"_state",new qOe({state:"open"})),we(this,"state",this._state)}setListener(o){if(this._messageListener=o,!!o)for(;this._unprocessedMessages.length>0&&this._messageListener!==void 0;){const e=this._unprocessedMessages.shift();this._messageListener(e)}}send(o){return this._sendImpl(o)}_dispatchReceivedMessage(o){this._unprocessedMessages.length===0&&this._messageListener?this._messageListener(o):this._unprocessedMessages.push(o)}_onConnectionClosed(){this._state.value={state:"closed",error:void 0}}log(o){return new ZOe(this,o??new YOe)}},we(p0,"id",0),p0),ZOe=class{constructor(o,e){we(this,"baseStream"),we(this,"logger"),this.baseStream=o,this.logger=e}get state(){return this.baseStream.state}setListener(o){if(o===void 0){this.baseStream.setListener(void 0);return}this.baseStream.setListener(e=>{this.logger.log(this.baseStream,"incoming",e),o(e)})}send(o){return this.logger.log(this.baseStream,"outgoing",o),this.baseStream.send(o)}toString(){return`StreamLogger/${this.baseStream.toString()}`}},YOe=class{log(o,e,t){console.log(`${e==="incoming"?"<-":"->"} [${o.toString()}] ${JSON.stringify(t)}`)}},XOe=class XQ{constructor(e){we(this,"connect"),this.connect=e}mapContext(e){return new XQ(t=>this.connect(t?QOe(t,e):void 0))}};function QOe(o,e){return{handleNotification:(t,i)=>o.handleNotification(t,e(i)),handleRequest:(t,i,n)=>o.handleRequest(t,i,e(n))}}var JOe=class QQ{constructor(e,t,i){we(this,"_stream"),we(this,"_listener"),we(this,"_logger"),we(this,"_unprocessedResponses",new Map),we(this,"_lastUsedRequestId",0),this._stream=e,this._listener=t,this._logger=i,this._stream.setListener(n=>{jOe(n)?n.id===void 0?this._processNotification(n):this._processRequest(n):this._processResponse(n)})}static createChannel(e,t){let i=!1;return new XOe(n=>{if(i)throw new Error(`A channel to the stream ${e} was already constructed!`);return i=!0,new QQ(e,n,t)})}get state(){return this._stream.state}async _processNotification(e){if(e.id!==void 0)throw new Error;if(!this._listener){this._logger&&this._logger.debug({text:"Notification ignored",message:e});return}try{await this._listener.handleNotification({method:e.method,params:e.params||null})}catch(t){this._logger&&this._logger.warn({text:`Exception was thrown while handling notification: ${t}`,exception:t,message:e})}}async _processRequest(e){if(e.id===void 0)throw new Error;let t;if(this._listener)try{t=await this._listener.handleRequest({method:e.method,params:e.params||null},e.id)}catch(n){this._logger&&this._logger.warn({text:`Exception was thrown while handling request: ${n}`,message:e,exception:n}),t={error:{code:aa.internalError,message:"An unexpected exception was thrown.",data:void 0}}}else this._logger&&this._logger.debug({text:"Received request even though not listening for requests",message:e}),t={error:{code:aa.methodNotFound,message:"This endpoint does not listen for requests or notifications.",data:void 0}};let i;"result"in t?i={jsonrpc:"2.0",id:e.id,result:t.result}:i={jsonrpc:"2.0",id:e.id,error:t.error},await this._stream.send(i)}_processResponse(e){const t=""+e.id,i=this._unprocessedResponses.get(t);if(!i){this._logger&&this._logger.debug({text:"Got an unexpected response message",message:e});return}this._unprocessedResponses.delete(t),i(e)}_newRequestId(){return this._lastUsedRequestId++}sendRequest(e,t,i){const n={jsonrpc:"2.0",id:this._newRequestId(),method:e.method,params:e.params||void 0};return i&&i(n.id),new Promise((s,r)=>{const a=""+n.id;this._unprocessedResponses.set(a,l=>{"result"in l?s({result:l.result}):(l.error||r(new Error("Response had neither 'result' nor 'error' field set.")),s({error:l.error}))}),this._stream.send(n).then(void 0,l=>{this._unprocessedResponses.delete(a),r(l)})})}sendNotification(e,t){const i={jsonrpc:"2.0",id:void 0,method:e.method,params:e.params||void 0};return this._stream.send(i)}toString(){return"StreamChannel/"+this._stream.toString()}},Fm;(function(o){function e(){return{deserializeFromJson:n=>({hasErrors:!1,value:n}),serializeToJson:n=>n}}o.sAny=e;function t(){return{deserializeFromJson:n=>({hasErrors:!1,value:{}}),serializeToJson:n=>({})}}o.sEmptyObject=t;function i(){return{deserializeFromJson:n=>({hasErrors:!1,value:void 0}),serializeToJson:n=>null}}o.sVoidFromNull=i})(Fm||(Fm={}));const JQ=Symbol("OptionalMethodNotFound");var eJ=class{contextualize(o){return new e4e(this,o)}},e4e=class extends eJ{constructor(o,e){super(),we(this,"underylingTypedChannel"),we(this,"converters"),this.underylingTypedChannel=o,this.converters=e}async request(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.request(o,e,i)}async notify(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.notify(o,e,i)}registerNotificationHandler(o,e){return this.underylingTypedChannel.registerNotificationHandler(o,async(t,i)=>await e(t,await this.converters.getNewContext(i)))}registerRequestHandler(o,e){return this.underylingTypedChannel.registerRequestHandler(o,async(t,i,n)=>await e(t,i,await this.converters.getNewContext(n)))}},VO=class tJ extends eJ{constructor(e,t={}){super(),we(this,"channelCtor"),we(this,"_requestSender"),we(this,"_handler",new Map),we(this,"_unknownNotificationHandler",new Set),we(this,"_timeout"),we(this,"sendExceptionDetails",!1),we(this,"_logger"),we(this,"listeningDeferred",new GOe),we(this,"onListening",this.listeningDeferred.promise),we(this,"_requestDidErrorEventEmitter",new AW),we(this,"onRequestDidError",this._requestDidErrorEventEmitter.event),this.channelCtor=e,this._logger=t.logger,this.sendExceptionDetails=!!t.sendExceptionDetails,this._timeout=KOe(1e3,()=>{this._requestSender||console.warn(`"${this.startListen.name}" has not been called within 1 second after construction of this channel. Did you forget to call it?`,this)})}static fromTransport(e,t={}){return new tJ(JOe.createChannel(e,t.logger),t)}startListen(){if(this._requestSender)throw new Error(`"${this.startListen.name}" can be called only once, but it already has been called.`);this._timeout&&(this._timeout.dispose(),this._timeout=void 0),this._requestSender=this.channelCtor.connect({handleRequest:(e,t,i)=>this.handleRequest(e,t,i),handleNotification:(e,t)=>this.handleNotification(e,t)}),this.listeningDeferred.resolve()}checkChannel(e){if(!e)throw new Error(`"${this.startListen.name}" must be called before any messages can be sent or received.`);return!0}async handleRequest(e,t,i){const n=this._handler.get(e.method);if(!n)return this._logger&&this._logger.debug({text:`No request handler for "${e.method}".`,data:{requestObject:e}}),{error:{code:aa.methodNotFound,message:`No request handler for "${e.method}".`,data:{method:e.method}}};if(n.kind!="request"){const r=`"${e.method}" is registered as notification, but was sent as request.`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e}}),{error:{code:aa.invalidRequest,message:r,data:{method:e.method}}}}const s=n.requestType.paramsSerializer.deserializeFromJson(e.params);if(s.hasErrors){const r=`Got invalid params: ${s.errorMessage}`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e,errorMessage:s.errorMessage}}),{error:{code:aa.invalidParams,message:r,data:{errors:s.errorMessage}}}}else{const r=s.value;let a;try{const l=await n.handler(r,t,i);if("error"in l||"errorMessage"in l){const c=l.error?n.requestType.errorSerializer.serializeToJson(l.error):void 0;a={error:{code:l.errorCode||aa.genericApplicationError,message:l.errorMessage||"An error was returned",data:c}}}else a={result:n.requestType.resultSerializer.serializeToJson(l.ok)}}catch(l){l instanceof zz?a={error:{code:l.code,message:l.message}}:(this._logger&&this._logger.warn({text:`An exception was thrown while handling a request: ${l}.`,exception:l,data:{requestObject:e}}),a={error:{code:aa.unexpectedServerError,message:this.sendExceptionDetails?`An exception was thrown while handling a request: ${l}.`:"Server has thrown an unexpected exception"}})}return a}}async handleNotification(e,t){const i=this._handler.get(e.method);if(!i){for(const r of this._unknownNotificationHandler)r(e);this._unknownNotificationHandler.size===0&&this._logger&&this._logger.debug({text:`Unhandled notification "${e.method}"`,data:{requestObject:e}});return}if(i.kind!="notification"){this._logger&&this._logger.debug({text:`"${e.method}" is registered as request, but was sent as notification.`,data:{requestObject:e}});return}const n=i.notificationType.paramsSerializer.deserializeFromJson(e.params);if(n.hasErrors){this._logger&&this._logger.debug({text:`Got invalid params: ${n}`,data:{requestObject:e,errorMessage:n.errorMessage}});return}const s=n.value;for(const r of i.handlers)try{r(s,t)}catch(a){this._logger&&this._logger.warn({text:`An exception was thrown while handling a notification: ${a}.`,exception:a,data:{requestObject:e}})}}registerUnknownNotificationHandler(e){return zN(this._unknownNotificationHandler,e)}registerRequestHandler(e,t){if(this._handler.get(e.method))throw new Error(`Handler with method "${e.method}" already registered.`);return zN(this._handler,e.method,{kind:"request",requestType:e,handler:t})}registerNotificationHandler(e,t){let i=this._handler.get(e.method);if(!i)i={kind:"notification",notificationType:e,handlers:new Set},this._handler.set(e.method,i);else{if(i.kind!=="notification")throw new Error(`Method "${e.method}" was already registered as request handler.`);if(i.notificationType!==e)throw new Error(`Method "${e.method}" was registered for a different type.`)}return zN(i.handlers,t)}getRegisteredTypes(){const e=[];for(const t of this._handler.values())t.kind==="notification"?e.push(t.notificationType):t.kind==="request"&&e.push(t.requestType);return e}async request(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error("Impossible");const n=e.paramsSerializer.serializeToJson(t);Vz(n);const s=await this._requestSender.sendRequest({method:e.method,params:n},i);if("error"in s){if(e.isOptional&&s.error.code===aa.methodNotFound)return JQ;let r;if(s.error.data!==void 0){const l=e.errorSerializer.deserializeFromJson(s.error.data);if(l.hasErrors)throw new Error(l.errorMessage);r=l.value}else r=void 0;const a=new zz(s.error.message,r,s.error.code);throw this._requestDidErrorEventEmitter.fire({error:a}),a}else{const r=e.resultSerializer.deserializeFromJson(s.result);if(r.hasErrors)throw new Error("Could not deserialize response: "+r.errorMessage+` +`}};mA=ql([Ti(0,Pe)],mA);class SMe{publicLog2(){}}class eL{static{this.SCHEME="inmemory"}constructor(){const e=_e.from({scheme:eL.SCHEME,authority:"model",path:"/"});this.workspace={id:Sq,folders:[new F_e({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===eL.SCHEME?this.workspace.folders[0]:null}}function tL(o,e,t){if(!e||!(o instanceof Jx))return;const i=[];Object.keys(e).forEach(n=>{tbe(n)&&i.push([`editor.${n}`,e[n]]),t&&ibe(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let _A=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:aF.convert(e),n=new Map;for(const a of i){if(!(a instanceof fh))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(gi.replaceMove(L.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:Lg(k2.bulkEditServiceSummary,s,r),isApplied:s>0}}};_A=ql([Ti(0,ei)],_A);class yMe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Lr(e)}}let bA=class extends BTe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};bA=ql([Ti(0,Ul),Ti(1,et)],bA);class xMe{constructor(){this._neverEmitter=new P,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class LMe extends $x{constructor(){super()}}class kMe extends pMe{constructor(){super(new Yee)}}let CA=class extends UP{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};CA=ql([Ti(0,ts),Ti(1,bi),Ti(2,ud),Ti(3,st),Ti(4,Er),Ti(5,Ie)],CA);const DMe={esmModuleLocation:void 0,label:"editorWorkerService"};let vA=class extends TP{constructor(e,t,i,n,s){super(DMe,e,t,i,n,s)}};vA=ql([Ti(0,ei),Ti(1,Xk),Ti(2,Mt),Ti(3,ti),Ti(4,he)],vA);class IMe{async playSignal(e,t){}}$e(Mt,kMe,0);$e(Pe,Jx,0);$e(Xk,pA,0);$e(SZ,mA,0);$e(sd,eL,0);$e(Zg,yMe,0);$e(ts,SMe,0);$e(Xw,vMe,0);$e(bF,CMe,0);$e(bi,Qx,0);$e($l,Fu,0);$e(_i,LMe,0);$e(er,NNe,0);$e(ei,ZP,0);$e(MO,GP,0);$e(Ie,uA,0);$e(ej,bMe,0);$e(id,p3,0);$e(ps,vme,0);$e(eo,vA,0);$e(Ow,_A,0);$e(PZ,xMe,0);$e(fs,gA,0);$e(kn,cA,0);$e(Mr,Iwe,0);$e(Pt,fA,0);$e(st,Ym,0);$e(Jn,lA,0);$e(ud,bA,0);$e(gd,KP,0);$e(Co,hA,0);$e(Jo,CA,0);$e(Er,AT,0);$e(dd,IMe,0);$e(S4,mMe,0);$e(Iz,ete,0);$e(g5,$0e,0);var Ne;(function(o){const e=new f_;for(const[l,c]of _7())e.set(l,c);const t=new Xx(e,!0);e.set(fe,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof hl?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new P;function r(l){if(n)return t;n=!0;for(const[d,h]of _7())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=We(d);e.get(h)instanceof hl&&e.set(h,l[d])}const c=Fbe();for(const d of c)try{t.createInstance(d)}catch(h){Ee(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new z,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(Ne||(Ne={}));var EMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},j6=function(o,e){return function(t,i){e(t,i,o)}},d0;let wA=class{static{d0=this}static{this._ttpTokenizer=Vl("tokenizeToString",{createHTML(e){return e}})}constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){const n=Ha(i.context)?i.context:void 0;let s;e?s=this._languageService.getLanguageIdByLanguageName(e):n&&(s=n.getModel()?.getLanguageId()),s||(s=qo);const r=await nue(this._languageService,t,s),a=d0._ttpTokenizer?d0._ttpTokenizer.createHTML(r)??r:r,l=document.createElement("span");l.innerHTML=a;const c=l.querySelector(".monaco-tokenized-source");return mi(c)?(gn(c,this.getFontInfo(n)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):Mne({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}};wA=d0=EMe([j6(0,Pe),j6(1,_i)],wA);var m3=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},It=function(o,e){return function(t,i){e(t,i,o)}};let NMe=0,q6=!1;function TMe(o){if(!o){if(q6)return;q6=!0}pee(o||wt.document.body)}let iL=class extends Pg{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f){const p={...t};p.ariaLabel=p.ariaLabel||x2.editorViewAccessibleLabel,super(e,p,{},i,n,s,r,c,d,h,u,g),l instanceof Ym?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,TMe(p.ariaContainerElement),Uue((_,b)=>i.createInstance(Tm,_,{instantHover:b},{})),Rfe(a),f.setDefaultCodeBlockRenderer(i.createInstance(wA))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++NMe,s=q.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),A.None;const t=e.id,i=e.label,n=q.and(q.equals("editorId",this.getId()),q.deserialize(e.precondition)),s=e.keybindings,r=q.and(n,q.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...f)=>Promise.resolve(e.run(this,...f)),d=new z,h=this.getId()+":"+t;if(d.add(Ye.registerCommand(h,c)),a){const g={command:{id:h,title:i},when:n,group:a,order:l};d.add(un.appendMenuItem(M.EditorContext,g))}if(Array.isArray(s))for(const g of s)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,g,c,r));const u=new x$(h,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,u),d.add(ue(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof Wx)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};iL=m3([It(2,fe),It(3,et),It(4,Pt),It(5,Ie),It(6,Ms),It(7,st),It(8,ci),It(9,bi),It(10,kn),It(11,ti),It(12,he),It(13,aa)],iL);let SA=class extends iL{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b){const C={...t};tL(h,C,!1);const w=c.registerEditorContainer(e);typeof C.theme=="string"&&c.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!C.autoDetectHighContrast);const v=C.model;delete C.model,super(e,C,i,n,s,r,a,l,c,d,u,p,_,b),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let S;if(typeof v>"u"){const x=f.getLanguageIdByMimeType(C.language)||C.language||qo;S=DY(g,f,C.value||"",x,void 0),this._ownsModel=!0}else S=v,this._ownsModel=!1;if(this._attachModel(S),S){const x={oldModelUrl:null,newModelUrl:S.uri};this._onDidChangeModel.fire(x)}}dispose(){super.dispose()}updateOptions(e){tL(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};SA=m3([It(2,fe),It(3,et),It(4,Pt),It(5,Ie),It(6,Ms),It(7,st),It(8,er),It(9,bi),It(10,Pe),It(11,kn),It(12,ei),It(13,_i),It(14,ti),It(15,he),It(16,aa)],SA);let yA=class extends Pl{constructor(e,t,i,n,s,r,a,l,c,d,h,u){const g={...t};tL(l,g,!0);const f=r.registerEditorContainer(e);typeof g.theme=="string"&&r.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},n,i,s,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){tL(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(iL,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};yA=m3([It(2,fe),It(3,Ie),It(4,et),It(5,er),It(6,bi),It(7,Pe),It(8,Jo),It(9,id),It(10,Co),It(11,dd)],yA);function DY(o,e,t,i,n){if(t=t||"",!i){const s=t.indexOf(` +`);let r=t;return s!==-1&&(r=t.substring(0,s)),K6(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return K6(o,t,e.createById(i),n)}function K6(o,e,t,i){return o.createModel(e,t,i)}E("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},m(142,"The background color of the diff editor's header"));E("multiDiffEditor.background",ki,m(143,"The background color of the multi file diff editor"));E("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},m(144,"The border color of the multi file diff editor"));var RMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G6=function(o,e){return function(t,i){e(t,i,o)}};class MMe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let xA=class extends A{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=De(this,void 0),this._collapsed=$(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=De(this,500),this.contentHeight=$(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=De(this,0),this._modifiedWidth=De(this,0),this._originalContentWidth=De(this,0),this._originalWidth=De(this,0),this.maxScroll=$(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Qe("div.multiDiffEntry",[Qe("div.header@header",[Qe("div.header-content",[Qe("div.collapse-button@collapseButton"),Qe("div.file-path",[Qe("div.title.modified.show-file-icons@primaryPath",[]),Qe("div.status.deleted@status",["R"]),Qe("div.title.original.show-file-icons@secondaryPath",[])]),Qe("div.actions@actions")])]),Qe("div.editorParent",[Qe("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Pl,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=Jt(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Jt(this.editor.getOriginalEditor()).isFocused,this.isFocused=$(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new z),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new Wy(this._elements.collapseButton,{});this._register(xe(l=>{r.element.className="",r.icon=this._collapsed.read(l)?G.chevronRight:G.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(xe(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{tb(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(xe(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new f_([Ie,this._contextKeyService])));this._register(a.createInstance(pv,this._elements.actions,M.MultiDiffEditorFileToolbar,{actionRunner:this._register(new lq(()=>this._viewModel.get()?.modifiedUri??this._viewModel.get()?.originalUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>oF(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){tb(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(tb(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let s=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,this._resourceLabel2?.setUri(s?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,s]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,s)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const s=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,tb(a=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};xA=RMe([G6(3,fe),G6(4,Ie)],xA);class PMe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(n=>this._itemData.get(n).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var AMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z6=function(o,e){return function(t,i){e(t,i,o)}};let LA=class extends A{constructor(e,t,i,n,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=r,this._scrollableElements=Qe("div.scrollContent",[Qe("div@content",{style:{overflow:"hidden"}}),Qe("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new u_({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Zs(pe(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new KL(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Qe("div.monaco-component.multiDiffEditor",{},[Qe("div",{},[this._scrollableElement.getDomNode()]),Qe("div.placeholder@placeholder",{},[Qe("div")])]),this._sizeObserver=this._register(new zj(this._element,void 0)),this._objectPool=this._register(new PMe(c=>{const d=this._instantiationService.createInstance(xA,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=dt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=dt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=$(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:f=>{throw new Ce}};const h=d.items.read(c),u=new Map;return{items:h.map(f=>{const p=c.store.add(new FMe(f,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),_=this._lastDocStates?.[p.getKey()];return _&&Et(b=>{p.setViewState(_,b)}),u.set(f,p),p}),getItem:f=>u.get(f)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=$(this,c=>{const d=this._viewModel.read(c)?.activeDiffItem.read(c);return d?this._viewItemsInfo.read(c).getItem(d).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new f_([Ie,this._contextKeyService]))),this._contextKeyService.createKey(N.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(Xn((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,g]of Object.entries(h.contextKeys)){const f=this._contextKeyService.createKey(u,void 0);f.set(g),d.add(ue(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(N.multiDiffEditorAllCollapsed.key,!1);this._register(xe(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(xe(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=$(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?m(145,"Loading..."):m(146,"No Changed Files")});this._register(xe(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(xe(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let g=u;const f=this._viewItems.read(c),p=JO(f,Bn(_=>_.maxScroll.read(c).maxScroll,uo));if(p){const _=p.maxScroll.read(c);g=u+_.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:g})})),e.replaceChildren(this._elements.root),this._register(ue(()=>{e.replaceChildren()})),this._register(xe(c=>{const d=this._viewModel.read(c);if(d&&!d.isLoading.read(c)){if(d.items.read(c).length===0||d.activeDiffItem.read(c))return;this.goToNextChange()}})),this._register(this._register(xe(c=>{tb(d=>{this.render(c)})})))}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(c=>c.viewModel.originalUri?.toString()===e.original?.toString()&&c.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new Ce("Resource not found in diff editor");const s=i[n];this._viewModel.get().activeDiffItem.setCache(s.viewModel,void 0);let r=0;for(let c=0;cl.viewModel===i):-1;if(n===-1){this._goToFile(0,"first");return}const s=t[n];s.viewModel.collapsed.get()&&s.viewModel.collapsed.set(!1,void 0);const r=s.template.get()?.editor;if(r?.getDiffComputationResult()?.changes2?.length){const l=r.getModifiedEditor().getPosition()?.lineNumber||1,c=r.getDiffComputationResult().changes2;if(e==="next"?c.some(h=>h.modified.startLineNumber>l):c.some(h=>h.modified.endLineNumberExclusive<=l)){r.goToDiff(e);return}}const a=(n+(e==="next"?1:-1)+t.length)%t.length;this._goToFile(a,e==="next"?"first":"last")}_goToFile(e,t){const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const n=i.template.get()?.editor;if(n?.getDiffComputationResult()?.changes2?.length)if(t==="first")n.revealFirstDiff();else{const s=n.getDiffComputationResult().changes2.at(-1),r=n.getModifiedEditor();r.setPosition({lineNumber:s.modified.startLineNumber,column:1}),r.revealLineInCenter(s.modified.startLineNumber)}n?.focus()}render(e){const t=this.scrollTop.read(e);let i=0,n=0,s=0;const r=this._sizeObserver.height.read(e),a=ge.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=ge.ofStartAndLength(n,h),g=ge.ofStartAndLength(s,d);if(g.isBefore(a))i-=d-h,c.hide();else if(g.isAfter(a))c.hide();else{const f=Math.max(0,Math.min(a.start-g.start,d-h));i-=f;const p=ge.ofStartAndLength(t+i,r);c.render(u,f,l,p)}n+=h+this._spaceBetweenPx,s+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};LA=AMe([Z6(4,Ie),Z6(5,fe)],LA);function OMe(o,e){const t=o.getModel(),i=o.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{o.getModel()===t&&i.clear()},350)}class FMe extends A{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(gO(this,void 0)),this.contentHeight=$(this,s=>this._templateRef.read(s)?.object.contentHeight?.read(s)??this.viewModel.lastTemplateData.read(s).contentHeight),this.maxScroll=$(this,s=>this._templateRef.read(s)?.object.maxScroll.read(s)??{maxScroll:0,scrollWidth:0}),this.template=$(this,s=>this._templateRef.read(s)?.object),this._isHidden=De(this,!1),this._isFocused=$(this,s=>this.template.read(s)?.isFocused.read(s)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(xe(s=>{const r=this._scrollLeft.read(s);this._templateRef.read(s)?.object.setScrollLeft(r)})),this._register(xe(s=>{const r=this._templateRef.read(s);!r||!this._isHidden.read(s)||r.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(ae.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const s=this._templateRef.get();s&&n&&s.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&Et(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new MMe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&s.object.editor.setSelections(r)}s.object.render(e,i,t,n)}}var WMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},BMe=function(o,e){return function(t,i){e(t,i,o)}};let kA=class extends A{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=De(this,void 0),this._viewModel=De(this,void 0),this._widgetImpl=$(this,n=>n.store.add(this._instantiationService.createInstance(ac(LA),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(fm(this._widgetImpl))}};kA=WMe([BMe(2,fe)],kA);function HMe(o,e,t){return Ne.initialize(t||{}).createInstance(SA,o,e)}function VMe(o){return Ne.get(et).onCodeEditorAdd(t=>{o(t)})}function zMe(o){return Ne.get(et).onDiffEditorAdd(t=>{o(t)})}function UMe(){return Ne.get(et).listCodeEditors()}function $Me(){return Ne.get(et).listDiffEditors()}function jMe(o,e,t){return Ne.initialize(t||{}).createInstance(yA,o,e)}function qMe(o,e){const t=Ne.initialize(e||{});return new kA(o,{},t)}function KMe(o){if(typeof o.id!="string"||typeof o.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Ye.registerCommand(o.id,o.run)}function GMe(o){if(typeof o.id!="string"||typeof o.label!="string"||typeof o.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=q.deserialize(o.precondition),t=(n,...s)=>Ki.runEditorCommand(n,s,e,(r,a,l)=>Promise.resolve(o.run(a,...l))),i=new z;if(i.add(Ye.registerCommand(o.id,t)),o.contextMenuGroupId){const n={command:{id:o.id,title:o.label},when:e,group:o.contextMenuGroupId,order:o.contextMenuOrder||0};i.add(un.appendMenuItem(M.EditorContext,n))}if(Array.isArray(o.keybindings)){const n=Ne.get(st);if(!(n instanceof Ym))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=q.and(e,q.deserialize(o.keybindingContext));i.add(n.addDynamicKeybindings(o.keybindings.map(r=>({keybinding:r,command:o.id,when:s}))))}}return i}function ZMe(o){return IY([o])}function IY(o){const e=Ne.get(st);return e instanceof Ym?e.addDynamicKeybindings(o.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:q.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),A.None)}function YMe(o,e,t){const i=Ne.get(_i),n=i.getLanguageIdByMimeType(e)||e;return DY(Ne.get(ei),i,o,n,t)}function XMe(o,e){const t=Ne.get(_i),i=t.getLanguageIdByMimeType(e)||e||qo;o.setLanguage(t.createById(i))}function QMe(o,e,t){o&&Ne.get($l).changeOne(e,o.uri,t)}function JMe(o){Ne.get($l).changeAll(o,[])}function e2e(o){return Ne.get($l).read(o)}function t2e(o){return Ne.get($l).onMarkerChanged(o)}function i2e(o){return Ne.get(ei).getModel(o)}function n2e(){return Ne.get(ei).getModels()}function s2e(o){return Ne.get(ei).onModelAdded(o)}function o2e(o){return Ne.get(ei).onModelRemoved(o)}function r2e(o){return Ne.get(ei).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function a2e(o){return uTe(Ne.get(ei),o)}function l2e(o,e){const t=Ne.get(_i),i=Ne.get(er);return a3.colorizeElement(i,t,o,e).then(()=>{i.registerEditorContainer(o)})}function c2e(o,e,t){const i=Ne.get(_i);return Ne.get(er).registerEditorContainer(wt.document.body),a3.colorize(i,o,e,t)}function d2e(o,e,t=4){return Ne.get(er).registerEditorContainer(wt.document.body),a3.colorizeModelLine(o,e,t)}function h2e(o){const e=ui.get(o);return e||{getInitialState:()=>Im,tokenize:(t,i,n)=>w4(o,n)}}function u2e(o,e){ui.getOrCreate(e);const t=h2e(e),i=bo(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const s=t.options?.selection;let r;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?r=s:s&&(r={lineNumber:s.startLineNumber,column:s.startColumn}),await o.openCodeEditor(i,t.resource,r)?i:null})}function C2e(){return{create:HMe,getEditors:UMe,getDiffEditors:$Me,onDidCreateEditor:VMe,onDidCreateDiffEditor:zMe,createDiffEditor:jMe,addCommand:KMe,addEditorAction:GMe,addKeybindingRule:ZMe,addKeybindingRules:IY,createModel:YMe,setModelLanguage:XMe,setModelMarkers:QMe,getModelMarkers:e2e,removeAllMarkers:JMe,onDidChangeMarkers:t2e,getModels:n2e,getModel:i2e,onDidCreateModel:s2e,onWillDisposeModel:o2e,onDidChangeModelLanguage:r2e,createWebWorker:a2e,colorizeElement:l2e,colorize:c2e,colorizeModelLine:d2e,tokenize:u2e,defineTheme:g2e,setTheme:f2e,remeasureFonts:p2e,registerCommand:m2e,registerLinkOpener:_2e,registerEditorOpener:b2e,AccessibilitySupport:O2,ContentWidgetPositionPreference:z2,CursorChangeReason:U2,DefaultEndOfLine:$2,EditorAutoIndentStrategy:q2,EditorOption:K2,EndOfLinePreference:G2,EndOfLineSequence:Z2,MinimapPosition:aP,MinimapSectionHeaderStyle:lP,MouseTargetType:cP,OverlayWidgetPositionPreference:uP,OverviewRulerLane:gP,GlyphMarginLane:Y2,RenderLineNumbersType:mP,RenderMinimap:_P,ScrollbarVisibility:CP,ScrollType:bP,TextEditorCursorBlinkingStyle:kP,TextEditorCursorStyle:DP,TrackedRangeStickiness:IP,WrappingIndent:EP,InjectedTextCursorStops:J2,PositionAffinity:pP,ShowLightbulbIconMode:wP,TextDirection:LP,ConfigurationChangedEvent:oU,BareFontInfo:Ig,FontInfo:U0,TextModelResolvedOptions:PS,FindMatch:MC,ApplyUpdateResult:Db,EditorZoom:hr,createMultiFileDiffEditor:qMe,EditorType:xw,EditorOptions:rs}}function v2e(o,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!o(t))return!1;return!0}function vS(o,e){return typeof o=="boolean"?o:e}function Y6(o,e){return typeof o=="string"?o:e}function w2e(o){const e={};for(const t of o)e[t]=!0;return e}function X6(o,e=!1){e&&(o=o.map(function(i){return i.toLowerCase()}));const t=w2e(o);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function DA(o,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof o[a]=="string")l=o[a];else if(o[a]&&o[a]instanceof RegExp)l=o[a].source;else throw o[a]===void 0?zt(o,"language definition does not contain attribute '"+a+"', used at: "+e):zt(o,"attribute reference '"+a+"' must be a string, used at: "+e);return Au(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const s=(o.ignoreCase?"i":"")+(o.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(_Te(o,e,c),s)),l)}return new RegExp(e,s)}function S2e(o,e,t,i){if(i<0)return o;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw zt(o,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw zt(o,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!bTe(o,Vd(o,n,"",[],""))))throw zt(o,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,o.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,s=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=DA(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=IA(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function EY(o,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:o,includeLF:vS(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:vS(e.ignoreCase,!1),unicode:vS(e.unicode,!1),tokenPostfix:Y6(e.tokenPostfix,"."+o),defaultToken:Y6(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=o,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw zt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw zt(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new x2e(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw zt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw zt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=vS(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw zt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw zt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw zt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:jc(t,a.open),close:jc(t,a.close)});else throw zt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function L2e(o){mm.registerLanguage(o)}function k2e(){let o=[];return o=o.concat(mm.getLanguages()),o}function D2e(o){return Ne.get(_i).languageIdCodec.encodeLanguageId(o)}function I2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function E2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function N2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ne.get(ti).register(o,e,100)}class T2e{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return iw.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new JL(n.tokens,n.endState)}}class iw{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g{const i=await Promise.resolve(e.create());return i?R2e(i)?TY(o,i):new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe)):null});return ui.registerFactory(o,t)}function A2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return NY(e)?_3(o,{create:()=>e}):ui.register(o,TY(o,e))}function O2e(o,e){const t=i=>new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe));return NY(e)?_3(o,{create:()=>e}):ui.register(o,t(e))}function F2e(o,e){return Ne.get(he).referenceProvider.register(o,e)}function W2e(o,e){return Ne.get(he).renameProvider.register(o,e)}function B2e(o,e){return Ne.get(he).newSymbolNamesProvider.register(o,e)}function H2e(o,e){return Ne.get(he).signatureHelpProvider.register(o,e)}function V2e(o,e){return Ne.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function z2e(o,e){return Ne.get(he).documentSymbolProvider.register(o,e)}function U2e(o,e){return Ne.get(he).documentHighlightProvider.register(o,e)}function $2e(o,e){return Ne.get(he).linkedEditingRangeProvider.register(o,e)}function j2e(o,e){return Ne.get(he).definitionProvider.register(o,e)}function q2e(o,e){return Ne.get(he).implementationProvider.register(o,e)}function K2e(o,e){return Ne.get(he).typeDefinitionProvider.register(o,e)}function G2e(o,e){return Ne.get(he).codeLensProvider.register(o,e)}function Z2e(o,e,t){return Ne.get(he).codeActionProvider.register(o,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,s,r,a)=>{const c=Ne.get($l).read({resource:n.uri}).filter(d=>L.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Y2e(o,e){return Ne.get(he).documentFormattingEditProvider.register(o,e)}function X2e(o,e){return Ne.get(he).documentRangeFormattingEditProvider.register(o,e)}function Q2e(o,e){return Ne.get(he).onTypeFormattingEditProvider.register(o,e)}function J2e(o,e){return Ne.get(he).linkProvider.register(o,e)}function ePe(o,e){return Ne.get(he).completionProvider.register(o,e)}function tPe(o,e){return Ne.get(he).colorProvider.register(o,e)}function iPe(o,e){return Ne.get(he).foldingRangeProvider.register(o,e)}function nPe(o,e){return Ne.get(he).declarationProvider.register(o,e)}function sPe(o,e){return Ne.get(he).selectionRangeProvider.register(o,e)}function oPe(o,e){return Ne.get(he).documentSemanticTokensProvider.register(o,e)}function rPe(o,e){return Ne.get(he).documentRangeSemanticTokensProvider.register(o,e)}function aPe(o,e){return Ne.get(he).inlineCompletionsProvider.register(o,e)}function lPe(o,e){return Ne.get(he).inlayHintsProvider.register(o,e)}function cPe(){return{register:L2e,getLanguages:k2e,onLanguage:I2e,onLanguageEncountered:E2e,getEncodedLanguageId:D2e,setLanguageConfiguration:N2e,setColorMap:P2e,registerTokensProviderFactory:_3,setTokensProvider:A2e,setMonarchTokensProvider:O2e,registerReferenceProvider:F2e,registerRenameProvider:W2e,registerNewSymbolNameProvider:B2e,registerCompletionItemProvider:ePe,registerSignatureHelpProvider:H2e,registerHoverProvider:V2e,registerDocumentSymbolProvider:z2e,registerDocumentHighlightProvider:U2e,registerLinkedEditingRangeProvider:$2e,registerDefinitionProvider:j2e,registerImplementationProvider:q2e,registerTypeDefinitionProvider:K2e,registerCodeLensProvider:G2e,registerCodeActionProvider:Z2e,registerDocumentFormattingEditProvider:Y2e,registerDocumentRangeFormattingEditProvider:X2e,registerOnTypeFormattingEditProvider:Q2e,registerLinkProvider:J2e,registerColorProvider:tPe,registerFoldingRangeProvider:iPe,registerDeclarationProvider:nPe,registerSelectionRangeProvider:sPe,registerDocumentSemanticTokensProvider:oPe,registerDocumentRangeSemanticTokensProvider:rPe,registerInlineCompletionsProvider:aPe,registerInlayHintsProvider:lPe,DocumentHighlightKind:j2,CompletionItemKind:B2,CompletionItemTag:H2,CompletionItemInsertTextRule:W2,SymbolKind:yP,SymbolTag:xP,IndentAction:Q2,CompletionTriggerKind:V2,SignatureHelpTriggerKind:SP,InlayHintKind:eP,InlineCompletionTriggerKind:nP,CodeActionTriggerType:F2,NewSymbolNameTag:dP,NewSymbolNameTriggerKind:hP,PartialAcceptTriggerKind:fP,HoverVerbosityAction:X2,InlineCompletionEndOfLifeReasonKind:tP,InlineCompletionHintStyle:iP,FoldingRangeKind:df,SelectedSuggestionInfo:c$,EditDeltaInfo:ov}}rs.wrappingIndent.defaultValue=0;rs.glyphMargin.defaultValue=!1;rs.autoIndent.defaultValue=3;rs.overviewRulerLanes.defaultValue=2;Vm.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const As=sY();As.editor=C2e();As.languages=cPe();const RY=As.CancellationTokenSource,Ph=As.Emitter,MY=As.KeyCode,PY=As.KeyMod,_d=As.Position,x_=As.Range,AY=As.Selection,OY=As.SelectionDirection,Zr=As.MarkerSeverity,nL=As.MarkerTag,hD=As.Uri,FY=As.Token,Dl=As.editor,de=As.languages,dPe=FA(),rm=globalThis;(dPe?.globalAPI||typeof rm.define=="function"&&rm.define.amd)&&(rm.monaco=As);typeof rm.require<"u"&&typeof rm.require.config=="function"&&rm.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const hPe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:RY,Emitter:Ph,KeyCode:MY,KeyMod:PY,MarkerSeverity:Zr,MarkerTag:nL,Position:_d,Range:x_,Selection:AY,SelectionDirection:OY,Token:FY,Uri:hD,editor:Dl,languages:de},Symbol.toStringTag,{value:"Module"}));let b3=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const C3={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},v3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},WY=new b3("css",C3,v3),BY=new b3("scss",C3,v3),HY=new b3("less",C3,v3);function w3(){return we(()=>import("./cssMode-k4cBIe4o.js"),__vite__mapDeps([0,1,2,3,4]))}de.onLanguage("less",()=>{w3().then(o=>o.setupMode(HY))});de.onLanguage("scss",()=>{w3().then(o=>o.setupMode(BY))});de.onLanguage("css",()=>{w3().then(o=>o.setupMode(WY))});const VY=Object.freeze(Object.defineProperty({__proto__:null,cssDefaults:WY,lessDefaults:HY,scssDefaults:BY},Symbol.toStringTag,{value:"Module"}));let uPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const gPe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},uD={format:gPe,suggest:{},data:{useDefaultDataProvider:!0}};function gD(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===bC,documentFormattingEdits:o===bC,documentRangeFormattingEdits:o===bC}}const bC="html",Q6="handlebars",J6="razor",zY=fD(bC,uD,gD(bC)),fPe=zY.defaults,UY=fD(Q6,uD,gD(Q6)),pPe=UY.defaults,$Y=fD(J6,uD,gD(J6)),mPe=$Y.defaults;function _Pe(){return we(()=>import("./htmlMode-B2JxHnrC.js"),__vite__mapDeps([5,1,2,3,4]))}function fD(o,e=uD,t=gD(o)){const i=new uPe(o,e,t);let n;const s=de.onLanguage(o,async()=>{n=(await _Pe()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}const jY=Object.freeze(Object.defineProperty({__proto__:null,handlebarDefaults:pPe,handlebarLanguageService:UY,htmlDefaults:fPe,htmlLanguageService:zY,razorDefaults:mPe,razorLanguageService:$Y,registerHTMLLanguageService:fD},Symbol.toStringTag,{value:"Module"}));let bPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const CPe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},vPe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},qY=new bPe("json",CPe,vPe),wPe=()=>KY().then(o=>o.getWorker());function KY(){return we(()=>import("./jsonMode-1xqDoFsh.js"),__vite__mapDeps([6,1,2,3,4]))}de.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});de.onLanguage("json",()=>{KY().then(o=>o.setupMode(qY))});const GY=Object.freeze(Object.defineProperty({__proto__:null,getWorker:wPe,jsonDefaults:qY},Symbol.toStringTag,{value:"Module"})),SPe="5.9.3";var ZY=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(ZY||{}),YY=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(YY||{}),XY=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(XY||{}),QY=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(QY||{}),JY=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(JY||{});class eX{constructor(e,t,i,n,s){this._onDidChange=new Ph,this._onDidExtraLibsChange=new Ph,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(n),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let i;if(typeof t>"u"?i=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:i=t,this._extraLibs[i]&&this._extraLibs[i].content===e)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[i]&&(n=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(n=this._extraLibs[i].version+1),this._extraLibs[i]={content:e,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[i];s&&s.version===n&&(delete this._extraLibs[i],this._removedExtraLibs[i]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const i=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=t.content;let s=1;this._removedExtraLibs[i]&&(s=this._removedExtraLibs[i]+1),this._extraLibs[i]={content:n,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(void 0)}}const yPe=SPe,tX={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},iX=new eX({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),nX=new eX({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),xPe=()=>pD().then(o=>o.getTypeScriptWorker()),LPe=()=>pD().then(o=>o.getJavaScriptWorker());function pD(){return we(()=>import("./tsMode-D10OTffV.js"),__vite__mapDeps([7,2,3,4]))}de.onLanguage("typescript",()=>pD().then(o=>o.setupTypeScript(iX)));de.onLanguage("javascript",()=>pD().then(o=>o.setupJavaScript(nX)));const sX=Object.freeze(Object.defineProperty({__proto__:null,JsxEmit:YY,ModuleKind:ZY,ModuleResolutionKind:JY,NewLineKind:XY,ScriptTarget:QY,getJavaScriptWorker:LPe,getTypeScriptWorker:xPe,javascriptDefaults:nX,typescriptDefaults:iX,typescriptVersion:yPe},Symbol.toStringTag,{value:"Module"})),oX={},NE={};class S3{static getOrCreate(e){return NE[e]||(NE[e]=new S3(e)),NE[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,oX[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function ye(o){const e=o.id;oX[e]=o,de.register(o);const t=S3.getOrCreate(e);de.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),de.onLanguageEncountered(e,async()=>{const i=await t.load();de.setLanguageConfiguration(e,i.conf)})}ye({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>we(()=>import("./abap-DLDM7-KI.js"),[])});ye({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>we(()=>import("./apex-DNDY2TF8.js"),[])});ye({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>we(()=>import("./azcli-Y6nb8tq_.js"),[])});ye({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>we(()=>import("./bat-BwHxbl9M.js"),[])});ye({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>we(()=>import("./bicep-CFznDFnq.js"),[])});ye({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>we(()=>import("./cameligo-Bf6VGUru.js"),[])});ye({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>we(()=>import("./clojure-Dnu-v4kV.js"),[])});ye({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>we(()=>import("./coffee-Bd8akH9Z.js"),[])});ye({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>we(()=>import("./csharp-Co3qMtFm.js"),[])});ye({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>we(()=>import("./csp-D-4FJmMZ.js"),[])});ye({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>we(()=>import("./css-DdJfP1eB.js"),[])});ye({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>we(()=>import("./cypher-cTPe9QuQ.js"),[])});ye({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>we(()=>import("./dart-BOtBlQCF.js"),[])});ye({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>we(()=>import("./dockerfile-BG73LgW2.js"),[])});ye({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>we(()=>import("./ecl-BEgZUVRK.js"),[])});ye({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>we(()=>import("./elixir-BkW5O-1t.js"),[])});ye({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>we(()=>import("./flow9-BeJ5waoc.js"),[])});ye({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>we(()=>import("./fsharp-PahG7c26.js"),[])});ye({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationDollar)});ye({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationBracket)});ye({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationBracket)});ye({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>we(()=>import("./freemarker2-C0l6anS_.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationBracket)});ye({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>we(()=>import("./go-acbASCJo.js"),[])});ye({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>we(()=>import("./graphql-BxJiqAUM.js"),[])});ye({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>we(()=>import("./handlebars-CrwlbXzI.js"),__vite__mapDeps([9,2,3,4]))});ye({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>we(()=>import("./hcl-DtV1sZF8.js"),[])});ye({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>we(()=>import("./html-Clnn5ww4.js"),__vite__mapDeps([10,2,3,4]))});ye({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>we(()=>import("./ini-Kd9XrMLS.js"),[])});ye({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>we(()=>import("./java-CXBNlu9o.js"),[])});ye({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>we(()=>import("./javascript-CO6b1bN1.js"),__vite__mapDeps([11,12,2,3,4]))});ye({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>we(()=>import("./julia-cl7-CwDS.js"),[])});ye({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>we(()=>import("./kotlin-s7OhZKlX.js"),[])});ye({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>we(()=>import("./less-9HpZscsL.js"),[])});ye({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>we(()=>import("./lexon-OrD6JF1K.js"),[])});ye({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>we(()=>import("./lua-Cyyb5UIc.js"),[])});ye({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>we(()=>import("./liquid-BL1JohJf.js"),__vite__mapDeps([13,2,3,4]))});ye({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>we(()=>import("./m3-B8OfTtLu.js"),[])});ye({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>we(()=>import("./markdown-BFxVWTOG.js"),[])});ye({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>we(()=>import("./mdx-BtwBPXgy.js"),__vite__mapDeps([14,2,3,4]))});ye({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>we(()=>import("./mips-CiqrrVzr.js"),[])});ye({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>we(()=>import("./msdax-DmeGPVcC.js"),[])});ye({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>we(()=>import("./mysql-C_tMU-Nz.js"),[])});ye({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>we(()=>import("./objective-c-BDtDVThU.js"),[])});ye({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>we(()=>import("./pascal-vHIfCaH5.js"),[])});ye({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>we(()=>import("./pascaligo-DtZ0uQbO.js"),[])});ye({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>we(()=>import("./perl-Ub6l9XKa.js"),[])});ye({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>we(()=>import("./pgsql-BlNEE0v7.js"),[])});ye({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>we(()=>import("./php-BBUBE1dy.js"),[])});ye({id:"pla",extensions:[".pla"],loader:()=>we(()=>import("./pla-DSh2-awV.js"),[])});ye({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>we(()=>import("./postiats-CocnycG-.js"),[])});ye({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>we(()=>import("./powerquery-tScXyioY.js"),[])});ye({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>we(()=>import("./powershell-COWaemsV.js"),[])});ye({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>we(()=>import("./protobuf-Brw8urJB.js"),[])});ye({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>we(()=>import("./pug-8SOpv6rk.js"),[])});ye({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>we(()=>import("./python-Cg60ZTQb.js"),__vite__mapDeps([15,2,3,4]))});ye({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>we(()=>import("./qsharp-Bw9ernYp.js"),[])});ye({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>we(()=>import("./r-j7ic8hl3.js"),[])});ye({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>we(()=>import("./razor-B77IdrOm.js"),__vite__mapDeps([16,2,3,4]))});ye({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>we(()=>import("./redis-Bu5POkcn.js"),[])});ye({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>we(()=>import("./redshift-Bs9aos_-.js"),[])});ye({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>we(()=>import("./restructuredtext-CqXO7rUv.js"),[])});ye({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>we(()=>import("./ruby-zBfavPgS.js"),[])});ye({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>we(()=>import("./rust-BzKRNQWT.js"),[])});ye({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>we(()=>import("./sb-BBc9UKZt.js"),[])});ye({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>we(()=>import("./scala-D9hQfWCl.js"),[])});ye({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>we(()=>import("./scheme-BPhDTwHR.js"),[])});ye({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>we(()=>import("./scss-CBJaRo0y.js"),[])});ye({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>we(()=>import("./shell-DiJ1NA_G.js"),[])});ye({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>we(()=>import("./solidity-Db0IVjzk.js"),[])});ye({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>we(()=>import("./sophia-CnS9iZB_.js"),[])});ye({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>we(()=>import("./sparql-CJmd_6j2.js"),[])});ye({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>we(()=>import("./sql-ClhHkBeG.js"),[])});ye({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>we(()=>import("./st-CHwy0fLd.js"),[])});ye({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>we(()=>import("./swift-Bqt4WxQ4.js"),[])});ye({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>we(()=>import("./tcl-Dm6ycUr_.js"),[])});ye({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>we(()=>import("./twig-Csy3S7wG.js"),[])});ye({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>we(()=>import("./typescript-BF2N5gRo.js"),__vite__mapDeps([12,2,3,4]))});ye({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>we(()=>import("./typespec-Btyra-wh.js"),[])});ye({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>we(()=>import("./vb-Db0cS2oM.js"),[])});ye({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>we(()=>import("./wgsl-DumH7NcR.js"),[])});ye({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\we(()=>import("./xml-CKVlGCVv.js"),__vite__mapDeps([17,2,3,4]))});ye({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>we(()=>import("./yaml-D9hqJrzJ.js"),__vite__mapDeps([18,2,3,4]))});var kPe=Object.defineProperty,DPe=(o,e,t)=>e in o?kPe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,ve=(o,e,t)=>DPe(o,typeof e!="symbol"?e+"":e,t),wS,eV,SS,TE,yS;function IPe(o){return o.method!==void 0}var tV;(function(o){function e(t){return t}o.create=e})(tV||(tV={}));var Kr;(function(o){o.parseError=-32700,o.invalidRequest=-32600,o.methodNotFound=-32601,o.invalidParams=-32602,o.internalError=-32603;function e(s){return-32099<=s&&s<=-32e3}o.isServerError=e;function t(s){if(!e(s))throw new Error("Invalid range for a server error.");return s}o.serverError=t,o.unexpectedServerError=-32e3;function i(s){return!0}o.isApplicationError=i;function n(s){return s}o.applicationError=n,o.genericApplicationError=-320100})(Kr||(Kr={}));var y3=class{constructor(){ve(this,"listeners",new Set),ve(this,"event",o=>(this.listeners.add(o),{dispose:()=>{this.listeners.delete(o)}}))}fire(o){this.listeners.forEach(e=>e(o))}},EPe=class{constructor(o){ve(this,"_value"),ve(this,"eventEmitter"),this._value=o,this.eventEmitter=new y3}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this.eventEmitter.fire(o))}get onChange(){return this.eventEmitter.event}};function NPe(o,e){const t=setTimeout(e,o);return{dispose:()=>clearTimeout(t)}}function RE(o,e,t){return o instanceof Set?(o.add(e),{dispose:()=>o.delete(e)}):(o.set(e,t),{dispose:()=>o.delete(e)})}var TPe=class{constructor(){ve(this,"_state","none"),ve(this,"promise"),ve(this,"resolve",()=>{}),ve(this,"reject",()=>{}),this.promise=new Promise((o,e)=>{this.resolve=o,this.reject=e})}get state(){return this._state}},rX=(wS=class{constructor(){ve(this,"_unprocessedMessages",[]),ve(this,"_messageListener"),ve(this,"id",wS.id++),ve(this,"_state",new EPe({state:"open"})),ve(this,"state",this._state)}setListener(o){if(this._messageListener=o,!!o)for(;this._unprocessedMessages.length>0&&this._messageListener!==void 0;){const e=this._unprocessedMessages.shift();this._messageListener(e)}}send(o){return this._sendImpl(o)}_dispatchReceivedMessage(o){this._unprocessedMessages.length===0&&this._messageListener?this._messageListener(o):this._unprocessedMessages.push(o)}_onConnectionClosed(){this._state.value={state:"closed",error:void 0}}log(o){return new RPe(this,o??new MPe)}},ve(wS,"id",0),wS),RPe=class{constructor(o,e){ve(this,"baseStream"),ve(this,"logger"),this.baseStream=o,this.logger=e}get state(){return this.baseStream.state}setListener(o){if(o===void 0){this.baseStream.setListener(void 0);return}this.baseStream.setListener(e=>{this.logger.log(this.baseStream,"incoming",e),o(e)})}send(o){return this.logger.log(this.baseStream,"outgoing",o),this.baseStream.send(o)}toString(){return`StreamLogger/${this.baseStream.toString()}`}},MPe=class{log(o,e,t){console.log(`${e==="incoming"?"<-":"->"} [${o.toString()}] ${JSON.stringify(t)}`)}},PPe=class aX{constructor(e){ve(this,"connect"),this.connect=e}mapContext(e){return new aX(t=>this.connect(t?APe(t,e):void 0))}};function APe(o,e){return{handleNotification:(t,i)=>o.handleNotification(t,e(i)),handleRequest:(t,i,n)=>o.handleRequest(t,i,e(n))}}var OPe=class lX{constructor(e,t,i){ve(this,"_stream"),ve(this,"_listener"),ve(this,"_logger"),ve(this,"_unprocessedResponses",new Map),ve(this,"_lastUsedRequestId",0),this._stream=e,this._listener=t,this._logger=i,this._stream.setListener(n=>{IPe(n)?n.id===void 0?this._processNotification(n):this._processRequest(n):this._processResponse(n)})}static createChannel(e,t){let i=!1;return new PPe(n=>{if(i)throw new Error(`A channel to the stream ${e} was already constructed!`);return i=!0,new lX(e,n,t)})}get state(){return this._stream.state}async _processNotification(e){if(e.id!==void 0)throw new Error;if(!this._listener){this._logger&&this._logger.debug({text:"Notification ignored",message:e});return}try{await this._listener.handleNotification({method:e.method,params:e.params||null})}catch(t){this._logger&&this._logger.warn({text:`Exception was thrown while handling notification: ${t}`,exception:t,message:e})}}async _processRequest(e){if(e.id===void 0)throw new Error;let t;if(this._listener)try{t=await this._listener.handleRequest({method:e.method,params:e.params||null},e.id)}catch(n){this._logger&&this._logger.warn({text:`Exception was thrown while handling request: ${n}`,message:e,exception:n}),t={error:{code:Kr.internalError,message:"An unexpected exception was thrown.",data:void 0}}}else this._logger&&this._logger.debug({text:"Received request even though not listening for requests",message:e}),t={error:{code:Kr.methodNotFound,message:"This endpoint does not listen for requests or notifications.",data:void 0}};let i;"result"in t?i={jsonrpc:"2.0",id:e.id,result:t.result}:i={jsonrpc:"2.0",id:e.id,error:t.error},await this._stream.send(i)}_processResponse(e){const t=""+e.id,i=this._unprocessedResponses.get(t);if(!i){this._logger&&this._logger.debug({text:"Got an unexpected response message",message:e});return}this._unprocessedResponses.delete(t),i(e)}_newRequestId(){return this._lastUsedRequestId++}sendRequest(e,t,i){const n={jsonrpc:"2.0",id:this._newRequestId(),method:e.method,params:e.params||void 0};return i&&i(n.id),new Promise((s,r)=>{const a=""+n.id;this._unprocessedResponses.set(a,l=>{"result"in l?s({result:l.result}):(l.error||r(new Error("Response had neither 'result' nor 'error' field set.")),s({error:l.error}))}),this._stream.send(n).then(void 0,l=>{this._unprocessedResponses.delete(a),r(l)})})}sendNotification(e,t){const i={jsonrpc:"2.0",id:void 0,method:e.method,params:e.params||void 0};return this._stream.send(i)}toString(){return"StreamChannel/"+this._stream.toString()}},am;(function(o){function e(){return{deserializeFromJson:n=>({hasErrors:!1,value:n}),serializeToJson:n=>n}}o.sAny=e;function t(){return{deserializeFromJson:n=>({hasErrors:!1,value:{}}),serializeToJson:n=>({})}}o.sEmptyObject=t;function i(){return{deserializeFromJson:n=>({hasErrors:!1,value:void 0}),serializeToJson:n=>null}}o.sVoidFromNull=i})(am||(am={}));const cX=Symbol("OptionalMethodNotFound");var dX=class{contextualize(o){return new FPe(this,o)}},FPe=class extends dX{constructor(o,e){super(),ve(this,"underylingTypedChannel"),ve(this,"converters"),this.underylingTypedChannel=o,this.converters=e}async request(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.request(o,e,i)}async notify(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.notify(o,e,i)}registerNotificationHandler(o,e){return this.underylingTypedChannel.registerNotificationHandler(o,async(t,i)=>await e(t,await this.converters.getNewContext(i)))}registerRequestHandler(o,e){return this.underylingTypedChannel.registerRequestHandler(o,async(t,i,n)=>await e(t,i,await this.converters.getNewContext(n)))}},EA=class hX extends dX{constructor(e,t={}){super(),ve(this,"channelCtor"),ve(this,"_requestSender"),ve(this,"_handler",new Map),ve(this,"_unknownNotificationHandler",new Set),ve(this,"_timeout"),ve(this,"sendExceptionDetails",!1),ve(this,"_logger"),ve(this,"listeningDeferred",new TPe),ve(this,"onListening",this.listeningDeferred.promise),ve(this,"_requestDidErrorEventEmitter",new y3),ve(this,"onRequestDidError",this._requestDidErrorEventEmitter.event),this.channelCtor=e,this._logger=t.logger,this.sendExceptionDetails=!!t.sendExceptionDetails,this._timeout=NPe(1e3,()=>{this._requestSender||console.warn(`"${this.startListen.name}" has not been called within 1 second after construction of this channel. Did you forget to call it?`,this)})}static fromTransport(e,t={}){return new hX(OPe.createChannel(e,t.logger),t)}startListen(){if(this._requestSender)throw new Error(`"${this.startListen.name}" can be called only once, but it already has been called.`);this._timeout&&(this._timeout.dispose(),this._timeout=void 0),this._requestSender=this.channelCtor.connect({handleRequest:(e,t,i)=>this.handleRequest(e,t,i),handleNotification:(e,t)=>this.handleNotification(e,t)}),this.listeningDeferred.resolve()}checkChannel(e){if(!e)throw new Error(`"${this.startListen.name}" must be called before any messages can be sent or received.`);return!0}async handleRequest(e,t,i){const n=this._handler.get(e.method);if(!n)return this._logger&&this._logger.debug({text:`No request handler for "${e.method}".`,data:{requestObject:e}}),{error:{code:Kr.methodNotFound,message:`No request handler for "${e.method}".`,data:{method:e.method}}};if(n.kind!="request"){const r=`"${e.method}" is registered as notification, but was sent as request.`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e}}),{error:{code:Kr.invalidRequest,message:r,data:{method:e.method}}}}const s=n.requestType.paramsSerializer.deserializeFromJson(e.params);if(s.hasErrors){const r=`Got invalid params: ${s.errorMessage}`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e,errorMessage:s.errorMessage}}),{error:{code:Kr.invalidParams,message:r,data:{errors:s.errorMessage}}}}else{const r=s.value;let a;try{const l=await n.handler(r,t,i);if("error"in l||"errorMessage"in l){const c=l.error?n.requestType.errorSerializer.serializeToJson(l.error):void 0;a={error:{code:l.errorCode||Kr.genericApplicationError,message:l.errorMessage||"An error was returned",data:c}}}else a={result:n.requestType.resultSerializer.serializeToJson(l.ok)}}catch(l){l instanceof nV?a={error:{code:l.code,message:l.message}}:(this._logger&&this._logger.warn({text:`An exception was thrown while handling a request: ${l}.`,exception:l,data:{requestObject:e}}),a={error:{code:Kr.unexpectedServerError,message:this.sendExceptionDetails?`An exception was thrown while handling a request: ${l}.`:"Server has thrown an unexpected exception"}})}return a}}async handleNotification(e,t){const i=this._handler.get(e.method);if(!i){for(const r of this._unknownNotificationHandler)r(e);this._unknownNotificationHandler.size===0&&this._logger&&this._logger.debug({text:`Unhandled notification "${e.method}"`,data:{requestObject:e}});return}if(i.kind!="notification"){this._logger&&this._logger.debug({text:`"${e.method}" is registered as request, but was sent as notification.`,data:{requestObject:e}});return}const n=i.notificationType.paramsSerializer.deserializeFromJson(e.params);if(n.hasErrors){this._logger&&this._logger.debug({text:`Got invalid params: ${n}`,data:{requestObject:e,errorMessage:n.errorMessage}});return}const s=n.value;for(const r of i.handlers)try{r(s,t)}catch(a){this._logger&&this._logger.warn({text:`An exception was thrown while handling a notification: ${a}.`,exception:a,data:{requestObject:e}})}}registerUnknownNotificationHandler(e){return RE(this._unknownNotificationHandler,e)}registerRequestHandler(e,t){if(this._handler.get(e.method))throw new Error(`Handler with method "${e.method}" already registered.`);return RE(this._handler,e.method,{kind:"request",requestType:e,handler:t})}registerNotificationHandler(e,t){let i=this._handler.get(e.method);if(!i)i={kind:"notification",notificationType:e,handlers:new Set},this._handler.set(e.method,i);else{if(i.kind!=="notification")throw new Error(`Method "${e.method}" was already registered as request handler.`);if(i.notificationType!==e)throw new Error(`Method "${e.method}" was registered for a different type.`)}return RE(i.handlers,t)}getRegisteredTypes(){const e=[];for(const t of this._handler.values())t.kind==="notification"?e.push(t.notificationType):t.kind==="request"&&e.push(t.requestType);return e}async request(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error("Impossible");const n=e.paramsSerializer.serializeToJson(t);iV(n);const s=await this._requestSender.sendRequest({method:e.method,params:n},i);if("error"in s){if(e.isOptional&&s.error.code===Kr.methodNotFound)return cX;let r;if(s.error.data!==void 0){const l=e.errorSerializer.deserializeFromJson(s.error.data);if(l.hasErrors)throw new Error(l.errorMessage);r=l.value}else r=void 0;const a=new nV(s.error.message,r,s.error.code);throw this._requestDidErrorEventEmitter.fire({error:a}),a}else{const r=e.resultSerializer.deserializeFromJson(s.result);if(r.hasErrors)throw new Error("Could not deserialize response: "+r.errorMessage+` -${JSON.stringify(s,null,2)}`);return r.value}}async notify(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error;const n=e.paramsSerializer.serializeToJson(t);Vz(n),this._requestSender.sendNotification({method:e.method,params:n},i)}};function Vz(o){if(o!==null&&Array.isArray(o)&&typeof o!="object")throw new Error("Invalid value! Only null, array and object is allowed.")}var zz=class iJ extends Error{constructor(e,t,i=aa.genericApplicationError){super(e),we(this,"data"),we(this,"code"),this.data=t,this.code=i,Object.setPrototypeOf(this,iJ.prototype)}},t4e=class zO{constructor(e,t,i,n,s=!1){we(this,"method"),we(this,"paramsSerializer"),we(this,"resultSerializer"),we(this,"errorSerializer"),we(this,"isOptional"),we(this,"kind","request"),this.method=e,this.paramsSerializer=t,this.resultSerializer=i,this.errorSerializer=n,this.isOptional=s}withMethod(e){return new zO(e,this.paramsSerializer,this.resultSerializer,this.errorSerializer)}optional(){return new zO(this.method,this.paramsSerializer,this.resultSerializer,this.errorSerializer,!0)}},i4e=class nJ{constructor(e,t){we(this,"method"),we(this,"paramsSerializer"),we(this,"kind","notification"),this.method=e,this.paramsSerializer=t}withMethod(e){return new nJ(e,this.paramsSerializer)}};function Be(o){return new t4e((o||{}).method,Fm.sAny(),Fm.sAny(),Fm.sAny())}function Ei(o){return new i4e((o||{}).method,Fm.sAny())}const n4e=Symbol();var Uz=(Bz=n4e,m0=class{constructor(o){we(this,"error"),we(this,Bz),this.error=o}},we(m0,"factory",o=>new m0(o)),m0);function s4e(o){const e=$z(o.server),t=$z(o.client);return new o4e(o.tags||[],e,t)}function $z(o){const e={};for(const[t,i]of Object.entries(o)){const n=i.method?i.method:t;e[t]=i.withMethod(n)}return e}var o4e=class sJ{constructor(e=[],t,i){we(this,"tags"),we(this,"server"),we(this,"client"),this.tags=e,this.server=t,this.client=i}_onlyDesignTime(){return new Error("This property is not meant to be accessed at runtime")}get TContractObject(){throw this._onlyDesignTime()}get TClientInterface(){throw this._onlyDesignTime()}get TServerInterface(){throw this._onlyDesignTime()}get TClientHandler(){throw this._onlyDesignTime()}get TServerHandler(){throw this._onlyDesignTime()}get TTags(){throw this._onlyDesignTime()}getInterface(e,t,i,n){const s=this.buildCounterpart(e,i),r=this.registerHandlers(e,t,n,s);return{counterpart:s,dispose:()=>r.dispose()}}buildCounterpart(e,t){const i={};for(const[n,s]of Object.entries(t)){let r;s.kind==="request"?s.isOptional?r=async(a,l)=>{a===void 0&&(a={});try{return await e.request(s,a,l)}catch(c){if(c&&c.code===aa.methodNotFound)return JQ;throw c}}:r=(a,l)=>(a===void 0&&(a={}),e.request(s,a,l)):r=(a,l)=>(a===void 0&&(a={}),e.notify(s,a,l)),i[n]=r}return i}registerHandlers(e,t,i,n){const s=[];for(const[r,a]of Object.entries(t))if(a.kind==="request"){let l=i[r];if(!l)continue;const c=this.createRequestHandler(n,l);s.push(e.registerRequestHandler(a,c))}else{const l=i[r];l&&s.push(e.registerNotificationHandler(a,(c,d)=>{l(c,{context:d,counterpart:n})}))}return{dispose:()=>s.forEach(r=>r.dispose())}}createRequestHandler(e,t){return async(i,n,s)=>{const r=await t(i,{context:s,counterpart:e,newErr:Uz.factory,requestId:n});return r instanceof Uz?r.error:{ok:r}}}static getServerFromStream(e,t,i,n){const s=VO.fromTransport(t,i),{server:r}=e.getServer(s,n);return s.startListen(),{channel:s,server:r}}static registerServerToStream(e,t,i,n){const s=VO.fromTransport(t,i),{client:r}=e.registerServer(s,n);return s.startListen(),{channel:s,client:r}}getServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.client,this.server,t);return{server:i,dispose:n}}registerServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.server,this.client,t);return{client:i,dispose:n}}withContext(){return new sJ(this.tags,this.server,this.client)}};let Wm=(function(o){return o.Comment="comment",o.Imports="imports",o.Region="region",o})({}),Vi=(function(o){return o[o.File=1]="File",o[o.Module=2]="Module",o[o.Namespace=3]="Namespace",o[o.Package=4]="Package",o[o.Class=5]="Class",o[o.Method=6]="Method",o[o.Property=7]="Property",o[o.Field=8]="Field",o[o.Constructor=9]="Constructor",o[o.Enum=10]="Enum",o[o.Interface=11]="Interface",o[o.Function=12]="Function",o[o.Variable=13]="Variable",o[o.Constant=14]="Constant",o[o.String=15]="String",o[o.Number=16]="Number",o[o.Boolean=17]="Boolean",o[o.Array=18]="Array",o[o.Object=19]="Object",o[o.Key=20]="Key",o[o.Null=21]="Null",o[o.EnumMember=22]="EnumMember",o[o.Struct=23]="Struct",o[o.Event=24]="Event",o[o.Operator=25]="Operator",o[o.TypeParameter=26]="TypeParameter",o})({}),oJ=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),jz=(function(o){return o[o.Type=1]="Type",o[o.Parameter=2]="Parameter",o})({}),r4e=(function(o){return o[o.None=0]="None",o[o.Full=1]="Full",o[o.Incremental=2]="Incremental",o})({}),qi=(function(o){return o[o.Text=1]="Text",o[o.Method=2]="Method",o[o.Function=3]="Function",o[o.Constructor=4]="Constructor",o[o.Field=5]="Field",o[o.Variable=6]="Variable",o[o.Class=7]="Class",o[o.Interface=8]="Interface",o[o.Module=9]="Module",o[o.Property=10]="Property",o[o.Unit=11]="Unit",o[o.Value=12]="Value",o[o.Enum=13]="Enum",o[o.Keyword=14]="Keyword",o[o.Snippet=15]="Snippet",o[o.Color=16]="Color",o[o.File=17]="File",o[o.Reference=18]="Reference",o[o.Folder=19]="Folder",o[o.EnumMember=20]="EnumMember",o[o.Constant=21]="Constant",o[o.Struct=22]="Struct",o[o.Event=23]="Event",o[o.Operator=24]="Operator",o[o.TypeParameter=25]="TypeParameter",o})({}),a4e=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),l4e=(function(o){return o[o.PlainText=1]="PlainText",o[o.Snippet=2]="Snippet",o})({}),UN=(function(o){return o[o.Text=1]="Text",o[o.Read=2]="Read",o[o.Write=3]="Write",o})({}),Lc=(function(o){return o.Empty="",o.QuickFix="quickfix",o.Refactor="refactor",o.RefactorExtract="refactor.extract",o.RefactorInline="refactor.inline",o.RefactorRewrite="refactor.rewrite",o.Source="source",o.SourceOrganizeImports="source.organizeImports",o.SourceFixAll="source.fixAll",o})({}),Jx=(function(o){return o.PlainText="plaintext",o.Markdown="markdown",o})({}),td=(function(o){return o[o.Error=1]="Error",o[o.Warning=2]="Warning",o[o.Information=3]="Information",o[o.Hint=4]="Hint",o})({}),qz=(function(o){return o[o.Unnecessary=1]="Unnecessary",o[o.Deprecated=2]="Deprecated",o})({}),ry=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",o})({}),ay=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange",o})({}),UO=(function(o){return o[o.Invoked=1]="Invoked",o[o.Automatic=2]="Automatic",o})({}),c4e=(function(o){return o.Relative="relative",o})({});var ht=class{constructor(o){this.method=o}};const Xe={textDocumentImplementation:new ht("textDocument/implementation"),textDocumentTypeDefinition:new ht("textDocument/typeDefinition"),textDocumentDocumentColor:new ht("textDocument/documentColor"),textDocumentColorPresentation:new ht("textDocument/colorPresentation"),textDocumentFoldingRange:new ht("textDocument/foldingRange"),textDocumentDeclaration:new ht("textDocument/declaration"),textDocumentSelectionRange:new ht("textDocument/selectionRange"),textDocumentPrepareCallHierarchy:new ht("textDocument/prepareCallHierarchy"),textDocumentSemanticTokensFull:new ht("textDocument/semanticTokens/full"),textDocumentSemanticTokensFullDelta:new ht("textDocument/semanticTokens/full/delta"),textDocumentLinkedEditingRange:new ht("textDocument/linkedEditingRange"),workspaceWillCreateFiles:new ht("workspace/willCreateFiles"),workspaceWillRenameFiles:new ht("workspace/willRenameFiles"),workspaceWillDeleteFiles:new ht("workspace/willDeleteFiles"),textDocumentMoniker:new ht("textDocument/moniker"),textDocumentPrepareTypeHierarchy:new ht("textDocument/prepareTypeHierarchy"),textDocumentInlineValue:new ht("textDocument/inlineValue"),textDocumentInlayHint:new ht("textDocument/inlayHint"),textDocumentDiagnostic:new ht("textDocument/diagnostic"),textDocumentInlineCompletion:new ht("textDocument/inlineCompletion"),textDocumentWillSaveWaitUntil:new ht("textDocument/willSaveWaitUntil"),textDocumentCompletion:new ht("textDocument/completion"),textDocumentHover:new ht("textDocument/hover"),textDocumentSignatureHelp:new ht("textDocument/signatureHelp"),textDocumentDefinition:new ht("textDocument/definition"),textDocumentReferences:new ht("textDocument/references"),textDocumentDocumentHighlight:new ht("textDocument/documentHighlight"),textDocumentDocumentSymbol:new ht("textDocument/documentSymbol"),textDocumentCodeAction:new ht("textDocument/codeAction"),workspaceSymbol:new ht("workspace/symbol"),textDocumentCodeLens:new ht("textDocument/codeLens"),textDocumentDocumentLink:new ht("textDocument/documentLink"),textDocumentFormatting:new ht("textDocument/formatting"),textDocumentRangeFormatting:new ht("textDocument/rangeFormatting"),textDocumentRangesFormatting:new ht("textDocument/rangesFormatting"),textDocumentOnTypeFormatting:new ht("textDocument/onTypeFormatting"),textDocumentRename:new ht("textDocument/rename"),workspaceExecuteCommand:new ht("workspace/executeCommand"),workspaceDidCreateFiles:new ht("workspace/didCreateFiles"),workspaceDidRenameFiles:new ht("workspace/didRenameFiles"),workspaceDidDeleteFiles:new ht("workspace/didDeleteFiles"),workspaceDidChangeConfiguration:new ht("workspace/didChangeConfiguration"),textDocumentDidOpen:new ht("textDocument/didOpen"),textDocumentDidChange:new ht("textDocument/didChange"),textDocumentDidClose:new ht("textDocument/didClose"),textDocumentDidSave:new ht("textDocument/didSave"),textDocumentWillSave:new ht("textDocument/willSave"),workspaceDidChangeWatchedFiles:new ht("workspace/didChangeWatchedFiles")},Vw=s4e({server:{textDocumentImplementation:Be({method:"textDocument/implementation"}),textDocumentTypeDefinition:Be({method:"textDocument/typeDefinition"}),textDocumentDocumentColor:Be({method:"textDocument/documentColor"}),textDocumentColorPresentation:Be({method:"textDocument/colorPresentation"}),textDocumentFoldingRange:Be({method:"textDocument/foldingRange"}),textDocumentDeclaration:Be({method:"textDocument/declaration"}),textDocumentSelectionRange:Be({method:"textDocument/selectionRange"}),textDocumentPrepareCallHierarchy:Be({method:"textDocument/prepareCallHierarchy"}),callHierarchyIncomingCalls:Be({method:"callHierarchy/incomingCalls"}),callHierarchyOutgoingCalls:Be({method:"callHierarchy/outgoingCalls"}),textDocumentSemanticTokensFull:Be({method:"textDocument/semanticTokens/full"}),textDocumentSemanticTokensFullDelta:Be({method:"textDocument/semanticTokens/full/delta"}),textDocumentSemanticTokensRange:Be({method:"textDocument/semanticTokens/range"}),textDocumentLinkedEditingRange:Be({method:"textDocument/linkedEditingRange"}),workspaceWillCreateFiles:Be({method:"workspace/willCreateFiles"}),workspaceWillRenameFiles:Be({method:"workspace/willRenameFiles"}),workspaceWillDeleteFiles:Be({method:"workspace/willDeleteFiles"}),textDocumentMoniker:Be({method:"textDocument/moniker"}),textDocumentPrepareTypeHierarchy:Be({method:"textDocument/prepareTypeHierarchy"}),typeHierarchySupertypes:Be({method:"typeHierarchy/supertypes"}),typeHierarchySubtypes:Be({method:"typeHierarchy/subtypes"}),textDocumentInlineValue:Be({method:"textDocument/inlineValue"}),textDocumentInlayHint:Be({method:"textDocument/inlayHint"}),inlayHintResolve:Be({method:"inlayHint/resolve"}),textDocumentDiagnostic:Be({method:"textDocument/diagnostic"}),workspaceDiagnostic:Be({method:"workspace/diagnostic"}),textDocumentInlineCompletion:Be({method:"textDocument/inlineCompletion"}),initialize:Be({method:"initialize"}),shutdown:Be({method:"shutdown"}),textDocumentWillSaveWaitUntil:Be({method:"textDocument/willSaveWaitUntil"}),textDocumentCompletion:Be({method:"textDocument/completion"}),completionItemResolve:Be({method:"completionItem/resolve"}),textDocumentHover:Be({method:"textDocument/hover"}),textDocumentSignatureHelp:Be({method:"textDocument/signatureHelp"}),textDocumentDefinition:Be({method:"textDocument/definition"}),textDocumentReferences:Be({method:"textDocument/references"}),textDocumentDocumentHighlight:Be({method:"textDocument/documentHighlight"}),textDocumentDocumentSymbol:Be({method:"textDocument/documentSymbol"}),textDocumentCodeAction:Be({method:"textDocument/codeAction"}),codeActionResolve:Be({method:"codeAction/resolve"}),workspaceSymbol:Be({method:"workspace/symbol"}),workspaceSymbolResolve:Be({method:"workspaceSymbol/resolve"}),textDocumentCodeLens:Be({method:"textDocument/codeLens"}),codeLensResolve:Be({method:"codeLens/resolve"}),textDocumentDocumentLink:Be({method:"textDocument/documentLink"}),documentLinkResolve:Be({method:"documentLink/resolve"}),textDocumentFormatting:Be({method:"textDocument/formatting"}),textDocumentRangeFormatting:Be({method:"textDocument/rangeFormatting"}),textDocumentRangesFormatting:Be({method:"textDocument/rangesFormatting"}),textDocumentOnTypeFormatting:Be({method:"textDocument/onTypeFormatting"}),textDocumentRename:Be({method:"textDocument/rename"}),textDocumentPrepareRename:Be({method:"textDocument/prepareRename"}),workspaceExecuteCommand:Be({method:"workspace/executeCommand"}),workspaceDidChangeWorkspaceFolders:Ei({method:"workspace/didChangeWorkspaceFolders"}),windowWorkDoneProgressCancel:Ei({method:"window/workDoneProgress/cancel"}),workspaceDidCreateFiles:Ei({method:"workspace/didCreateFiles"}),workspaceDidRenameFiles:Ei({method:"workspace/didRenameFiles"}),workspaceDidDeleteFiles:Ei({method:"workspace/didDeleteFiles"}),notebookDocumentDidOpen:Ei({method:"notebookDocument/didOpen"}),notebookDocumentDidChange:Ei({method:"notebookDocument/didChange"}),notebookDocumentDidSave:Ei({method:"notebookDocument/didSave"}),notebookDocumentDidClose:Ei({method:"notebookDocument/didClose"}),initialized:Ei({method:"initialized"}),exit:Ei({method:"exit"}),workspaceDidChangeConfiguration:Ei({method:"workspace/didChangeConfiguration"}),textDocumentDidOpen:Ei({method:"textDocument/didOpen"}),textDocumentDidChange:Ei({method:"textDocument/didChange"}),textDocumentDidClose:Ei({method:"textDocument/didClose"}),textDocumentDidSave:Ei({method:"textDocument/didSave"}),textDocumentWillSave:Ei({method:"textDocument/willSave"}),workspaceDidChangeWatchedFiles:Ei({method:"workspace/didChangeWatchedFiles"}),setTrace:Ei({method:"$/setTrace"}),cancelRequest:Ei({method:"$/cancelRequest"}),progress:Ei({method:"$/progress"})},client:{workspaceWorkspaceFolders:Be({method:"workspace/workspaceFolders"}).optional(),workspaceConfiguration:Be({method:"workspace/configuration"}).optional(),workspaceFoldingRangeRefresh:Be({method:"workspace/foldingRange/refresh"}).optional(),windowWorkDoneProgressCreate:Be({method:"window/workDoneProgress/create"}).optional(),workspaceSemanticTokensRefresh:Be({method:"workspace/semanticTokens/refresh"}).optional(),windowShowDocument:Be({method:"window/showDocument"}).optional(),workspaceInlineValueRefresh:Be({method:"workspace/inlineValue/refresh"}).optional(),workspaceInlayHintRefresh:Be({method:"workspace/inlayHint/refresh"}).optional(),workspaceDiagnosticRefresh:Be({method:"workspace/diagnostic/refresh"}).optional(),clientRegisterCapability:Be({method:"client/registerCapability"}).optional(),clientUnregisterCapability:Be({method:"client/unregisterCapability"}).optional(),windowShowMessageRequest:Be({method:"window/showMessageRequest"}).optional(),workspaceCodeLensRefresh:Be({method:"workspace/codeLens/refresh"}).optional(),workspaceApplyEdit:Be({method:"workspace/applyEdit"}).optional(),windowShowMessage:Ei({method:"window/showMessage"}),windowLogMessage:Ei({method:"window/logMessage"}),telemetryEvent:Ei({method:"telemetry/event"}),textDocumentPublishDiagnostics:Ei({method:"textDocument/publishDiagnostics"}),logTrace:Ei({method:"$/logTrace"}),cancelRequest:Ei({method:"$/cancelRequest"}),progress:Ei({method:"$/progress"})}});function zg(o,e){if(o.textModel!==e)throw new Error(`Expected text model to be ${e}, but got ${o.textModel}`);return o}var ji=(VN=class{constructor(){we(this,"_store",new OW)}dispose(){this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}},we(VN,"None",Object.freeze({dispose(){}})),VN),OW=(_0=class{constructor(){we(this,"_toDispose",new Set),we(this,"_isDisposed",!1)}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){if(this._toDispose.size!==0)try{for(const o of this._toDispose)o.dispose()}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?_0.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}},we(_0,"DISABLE_DISPOSED_WARNING",!1),_0);const rJ=new Map([[Lc.Empty,""],[Lc.QuickFix,"quickfix"],[Lc.Refactor,"refactor"],[Lc.RefactorExtract,"refactor.extract"],[Lc.RefactorInline,"refactor.inline"],[Lc.RefactorRewrite,"refactor.rewrite"],[Lc.Source,"source"],[Lc.SourceOrganizeImports,"source.organizeImports"],[Lc.SourceFixAll,"source.fixAll"]]);function d4e(o){if(o)return rJ.get(o)??o}const h4e=new Map([[he.CodeActionTriggerType.Invoke,UO.Invoked],[he.CodeActionTriggerType.Auto,UO.Automatic]]);function u4e(o){return h4e.get(o)??UO.Invoked}const aJ=new Map([[qi.Text,he.CompletionItemKind.Text],[qi.Method,he.CompletionItemKind.Method],[qi.Function,he.CompletionItemKind.Function],[qi.Constructor,he.CompletionItemKind.Constructor],[qi.Field,he.CompletionItemKind.Field],[qi.Variable,he.CompletionItemKind.Variable],[qi.Class,he.CompletionItemKind.Class],[qi.Interface,he.CompletionItemKind.Interface],[qi.Module,he.CompletionItemKind.Module],[qi.Property,he.CompletionItemKind.Property],[qi.Unit,he.CompletionItemKind.Unit],[qi.Value,he.CompletionItemKind.Value],[qi.Enum,he.CompletionItemKind.Enum],[qi.Keyword,he.CompletionItemKind.Keyword],[qi.Snippet,he.CompletionItemKind.Snippet],[qi.Color,he.CompletionItemKind.Color],[qi.File,he.CompletionItemKind.File],[qi.Reference,he.CompletionItemKind.Reference],[qi.Folder,he.CompletionItemKind.Folder],[qi.EnumMember,he.CompletionItemKind.EnumMember],[qi.Constant,he.CompletionItemKind.Constant],[qi.Struct,he.CompletionItemKind.Struct],[qi.Event,he.CompletionItemKind.Event],[qi.Operator,he.CompletionItemKind.Operator],[qi.TypeParameter,he.CompletionItemKind.TypeParameter]]);function g4e(o){return o?aJ.get(o)??he.CompletionItemKind.Text:he.CompletionItemKind.Text}const lJ=new Map([[a4e.Deprecated,he.CompletionItemTag.Deprecated]]);function f4e(o){return lJ.get(o)}const p4e=new Map([[he.CompletionTriggerKind.Invoke,ry.Invoked],[he.CompletionTriggerKind.TriggerCharacter,ry.TriggerCharacter],[he.CompletionTriggerKind.TriggerForIncompleteCompletions,ry.TriggerForIncompleteCompletions]]);function m4e(o){return p4e.get(o)??ry.Invoked}const _4e=new Map([[l4e.Snippet,he.CompletionItemInsertTextRule.InsertAsSnippet]]);function b4e(o){if(o)return _4e.get(o)}const cJ=new Map([[Vi.File,he.SymbolKind.File],[Vi.Module,he.SymbolKind.Module],[Vi.Namespace,he.SymbolKind.Namespace],[Vi.Package,he.SymbolKind.Package],[Vi.Class,he.SymbolKind.Class],[Vi.Method,he.SymbolKind.Method],[Vi.Property,he.SymbolKind.Property],[Vi.Field,he.SymbolKind.Field],[Vi.Constructor,he.SymbolKind.Constructor],[Vi.Enum,he.SymbolKind.Enum],[Vi.Interface,he.SymbolKind.Interface],[Vi.Function,he.SymbolKind.Function],[Vi.Variable,he.SymbolKind.Variable],[Vi.Constant,he.SymbolKind.Constant],[Vi.String,he.SymbolKind.String],[Vi.Number,he.SymbolKind.Number],[Vi.Boolean,he.SymbolKind.Boolean],[Vi.Array,he.SymbolKind.Array],[Vi.Object,he.SymbolKind.Object],[Vi.Key,he.SymbolKind.Key],[Vi.Null,he.SymbolKind.Null],[Vi.EnumMember,he.SymbolKind.EnumMember],[Vi.Struct,he.SymbolKind.Struct],[Vi.Event,he.SymbolKind.Event],[Vi.Operator,he.SymbolKind.Operator],[Vi.TypeParameter,he.SymbolKind.TypeParameter]]);function dJ(o){return cJ.get(o)??he.SymbolKind.File}const C4e=new Map([[oJ.Deprecated,he.SymbolTag.Deprecated]]);function hJ(o){return C4e.get(o)}const v4e=new Map([[UN.Text,he.DocumentHighlightKind.Text],[UN.Read,he.DocumentHighlightKind.Read],[UN.Write,he.DocumentHighlightKind.Write]]);function w4e(o){return o?v4e.get(o)??he.DocumentHighlightKind.Text:he.DocumentHighlightKind.Text}const S4e=new Map([[Wm.Comment,he.FoldingRangeKind.Comment],[Wm.Imports,he.FoldingRangeKind.Imports],[Wm.Region,he.FoldingRangeKind.Region]]);function y4e(o){if(o)return S4e.get(o)}const L4e=new Map([[ca.Error,td.Error],[ca.Warning,td.Warning],[ca.Info,td.Information],[ca.Hint,td.Hint]]);function x4e(o){return L4e.get(o)??td.Error}const D4e=new Map([[td.Error,ca.Error],[td.Warning,ca.Warning],[td.Information,ca.Info],[td.Hint,ca.Hint]]);function k4e(o){return o?D4e.get(o)??ca.Error:ca.Error}const uJ=new Map([[qz.Unnecessary,Qx.Unnecessary],[qz.Deprecated,Qx.Deprecated]]);function I4e(o){return uJ.get(o)}const E4e=new Map([[he.SignatureHelpTriggerKind.Invoke,ay.Invoked],[he.SignatureHelpTriggerKind.TriggerCharacter,ay.TriggerCharacter],[he.SignatureHelpTriggerKind.ContentChange,ay.ContentChange]]);function N4e(o){return E4e.get(o)??ay.Invoked}function Bm(o){if(o)return{id:o.command,title:o.title,arguments:o.arguments}}const T4e=new Map([[jz.Type,he.InlayHintKind.Type],[jz.Parameter,he.InlayHintKind.Parameter]]);function R4e(o){return o?T4e.get(o)??he.InlayHintKind.Type:he.InlayHintKind.Type}function iu(o,e){if("targetUri"in o){const t=e.bridge.translateBackRange({uri:o.targetUri},o.targetRange);return{uri:t.textModel.uri,range:t.range,originSelectionRange:o.originSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.originSelectionRange).range:void 0,targetSelectionRange:o.targetSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.targetSelectionRange).range:void 0}}else{const t=e.bridge.translateBackRange({uri:o.uri},o.range);return{uri:t.textModel.uri,range:t.range}}}function An(o){return!o||o.length===0?{language:"*"}:o.map(e=>"notebook"in e?typeof e.notebook=="string"?{notebookType:e.notebook,language:e.language}:{notebookType:e.notebook.notebookType,language:e.language,pattern:e.notebook.pattern,scheme:e.notebook.scheme}:{language:e.language,pattern:e.pattern,scheme:e.scheme})}function M4e(o,e){if(!e)return!0;const t=o.getLanguageId();if(o.uri.toString(!0),!e||e.length===0)return!0;for(const i of e)if(!(i.language&&i.language!=="*"&&i.language!==t))return!0;return!1}function $O(o){const e={severity:k4e(o.severity),startLineNumber:o.range.start.line+1,startColumn:o.range.start.character+1,endLineNumber:o.range.end.line+1,endColumn:o.range.end.character+1,message:o.message,source:o.source,code:typeof o.code=="string"?o.code:o.code?.toString()};return o.tags&&(e.tags=o.tags.map(t=>I4e(t)).filter(t=>t!==void 0)),o.relatedInformation&&(e.relatedInformation=o.relatedInformation.map(t=>({resource:rI.parse(t.location.uri),startLineNumber:t.location.range.start.line+1,startColumn:t.location.range.start.character+1,endLineNumber:t.location.range.end.line+1,endColumn:t.location.range.end.character+1,message:t.message}))),e}var P4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{completion:{dynamicRegistration:!0,contextSupport:!0,completionItemKind:{valueSet:Array.from(aJ.keys())},completionItem:{tagSupport:{valueSet:Array.from(lJ.keys())},commitCharactersSupport:!0,deprecatedSupport:!0,preselectSupport:!0}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentCompletion,!0,e=>he.registerCompletionItemProvider(An(e.documentSelector),new A4e(this._connection,e))))}},A4e=class{constructor(o,e){we(this,"resolveCompletionItem"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveCompletionItem=async(t,i)=>(gJ(t,await this._client.server.completionItemResolve(t._lspItem),this._client.bridge,t._translated,t._model),t))}get triggerCharacters(){return this._capabilities.triggerCharacters}async provideCompletionItems(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentCompletion({textDocument:n.textDocument,position:n.position,context:t.triggerCharacter?{triggerKind:m4e(t.triggerKind),triggerCharacter:t.triggerCharacter}:void 0});return s?{suggestions:(Array.isArray(s)?s:s.items).map(r=>({...O4e(r,this._client.bridge,n,o,e),_lspItem:r,_translated:n,_model:o}))}:{suggestions:[]}}};function O4e(o,e,t,i,n){let s=o.insertText||o.label,r;o.textEdit&&("range"in o.textEdit?(s=o.textEdit.newText,r=zg(e.translateBackRange(t.textDocument,o.textEdit.range),i).range):(s=o.textEdit.newText,r={insert:zg(e.translateBackRange(t.textDocument,o.textEdit.insert),i).range,replace:zg(e.translateBackRange(t.textDocument,o.textEdit.replace),i).range})),r||(r=eb.fromPositions(n,n));const a={label:o.label,kind:g4e(o.kind),insertText:s,sortText:o.sortText,filterText:o.filterText,preselect:o.preselect,commitCharacters:o.commitCharacters,range:r};return gJ(a,o,e,t,i),a}function gJ(o,e,t,i,n){e.detail!==void 0&&(o.detail=e.detail),e.documentation!==void 0&&(o.documentation=F4e(e.documentation)),e.insertTextFormat!==void 0&&(o.insertTextRules=b4e(e.insertTextFormat)),e.tags&&e.tags.length>0&&(o.tags=e.tags.map(f4e).filter(s=>s!==void 0)),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(o.additionalTextEdits=e.additionalTextEdits.map(s=>({range:zg(t.translateBackRange(i.textDocument,s.range),n).range,text:s.newText}))),e.command&&(o.command=Bm(e.command))}function F4e(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var W4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{hover:{dynamicRegistration:!0,contentFormat:[Jx.Markdown,Jx.PlainText]}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentHover,!0,e=>he.registerHoverProvider(An(e.documentSelector),new B4e(this._connection,e))))}},B4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideHover(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentHover({textDocument:i.textDocument,position:i.position});return!n||!n.contents?null:{contents:H4e(n.contents),range:n.range?this._client.bridge.translateBackRange(i.textDocument,n.range).range:void 0}}};function H4e(o){return Array.isArray(o)?o.map(e=>Kz(e)):[Kz(o)]}function Kz(o){return typeof o=="string"?{value:o,isTrusted:!0}:"kind"in o?{value:o.value,isTrusted:!0}:{value:`\`\`\`${o.language} +${JSON.stringify(s,null,2)}`);return r.value}}async notify(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error;const n=e.paramsSerializer.serializeToJson(t);iV(n),this._requestSender.sendNotification({method:e.method,params:n},i)}};function iV(o){if(o!==null&&Array.isArray(o)&&typeof o!="object")throw new Error("Invalid value! Only null, array and object is allowed.")}var nV=class uX extends Error{constructor(e,t,i=Kr.genericApplicationError){super(e),ve(this,"data"),ve(this,"code"),this.data=t,this.code=i,Object.setPrototypeOf(this,uX.prototype)}},WPe=class NA{constructor(e,t,i,n,s=!1){ve(this,"method"),ve(this,"paramsSerializer"),ve(this,"resultSerializer"),ve(this,"errorSerializer"),ve(this,"isOptional"),ve(this,"kind","request"),this.method=e,this.paramsSerializer=t,this.resultSerializer=i,this.errorSerializer=n,this.isOptional=s}withMethod(e){return new NA(e,this.paramsSerializer,this.resultSerializer,this.errorSerializer)}optional(){return new NA(this.method,this.paramsSerializer,this.resultSerializer,this.errorSerializer,!0)}},BPe=class gX{constructor(e,t){ve(this,"method"),ve(this,"paramsSerializer"),ve(this,"kind","notification"),this.method=e,this.paramsSerializer=t}withMethod(e){return new gX(e,this.paramsSerializer)}};function Oe(o){return new WPe((o||{}).method,am.sAny(),am.sAny(),am.sAny())}function yi(o){return new BPe((o||{}).method,am.sAny())}const HPe=Symbol();var sV=(eV=HPe,SS=class{constructor(o){ve(this,"error"),ve(this,eV),this.error=o}},ve(SS,"factory",o=>new SS(o)),SS);function VPe(o){const e=oV(o.server),t=oV(o.client);return new zPe(o.tags||[],e,t)}function oV(o){const e={};for(const[t,i]of Object.entries(o)){const n=i.method?i.method:t;e[t]=i.withMethod(n)}return e}var zPe=class fX{constructor(e=[],t,i){ve(this,"tags"),ve(this,"server"),ve(this,"client"),this.tags=e,this.server=t,this.client=i}_onlyDesignTime(){return new Error("This property is not meant to be accessed at runtime")}get TContractObject(){throw this._onlyDesignTime()}get TClientInterface(){throw this._onlyDesignTime()}get TServerInterface(){throw this._onlyDesignTime()}get TClientHandler(){throw this._onlyDesignTime()}get TServerHandler(){throw this._onlyDesignTime()}get TTags(){throw this._onlyDesignTime()}getInterface(e,t,i,n){const s=this.buildCounterpart(e,i),r=this.registerHandlers(e,t,n,s);return{counterpart:s,dispose:()=>r.dispose()}}buildCounterpart(e,t){const i={};for(const[n,s]of Object.entries(t)){let r;s.kind==="request"?s.isOptional?r=async(a,l)=>{a===void 0&&(a={});try{return await e.request(s,a,l)}catch(c){if(c&&c.code===Kr.methodNotFound)return cX;throw c}}:r=(a,l)=>(a===void 0&&(a={}),e.request(s,a,l)):r=(a,l)=>(a===void 0&&(a={}),e.notify(s,a,l)),i[n]=r}return i}registerHandlers(e,t,i,n){const s=[];for(const[r,a]of Object.entries(t))if(a.kind==="request"){let l=i[r];if(!l)continue;const c=this.createRequestHandler(n,l);s.push(e.registerRequestHandler(a,c))}else{const l=i[r];l&&s.push(e.registerNotificationHandler(a,(c,d)=>{l(c,{context:d,counterpart:n})}))}return{dispose:()=>s.forEach(r=>r.dispose())}}createRequestHandler(e,t){return async(i,n,s)=>{const r=await t(i,{context:s,counterpart:e,newErr:sV.factory,requestId:n});return r instanceof sV?r.error:{ok:r}}}static getServerFromStream(e,t,i,n){const s=EA.fromTransport(t,i),{server:r}=e.getServer(s,n);return s.startListen(),{channel:s,server:r}}static registerServerToStream(e,t,i,n){const s=EA.fromTransport(t,i),{client:r}=e.registerServer(s,n);return s.startListen(),{channel:s,client:r}}getServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.client,this.server,t);return{server:i,dispose:n}}registerServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.server,this.client,t);return{client:i,dispose:n}}withContext(){return new fX(this.tags,this.server,this.client)}};let lm=(function(o){return o.Comment="comment",o.Imports="imports",o.Region="region",o})({}),Pi=(function(o){return o[o.File=1]="File",o[o.Module=2]="Module",o[o.Namespace=3]="Namespace",o[o.Package=4]="Package",o[o.Class=5]="Class",o[o.Method=6]="Method",o[o.Property=7]="Property",o[o.Field=8]="Field",o[o.Constructor=9]="Constructor",o[o.Enum=10]="Enum",o[o.Interface=11]="Interface",o[o.Function=12]="Function",o[o.Variable=13]="Variable",o[o.Constant=14]="Constant",o[o.String=15]="String",o[o.Number=16]="Number",o[o.Boolean=17]="Boolean",o[o.Array=18]="Array",o[o.Object=19]="Object",o[o.Key=20]="Key",o[o.Null=21]="Null",o[o.EnumMember=22]="EnumMember",o[o.Struct=23]="Struct",o[o.Event=24]="Event",o[o.Operator=25]="Operator",o[o.TypeParameter=26]="TypeParameter",o})({}),pX=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),rV=(function(o){return o[o.Type=1]="Type",o[o.Parameter=2]="Parameter",o})({}),UPe=(function(o){return o[o.None=0]="None",o[o.Full=1]="Full",o[o.Incremental=2]="Incremental",o})({}),Bi=(function(o){return o[o.Text=1]="Text",o[o.Method=2]="Method",o[o.Function=3]="Function",o[o.Constructor=4]="Constructor",o[o.Field=5]="Field",o[o.Variable=6]="Variable",o[o.Class=7]="Class",o[o.Interface=8]="Interface",o[o.Module=9]="Module",o[o.Property=10]="Property",o[o.Unit=11]="Unit",o[o.Value=12]="Value",o[o.Enum=13]="Enum",o[o.Keyword=14]="Keyword",o[o.Snippet=15]="Snippet",o[o.Color=16]="Color",o[o.File=17]="File",o[o.Reference=18]="Reference",o[o.Folder=19]="Folder",o[o.EnumMember=20]="EnumMember",o[o.Constant=21]="Constant",o[o.Struct=22]="Struct",o[o.Event=23]="Event",o[o.Operator=24]="Operator",o[o.TypeParameter=25]="TypeParameter",o})({}),$Pe=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),jPe=(function(o){return o[o.PlainText=1]="PlainText",o[o.Snippet=2]="Snippet",o})({}),ME=(function(o){return o[o.Text=1]="Text",o[o.Read=2]="Read",o[o.Write=3]="Write",o})({}),sc=(function(o){return o.Empty="",o.QuickFix="quickfix",o.Refactor="refactor",o.RefactorExtract="refactor.extract",o.RefactorInline="refactor.inline",o.RefactorRewrite="refactor.rewrite",o.Source="source",o.SourceOrganizeImports="source.organizeImports",o.SourceFixAll="source.fixAll",o})({}),sL=(function(o){return o.PlainText="plaintext",o.Markdown="markdown",o})({}),Pc=(function(o){return o[o.Error=1]="Error",o[o.Warning=2]="Warning",o[o.Information=3]="Information",o[o.Hint=4]="Hint",o})({}),aV=(function(o){return o[o.Unnecessary=1]="Unnecessary",o[o.Deprecated=2]="Deprecated",o})({}),h0=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",o})({}),u0=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange",o})({}),TA=(function(o){return o[o.Invoked=1]="Invoked",o[o.Automatic=2]="Automatic",o})({}),qPe=(function(o){return o.Relative="relative",o})({});var rt=class{constructor(o){this.method=o}};const qe={textDocumentImplementation:new rt("textDocument/implementation"),textDocumentTypeDefinition:new rt("textDocument/typeDefinition"),textDocumentDocumentColor:new rt("textDocument/documentColor"),textDocumentColorPresentation:new rt("textDocument/colorPresentation"),textDocumentFoldingRange:new rt("textDocument/foldingRange"),textDocumentDeclaration:new rt("textDocument/declaration"),textDocumentSelectionRange:new rt("textDocument/selectionRange"),textDocumentPrepareCallHierarchy:new rt("textDocument/prepareCallHierarchy"),textDocumentSemanticTokensFull:new rt("textDocument/semanticTokens/full"),textDocumentSemanticTokensFullDelta:new rt("textDocument/semanticTokens/full/delta"),textDocumentLinkedEditingRange:new rt("textDocument/linkedEditingRange"),workspaceWillCreateFiles:new rt("workspace/willCreateFiles"),workspaceWillRenameFiles:new rt("workspace/willRenameFiles"),workspaceWillDeleteFiles:new rt("workspace/willDeleteFiles"),textDocumentMoniker:new rt("textDocument/moniker"),textDocumentPrepareTypeHierarchy:new rt("textDocument/prepareTypeHierarchy"),textDocumentInlineValue:new rt("textDocument/inlineValue"),textDocumentInlayHint:new rt("textDocument/inlayHint"),textDocumentDiagnostic:new rt("textDocument/diagnostic"),textDocumentInlineCompletion:new rt("textDocument/inlineCompletion"),textDocumentWillSaveWaitUntil:new rt("textDocument/willSaveWaitUntil"),textDocumentCompletion:new rt("textDocument/completion"),textDocumentHover:new rt("textDocument/hover"),textDocumentSignatureHelp:new rt("textDocument/signatureHelp"),textDocumentDefinition:new rt("textDocument/definition"),textDocumentReferences:new rt("textDocument/references"),textDocumentDocumentHighlight:new rt("textDocument/documentHighlight"),textDocumentDocumentSymbol:new rt("textDocument/documentSymbol"),textDocumentCodeAction:new rt("textDocument/codeAction"),workspaceSymbol:new rt("workspace/symbol"),textDocumentCodeLens:new rt("textDocument/codeLens"),textDocumentDocumentLink:new rt("textDocument/documentLink"),textDocumentFormatting:new rt("textDocument/formatting"),textDocumentRangeFormatting:new rt("textDocument/rangeFormatting"),textDocumentRangesFormatting:new rt("textDocument/rangesFormatting"),textDocumentOnTypeFormatting:new rt("textDocument/onTypeFormatting"),textDocumentRename:new rt("textDocument/rename"),workspaceExecuteCommand:new rt("workspace/executeCommand"),workspaceDidCreateFiles:new rt("workspace/didCreateFiles"),workspaceDidRenameFiles:new rt("workspace/didRenameFiles"),workspaceDidDeleteFiles:new rt("workspace/didDeleteFiles"),workspaceDidChangeConfiguration:new rt("workspace/didChangeConfiguration"),textDocumentDidOpen:new rt("textDocument/didOpen"),textDocumentDidChange:new rt("textDocument/didChange"),textDocumentDidClose:new rt("textDocument/didClose"),textDocumentDidSave:new rt("textDocument/didSave"),textDocumentWillSave:new rt("textDocument/willSave"),workspaceDidChangeWatchedFiles:new rt("workspace/didChangeWatchedFiles")},nw=VPe({server:{textDocumentImplementation:Oe({method:"textDocument/implementation"}),textDocumentTypeDefinition:Oe({method:"textDocument/typeDefinition"}),textDocumentDocumentColor:Oe({method:"textDocument/documentColor"}),textDocumentColorPresentation:Oe({method:"textDocument/colorPresentation"}),textDocumentFoldingRange:Oe({method:"textDocument/foldingRange"}),textDocumentDeclaration:Oe({method:"textDocument/declaration"}),textDocumentSelectionRange:Oe({method:"textDocument/selectionRange"}),textDocumentPrepareCallHierarchy:Oe({method:"textDocument/prepareCallHierarchy"}),callHierarchyIncomingCalls:Oe({method:"callHierarchy/incomingCalls"}),callHierarchyOutgoingCalls:Oe({method:"callHierarchy/outgoingCalls"}),textDocumentSemanticTokensFull:Oe({method:"textDocument/semanticTokens/full"}),textDocumentSemanticTokensFullDelta:Oe({method:"textDocument/semanticTokens/full/delta"}),textDocumentSemanticTokensRange:Oe({method:"textDocument/semanticTokens/range"}),textDocumentLinkedEditingRange:Oe({method:"textDocument/linkedEditingRange"}),workspaceWillCreateFiles:Oe({method:"workspace/willCreateFiles"}),workspaceWillRenameFiles:Oe({method:"workspace/willRenameFiles"}),workspaceWillDeleteFiles:Oe({method:"workspace/willDeleteFiles"}),textDocumentMoniker:Oe({method:"textDocument/moniker"}),textDocumentPrepareTypeHierarchy:Oe({method:"textDocument/prepareTypeHierarchy"}),typeHierarchySupertypes:Oe({method:"typeHierarchy/supertypes"}),typeHierarchySubtypes:Oe({method:"typeHierarchy/subtypes"}),textDocumentInlineValue:Oe({method:"textDocument/inlineValue"}),textDocumentInlayHint:Oe({method:"textDocument/inlayHint"}),inlayHintResolve:Oe({method:"inlayHint/resolve"}),textDocumentDiagnostic:Oe({method:"textDocument/diagnostic"}),workspaceDiagnostic:Oe({method:"workspace/diagnostic"}),textDocumentInlineCompletion:Oe({method:"textDocument/inlineCompletion"}),initialize:Oe({method:"initialize"}),shutdown:Oe({method:"shutdown"}),textDocumentWillSaveWaitUntil:Oe({method:"textDocument/willSaveWaitUntil"}),textDocumentCompletion:Oe({method:"textDocument/completion"}),completionItemResolve:Oe({method:"completionItem/resolve"}),textDocumentHover:Oe({method:"textDocument/hover"}),textDocumentSignatureHelp:Oe({method:"textDocument/signatureHelp"}),textDocumentDefinition:Oe({method:"textDocument/definition"}),textDocumentReferences:Oe({method:"textDocument/references"}),textDocumentDocumentHighlight:Oe({method:"textDocument/documentHighlight"}),textDocumentDocumentSymbol:Oe({method:"textDocument/documentSymbol"}),textDocumentCodeAction:Oe({method:"textDocument/codeAction"}),codeActionResolve:Oe({method:"codeAction/resolve"}),workspaceSymbol:Oe({method:"workspace/symbol"}),workspaceSymbolResolve:Oe({method:"workspaceSymbol/resolve"}),textDocumentCodeLens:Oe({method:"textDocument/codeLens"}),codeLensResolve:Oe({method:"codeLens/resolve"}),textDocumentDocumentLink:Oe({method:"textDocument/documentLink"}),documentLinkResolve:Oe({method:"documentLink/resolve"}),textDocumentFormatting:Oe({method:"textDocument/formatting"}),textDocumentRangeFormatting:Oe({method:"textDocument/rangeFormatting"}),textDocumentRangesFormatting:Oe({method:"textDocument/rangesFormatting"}),textDocumentOnTypeFormatting:Oe({method:"textDocument/onTypeFormatting"}),textDocumentRename:Oe({method:"textDocument/rename"}),textDocumentPrepareRename:Oe({method:"textDocument/prepareRename"}),workspaceExecuteCommand:Oe({method:"workspace/executeCommand"}),workspaceDidChangeWorkspaceFolders:yi({method:"workspace/didChangeWorkspaceFolders"}),windowWorkDoneProgressCancel:yi({method:"window/workDoneProgress/cancel"}),workspaceDidCreateFiles:yi({method:"workspace/didCreateFiles"}),workspaceDidRenameFiles:yi({method:"workspace/didRenameFiles"}),workspaceDidDeleteFiles:yi({method:"workspace/didDeleteFiles"}),notebookDocumentDidOpen:yi({method:"notebookDocument/didOpen"}),notebookDocumentDidChange:yi({method:"notebookDocument/didChange"}),notebookDocumentDidSave:yi({method:"notebookDocument/didSave"}),notebookDocumentDidClose:yi({method:"notebookDocument/didClose"}),initialized:yi({method:"initialized"}),exit:yi({method:"exit"}),workspaceDidChangeConfiguration:yi({method:"workspace/didChangeConfiguration"}),textDocumentDidOpen:yi({method:"textDocument/didOpen"}),textDocumentDidChange:yi({method:"textDocument/didChange"}),textDocumentDidClose:yi({method:"textDocument/didClose"}),textDocumentDidSave:yi({method:"textDocument/didSave"}),textDocumentWillSave:yi({method:"textDocument/willSave"}),workspaceDidChangeWatchedFiles:yi({method:"workspace/didChangeWatchedFiles"}),setTrace:yi({method:"$/setTrace"}),cancelRequest:yi({method:"$/cancelRequest"}),progress:yi({method:"$/progress"})},client:{workspaceWorkspaceFolders:Oe({method:"workspace/workspaceFolders"}).optional(),workspaceConfiguration:Oe({method:"workspace/configuration"}).optional(),workspaceFoldingRangeRefresh:Oe({method:"workspace/foldingRange/refresh"}).optional(),windowWorkDoneProgressCreate:Oe({method:"window/workDoneProgress/create"}).optional(),workspaceSemanticTokensRefresh:Oe({method:"workspace/semanticTokens/refresh"}).optional(),windowShowDocument:Oe({method:"window/showDocument"}).optional(),workspaceInlineValueRefresh:Oe({method:"workspace/inlineValue/refresh"}).optional(),workspaceInlayHintRefresh:Oe({method:"workspace/inlayHint/refresh"}).optional(),workspaceDiagnosticRefresh:Oe({method:"workspace/diagnostic/refresh"}).optional(),clientRegisterCapability:Oe({method:"client/registerCapability"}).optional(),clientUnregisterCapability:Oe({method:"client/unregisterCapability"}).optional(),windowShowMessageRequest:Oe({method:"window/showMessageRequest"}).optional(),workspaceCodeLensRefresh:Oe({method:"workspace/codeLens/refresh"}).optional(),workspaceApplyEdit:Oe({method:"workspace/applyEdit"}).optional(),windowShowMessage:yi({method:"window/showMessage"}),windowLogMessage:yi({method:"window/logMessage"}),telemetryEvent:yi({method:"telemetry/event"}),textDocumentPublishDiagnostics:yi({method:"textDocument/publishDiagnostics"}),logTrace:yi({method:"$/logTrace"}),cancelRequest:yi({method:"$/cancelRequest"}),progress:yi({method:"$/progress"})}});function Cg(o,e){if(o.textModel!==e)throw new Error(`Expected text model to be ${e}, but got ${o.textModel}`);return o}var Wi=(TE=class{constructor(){ve(this,"_store",new x3)}dispose(){this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}},ve(TE,"None",Object.freeze({dispose(){}})),TE),x3=(yS=class{constructor(){ve(this,"_toDispose",new Set),ve(this,"_isDisposed",!1)}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){if(this._toDispose.size!==0)try{for(const o of this._toDispose)o.dispose()}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?yS.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}},ve(yS,"DISABLE_DISPOSED_WARNING",!1),yS);const mX=new Map([[sc.Empty,""],[sc.QuickFix,"quickfix"],[sc.Refactor,"refactor"],[sc.RefactorExtract,"refactor.extract"],[sc.RefactorInline,"refactor.inline"],[sc.RefactorRewrite,"refactor.rewrite"],[sc.Source,"source"],[sc.SourceOrganizeImports,"source.organizeImports"],[sc.SourceFixAll,"source.fixAll"]]);function KPe(o){if(o)return mX.get(o)??o}const GPe=new Map([[de.CodeActionTriggerType.Invoke,TA.Invoked],[de.CodeActionTriggerType.Auto,TA.Automatic]]);function ZPe(o){return GPe.get(o)??TA.Invoked}const _X=new Map([[Bi.Text,de.CompletionItemKind.Text],[Bi.Method,de.CompletionItemKind.Method],[Bi.Function,de.CompletionItemKind.Function],[Bi.Constructor,de.CompletionItemKind.Constructor],[Bi.Field,de.CompletionItemKind.Field],[Bi.Variable,de.CompletionItemKind.Variable],[Bi.Class,de.CompletionItemKind.Class],[Bi.Interface,de.CompletionItemKind.Interface],[Bi.Module,de.CompletionItemKind.Module],[Bi.Property,de.CompletionItemKind.Property],[Bi.Unit,de.CompletionItemKind.Unit],[Bi.Value,de.CompletionItemKind.Value],[Bi.Enum,de.CompletionItemKind.Enum],[Bi.Keyword,de.CompletionItemKind.Keyword],[Bi.Snippet,de.CompletionItemKind.Snippet],[Bi.Color,de.CompletionItemKind.Color],[Bi.File,de.CompletionItemKind.File],[Bi.Reference,de.CompletionItemKind.Reference],[Bi.Folder,de.CompletionItemKind.Folder],[Bi.EnumMember,de.CompletionItemKind.EnumMember],[Bi.Constant,de.CompletionItemKind.Constant],[Bi.Struct,de.CompletionItemKind.Struct],[Bi.Event,de.CompletionItemKind.Event],[Bi.Operator,de.CompletionItemKind.Operator],[Bi.TypeParameter,de.CompletionItemKind.TypeParameter]]);function YPe(o){return o?_X.get(o)??de.CompletionItemKind.Text:de.CompletionItemKind.Text}const bX=new Map([[$Pe.Deprecated,de.CompletionItemTag.Deprecated]]);function XPe(o){return bX.get(o)}const QPe=new Map([[de.CompletionTriggerKind.Invoke,h0.Invoked],[de.CompletionTriggerKind.TriggerCharacter,h0.TriggerCharacter],[de.CompletionTriggerKind.TriggerForIncompleteCompletions,h0.TriggerForIncompleteCompletions]]);function JPe(o){return QPe.get(o)??h0.Invoked}const eAe=new Map([[jPe.Snippet,de.CompletionItemInsertTextRule.InsertAsSnippet]]);function tAe(o){if(o)return eAe.get(o)}const CX=new Map([[Pi.File,de.SymbolKind.File],[Pi.Module,de.SymbolKind.Module],[Pi.Namespace,de.SymbolKind.Namespace],[Pi.Package,de.SymbolKind.Package],[Pi.Class,de.SymbolKind.Class],[Pi.Method,de.SymbolKind.Method],[Pi.Property,de.SymbolKind.Property],[Pi.Field,de.SymbolKind.Field],[Pi.Constructor,de.SymbolKind.Constructor],[Pi.Enum,de.SymbolKind.Enum],[Pi.Interface,de.SymbolKind.Interface],[Pi.Function,de.SymbolKind.Function],[Pi.Variable,de.SymbolKind.Variable],[Pi.Constant,de.SymbolKind.Constant],[Pi.String,de.SymbolKind.String],[Pi.Number,de.SymbolKind.Number],[Pi.Boolean,de.SymbolKind.Boolean],[Pi.Array,de.SymbolKind.Array],[Pi.Object,de.SymbolKind.Object],[Pi.Key,de.SymbolKind.Key],[Pi.Null,de.SymbolKind.Null],[Pi.EnumMember,de.SymbolKind.EnumMember],[Pi.Struct,de.SymbolKind.Struct],[Pi.Event,de.SymbolKind.Event],[Pi.Operator,de.SymbolKind.Operator],[Pi.TypeParameter,de.SymbolKind.TypeParameter]]);function vX(o){return CX.get(o)??de.SymbolKind.File}const iAe=new Map([[pX.Deprecated,de.SymbolTag.Deprecated]]);function wX(o){return iAe.get(o)}const nAe=new Map([[ME.Text,de.DocumentHighlightKind.Text],[ME.Read,de.DocumentHighlightKind.Read],[ME.Write,de.DocumentHighlightKind.Write]]);function sAe(o){return o?nAe.get(o)??de.DocumentHighlightKind.Text:de.DocumentHighlightKind.Text}const oAe=new Map([[lm.Comment,de.FoldingRangeKind.Comment],[lm.Imports,de.FoldingRangeKind.Imports],[lm.Region,de.FoldingRangeKind.Region]]);function rAe(o){if(o)return oAe.get(o)}const aAe=new Map([[Zr.Error,Pc.Error],[Zr.Warning,Pc.Warning],[Zr.Info,Pc.Information],[Zr.Hint,Pc.Hint]]);function lAe(o){return aAe.get(o)??Pc.Error}const cAe=new Map([[Pc.Error,Zr.Error],[Pc.Warning,Zr.Warning],[Pc.Information,Zr.Info],[Pc.Hint,Zr.Hint]]);function dAe(o){return o?cAe.get(o)??Zr.Error:Zr.Error}const SX=new Map([[aV.Unnecessary,nL.Unnecessary],[aV.Deprecated,nL.Deprecated]]);function hAe(o){return SX.get(o)}const uAe=new Map([[de.SignatureHelpTriggerKind.Invoke,u0.Invoked],[de.SignatureHelpTriggerKind.TriggerCharacter,u0.TriggerCharacter],[de.SignatureHelpTriggerKind.ContentChange,u0.ContentChange]]);function gAe(o){return uAe.get(o)??u0.Invoked}function cm(o){if(o)return{id:o.command,title:o.title,arguments:o.arguments}}const fAe=new Map([[rV.Type,de.InlayHintKind.Type],[rV.Parameter,de.InlayHintKind.Parameter]]);function pAe(o){return o?fAe.get(o)??de.InlayHintKind.Type:de.InlayHintKind.Type}function Ah(o,e){if("targetUri"in o){const t=e.bridge.translateBackRange({uri:o.targetUri},o.targetRange);return{uri:t.textModel.uri,range:t.range,originSelectionRange:o.originSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.originSelectionRange).range:void 0,targetSelectionRange:o.targetSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.targetSelectionRange).range:void 0}}else{const t=e.bridge.translateBackRange({uri:o.uri},o.range);return{uri:t.textModel.uri,range:t.range}}}function In(o){return!o||o.length===0?{language:"*"}:o.map(e=>"notebook"in e?typeof e.notebook=="string"?{notebookType:e.notebook,language:e.language}:{notebookType:e.notebook.notebookType,language:e.language,pattern:e.notebook.pattern,scheme:e.notebook.scheme}:{language:e.language,pattern:e.pattern,scheme:e.scheme})}function mAe(o,e){if(!e)return!0;const t=o.getLanguageId();if(o.uri.toString(!0),!e||e.length===0)return!0;for(const i of e)if(!(i.language&&i.language!=="*"&&i.language!==t))return!0;return!1}function RA(o){const e={severity:dAe(o.severity),startLineNumber:o.range.start.line+1,startColumn:o.range.start.character+1,endLineNumber:o.range.end.line+1,endColumn:o.range.end.character+1,message:o.message,source:o.source,code:typeof o.code=="string"?o.code:o.code?.toString()};return o.tags&&(e.tags=o.tags.map(t=>hAe(t)).filter(t=>t!==void 0)),o.relatedInformation&&(e.relatedInformation=o.relatedInformation.map(t=>({resource:hD.parse(t.location.uri),startLineNumber:t.location.range.start.line+1,startColumn:t.location.range.start.character+1,endLineNumber:t.location.range.end.line+1,endColumn:t.location.range.end.character+1,message:t.message}))),e}var _Ae=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{completion:{dynamicRegistration:!0,contextSupport:!0,completionItemKind:{valueSet:Array.from(_X.keys())},completionItem:{tagSupport:{valueSet:Array.from(bX.keys())},commitCharactersSupport:!0,deprecatedSupport:!0,preselectSupport:!0}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentCompletion,!0,e=>de.registerCompletionItemProvider(In(e.documentSelector),new bAe(this._connection,e))))}},bAe=class{constructor(o,e){ve(this,"resolveCompletionItem"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveCompletionItem=async(t,i)=>(yX(t,await this._client.server.completionItemResolve(t._lspItem),this._client.bridge,t._translated,t._model),t))}get triggerCharacters(){return this._capabilities.triggerCharacters}async provideCompletionItems(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentCompletion({textDocument:n.textDocument,position:n.position,context:t.triggerCharacter?{triggerKind:JPe(t.triggerKind),triggerCharacter:t.triggerCharacter}:void 0});return s?{suggestions:(Array.isArray(s)?s:s.items).map(r=>({...CAe(r,this._client.bridge,n,o,e),_lspItem:r,_translated:n,_model:o}))}:{suggestions:[]}}};function CAe(o,e,t,i,n){let s=o.insertText||o.label,r;o.textEdit&&("range"in o.textEdit?(s=o.textEdit.newText,r=Cg(e.translateBackRange(t.textDocument,o.textEdit.range),i).range):(s=o.textEdit.newText,r={insert:Cg(e.translateBackRange(t.textDocument,o.textEdit.insert),i).range,replace:Cg(e.translateBackRange(t.textDocument,o.textEdit.replace),i).range})),r||(r=x_.fromPositions(n,n));const a={label:o.label,kind:YPe(o.kind),insertText:s,sortText:o.sortText,filterText:o.filterText,preselect:o.preselect,commitCharacters:o.commitCharacters,range:r};return yX(a,o,e,t,i),a}function yX(o,e,t,i,n){e.detail!==void 0&&(o.detail=e.detail),e.documentation!==void 0&&(o.documentation=vAe(e.documentation)),e.insertTextFormat!==void 0&&(o.insertTextRules=tAe(e.insertTextFormat)),e.tags&&e.tags.length>0&&(o.tags=e.tags.map(XPe).filter(s=>s!==void 0)),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(o.additionalTextEdits=e.additionalTextEdits.map(s=>({range:Cg(t.translateBackRange(i.textDocument,s.range),n).range,text:s.newText}))),e.command&&(o.command=cm(e.command))}function vAe(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var wAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{hover:{dynamicRegistration:!0,contentFormat:[sL.Markdown,sL.PlainText]}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentHover,!0,e=>de.registerHoverProvider(In(e.documentSelector),new SAe(this._connection,e))))}},SAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideHover(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentHover({textDocument:i.textDocument,position:i.position});return!n||!n.contents?null:{contents:yAe(n.contents),range:n.range?this._client.bridge.translateBackRange(i.textDocument,n.range).range:void 0}}};function yAe(o){return Array.isArray(o)?o.map(e=>lV(e)):[lV(o)]}function lV(o){return typeof o=="string"?{value:o,isTrusted:!0}:"kind"in o?{value:o.value,isTrusted:!0}:{value:`\`\`\`${o.language} ${o.value} -\`\`\``,isTrusted:!0}}var V4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{signatureHelp:{dynamicRegistration:!0,contextSupport:!0,signatureInformation:{documentationFormat:[Jx.Markdown,Jx.PlainText],parameterInformation:{labelOffsetSupport:!0},activeParameterSupport:!0}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentSignatureHelp,!0,e=>he.registerSignatureHelpProvider(An(e.documentSelector),new z4e(this._connection,e))))}},z4e=class{constructor(o,e){we(this,"signatureHelpTriggerCharacters"),we(this,"signatureHelpRetriggerCharacters"),this._client=o,this._capabilities=e,this.signatureHelpTriggerCharacters=e.triggerCharacters,this.signatureHelpRetriggerCharacters=e.retriggerCharacters}async provideSignatureHelp(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentSignatureHelp({textDocument:n.textDocument,position:n.position,context:{triggerKind:N4e(i.triggerKind),triggerCharacter:i.triggerCharacter,isRetrigger:i.isRetrigger}});return s?{value:{signatures:s.signatures.map(r=>({label:r.label,documentation:Gz(r.documentation),parameters:r.parameters?.map(a=>({label:a.label,documentation:Gz(a.documentation)}))||[],activeParameter:r.activeParameter})),activeSignature:s.activeSignature||0,activeParameter:s.activeParameter||0},dispose:()=>{}}:null}};function Gz(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var U4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{definition:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDefinition,!0,e=>he.registerDefinitionProvider(An(e.documentSelector),new $4e(this._connection,e))))}},$4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDefinition(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDefinition({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>iu(s,this._client)):iu(n,this._client):null}},j4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{declaration:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDeclaration,!0,e=>he.registerDeclarationProvider(An(e.documentSelector),new q4e(this._connection,e))))}},q4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDeclaration(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDeclaration({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>iu(s,this._client)):iu(n,this._client):null}},K4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{typeDefinition:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentTypeDefinition,!0,e=>he.registerTypeDefinitionProvider(An(e.documentSelector),new G4e(this._connection,e))))}},G4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideTypeDefinition(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentTypeDefinition({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>iu(s,this._client)):iu(n,this._client):null}},Z4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{implementation:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentImplementation,!0,e=>he.registerImplementationProvider(An(e.documentSelector),new Y4e(this._connection,e))))}},Y4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideImplementation(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentImplementation({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>iu(s,this._client)):iu(n,this._client):null}},X4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{references:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentReferences,!0,e=>he.registerReferenceProvider(An(e.documentSelector),new Q4e(this._connection,e))))}},Q4e=class{constructor(o,e){this._client=o,this._capabilities=e}async provideReferences(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentReferences({textDocument:n.textDocument,position:n.position,context:{includeDeclaration:t.includeDeclaration}});return s?s.map(r=>{const a=this._client.bridge.translateBackRange({uri:r.uri},r.range);return{uri:a.textModel.uri,range:a.range}}):null}},J4e=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentHighlight:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDocumentHighlight,!0,e=>he.registerDocumentHighlightProvider(An(e.documentSelector),new eFe(this._connection,e))))}},eFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentHighlights(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDocumentHighlight({textDocument:i.textDocument,position:i.position});return n?n.map(s=>({range:this._client.bridge.translateBackRange(i.textDocument,s.range).range,kind:w4e(s.kind)})):null}},tFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentSymbol:{dynamicRegistration:!0,hierarchicalDocumentSymbolSupport:!0,symbolKind:{valueSet:Array.from(cJ.keys())},tagSupport:{valueSet:[oJ.Deprecated]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDocumentSymbol,!0,e=>he.registerDocumentSymbolProvider(An(e.documentSelector),new iFe(this._connection,e))))}},iFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentSymbols(o,e){const t=this._client.bridge.translate(o,new Wd(1,1)),i=await this._client.server.textDocumentDocumentSymbol({textDocument:t.textDocument});return i?Array.isArray(i)&&i.length>0?"location"in i[0]?i.map(n=>nFe(n,this._client)):i.map(n=>fJ(n,this._client,t.textDocument)):[]:null}};function fJ(o,e,t){return{name:o.name,detail:o.detail||"",kind:dJ(o.kind),tags:o.tags?.map(i=>hJ(i)).filter(i=>i!==void 0)||[],range:e.bridge.translateBackRange(t,o.range).range,selectionRange:e.bridge.translateBackRange(t,o.selectionRange).range,children:o.children?.map(i=>fJ(i,e,t))||[]}}function nFe(o,e){return{name:o.name,detail:"",kind:dJ(o.kind),tags:o.tags?.map(t=>hJ(t)).filter(t=>t!==void 0)||[],range:e.bridge.translateBackRange({uri:o.location.uri},o.location.range).range,selectionRange:e.bridge.translateBackRange({uri:o.location.uri},o.location.range).range,children:[]}}var sFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{rename:{dynamicRegistration:!0,prepareSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentRename,!0,e=>he.registerRenameProvider(An(e.documentSelector),new oFe(this._connection,e))))}},oFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideRenameEdits(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentRename({textDocument:n.textDocument,position:n.position,newName:t});return s?rFe(s,this._client):null}async resolveRenameLocation(o,e,t){if(!this._capabilities.prepareProvider)return null;const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentPrepareRename({textDocument:i.textDocument,position:i.position});if(!n)return null;if("range"in n&&"placeholder"in n)return{range:this._client.bridge.translateBackRange(i.textDocument,n.range).range,text:n.placeholder};if("defaultBehavior"in n)return null;if("start"in n&&"end"in n){const s=this._client.bridge.translateBackRange(i.textDocument,n).range;return{range:s,text:o.getValueInRange(s)}}return null}};function rFe(o,e){const t=[];if(o.changes)for(const i in o.changes){const n=o.changes[i];for(const s of n){const r=e.bridge.translateBackRange({uri:i},s.range);t.push({resource:r.textModel.uri,versionId:void 0,textEdit:{range:r.range,text:s.newText}})}}if(o.documentChanges){for(const i of o.documentChanges)if("textDocument"in i){const n=i.textDocument.uri;for(const s of i.edits){const r=e.bridge.translateBackRange({uri:n},s.range);t.push({resource:r.textModel.uri,versionId:i.textDocument.version,textEdit:{range:r.range,text:s.newText}})}}}return{edits:t}}var aFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:Array.from(rJ.keys())}},isPreferredSupport:!0,disabledSupport:!0,dataSupport:!0,resolveSupport:{properties:["edit"]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentCodeAction,!0,e=>he.registerCodeActionProvider(An(e.documentSelector),new lFe(this._connection,e))))}},lFe=class{constructor(o,e){we(this,"resolveCodeAction"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveCodeAction=async(t,i)=>{if(t._lspAction){const n=await this._client.server.codeActionResolve(t._lspAction);n.edit&&(t.edit=Zz(n.edit,this._client)),n.command&&(t.command=Bm(n.command))}return t})}async provideCodeActions(o,e,t,i){const n=this._client.bridge.translate(o,e.getStartPosition()),s=await this._client.server.textDocumentCodeAction({textDocument:n.textDocument,range:this._client.bridge.translateRange(o,e),context:{diagnostics:t.markers.map(r=>({range:this._client.bridge.translateRange(o,eb.lift(r)),message:r.message,severity:x4e(r.severity)})),triggerKind:u4e(t.trigger)}});return s?{actions:(Array.isArray(s)?s:[s]).map(r=>{if("title"in r&&!("kind"in r)){const a=r;return{title:a.title,command:Bm(a)}}else{const a=r;return{title:a.title,kind:d4e(a.kind),isPreferred:a.isPreferred,disabled:a.disabled?.reason,edit:a.edit?Zz(a.edit,this._client):void 0,command:Bm(a.command),_lspAction:a}}}),dispose:()=>{}}:null}};function Zz(o,e){const t=[];if(o.changes)for(const i in o.changes){const n=o.changes[i];for(const s of n){const r=e.bridge.translateBackRange({uri:i},s.range);t.push({resource:r.textModel.uri,versionId:void 0,textEdit:{range:r.range,text:s.newText}})}}if(o.documentChanges){for(const i of o.documentChanges)if("textDocument"in i){const n=i.textDocument.uri;for(const s of i.edits){const r=e.bridge.translateBackRange({uri:n},s.range);t.push({resource:r.textModel.uri,versionId:i.textDocument.version??void 0,textEdit:{range:r.range,text:s.newText}})}}}return{edits:t}}var cFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{codeLens:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentCodeLens,!0,e=>he.registerCodeLensProvider(An(e.documentSelector),new dFe(this._connection,e))))}},dFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideCodeLenses(o,e){const t=this._client.bridge.translate(o,new Wd(1,1)),i=await this._client.server.textDocumentCodeLens({textDocument:t.textDocument});return i?{lenses:i.map(n=>({range:zg(this._client.bridge.translateBackRange(t.textDocument,n.range),o).range,command:Bm(n.command),_lspCodeLens:n})),dispose:()=>{}}:null}async resolveCodeLens(o,e,t){if(!this._capabilities.resolveProvider||!e._lspCodeLens)return e;const i=await this._client.server.codeLensResolve(e._lspCodeLens);return i.command&&(e.command={id:i.command.command,title:i.command.title,arguments:i.command.arguments}),e}},hFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentLink:{dynamicRegistration:!0,tooltipSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDocumentLink,!0,e=>he.registerLinkProvider(An(e.documentSelector),new uFe(this._connection,e))))}},uFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideLinks(o,e){const t=this._client.bridge.translate(o,new Wd(1,1)),i=await this._client.server.textDocumentDocumentLink({textDocument:t.textDocument});return i?{links:i.map(n=>({range:this._client.bridge.translateBackRange(t.textDocument,n.range).range,url:n.target,tooltip:n.tooltip}))}:null}async resolveLink(o,e){return this._capabilities.resolveProvider,o}},gFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{formatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentFormatting,!0,e=>he.registerDocumentFormattingEditProvider(An(e.documentSelector),new fFe(this._connection,e))))}},fFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentFormattingEdits(o,e,t){const i=this._client.bridge.translate(o,new Wd(1,1)),n=await this._client.server.textDocumentFormatting({textDocument:i.textDocument,options:{tabSize:e.tabSize,insertSpaces:e.insertSpaces}});return n?n.map(s=>({range:this._client.bridge.translateBackRange(i.textDocument,s.range).range,text:s.newText})):null}},pFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{rangeFormatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentRangeFormatting,!0,e=>he.registerDocumentRangeFormattingEditProvider(An(e.documentSelector),new mFe(this._connection,e))))}},mFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentRangeFormattingEdits(o,e,t,i){const n=this._client.bridge.translate(o,e.getStartPosition()),s=await this._client.server.textDocumentRangeFormatting({textDocument:n.textDocument,range:this._client.bridge.translateRange(o,e),options:{tabSize:t.tabSize,insertSpaces:t.insertSpaces}});return s?s.map(r=>({range:this._client.bridge.translateBackRange(n.textDocument,r.range).range,text:r.newText})):null}},_Fe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{onTypeFormatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentOnTypeFormatting,!0,e=>he.registerOnTypeFormattingEditProvider(An(e.documentSelector),new bFe(this._connection,e))))}},bFe=class{constructor(o,e){we(this,"autoFormatTriggerCharacters"),this._client=o,this._capabilities=e,this.autoFormatTriggerCharacters=[e.firstTriggerCharacter,...e.moreTriggerCharacter||[]]}async provideOnTypeFormattingEdits(o,e,t,i,n){const s=this._client.bridge.translate(o,e),r=await this._client.server.textDocumentOnTypeFormatting({textDocument:s.textDocument,position:s.position,ch:t,options:{tabSize:i.tabSize,insertSpaces:i.insertSpaces}});return r?r.map(a=>({range:this._client.bridge.translateBackRange(s.textDocument,a.range).range,text:a.newText})):null}},CFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{foldingRange:{dynamicRegistration:!0,rangeLimit:5e3,lineFoldingOnly:!1,foldingRangeKind:{valueSet:[Wm.Comment,Wm.Imports,Wm.Region]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentFoldingRange,!0,e=>he.registerFoldingRangeProvider(An(e.documentSelector),new vFe(this._connection,e))))}},vFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideFoldingRanges(o,e,t){const i=this._client.bridge.translate(o,new Wd(1,1)),n=await this._client.server.textDocumentFoldingRange({textDocument:i.textDocument});return n?n.map(s=>({start:s.startLine+1,end:s.endLine+1,kind:y4e(s.kind)})):null}},wFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{selectionRange:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentSelectionRange,!0,e=>he.registerSelectionRangeProvider(An(e.documentSelector),new SFe(this._connection,e))))}},SFe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideSelectionRanges(o,e,t){const i=this._client.bridge.translate(o,e[0]),n=await this._client.server.textDocumentSelectionRange({textDocument:i.textDocument,positions:e.map(s=>this._client.bridge.translate(o,s).position)});return n?n.map(s=>this.convertSelectionRange(s,i.textDocument)):null}convertSelectionRange(o,e){const t=[];let i=o;for(;i;)t.push({range:this._client.bridge.translateBackRange(e,i.range).range}),i=i.parent;return t}},yFe=class extends ji{constructor(o){super(),we(this,"_providers",new Set),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{inlayHint:{dynamicRegistration:!0,resolveSupport:{properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]}}},workspace:{inlayHint:{refreshSupport:!0}}})),this._register(this._connection.connection.registerRequestHandler(Vw.client.workspaceInlayHintRefresh,async()=>{for(const e of this._providers)e.refresh();return{ok:null}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentInlayHint,!0,e=>{const t=new LFe(this._connection,e);this._providers.add(t);const i=he.registerInlayHintsProvider(An(e.documentSelector),t);return{dispose:()=>{this._providers.delete(t),i.dispose()}}}))}},LFe=class{constructor(o,e){we(this,"_onDidChangeInlayHints",new tu),we(this,"onDidChangeInlayHints",this._onDidChangeInlayHints.event),we(this,"resolveInlayHint"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveInlayHint=async(t,i)=>{const n=await this._client.server.inlayHintResolve(t._lspInlayHint);return n.tooltip&&(t.tooltip=jO(n.tooltip)),n.label!==t._lspInlayHint.label&&(t.label=Yz(n.label)),n.textEdits&&(t.textEdits=n.textEdits.map(s=>({range:this._client.bridge.translateBackRange({uri:t._targetUri},s.range).range,text:s.newText}))),t})}refresh(){this._onDidChangeInlayHints.fire()}async provideInlayHints(o,e,t){const i=this._client.bridge.translate(o,e.getStartPosition()),n=await xFe(async()=>await this._client.server.textDocumentInlayHint({textDocument:i.textDocument,range:this._client.bridge.translateRange(o,e)}));return n?{hints:n.map(s=>({label:Yz(s.label),position:zg(this._client.bridge.translateBack(i.textDocument,s.position),o).position,kind:R4e(s.kind),tooltip:jO(s.tooltip),paddingLeft:s.paddingLeft,paddingRight:s.paddingRight,textEdits:s.textEdits?.map(r=>({range:zg(this._client.bridge.translateBackRange(i.textDocument,r.range),o).range,text:r.newText})),_lspInlayHint:s,_targetUri:i.textDocument.uri})),dispose:()=>{}}:null}};async function xFe(o){for(let e=3;;e--)try{return await o()}catch(t){if(t.message==="content modified"&&e>0)continue;throw t}}function Yz(o){return typeof o=="string"?o:o.map(e=>{const t={label:e.value,tooltip:jO(e.tooltip),command:Bm(e.command)};return e.location&&(t.location={uri:rI.parse(e.location.uri),range:new eb(e.location.range.start.line+1,e.location.range.start.character+1,e.location.range.end.line+1,e.location.range.end.character+1)}),t})}function jO(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var DFe=class extends ji{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{semanticTokens:{dynamicRegistration:!0,requests:{range:!0,full:{delta:!0}},tokenTypes:["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],formats:[c4e.Relative],overlappingTokenSupport:!1,multilineTokenSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentSemanticTokensFull,!0,e=>he.registerDocumentSemanticTokensProvider(An(e.documentSelector),new kFe(this._connection,e))))}},kFe=class{constructor(o,e){this._client=o,this._capabilities=e}getLegend(){return{tokenTypes:this._capabilities.legend.tokenTypes,tokenModifiers:this._capabilities.legend.tokenModifiers}}releaseDocumentSemanticTokens(o){}async provideDocumentSemanticTokens(o,e,t){const i=this._client.bridge.translate(o,o.getPositionAt(0)),n=this._capabilities.full;if(e&&n&&typeof n=="object"&&n.delta){const r=await this._client.server.textDocumentSemanticTokensFullDelta({textDocument:i.textDocument,previousResultId:e});return r?"edits"in r?{resultId:r.resultId,edits:r.edits.map(a=>({start:a.start,deleteCount:a.deleteCount,data:a.data?new Uint32Array(a.data):void 0}))}:{resultId:r.resultId,data:new Uint32Array(r.data)}:null}const s=await this._client.server.textDocumentSemanticTokensFull({textDocument:i.textDocument});return s?{resultId:s.resultId,data:new Uint32Array(s.data)}:null}async provideDocumentSemanticTokensEdits(o,e,t){return this.provideDocumentSemanticTokens(o,e,t)}},IFe=class extends ji{constructor(o){super(),we(this,"_diagnosticsMarkerOwner","lsp"),we(this,"_pullDiagnosticProviders",new Map),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[...uJ.keys()]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0},diagnostic:{dynamicRegistration:!0,relatedDocumentSupport:!0}}}));debugger;this._register(this._connection.connection.registerNotificationHandler(Vw.client.textDocumentPublishDiagnostics,e=>this._handlePublishDiagnostics(e))),this._register(this._connection.capabilities.registerCapabilityHandler(Xe.textDocumentDiagnostic,!0,e=>{const t=new OW;for(const i of $l.getModels())this._addPullDiagnosticProvider(i,e,t);return t.add($l.onDidCreateModel(i=>{this._addPullDiagnosticProvider(i,e,t)})),t}))}_addPullDiagnosticProvider(o,e,t){if(o.getLanguageId(),!M4e(o,e.documentSelector))return;const i=new EFe(o,this._connection,this._diagnosticsMarkerOwner,e);this._pullDiagnosticProviders.set(o,i),t.add(i),t.add(o.onWillDispose(()=>{this._pullDiagnosticProviders.delete(o)}))}_handlePublishDiagnostics(o){const e=o.uri;try{const t=this._connection.bridge.translateBack({uri:e},{line:0,character:0}).textModel;if(!t||t.isDisposed())return;const i=o.diagnostics.map(n=>$O(n));$l.setModelMarkers(t,this._diagnosticsMarkerOwner,i)}catch(t){console.debug(`Could not set diagnostics for ${e}:`,t)}}},EFe=class extends ji{constructor(o,e,t,i){super(),we(this,"_updateHandle"),we(this,"_previousResultId"),this._model=o,this._connection=e,this._markerOwner=t,this._capability=i,this._register(this._model.onDidChangeContent(()=>{this._scheduleDiagnosticUpdate()})),this._scheduleDiagnosticUpdate()}_scheduleDiagnosticUpdate(){this._updateHandle!==void 0&&clearTimeout(this._updateHandle),this._updateHandle=window.setTimeout(()=>{this._updateHandle=void 0,this._requestDiagnostics()},500)}async _requestDiagnostics(){if(!this._model.isDisposed())try{const o=this._connection.bridge.translate(this._model,new Wd(1,1)),e=await this._connection.server.textDocumentDiagnostic({textDocument:o.textDocument,identifier:this._capability.identifier,previousResultId:this._previousResultId});if(this._model.isDisposed())return;this._handleDiagnosticReport(e)}catch(o){console.error("Error requesting diagnostics:",o)}}_handleDiagnosticReport(o){if(o.kind==="full"){this._previousResultId=o.resultId;const e=o.items.map(t=>$O(t));$l.setModelMarkers(this._model,this._markerOwner,e),"relatedDocuments"in o&&o.relatedDocuments&&this._handleRelatedDocuments(o.relatedDocuments)}else o.kind==="unchanged"&&(this._previousResultId=o.resultId)}_handleRelatedDocuments(o){for(const[e,t]of Object.entries(o))try{const i=this._connection.bridge.translateBack({uri:e},{line:0,character:0}).textModel;if(!i||i.isDisposed())continue;if(t.kind==="full"){const n=t.items.map(s=>$O(s));$l.setModelMarkers(i,this._markerOwner,n)}}catch(i){console.debug(`Could not set related diagnostics for ${e}:`,i)}}dispose(){this._updateHandle!==void 0&&(clearTimeout(this._updateHandle),this._updateHandle=void 0),super.dispose()}},NFe=class{constructor(o,e,t,i){this.server=o,this.bridge=e,this.capabilities=t,this.connection=i}},TFe=class extends ji{constructor(o){super(),we(this,"_staticCapabilities",new Set),we(this,"_dynamicFromStatic",PFe.create()),we(this,"_registrations",new Map),we(this,"_serverCapabilities"),this._connection=o,this._register(this._connection.registerRequestHandler(Vw.client.clientRegisterCapability,async e=>{for(const t of e.registrations){const i=Qz(t.method),n=new Xz(t.id,i,t.registerOptions,!1);this._registerCapabilityOptions(n)}return{ok:null}})),this._register(this._connection.registerRequestHandler(Vw.client.clientUnregisterCapability,async e=>{for(const t of e.unregisterations){const i=Qz(t.method),n=this._registrations.get(i),s=n?.registrations.get(t.id);if(!s)throw new Error(`No registration for method ${t.method} with id ${t.id}`);s?.handlerDisposables.forEach(r=>r.dispose()),n?.registrations.delete(t.id)}return{ok:null}}))}_registerCapabilityOptions(o){let e=this._registrations.get(o.capability);if(e||(e=new Jz,this._registrations.set(o.capability,e)),e.registrations.has(o.id))throw new Error(`Handler for method ${o.capability.method} with id ${o.id} already registered`);e.registrations.set(o.id,o);for(const t of e.handlers)!t.handleStaticCapability&&o.isFromStatic||o.handlerDisposables.set(t,t.handler(o.options))}setServerCapabilities(o){if(this._serverCapabilities)throw new Error("Server capabilities already set");this._serverCapabilities=o;for(const e of Object.values(Xe)){const t=this._dynamicFromStatic.getOptions(e,o);t&&this._registerCapabilityOptions(new Xz(e.method,e,t,!0))}}getClientCapabilities(){const o={};for(const e of this._staticCapabilities)mJ(o,e.cap);return o}addStaticClientCapabilities(o){const e={cap:o};return this._staticCapabilities.add(e),{dispose:()=>{this._staticCapabilities.delete(e)}}}registerCapabilityHandler(o,e,t){let i=this._registrations.get(o);i||(i=new Jz,this._registrations.set(o,i));const n=new RFe(o,e,t);i.handlers.add(n);for(const s of i.registrations.values())!n.handleStaticCapability&&s.isFromStatic||s.handlerDisposables.set(n,t(s.options));return{dispose:()=>{i.handlers.delete(n);for(const s of i.registrations.values()){const r=s.handlerDisposables.get(n);r&&(r.dispose(),s.handlerDisposables.delete(n))}}}}},RFe=class{constructor(o,e,t){this.capability=o,this.handleStaticCapability=e,this.handler=t}},Xz=class{constructor(o,e,t,i){we(this,"handlerDisposables",new Map),this.id=o,this.capability=e,this.options=t,this.isFromStatic=i}};const MFe=new Map([...Object.values(Xe)].map(o=>[o.method,o]));function Qz(o){const e=MFe.get(o);if(!e)throw new Error(`No capability found for method ${o}`);return e}var Jz=class{constructor(){we(this,"handlers",new Set),we(this,"registrations",new Map)}},PFe=class pJ{constructor(){we(this,"_mappings",new Map)}static create(){const e=new pJ;return e.set(Xe.textDocumentDidChange,t=>{if(t.textDocumentSync!==void 0)return typeof t.textDocumentSync=="object"?{syncKind:t.textDocumentSync.change??r4e.None,documentSelector:null}:{syncKind:t.textDocumentSync,documentSelector:null}}),e.set(Xe.textDocumentCompletion,t=>t.completionProvider),e.set(Xe.textDocumentHover,t=>t.hoverProvider),e.set(Xe.textDocumentSignatureHelp,t=>t.signatureHelpProvider),e.set(Xe.textDocumentDefinition,t=>t.definitionProvider),e.set(Xe.textDocumentReferences,t=>t.referencesProvider),e.set(Xe.textDocumentDocumentHighlight,t=>t.documentHighlightProvider),e.set(Xe.textDocumentDocumentSymbol,t=>t.documentSymbolProvider),e.set(Xe.textDocumentCodeAction,t=>t.codeActionProvider),e.set(Xe.textDocumentCodeLens,t=>t.codeLensProvider),e.set(Xe.textDocumentDocumentLink,t=>t.documentLinkProvider),e.set(Xe.textDocumentFormatting,t=>t.documentFormattingProvider),e.set(Xe.textDocumentRangeFormatting,t=>t.documentRangeFormattingProvider),e.set(Xe.textDocumentOnTypeFormatting,t=>t.documentOnTypeFormattingProvider),e.set(Xe.textDocumentRename,t=>t.renameProvider),e.set(Xe.textDocumentFoldingRange,t=>t.foldingRangeProvider),e.set(Xe.textDocumentDeclaration,t=>t.declarationProvider),e.set(Xe.textDocumentTypeDefinition,t=>t.typeDefinitionProvider),e.set(Xe.textDocumentImplementation,t=>t.implementationProvider),e.set(Xe.textDocumentDocumentColor,t=>t.colorProvider),e.set(Xe.textDocumentSelectionRange,t=>t.selectionRangeProvider),e.set(Xe.textDocumentLinkedEditingRange,t=>t.linkedEditingRangeProvider),e.set(Xe.textDocumentPrepareCallHierarchy,t=>t.callHierarchyProvider),e.set(Xe.textDocumentSemanticTokensFull,t=>t.semanticTokensProvider),e.set(Xe.textDocumentInlayHint,t=>t.inlayHintProvider),e.set(Xe.textDocumentInlineValue,t=>t.inlineValueProvider),e.set(Xe.textDocumentDiagnostic,t=>t.diagnosticProvider),e.set(Xe.textDocumentMoniker,t=>t.monikerProvider),e.set(Xe.textDocumentPrepareTypeHierarchy,t=>t.typeHierarchyProvider),e.set(Xe.workspaceSymbol,t=>t.workspaceSymbolProvider),e.set(Xe.workspaceExecuteCommand,t=>t.executeCommandProvider),e}set(e,t){if(this._mappings.has(e.method))throw new Error(`Capability for method ${e.method} already registered`);this._mappings.set(e.method,t)}getOptions(e,t){const i=this._mappings.get(e.method);if(i)return i(t)}};function mJ(o,e){for(const t of Object.keys(e)){const i=e[t];if(i===void 0)continue;const n=o[t];if(n===void 0){o[t]=i;continue}if(typeof i!="object"||i===null){o[t]=i;continue}if(typeof n!="object"||n===null){o[t]=i;continue}mJ(n,i)}}var AFe=class extends ji{constructor(o,e){super(),we(this,"_managedModels",new Map),we(this,"_managedModelsReverse",new Map),we(this,"_started",!1),this._server=o,this._capabilities=e,this._register(this._capabilities.addStaticClientCapabilities({textDocument:{synchronization:{dynamicRegistration:!0,willSave:!1,willSaveWaitUntil:!1,didSave:!1}}})),this._register(e.registerCapabilityHandler(Xe.textDocumentDidChange,!0,t=>{if(this._started)return{dispose:()=>{}};this._started=!0,this._register($l.onDidCreateModel(i=>{this._getOrCreateManagedModel(i)}));for(const i of $l.getModels())this._getOrCreateManagedModel(i);return{dispose:()=>{}}}))}_getOrCreateManagedModel(o){if(!this._started)throw new Error("Not started");const e=o.uri.toString(!0).toLowerCase();let t=this._managedModels.get(o);return t||(t=new OFe(o,this._server),this._managedModels.set(o,t),this._managedModelsReverse.set(e,o)),o.onWillDispose(()=>{t.dispose(),this._managedModels.delete(o),this._managedModelsReverse.delete(e)}),t}translateBack(o,e){const t=o.uri.toLowerCase(),i=this._managedModelsReverse.get(t);if(!i)throw new Error(`No text model for uri ${t}`);return{textModel:i,position:new Wd(e.line+1,e.character+1)}}translateBackRange(o,e){const t=o.uri.toLowerCase(),i=this._managedModelsReverse.get(t);if(!i)throw new Error(`No text model for uri ${t}`);return{textModel:i,range:new eb(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}}translate(o,e){return{textDocument:{uri:o.uri.toString(!0)},position:{line:e.lineNumber-1,character:e.column-1}}}translateRange(o,e){return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}},OFe=class extends ji{constructor(o,e){super(),this._textModel=o,this._api=e;const t=o.uri.toString(!0).toLowerCase();this._api.textDocumentDidOpen({textDocument:{languageId:o.getLanguageId(),uri:t,version:o.getVersionId(),text:o.getValue()}}),this._register(o.onDidChangeContent(i=>{const n=i.changes.map(s=>FFe(s));this._api.textDocumentDidChange({textDocument:{uri:t,version:o.getVersionId()},contentChanges:n})})),this._register({dispose:()=>{this._api.textDocumentDidClose({textDocument:{uri:t}})}})}};function FFe(o){return{range:WFe(o.range),rangeLength:o.rangeLength,text:o.text}}function WFe(o){return{start:{line:o.startLineNumber-1,character:o.startColumn-1},end:{line:o.endLineNumber-1,character:o.endColumn-1}}}var BFe=class{constructor(o){we(this,"_connection"),we(this,"_capabilitiesRegistry"),we(this,"_bridge"),we(this,"_initPromise");const e=VO.fromTransport(o),t=Vw.getServer(e,{});e.startListen(),this._capabilitiesRegistry=new TFe(e),this._bridge=new AFe(t.server,this._capabilitiesRegistry),this._connection=new NFe(t.server,this._bridge,this._capabilitiesRegistry,e),this.createFeatures(),this._initPromise=this._init()}async _init(){const o=await this._connection.server.initialize({processId:null,capabilities:this._capabilitiesRegistry.getClientCapabilities(),rootUri:null});this._connection.server.initialized({}),this._capabilitiesRegistry.setServerCapabilities(o.capabilities)}createFeatures(){const o=new OW;return o.add(new P4e(this._connection)),o.add(new W4e(this._connection)),o.add(new V4e(this._connection)),o.add(new U4e(this._connection)),o.add(new j4e(this._connection)),o.add(new K4e(this._connection)),o.add(new Z4e(this._connection)),o.add(new X4e(this._connection)),o.add(new J4e(this._connection)),o.add(new tFe(this._connection)),o.add(new sFe(this._connection)),o.add(new aFe(this._connection)),o.add(new cFe(this._connection)),o.add(new hFe(this._connection)),o.add(new gFe(this._connection)),o.add(new pFe(this._connection)),o.add(new _Fe(this._connection)),o.add(new CFe(this._connection)),o.add(new wFe(this._connection)),o.add(new yFe(this._connection)),o.add(new DFe(this._connection)),o.add(new IFe(this._connection)),o}},Rp=null;typeof WebSocket<"u"?Rp=WebSocket:typeof MozWebSocket<"u"?Rp=MozWebSocket:typeof global<"u"?Rp=global.WebSocket||global.MozWebSocket:typeof window<"u"?Rp=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Rp=self.WebSocket||self.MozWebSocket);var HFe=Rp;function VFe(o){return"host"in o?{address:`${o.forceTls?"wss":"ws"}://${o.host}:${o.port}`}:o}var zFe=class qO extends YQ{constructor(e){super(),we(this,"socket"),we(this,"errorEmitter",new AW),we(this,"onError",this.errorEmitter),this.socket=e,e.onmessage=t=>{try{const i=t.data;if(typeof i=="string"){const n=JSON.parse(i);this._dispatchReceivedMessage(n)}else throw new Error("Not supported")}catch(i){this.errorEmitter.fire({error:i})}},e.onclose=t=>{this._onConnectionClosed()}}static connectTo(e){const t=new HFe(VFe(e).address);return new Promise((i,n)=>{t.onerror=s=>{n(s)},t.onopen=()=>{i(new qO(t))}})}static fromWebSocket(e){return new qO(e)}close(){this.socket.close()}dispose(){this.close()}_sendImpl(e){const t=JSON.stringify(e);return new Promise((i,n)=>{this.socket.send(t,s=>{s?n(s):i()})})}toString(){return`${this.id}@${this.socket.url}`}},_J=class extends YQ{constructor(o,e=void 0,t=void 0){super(),we(this,"_windowLike"),we(this,"_source"),we(this,"_loadingState"),we(this,"_disposed",!1),we(this,"_messageHandler",({data:i,source:n})=>{this._source&&n!==this._source||typeof i=="object"&&i&&this._dispatchReceivedMessage(i)}),this._windowLike=o,this._source=e,this._loadingState=t,this._windowLike.addEventListener("message",this._messageHandler)}async _sendImpl(o){if(this._disposed)throw new Error("Transport is disposed");this._loadingState&&!this._loadingState.loaded&&await this._loadingState.onLoaded,this._windowLike.postMessage(o)}toString(){return`${this.id}@${this._windowLike}`}dispose(){this._disposed||(this._disposed=!0,this._windowLike.removeEventListener("message",this._messageHandler))}};function UFe(o){if(typeof window>"u")throw new Error("call this function from the main browser thread");return new _J(o)}function $Fe(o){if(typeof window>"u")throw new Error("call this function from the main browser thread");return new _J(o.contentWindow,o.contentWindow,{loaded:window.document.readyState==="complete",onLoaded:new Promise(e=>{window.addEventListener("load",()=>e())})})}const jFe=Object.freeze(Object.defineProperty({__proto__:null,MonacoLspClient:BFe,WebSocketTransport:zFe,createTransportToIFrame:$Fe,createTransportToWorker:UFe},Symbol.toStringTag,{value:"Module"}));function qFe(o,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(o,e)}catch(i){console.error(i);return}try{return globalThis.trustedTypes?.createPolicy(o,e)}catch(i){console.error(i);return}}let eD;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?eD=globalThis.workerttPolicy:eD=qFe("defaultWorkerFactory",{createScriptURL:o=>o});function KFe(o){const e=o.label,t=globalThis.MonacoEnvironment;if(t){if(typeof t.getWorker=="function")return t.getWorker("workerMain.js",e);if(typeof t.getWorkerUrl=="function"){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(eD?eD.createScriptURL(i):i,{name:e,type:"module"})}}if(o.createWorker)return o.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function GFe(o){const e=Promise.resolve(KFe({label:o.label??"monaco-editor-worker",moduleId:o.moduleId,createWorker:o.createWorker})).then(t=>(t.postMessage("ignore"),t.postMessage(o.createData),t));return $l.createWebWorker({worker:e,host:o.host,keepIdleModels:o.keepIdleModels})}function bJ(){return IOe}const ZFe=globalThis.MonacoEnvironment;ZFe?.globalAPI&&(globalThis.monaco=bJ());const hI=bJ();hI.languages.css=TQ;hI.languages.html=AQ;hI.languages.typescript=GQ;hI.languages.json=WQ;const NBe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:SQ,Emitter:tu,KeyCode:yQ,KeyMod:LQ,MarkerSeverity:ca,MarkerTag:Qx,Position:Wd,Range:eb,Selection:xQ,SelectionDirection:DQ,Token:kQ,Uri:rI,createWebWorker:GFe,css:TQ,editor:$l,html:AQ,json:WQ,languages:he,lsp:jFe,typescript:GQ},Symbol.toStringTag,{value:"Module"}));export{ca as M,eb as R,rI as U,Qx as a,NBe as b,GFe as c,$l as e,he as l,qQ as t}; +\`\`\``,isTrusted:!0}}var xAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{signatureHelp:{dynamicRegistration:!0,contextSupport:!0,signatureInformation:{documentationFormat:[sL.Markdown,sL.PlainText],parameterInformation:{labelOffsetSupport:!0},activeParameterSupport:!0}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentSignatureHelp,!0,e=>de.registerSignatureHelpProvider(In(e.documentSelector),new LAe(this._connection,e))))}},LAe=class{constructor(o,e){ve(this,"signatureHelpTriggerCharacters"),ve(this,"signatureHelpRetriggerCharacters"),this._client=o,this._capabilities=e,this.signatureHelpTriggerCharacters=e.triggerCharacters,this.signatureHelpRetriggerCharacters=e.retriggerCharacters}async provideSignatureHelp(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentSignatureHelp({textDocument:n.textDocument,position:n.position,context:{triggerKind:gAe(i.triggerKind),triggerCharacter:i.triggerCharacter,isRetrigger:i.isRetrigger}});return s?{value:{signatures:s.signatures.map(r=>({label:r.label,documentation:cV(r.documentation),parameters:r.parameters?.map(a=>({label:a.label,documentation:cV(a.documentation)}))||[],activeParameter:r.activeParameter})),activeSignature:s.activeSignature||0,activeParameter:s.activeParameter||0},dispose:()=>{}}:null}};function cV(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var kAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{definition:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDefinition,!0,e=>de.registerDefinitionProvider(In(e.documentSelector),new DAe(this._connection,e))))}},DAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDefinition(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDefinition({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>Ah(s,this._client)):Ah(n,this._client):null}},IAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{declaration:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDeclaration,!0,e=>de.registerDeclarationProvider(In(e.documentSelector),new EAe(this._connection,e))))}},EAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDeclaration(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDeclaration({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>Ah(s,this._client)):Ah(n,this._client):null}},NAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{typeDefinition:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentTypeDefinition,!0,e=>de.registerTypeDefinitionProvider(In(e.documentSelector),new TAe(this._connection,e))))}},TAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideTypeDefinition(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentTypeDefinition({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>Ah(s,this._client)):Ah(n,this._client):null}},RAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{implementation:{dynamicRegistration:!0,linkSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentImplementation,!0,e=>de.registerImplementationProvider(In(e.documentSelector),new MAe(this._connection,e))))}},MAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideImplementation(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentImplementation({textDocument:i.textDocument,position:i.position});return n?Array.isArray(n)?n.map(s=>Ah(s,this._client)):Ah(n,this._client):null}},PAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{references:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentReferences,!0,e=>de.registerReferenceProvider(In(e.documentSelector),new AAe(this._connection,e))))}},AAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideReferences(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentReferences({textDocument:n.textDocument,position:n.position,context:{includeDeclaration:t.includeDeclaration}});return s?s.map(r=>{const a=this._client.bridge.translateBackRange({uri:r.uri},r.range);return{uri:a.textModel.uri,range:a.range}}):null}},OAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentHighlight:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDocumentHighlight,!0,e=>de.registerDocumentHighlightProvider(In(e.documentSelector),new FAe(this._connection,e))))}},FAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentHighlights(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentDocumentHighlight({textDocument:i.textDocument,position:i.position});return n?n.map(s=>({range:this._client.bridge.translateBackRange(i.textDocument,s.range).range,kind:sAe(s.kind)})):null}},WAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentSymbol:{dynamicRegistration:!0,hierarchicalDocumentSymbolSupport:!0,symbolKind:{valueSet:Array.from(CX.keys())},tagSupport:{valueSet:[pX.Deprecated]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDocumentSymbol,!0,e=>de.registerDocumentSymbolProvider(In(e.documentSelector),new BAe(this._connection,e))))}},BAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentSymbols(o,e){const t=this._client.bridge.translate(o,new _d(1,1)),i=await this._client.server.textDocumentDocumentSymbol({textDocument:t.textDocument});return i?Array.isArray(i)&&i.length>0?"location"in i[0]?i.map(n=>HAe(n,this._client)):i.map(n=>xX(n,this._client,t.textDocument)):[]:null}};function xX(o,e,t){return{name:o.name,detail:o.detail||"",kind:vX(o.kind),tags:o.tags?.map(i=>wX(i)).filter(i=>i!==void 0)||[],range:e.bridge.translateBackRange(t,o.range).range,selectionRange:e.bridge.translateBackRange(t,o.selectionRange).range,children:o.children?.map(i=>xX(i,e,t))||[]}}function HAe(o,e){return{name:o.name,detail:"",kind:vX(o.kind),tags:o.tags?.map(t=>wX(t)).filter(t=>t!==void 0)||[],range:e.bridge.translateBackRange({uri:o.location.uri},o.location.range).range,selectionRange:e.bridge.translateBackRange({uri:o.location.uri},o.location.range).range,children:[]}}var VAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{rename:{dynamicRegistration:!0,prepareSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentRename,!0,e=>de.registerRenameProvider(In(e.documentSelector),new zAe(this._connection,e))))}},zAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideRenameEdits(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentRename({textDocument:n.textDocument,position:n.position,newName:t});return s?UAe(s,this._client):null}async resolveRenameLocation(o,e,t){if(!this._capabilities.prepareProvider)return null;const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentPrepareRename({textDocument:i.textDocument,position:i.position});if(!n)return null;if("range"in n&&"placeholder"in n)return{range:this._client.bridge.translateBackRange(i.textDocument,n.range).range,text:n.placeholder};if("defaultBehavior"in n)return null;if("start"in n&&"end"in n){const s=this._client.bridge.translateBackRange(i.textDocument,n).range;return{range:s,text:o.getValueInRange(s)}}return null}};function UAe(o,e){const t=[];if(o.changes)for(const i in o.changes){const n=o.changes[i];for(const s of n){const r=e.bridge.translateBackRange({uri:i},s.range);t.push({resource:r.textModel.uri,versionId:void 0,textEdit:{range:r.range,text:s.newText}})}}if(o.documentChanges){for(const i of o.documentChanges)if("textDocument"in i){const n=i.textDocument.uri;for(const s of i.edits){const r=e.bridge.translateBackRange({uri:n},s.range);t.push({resource:r.textModel.uri,versionId:i.textDocument.version,textEdit:{range:r.range,text:s.newText}})}}}return{edits:t}}var $Ae=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:Array.from(mX.keys())}},isPreferredSupport:!0,disabledSupport:!0,dataSupport:!0,resolveSupport:{properties:["edit"]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentCodeAction,!0,e=>de.registerCodeActionProvider(In(e.documentSelector),new jAe(this._connection,e))))}},jAe=class{constructor(o,e){ve(this,"resolveCodeAction"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveCodeAction=async(t,i)=>{if(t._lspAction){const n=await this._client.server.codeActionResolve(t._lspAction);n.edit&&(t.edit=dV(n.edit,this._client)),n.command&&(t.command=cm(n.command))}return t})}async provideCodeActions(o,e,t,i){const n=this._client.bridge.translate(o,e.getStartPosition()),s=await this._client.server.textDocumentCodeAction({textDocument:n.textDocument,range:this._client.bridge.translateRange(o,e),context:{diagnostics:t.markers.map(r=>({range:this._client.bridge.translateRange(o,x_.lift(r)),message:r.message,severity:lAe(r.severity)})),triggerKind:ZPe(t.trigger)}});return s?{actions:(Array.isArray(s)?s:[s]).map(r=>{if("title"in r&&!("kind"in r)){const a=r;return{title:a.title,command:cm(a)}}else{const a=r;return{title:a.title,kind:KPe(a.kind),isPreferred:a.isPreferred,disabled:a.disabled?.reason,edit:a.edit?dV(a.edit,this._client):void 0,command:cm(a.command),_lspAction:a}}}),dispose:()=>{}}:null}};function dV(o,e){const t=[];if(o.changes)for(const i in o.changes){const n=o.changes[i];for(const s of n){const r=e.bridge.translateBackRange({uri:i},s.range);t.push({resource:r.textModel.uri,versionId:void 0,textEdit:{range:r.range,text:s.newText}})}}if(o.documentChanges){for(const i of o.documentChanges)if("textDocument"in i){const n=i.textDocument.uri;for(const s of i.edits){const r=e.bridge.translateBackRange({uri:n},s.range);t.push({resource:r.textModel.uri,versionId:i.textDocument.version??void 0,textEdit:{range:r.range,text:s.newText}})}}}return{edits:t}}var qAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{codeLens:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentCodeLens,!0,e=>de.registerCodeLensProvider(In(e.documentSelector),new KAe(this._connection,e))))}},KAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideCodeLenses(o,e){const t=this._client.bridge.translate(o,new _d(1,1)),i=await this._client.server.textDocumentCodeLens({textDocument:t.textDocument});return i?{lenses:i.map(n=>({range:Cg(this._client.bridge.translateBackRange(t.textDocument,n.range),o).range,command:cm(n.command),_lspCodeLens:n})),dispose:()=>{}}:null}async resolveCodeLens(o,e,t){if(!this._capabilities.resolveProvider||!e._lspCodeLens)return e;const i=await this._client.server.codeLensResolve(e._lspCodeLens);return i.command&&(e.command={id:i.command.command,title:i.command.title,arguments:i.command.arguments}),e}},GAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{documentLink:{dynamicRegistration:!0,tooltipSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDocumentLink,!0,e=>de.registerLinkProvider(In(e.documentSelector),new ZAe(this._connection,e))))}},ZAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideLinks(o,e){const t=this._client.bridge.translate(o,new _d(1,1)),i=await this._client.server.textDocumentDocumentLink({textDocument:t.textDocument});return i?{links:i.map(n=>({range:this._client.bridge.translateBackRange(t.textDocument,n.range).range,url:n.target,tooltip:n.tooltip}))}:null}async resolveLink(o,e){return this._capabilities.resolveProvider,o}},YAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{formatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentFormatting,!0,e=>de.registerDocumentFormattingEditProvider(In(e.documentSelector),new XAe(this._connection,e))))}},XAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentFormattingEdits(o,e,t){const i=this._client.bridge.translate(o,new _d(1,1)),n=await this._client.server.textDocumentFormatting({textDocument:i.textDocument,options:{tabSize:e.tabSize,insertSpaces:e.insertSpaces}});return n?n.map(s=>({range:this._client.bridge.translateBackRange(i.textDocument,s.range).range,text:s.newText})):null}},QAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{rangeFormatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentRangeFormatting,!0,e=>de.registerDocumentRangeFormattingEditProvider(In(e.documentSelector),new JAe(this._connection,e))))}},JAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideDocumentRangeFormattingEdits(o,e,t,i){const n=this._client.bridge.translate(o,e.getStartPosition()),s=await this._client.server.textDocumentRangeFormatting({textDocument:n.textDocument,range:this._client.bridge.translateRange(o,e),options:{tabSize:t.tabSize,insertSpaces:t.insertSpaces}});return s?s.map(r=>({range:this._client.bridge.translateBackRange(n.textDocument,r.range).range,text:r.newText})):null}},eOe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{onTypeFormatting:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentOnTypeFormatting,!0,e=>de.registerOnTypeFormattingEditProvider(In(e.documentSelector),new tOe(this._connection,e))))}},tOe=class{constructor(o,e){ve(this,"autoFormatTriggerCharacters"),this._client=o,this._capabilities=e,this.autoFormatTriggerCharacters=[e.firstTriggerCharacter,...e.moreTriggerCharacter||[]]}async provideOnTypeFormattingEdits(o,e,t,i,n){const s=this._client.bridge.translate(o,e),r=await this._client.server.textDocumentOnTypeFormatting({textDocument:s.textDocument,position:s.position,ch:t,options:{tabSize:i.tabSize,insertSpaces:i.insertSpaces}});return r?r.map(a=>({range:this._client.bridge.translateBackRange(s.textDocument,a.range).range,text:a.newText})):null}},iOe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{foldingRange:{dynamicRegistration:!0,rangeLimit:5e3,lineFoldingOnly:!1,foldingRangeKind:{valueSet:[lm.Comment,lm.Imports,lm.Region]}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentFoldingRange,!0,e=>de.registerFoldingRangeProvider(In(e.documentSelector),new nOe(this._connection,e))))}},nOe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideFoldingRanges(o,e,t){const i=this._client.bridge.translate(o,new _d(1,1)),n=await this._client.server.textDocumentFoldingRange({textDocument:i.textDocument});return n?n.map(s=>({start:s.startLine+1,end:s.endLine+1,kind:rAe(s.kind)})):null}},sOe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{selectionRange:{dynamicRegistration:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentSelectionRange,!0,e=>de.registerSelectionRangeProvider(In(e.documentSelector),new oOe(this._connection,e))))}},oOe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideSelectionRanges(o,e,t){const i=this._client.bridge.translate(o,e[0]),n=await this._client.server.textDocumentSelectionRange({textDocument:i.textDocument,positions:e.map(s=>this._client.bridge.translate(o,s).position)});return n?n.map(s=>this.convertSelectionRange(s,i.textDocument)):null}convertSelectionRange(o,e){const t=[];let i=o;for(;i;)t.push({range:this._client.bridge.translateBackRange(e,i.range).range}),i=i.parent;return t}},rOe=class extends Wi{constructor(o){super(),ve(this,"_providers",new Set),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{inlayHint:{dynamicRegistration:!0,resolveSupport:{properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]}}},workspace:{inlayHint:{refreshSupport:!0}}})),this._register(this._connection.connection.registerRequestHandler(nw.client.workspaceInlayHintRefresh,async()=>{for(const e of this._providers)e.refresh();return{ok:null}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentInlayHint,!0,e=>{const t=new aOe(this._connection,e);this._providers.add(t);const i=de.registerInlayHintsProvider(In(e.documentSelector),t);return{dispose:()=>{this._providers.delete(t),i.dispose()}}}))}},aOe=class{constructor(o,e){ve(this,"_onDidChangeInlayHints",new Ph),ve(this,"onDidChangeInlayHints",this._onDidChangeInlayHints.event),ve(this,"resolveInlayHint"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveInlayHint=async(t,i)=>{const n=await this._client.server.inlayHintResolve(t._lspInlayHint);return n.tooltip&&(t.tooltip=MA(n.tooltip)),n.label!==t._lspInlayHint.label&&(t.label=hV(n.label)),n.textEdits&&(t.textEdits=n.textEdits.map(s=>({range:this._client.bridge.translateBackRange({uri:t._targetUri},s.range).range,text:s.newText}))),t})}refresh(){this._onDidChangeInlayHints.fire()}async provideInlayHints(o,e,t){const i=this._client.bridge.translate(o,e.getStartPosition()),n=await lOe(async()=>await this._client.server.textDocumentInlayHint({textDocument:i.textDocument,range:this._client.bridge.translateRange(o,e)}));return n?{hints:n.map(s=>({label:hV(s.label),position:Cg(this._client.bridge.translateBack(i.textDocument,s.position),o).position,kind:pAe(s.kind),tooltip:MA(s.tooltip),paddingLeft:s.paddingLeft,paddingRight:s.paddingRight,textEdits:s.textEdits?.map(r=>({range:Cg(this._client.bridge.translateBackRange(i.textDocument,r.range),o).range,text:r.newText})),_lspInlayHint:s,_targetUri:i.textDocument.uri})),dispose:()=>{}}:null}};async function lOe(o){for(let e=3;;e--)try{return await o()}catch(t){if(t.message==="content modified"&&e>0)continue;throw t}}function hV(o){return typeof o=="string"?o:o.map(e=>{const t={label:e.value,tooltip:MA(e.tooltip),command:cm(e.command)};return e.location&&(t.location={uri:hD.parse(e.location.uri),range:new x_(e.location.range.start.line+1,e.location.range.start.character+1,e.location.range.end.line+1,e.location.range.end.character+1)}),t})}function MA(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var cOe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{semanticTokens:{dynamicRegistration:!0,requests:{range:!0,full:{delta:!0}},tokenTypes:["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],formats:[qPe.Relative],overlappingTokenSupport:!1,multilineTokenSupport:!0}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentSemanticTokensFull,!0,e=>de.registerDocumentSemanticTokensProvider(In(e.documentSelector),new dOe(this._connection,e))))}},dOe=class{constructor(o,e){this._client=o,this._capabilities=e}getLegend(){return{tokenTypes:this._capabilities.legend.tokenTypes,tokenModifiers:this._capabilities.legend.tokenModifiers}}releaseDocumentSemanticTokens(o){}async provideDocumentSemanticTokens(o,e,t){const i=this._client.bridge.translate(o,o.getPositionAt(0)),n=this._capabilities.full;if(e&&n&&typeof n=="object"&&n.delta){const r=await this._client.server.textDocumentSemanticTokensFullDelta({textDocument:i.textDocument,previousResultId:e});return r?"edits"in r?{resultId:r.resultId,edits:r.edits.map(a=>({start:a.start,deleteCount:a.deleteCount,data:a.data?new Uint32Array(a.data):void 0}))}:{resultId:r.resultId,data:new Uint32Array(r.data)}:null}const s=await this._client.server.textDocumentSemanticTokensFull({textDocument:i.textDocument});return s?{resultId:s.resultId,data:new Uint32Array(s.data)}:null}async provideDocumentSemanticTokensEdits(o,e,t){return this.provideDocumentSemanticTokens(o,e,t)}},hOe=class extends Wi{constructor(o){super(),ve(this,"_diagnosticsMarkerOwner","lsp"),ve(this,"_pullDiagnosticProviders",new Map),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[...SX.keys()]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0},diagnostic:{dynamicRegistration:!0,relatedDocumentSupport:!0}}}));debugger;this._register(this._connection.connection.registerNotificationHandler(nw.client.textDocumentPublishDiagnostics,e=>this._handlePublishDiagnostics(e))),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentDiagnostic,!0,e=>{const t=new x3;for(const i of Dl.getModels())this._addPullDiagnosticProvider(i,e,t);return t.add(Dl.onDidCreateModel(i=>{this._addPullDiagnosticProvider(i,e,t)})),t}))}_addPullDiagnosticProvider(o,e,t){if(o.getLanguageId(),!mAe(o,e.documentSelector))return;const i=new uOe(o,this._connection,this._diagnosticsMarkerOwner,e);this._pullDiagnosticProviders.set(o,i),t.add(i),t.add(o.onWillDispose(()=>{this._pullDiagnosticProviders.delete(o)}))}_handlePublishDiagnostics(o){const e=o.uri;try{const t=this._connection.bridge.translateBack({uri:e},{line:0,character:0}).textModel;if(!t||t.isDisposed())return;const i=o.diagnostics.map(n=>RA(n));Dl.setModelMarkers(t,this._diagnosticsMarkerOwner,i)}catch(t){console.debug(`Could not set diagnostics for ${e}:`,t)}}},uOe=class extends Wi{constructor(o,e,t,i){super(),ve(this,"_updateHandle"),ve(this,"_previousResultId"),this._model=o,this._connection=e,this._markerOwner=t,this._capability=i,this._register(this._model.onDidChangeContent(()=>{this._scheduleDiagnosticUpdate()})),this._scheduleDiagnosticUpdate()}_scheduleDiagnosticUpdate(){this._updateHandle!==void 0&&clearTimeout(this._updateHandle),this._updateHandle=window.setTimeout(()=>{this._updateHandle=void 0,this._requestDiagnostics()},500)}async _requestDiagnostics(){if(!this._model.isDisposed())try{const o=this._connection.bridge.translate(this._model,new _d(1,1)),e=await this._connection.server.textDocumentDiagnostic({textDocument:o.textDocument,identifier:this._capability.identifier,previousResultId:this._previousResultId});if(this._model.isDisposed())return;this._handleDiagnosticReport(e)}catch(o){console.error("Error requesting diagnostics:",o)}}_handleDiagnosticReport(o){if(o.kind==="full"){this._previousResultId=o.resultId;const e=o.items.map(t=>RA(t));Dl.setModelMarkers(this._model,this._markerOwner,e),"relatedDocuments"in o&&o.relatedDocuments&&this._handleRelatedDocuments(o.relatedDocuments)}else o.kind==="unchanged"&&(this._previousResultId=o.resultId)}_handleRelatedDocuments(o){for(const[e,t]of Object.entries(o))try{const i=this._connection.bridge.translateBack({uri:e},{line:0,character:0}).textModel;if(!i||i.isDisposed())continue;if(t.kind==="full"){const n=t.items.map(s=>RA(s));Dl.setModelMarkers(i,this._markerOwner,n)}}catch(i){console.debug(`Could not set related diagnostics for ${e}:`,i)}}dispose(){this._updateHandle!==void 0&&(clearTimeout(this._updateHandle),this._updateHandle=void 0),super.dispose()}},gOe=class{constructor(o,e,t,i){this.server=o,this.bridge=e,this.capabilities=t,this.connection=i}},fOe=class extends Wi{constructor(o){super(),ve(this,"_staticCapabilities",new Set),ve(this,"_dynamicFromStatic",_Oe.create()),ve(this,"_registrations",new Map),ve(this,"_serverCapabilities"),this._connection=o,this._register(this._connection.registerRequestHandler(nw.client.clientRegisterCapability,async e=>{for(const t of e.registrations){const i=gV(t.method),n=new uV(t.id,i,t.registerOptions,!1);this._registerCapabilityOptions(n)}return{ok:null}})),this._register(this._connection.registerRequestHandler(nw.client.clientUnregisterCapability,async e=>{for(const t of e.unregisterations){const i=gV(t.method),n=this._registrations.get(i),s=n?.registrations.get(t.id);if(!s)throw new Error(`No registration for method ${t.method} with id ${t.id}`);s?.handlerDisposables.forEach(r=>r.dispose()),n?.registrations.delete(t.id)}return{ok:null}}))}_registerCapabilityOptions(o){let e=this._registrations.get(o.capability);if(e||(e=new fV,this._registrations.set(o.capability,e)),e.registrations.has(o.id))throw new Error(`Handler for method ${o.capability.method} with id ${o.id} already registered`);e.registrations.set(o.id,o);for(const t of e.handlers)!t.handleStaticCapability&&o.isFromStatic||o.handlerDisposables.set(t,t.handler(o.options))}setServerCapabilities(o){if(this._serverCapabilities)throw new Error("Server capabilities already set");this._serverCapabilities=o;for(const e of Object.values(qe)){const t=this._dynamicFromStatic.getOptions(e,o);t&&this._registerCapabilityOptions(new uV(e.method,e,t,!0))}}getClientCapabilities(){const o={};for(const e of this._staticCapabilities)kX(o,e.cap);return o}addStaticClientCapabilities(o){const e={cap:o};return this._staticCapabilities.add(e),{dispose:()=>{this._staticCapabilities.delete(e)}}}registerCapabilityHandler(o,e,t){let i=this._registrations.get(o);i||(i=new fV,this._registrations.set(o,i));const n=new pOe(o,e,t);i.handlers.add(n);for(const s of i.registrations.values())!n.handleStaticCapability&&s.isFromStatic||s.handlerDisposables.set(n,t(s.options));return{dispose:()=>{i.handlers.delete(n);for(const s of i.registrations.values()){const r=s.handlerDisposables.get(n);r&&(r.dispose(),s.handlerDisposables.delete(n))}}}}},pOe=class{constructor(o,e,t){this.capability=o,this.handleStaticCapability=e,this.handler=t}},uV=class{constructor(o,e,t,i){ve(this,"handlerDisposables",new Map),this.id=o,this.capability=e,this.options=t,this.isFromStatic=i}};const mOe=new Map([...Object.values(qe)].map(o=>[o.method,o]));function gV(o){const e=mOe.get(o);if(!e)throw new Error(`No capability found for method ${o}`);return e}var fV=class{constructor(){ve(this,"handlers",new Set),ve(this,"registrations",new Map)}},_Oe=class LX{constructor(){ve(this,"_mappings",new Map)}static create(){const e=new LX;return e.set(qe.textDocumentDidChange,t=>{if(t.textDocumentSync!==void 0)return typeof t.textDocumentSync=="object"?{syncKind:t.textDocumentSync.change??UPe.None,documentSelector:null}:{syncKind:t.textDocumentSync,documentSelector:null}}),e.set(qe.textDocumentCompletion,t=>t.completionProvider),e.set(qe.textDocumentHover,t=>t.hoverProvider),e.set(qe.textDocumentSignatureHelp,t=>t.signatureHelpProvider),e.set(qe.textDocumentDefinition,t=>t.definitionProvider),e.set(qe.textDocumentReferences,t=>t.referencesProvider),e.set(qe.textDocumentDocumentHighlight,t=>t.documentHighlightProvider),e.set(qe.textDocumentDocumentSymbol,t=>t.documentSymbolProvider),e.set(qe.textDocumentCodeAction,t=>t.codeActionProvider),e.set(qe.textDocumentCodeLens,t=>t.codeLensProvider),e.set(qe.textDocumentDocumentLink,t=>t.documentLinkProvider),e.set(qe.textDocumentFormatting,t=>t.documentFormattingProvider),e.set(qe.textDocumentRangeFormatting,t=>t.documentRangeFormattingProvider),e.set(qe.textDocumentOnTypeFormatting,t=>t.documentOnTypeFormattingProvider),e.set(qe.textDocumentRename,t=>t.renameProvider),e.set(qe.textDocumentFoldingRange,t=>t.foldingRangeProvider),e.set(qe.textDocumentDeclaration,t=>t.declarationProvider),e.set(qe.textDocumentTypeDefinition,t=>t.typeDefinitionProvider),e.set(qe.textDocumentImplementation,t=>t.implementationProvider),e.set(qe.textDocumentDocumentColor,t=>t.colorProvider),e.set(qe.textDocumentSelectionRange,t=>t.selectionRangeProvider),e.set(qe.textDocumentLinkedEditingRange,t=>t.linkedEditingRangeProvider),e.set(qe.textDocumentPrepareCallHierarchy,t=>t.callHierarchyProvider),e.set(qe.textDocumentSemanticTokensFull,t=>t.semanticTokensProvider),e.set(qe.textDocumentInlayHint,t=>t.inlayHintProvider),e.set(qe.textDocumentInlineValue,t=>t.inlineValueProvider),e.set(qe.textDocumentDiagnostic,t=>t.diagnosticProvider),e.set(qe.textDocumentMoniker,t=>t.monikerProvider),e.set(qe.textDocumentPrepareTypeHierarchy,t=>t.typeHierarchyProvider),e.set(qe.workspaceSymbol,t=>t.workspaceSymbolProvider),e.set(qe.workspaceExecuteCommand,t=>t.executeCommandProvider),e}set(e,t){if(this._mappings.has(e.method))throw new Error(`Capability for method ${e.method} already registered`);this._mappings.set(e.method,t)}getOptions(e,t){const i=this._mappings.get(e.method);if(i)return i(t)}};function kX(o,e){for(const t of Object.keys(e)){const i=e[t];if(i===void 0)continue;const n=o[t];if(n===void 0){o[t]=i;continue}if(typeof i!="object"||i===null){o[t]=i;continue}if(typeof n!="object"||n===null){o[t]=i;continue}kX(n,i)}}var bOe=class extends Wi{constructor(o,e){super(),ve(this,"_managedModels",new Map),ve(this,"_managedModelsReverse",new Map),ve(this,"_started",!1),this._server=o,this._capabilities=e,this._register(this._capabilities.addStaticClientCapabilities({textDocument:{synchronization:{dynamicRegistration:!0,willSave:!1,willSaveWaitUntil:!1,didSave:!1}}})),this._register(e.registerCapabilityHandler(qe.textDocumentDidChange,!0,t=>{if(this._started)return{dispose:()=>{}};this._started=!0,this._register(Dl.onDidCreateModel(i=>{this._getOrCreateManagedModel(i)}));for(const i of Dl.getModels())this._getOrCreateManagedModel(i);return{dispose:()=>{}}}))}_getOrCreateManagedModel(o){if(!this._started)throw new Error("Not started");const e=o.uri.toString(!0).toLowerCase();let t=this._managedModels.get(o);return t||(t=new COe(o,this._server),this._managedModels.set(o,t),this._managedModelsReverse.set(e,o)),o.onWillDispose(()=>{t.dispose(),this._managedModels.delete(o),this._managedModelsReverse.delete(e)}),t}translateBack(o,e){const t=o.uri.toLowerCase(),i=this._managedModelsReverse.get(t);if(!i)throw new Error(`No text model for uri ${t}`);return{textModel:i,position:new _d(e.line+1,e.character+1)}}translateBackRange(o,e){const t=o.uri.toLowerCase(),i=this._managedModelsReverse.get(t);if(!i)throw new Error(`No text model for uri ${t}`);return{textModel:i,range:new x_(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}}translate(o,e){return{textDocument:{uri:o.uri.toString(!0)},position:{line:e.lineNumber-1,character:e.column-1}}}translateRange(o,e){return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}},COe=class extends Wi{constructor(o,e){super(),this._textModel=o,this._api=e;const t=o.uri.toString(!0).toLowerCase();this._api.textDocumentDidOpen({textDocument:{languageId:o.getLanguageId(),uri:t,version:o.getVersionId(),text:o.getValue()}}),this._register(o.onDidChangeContent(i=>{const n=i.changes.map(s=>vOe(s));this._api.textDocumentDidChange({textDocument:{uri:t,version:o.getVersionId()},contentChanges:n})})),this._register({dispose:()=>{this._api.textDocumentDidClose({textDocument:{uri:t}})}})}};function vOe(o){return{range:wOe(o.range),rangeLength:o.rangeLength,text:o.text}}function wOe(o){return{start:{line:o.startLineNumber-1,character:o.startColumn-1},end:{line:o.endLineNumber-1,character:o.endColumn-1}}}var SOe=class{constructor(o){ve(this,"_connection"),ve(this,"_capabilitiesRegistry"),ve(this,"_bridge"),ve(this,"_initPromise");const e=EA.fromTransport(o),t=nw.getServer(e,{});e.startListen(),this._capabilitiesRegistry=new fOe(e),this._bridge=new bOe(t.server,this._capabilitiesRegistry),this._connection=new gOe(t.server,this._bridge,this._capabilitiesRegistry,e),this.createFeatures(),this._initPromise=this._init()}async _init(){const o=await this._connection.server.initialize({processId:null,capabilities:this._capabilitiesRegistry.getClientCapabilities(),rootUri:null});this._connection.server.initialized({}),this._capabilitiesRegistry.setServerCapabilities(o.capabilities)}createFeatures(){const o=new x3;return o.add(new _Ae(this._connection)),o.add(new wAe(this._connection)),o.add(new xAe(this._connection)),o.add(new kAe(this._connection)),o.add(new IAe(this._connection)),o.add(new NAe(this._connection)),o.add(new RAe(this._connection)),o.add(new PAe(this._connection)),o.add(new OAe(this._connection)),o.add(new WAe(this._connection)),o.add(new VAe(this._connection)),o.add(new $Ae(this._connection)),o.add(new qAe(this._connection)),o.add(new GAe(this._connection)),o.add(new YAe(this._connection)),o.add(new QAe(this._connection)),o.add(new eOe(this._connection)),o.add(new iOe(this._connection)),o.add(new sOe(this._connection)),o.add(new rOe(this._connection)),o.add(new cOe(this._connection)),o.add(new hOe(this._connection)),o}},ip=null;typeof WebSocket<"u"?ip=WebSocket:typeof MozWebSocket<"u"?ip=MozWebSocket:typeof global<"u"?ip=global.WebSocket||global.MozWebSocket:typeof window<"u"?ip=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ip=self.WebSocket||self.MozWebSocket);var yOe=ip;function xOe(o){return"host"in o?{address:`${o.forceTls?"wss":"ws"}://${o.host}:${o.port}`}:o}var LOe=class PA extends rX{constructor(e){super(),ve(this,"socket"),ve(this,"errorEmitter",new y3),ve(this,"onError",this.errorEmitter),this.socket=e,e.onmessage=t=>{try{const i=t.data;if(typeof i=="string"){const n=JSON.parse(i);this._dispatchReceivedMessage(n)}else throw new Error("Not supported")}catch(i){this.errorEmitter.fire({error:i})}},e.onclose=t=>{this._onConnectionClosed()}}static connectTo(e){const t=new yOe(xOe(e).address);return new Promise((i,n)=>{t.onerror=s=>{n(s)},t.onopen=()=>{i(new PA(t))}})}static fromWebSocket(e){return new PA(e)}close(){this.socket.close()}dispose(){this.close()}_sendImpl(e){const t=JSON.stringify(e);return new Promise((i,n)=>{this.socket.send(t,s=>{s?n(s):i()})})}toString(){return`${this.id}@${this.socket.url}`}},DX=class extends rX{constructor(o,e=void 0,t=void 0){super(),ve(this,"_windowLike"),ve(this,"_source"),ve(this,"_loadingState"),ve(this,"_disposed",!1),ve(this,"_messageHandler",({data:i,source:n})=>{this._source&&n!==this._source||typeof i=="object"&&i&&this._dispatchReceivedMessage(i)}),this._windowLike=o,this._source=e,this._loadingState=t,this._windowLike.addEventListener("message",this._messageHandler)}async _sendImpl(o){if(this._disposed)throw new Error("Transport is disposed");this._loadingState&&!this._loadingState.loaded&&await this._loadingState.onLoaded,this._windowLike.postMessage(o)}toString(){return`${this.id}@${this._windowLike}`}dispose(){this._disposed||(this._disposed=!0,this._windowLike.removeEventListener("message",this._messageHandler))}};function kOe(o){if(typeof window>"u")throw new Error("call this function from the main browser thread");return new DX(o)}function DOe(o){if(typeof window>"u")throw new Error("call this function from the main browser thread");return new DX(o.contentWindow,o.contentWindow,{loaded:window.document.readyState==="complete",onLoaded:new Promise(e=>{window.addEventListener("load",()=>e())})})}const IOe=Object.freeze(Object.defineProperty({__proto__:null,MonacoLspClient:SOe,WebSocketTransport:LOe,createTransportToIFrame:DOe,createTransportToWorker:kOe},Symbol.toStringTag,{value:"Module"}));function EOe(o,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(o,e)}catch(i){console.error(i);return}try{return globalThis.trustedTypes?.createPolicy(o,e)}catch(i){console.error(i);return}}let oL;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?oL=globalThis.workerttPolicy:oL=EOe("defaultWorkerFactory",{createScriptURL:o=>o});function NOe(o){const e=o.label,t=globalThis.MonacoEnvironment;if(t){if(typeof t.getWorker=="function")return t.getWorker("workerMain.js",e);if(typeof t.getWorkerUrl=="function"){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(oL?oL.createScriptURL(i):i,{name:e,type:"module"})}}if(o.createWorker)return o.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function TOe(o){const e=Promise.resolve(NOe({label:o.label??"monaco-editor-worker",moduleId:o.moduleId,createWorker:o.createWorker})).then(t=>(t.postMessage("ignore"),t.postMessage(o.createData),t));return Dl.createWebWorker({worker:e,host:o.host,keepIdleModels:o.keepIdleModels})}function IX(){return hPe}const ROe=globalThis.MonacoEnvironment;ROe?.globalAPI&&(globalThis.monaco=IX());const mD=IX();mD.languages.css=VY;mD.languages.html=jY;mD.languages.typescript=sX;mD.languages.json=GY;const fWe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:RY,Emitter:Ph,KeyCode:MY,KeyMod:PY,MarkerSeverity:Zr,MarkerTag:nL,Position:_d,Range:x_,Selection:AY,SelectionDirection:OY,Token:FY,Uri:hD,createWebWorker:TOe,css:VY,editor:Dl,html:jY,json:GY,languages:de,lsp:IOe,typescript:sX},Symbol.toStringTag,{value:"Module"}));export{Zr as M,x_ as R,hD as U,nL as a,fWe as b,TOe as c,Dl as e,de as l,iX as t}; diff --git a/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CBECm49E.js b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CBECm49E.js new file mode 100644 index 000000000..568a1ef74 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CBECm49E.js @@ -0,0 +1,99 @@ +import{g as zt}from"./chunk-XXDRQBXY-O3ugxnCs.js";import{s as Ut}from"./chunk-POPQ4Y6H-ClOHKyvb.js";import{_ as p,b as Kt,a as Zt,s as jt,g as qt,n as Wt,o as Ht,c as $,l as M,k as Qt,p as Xt,q as Jt,r as $t,t as te,u as ee,v as se,j as ie,x as re}from"./mermaidParser.worker-DimdFOud.js";import{c as ne}from"./channel-BKkxHUFp.js";var Tt=(function(){var e=p(function(V,n,o,h){for(o=o||{},h=V.length;h--;o[V[h]]=n);return o},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],c=[1,9],b=[1,10],k=[1,11],f=[1,12],S=[1,30],d=[1,23],g=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],A=[1,28],U=[1,29],N=[1,20],I=[1,18],R=[1,21],v=[1,22],Ot=[2,6],l=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],K=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],D=[1,46],L=[1,47],Z=[1,57],j=[43,51,53,54,55,74,75],q=[1,70],W=[1,68],w=[1,65],H=[1,69],Q=[1,71],tt=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],et=[1,78],st=[1,77],it=[1,76],xt=[69,70,71,72,73],Nt=[1,91],Ct=[6,9,45,50],P=[6,9,12,44,45,50,51,52],rt=[1,101],nt=[1,100],at=[1,99],X=[18,61],At=[1,110],It=[1,109],Rt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:p(function(n,o,h,i,y,t,J){var s=t.length-1;switch(y){case 1:break;case 2:this.$=[];break;case 3:this.$=t[s-1].concat(t[s]);break;case 4:this.$=t[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[s-4]),i.addEntity(t[s-2]),i.addRelationship(t[s-4],t[s],t[s-2],t[s-3]),this.$=[t[s-4],t[s-2]];break;case 8:i.addEntity(t[s-8]),i.addEntity(t[s-4]),i.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),i.setClass([t[s-8]],t[s-6]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-8],t[s-4]];break;case 9:i.addEntity(t[s-6]),i.addEntity(t[s-2]),i.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),i.setClass([t[s-6]],t[s-4]),this.$=[t[s-6],t[s-2]];break;case 10:i.addEntity(t[s-6]),i.addEntity(t[s-4]),i.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-6],t[s-4]];break;case 11:i.addEntity(t[s-3]),i.addAttributes(t[s-3],t[s-1]),this.$=[t[s-3]];break;case 12:i.addEntity(t[s-5]),i.addAttributes(t[s-5],t[s-1]),i.setClass([t[s-5]],t[s-3]),this.$=[t[s-5]];break;case 13:i.addEntity(t[s-2]),this.$=[t[s-2]];break;case 14:i.addEntity(t[s-4]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-4]];break;case 15:i.addEntity(t[s]),this.$=[t[s]];break;case 16:i.addEntity(t[s-2]),i.setClass([t[s-2]],t[s]),this.$=[t[s-2]];break;case 17:i.addEntity(t[s-6],t[s-4]),i.addAttributes(t[s-6],t[s-1]),this.$=[t[s-6]];break;case 18:i.addEntity(t[s-8],t[s-6]),i.addAttributes(t[s-8],t[s-1]),i.setClass([t[s-8]],t[s-3]),this.$=[t[s-8]];break;case 19:i.addEntity(t[s-5],t[s-3]),this.$=[t[s-5]];break;case 20:i.addEntity(t[s-7],t[s-5]),i.setClass([t[s-7]],t[s-2]),this.$=[t[s-7]];break;case 21:i.addEntity(t[s-3],t[s-1]);break;case 22:i.addEntity(t[s-5],t[s-3]),i.setClass([t[s-5]],t[s]);break;case 23:case 24:this.$=t[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[s]:(i.setDirection(t[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[s-2].id},t[s-1],{text:t[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-1],text:t[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-4],text:t[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[s];break;case 35:this.$=t[s-1]+" "+t[s];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[s-3],i.addClass(t[s-2],t[s-1]);break;case 41:case 42:case 63:case 72:this.$=[t[s]];break;case 43:case 44:this.$=t[s-2].concat([t[s]]);break;case 45:this.$=t[s-2],i.setClass(t[s-1],t[s]);break;case 46:this.$=t[s-3],i.addCssStyles(t[s-2],t[s-1]);break;case 47:this.$=[t[s]];break;case 48:t[s-2].push(t[s]),this.$=t[s-2];break;case 50:this.$=t[s-1]+t[s];break;case 58:case 84:case 85:this.$=t[s].replace(/"/g,"");break;case 64:t[s].push(t[s-1]),this.$=t[s];break;case 65:this.$={type:t[s-1],name:t[s]};break;case 66:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 67:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 68:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 69:case 71:case 74:this.$=t[s];break;case 70:this.$=t[s-1]+t[s];break;case 73:t[s-2].push(t[s]),this.$=t[s-2];break;case 75:this.$=t[s].replace(/"/g,"");break;case 76:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(a,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},e(a,Ot,{1:[2,1]}),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e(l,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(l,[2,26]),e(l,[2,27]),e(l,[2,28]),e(l,[2,29]),e(l,[2,30]),e(l,u,{5:44}),e(K,[2,58]),e(K,[2,59]),e(K,[2,60]),e(K,[2,61]),e(K,[2,62]),e(l,[2,36]),e(l,[2,37]),e(l,[2,38]),e(l,[2,39]),{15:45,43:D,44:L},{15:48,43:D,44:L},{15:49,43:D,44:L},{10:50,43:m,51:N,53:I,54:R,55:v},{10:51,43:m,51:N,53:I,54:R,55:v},{15:52,43:D,44:L},{17:53,18:[1,54],56:55,57:56,61:Z},{10:58,43:m,51:N,53:I,54:R,55:v},{68:59,74:[1,60],75:[1,61]},e(j,[2,77]),e(j,[2,78]),e(j,[2,79]),e(j,[2,80]),e(j,[2,81]),e(l,[2,23]),e(l,[2,24]),e(l,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},{12:q,42:64,44:W,45:w,48:66,49:67,51:H,52:Q},e(tt,[2,41]),e(tt,[2,42]),{15:72,43:D,44:L,45:w},{12:q,42:73,44:W,45:w,48:66,49:67,51:H,52:Q},{6:et,9:st,19:[1,75],35:74,50:it},{12:[1,79],14:[1,80]},e(l,[2,16],{67:35,11:81,16:[1,82],45:w,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},e(l,[2,13]),{17:84,18:[2,63],56:55,57:56,61:Z},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},e(xt,[2,82]),e(xt,[2,83]),e(l,[2,31]),e(l,Ot),{6:et,9:st,35:90,45:Nt,50:it},{43:[1,92],44:[1,93]},e(Ct,[2,47],{49:94,12:q,44:W,51:H,52:Q}),e(P,[2,49]),e(P,[2,54]),e(P,[2,55]),e(P,[2,56]),e(P,[2,57]),e(l,[2,45],{45:w}),{6:et,9:st,35:95,45:Nt,50:it},e(l,[2,32]),{10:97,36:96,43:m,51:N,53:I,54:R,55:v},e(l,[2,51]),e(l,[2,52]),e(l,[2,53]),{13:98,43:rt,53:nt,76:at},{15:102,43:D,44:L},{10:103,43:m,51:N,53:I,54:R,55:v},{17:104,18:[1,105],56:55,57:56,61:Z},e(l,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:At,66:It}),e([18,61,65,66],[2,71]),{61:[2,70]},e(l,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(l,[2,40]),{12:q,44:W,48:113,49:67,51:H,52:Q},e(tt,[2,43]),e(tt,[2,44]),e(P,[2,50]),e(l,[2,46]),{10:115,20:[1,114],43:m,51:N,53:I,54:R,55:v},e(Rt,[2,34]),e(l,[2,7]),e(l,[2,84]),e(l,[2,85]),e(l,[2,86]),{12:[1,116],45:w},{12:[1,118],14:[1,117]},{18:[1,119]},e(l,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:It}),e(X,[2,67]),e(yt,[2,72]),e(X,[2,75]),e(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:Z},{15:124,43:D,44:L},e(Ct,[2,48],{49:94,12:q,44:W,51:H,52:Q}),{6:et,9:st,35:125,50:it},e(Rt,[2,35]),{13:126,43:rt,53:nt,76:at},{15:127,43:D,44:L},{13:128,43:rt,53:nt,76:at},e(l,[2,12]),e(X,[2,68]),{63:129,65:At},{18:[1,130]},e(l,[2,19]),e(l,[2,22],{16:[1,131],45:w}),e(l,[2,33]),e(l,[2,10]),{12:[1,132],45:w},e(l,[2,9]),e(yt,[2,73]),e(l,[2,17]),{17:133,18:[1,134],56:55,57:56,61:Z},{13:135,43:rt,53:nt,76:at},{18:[1,136]},e(l,[2,20]),e(l,[2,8]),e(l,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:p(function(n,o){if(o.recoverable)this.trace(n);else{var h=new Error(n);throw h.hash=o,h}},"parseError"),parse:p(function(n){var o=this,h=[0],i=[],y=[null],t=[],J=this.table,s="",ct=0,vt=0,Gt=2,Dt=1,Ft=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(G.yy[kt]=this.yy[kt]);_.setInput(n,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var mt=_.yylloc;t.push(mt);var Yt=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pt(T){h.length=h.length-2*T,y.length=y.length-T,t.length=t.length-T}p(Pt,"popStack");function Lt(){var T;return T=i.pop()||_.lex()||Dt,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}p(Lt,"lex");for(var E,F,O,Et,z={},lt,C,wt,ht;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Lt()),O=J[F]&&J[F][E]),typeof O>"u"||!O.length||!O[0]){var St="";ht=[];for(lt in J[F])this.terminals_[lt]&<>Gt&&ht.push("'"+this.terminals_[lt]+"'");_.showPosition?St="Parse error on line "+(ct+1)+`: +`+_.showPosition()+` +Expecting `+ht.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(ct+1)+": Unexpected "+(E==Dt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:_.match,token:this.terminals_[E]||E,line:_.yylineno,loc:mt,expected:ht})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(O[0]){case 1:h.push(E),y.push(_.yytext),t.push(_.yylloc),h.push(O[1]),E=null,vt=_.yyleng,s=_.yytext,ct=_.yylineno,mt=_.yylloc;break;case 2:if(C=this.productions_[O[1]][1],z.$=y[y.length-C],z._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},Yt&&(z._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(z,[s,vt,ct,G.yy,O[1],y,t].concat(Ft)),typeof Et<"u")return Et;C&&(h=h.slice(0,-1*C*2),y=y.slice(0,-1*C),t=t.slice(0,-1*C)),h.push(this.productions_[O[1]][0]),y.push(z.$),t.push(z._$),wt=J[h[h.length-2]][h[h.length-1]],h.push(wt);break;case 3:return!0}}return!0},"parse")},Bt=(function(){var V={EOF:1,parseError:p(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw new Error(o)},"parseError"),setInput:p(function(n,o){return this.yy=o||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var o=n.length,h=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+o+"^"},"showPosition"),test_match:p(function(n,o){var h,i,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),i=n[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],h=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var t in y)this[t]=y[t];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,h,i;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;to[0].length)){if(o=h,i=t,this.options.backtrack_lexer){if(n=this.test_match(h,y[t]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,y[i]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(o,h,i,y){switch(i){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return h.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return h.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return V})();_t.lexer=Bt;function ot(){this.yy={}}return p(ot,"Parser"),ot.prototype=_t,_t.Parser=ot,new ot})();Tt.parser=Tt;var ae=Tt,oe=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Kt,this.getAccTitle=Zt,this.setAccDescription=jt,this.getAccDescription=qt,this.setDiagramTitle=Wt,this.getDiagramTitle=Ht,this.getConfig=p(()=>$().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{p(this,"ErDB")}addEntity(e,a=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&a&&(this.entities.get(e).alias=a,M.info(`Add alias '${a}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:a,shape:"erBox",look:$().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),M.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,a){const u=this.addEntity(e);let r;for(r=a.length-1;r>=0;r--)a[r].keys||(a[r].keys=[]),a[r].comment||(a[r].comment=""),u.attributes.push(a[r]),M.debug("Added attribute ",a[r].name)}addRelationship(e,a,u,r){let c;if(this.subGraphLookup.has(e))c=e;else{const f=this.addEntity(e);if(!f)return;c=f.id}let b;if(this.subGraphLookup.has(u))b=u;else{const f=this.addEntity(u);if(!f)return;b=f.id}const k={entityA:c,roleA:a,entityB:b,relSpec:r};this.relationships.push(k),M.debug("Added new relationship :",k)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let a=[];for(const u of e){const r=this.classes.get(u);r?.styles&&(a=[...a,...r.styles??[]].map(c=>c.trim())),r?.textStyles&&(a=[...a,...r.textStyles??[]].map(c=>c.trim()))}return a}addCssStyles(e,a){for(const u of e){const r=this.entities.get(u),c=this.subGraphLookup.get(u);if(a){if(r)for(const b of a)r.cssStyles.push(b);if(c){c.cssStyles||(c.cssStyles=[]);for(const b of a)c.cssStyles.push(b)}}}}addClass(e,a){e.forEach(u=>{let r=this.classes.get(u);r===void 0&&(r={id:u,styles:[],textStyles:[]},this.classes.set(u,r)),a&&a.forEach(function(c){if(/color/.exec(c)){const b=c.replace("fill","bgFill");r.textStyles.push(b)}r.styles.push(c)})})}addSubGraph(e,a,u){let r=e.text.trim(),c=u.text;const k=p(g=>{const x=new Set;let B;return{nodeList:g.filter(m=>{if(m?.stmt)return m.stmt==="dir"&&(B=m.value),!1;if(typeof m!="string")return!1;const A=m.trim();return!A||x.has(A)?!1:(x.add(A),!0)}),dir:B}},"uniq")(a.flat()),f=k.nodeList,S=k.dir;r=r??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;const d={id:r,nodes:f,title:c.trim(),classes:[],cssStyles:[],dir:S,labelType:this.sanitizeNodeLabelType(u?.type)};return M.info("Adding",d.id,d.nodes,d.dir),d.nodes=this.makeUniq(d,this.subGraphs).nodes,this.subGraphs.push(d),this.subGraphLookup.set(r,d),r}getSubGraphs(){return this.subGraphs}setClass(e,a){for(const u of e){const r=this.entities.get(u);if(r)for(const b of a)r.cssClasses+=" "+b;const c=this.subGraphLookup.get(u);if(c)for(const b of a)c.classes.push(b)}}subgraphNodeCache(e){const a=new Set;for(const u of e)for(const r of u.nodes)a.add(r);return a}makeUniq(e,a){const u=this.subgraphNodeCache(a),r=[];return e.nodes.forEach((c,b)=>{u.has(c)?M.warn(`Entity '${c}' already belongs to another subgraph and will be ignored`):r.push(e.nodes[b])}),{nodes:r}}sanitizeText(e){return Qt.sanitizeText(e,$())}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,Xt()}getData(){const e=[],a=[],u=$(),r=this.getSubGraphs(),c=new Map,b=new Map;for(let d=r.length-1;d>=0;d--){const g=r[d];g.nodes.length>0&&b.set(g.id,!0);for(const x of g.nodes)c.set(x,g.id)}for(let d=r.length-1;d>=0;d--){const g=r[d];e.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:c.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssStyles:g.cssStyles,cssClasses:g.classes.join(" "),shape:"rect",dir:g.dir,isGroup:!0,look:u.look})}const k=new Set(r.map(d=>d.id));let f=0;for(const d of this.entities.keys()){if(k.has(d))continue;const g=this.entities.get(d);g&&(g.cssCompiledStyles=this.getCompiledStyles(g.cssClasses.split(" ")),g.colorIndex=f++,e.push({...g,parentId:c.get(d),isGroup:!1}))}let S=0;for(const d of this.relationships){const g={id:Jt(d.entityA,d.entityB,{prefix:"id",counter:S++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:u.look,labelType:"markdown"};a.push(g)}return{nodes:e,edges:a,other:{},config:u,direction:this.direction}}},Mt={};te(Mt,{draw:()=>ce});var ce=p(async function(e,a,u,r){M.info("REF0:"),M.info("Drawing er diagram (unified)",a);const{securityLevel:c,er:b,layout:k}=$(),f=r.db.getData(),S=zt(a,c);f.type=r.type,f.layoutAlgorithm=ee(k),f.config.flowchart.nodeSpacing=b?.nodeSpacing||140,f.config.flowchart.rankSpacing=b?.rankSpacing||80,f.direction=r.db.getDirection();const{config:d}=f,{look:g}=d;g==="neo"?f.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:f.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],f.diagramId=a,await se(f,S),f.layoutAlgorithm==="elk"&&S.select(".edges").lower();const x=S.selectAll('[id*="-background"]');Array.from(x).length>0&&x.each(function(){const Y=ie(this),A=Y.attr("id").replace("-background",""),U=S.select(`#${CSS.escape(A)}`);if(!U.empty()){const N=U.attr("transform");Y.attr("transform",N)}});const B=8;re.insertTitle(S,"erDiagramTitleText",b?.titleTopMargin??25,r.db.getDiagramTitle()),Ut(S,B,"erDiagram",b?.useMaxWidth??!0)},"draw"),Vt=p((e,a)=>{const u=ne,r=u(e,"r"),c=u(e,"g"),b=u(e,"b");return $t(r,c,b,a)},"fade"),ut=new Set(["redux-color","redux-dark-color"]),le=p(e=>{const{theme:a,look:u,bkgColorArray:r,borderColorArray:c}=e;if(!ut.has(a))return"";const b=r?.length>0;let k="";for(let f=0;f{const{look:a,theme:u,erEdgeLabelBackground:r,strokeWidth:c}=e;return` + ${le(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${ut.has(u)&&r?r:Vt(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${ut.has(u)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${ut.has(u)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${a==="neo"?c:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${a==="neo"?c:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${Vt(e.tertiaryColor,.5)}; + } + + .cluster rect { + fill: ${e.clusterBkg??e.mainBkg}; + stroke: ${e.clusterBorder??e.nodeBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor??e.textColor}; + } + + .cluster-label text { + fill: ${e.titleColor??e.textColor}; + } +`},"getStyles"),ue=he,ge={parser:ae,get db(){return new oe},renderer:Mt,styles:ue};export{ge as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CyT2KwqT.js b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CyT2KwqT.js new file mode 100644 index 000000000..2bfce4c45 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-CyT2KwqT.js @@ -0,0 +1,99 @@ +import{g as zt}from"./chunk-XXDRQBXY-CiRZidGx.js";import{s as Ut}from"./chunk-POPQ4Y6H-Enw1vTgw.js";import{_ as p,b as Kt,a as Zt,s as jt,g as qt,p as Wt,q as Ht,c as $,l as M,k as Qt,r as Xt,t as Jt,u as $t,v as te,x as ee,y as se,j as ie,z as re}from"./mermaid.core-CM2luXFy.js";import{c as ne}from"./channel-vcmCqkai.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var Tt=(function(){var e=p(function(V,n,o,h){for(o=o||{},h=V.length;h--;o[V[h]]=n);return o},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],c=[1,9],b=[1,10],k=[1,11],f=[1,12],S=[1,30],d=[1,23],g=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],A=[1,28],U=[1,29],N=[1,20],I=[1,18],R=[1,21],v=[1,22],Ot=[2,6],l=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],K=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],D=[1,46],L=[1,47],Z=[1,57],j=[43,51,53,54,55,74,75],q=[1,70],W=[1,68],w=[1,65],H=[1,69],Q=[1,71],tt=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],et=[1,78],st=[1,77],it=[1,76],xt=[69,70,71,72,73],Nt=[1,91],Ct=[6,9,45,50],P=[6,9,12,44,45,50,51,52],rt=[1,101],nt=[1,100],at=[1,99],X=[18,61],At=[1,110],It=[1,109],Rt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:p(function(n,o,h,i,y,t,J){var s=t.length-1;switch(y){case 1:break;case 2:this.$=[];break;case 3:this.$=t[s-1].concat(t[s]);break;case 4:this.$=t[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[s-4]),i.addEntity(t[s-2]),i.addRelationship(t[s-4],t[s],t[s-2],t[s-3]),this.$=[t[s-4],t[s-2]];break;case 8:i.addEntity(t[s-8]),i.addEntity(t[s-4]),i.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),i.setClass([t[s-8]],t[s-6]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-8],t[s-4]];break;case 9:i.addEntity(t[s-6]),i.addEntity(t[s-2]),i.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),i.setClass([t[s-6]],t[s-4]),this.$=[t[s-6],t[s-2]];break;case 10:i.addEntity(t[s-6]),i.addEntity(t[s-4]),i.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-6],t[s-4]];break;case 11:i.addEntity(t[s-3]),i.addAttributes(t[s-3],t[s-1]),this.$=[t[s-3]];break;case 12:i.addEntity(t[s-5]),i.addAttributes(t[s-5],t[s-1]),i.setClass([t[s-5]],t[s-3]),this.$=[t[s-5]];break;case 13:i.addEntity(t[s-2]),this.$=[t[s-2]];break;case 14:i.addEntity(t[s-4]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-4]];break;case 15:i.addEntity(t[s]),this.$=[t[s]];break;case 16:i.addEntity(t[s-2]),i.setClass([t[s-2]],t[s]),this.$=[t[s-2]];break;case 17:i.addEntity(t[s-6],t[s-4]),i.addAttributes(t[s-6],t[s-1]),this.$=[t[s-6]];break;case 18:i.addEntity(t[s-8],t[s-6]),i.addAttributes(t[s-8],t[s-1]),i.setClass([t[s-8]],t[s-3]),this.$=[t[s-8]];break;case 19:i.addEntity(t[s-5],t[s-3]),this.$=[t[s-5]];break;case 20:i.addEntity(t[s-7],t[s-5]),i.setClass([t[s-7]],t[s-2]),this.$=[t[s-7]];break;case 21:i.addEntity(t[s-3],t[s-1]);break;case 22:i.addEntity(t[s-5],t[s-3]),i.setClass([t[s-5]],t[s]);break;case 23:case 24:this.$=t[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[s]:(i.setDirection(t[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[s-2].id},t[s-1],{text:t[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-1],text:t[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-4],text:t[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[s];break;case 35:this.$=t[s-1]+" "+t[s];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[s-3],i.addClass(t[s-2],t[s-1]);break;case 41:case 42:case 63:case 72:this.$=[t[s]];break;case 43:case 44:this.$=t[s-2].concat([t[s]]);break;case 45:this.$=t[s-2],i.setClass(t[s-1],t[s]);break;case 46:this.$=t[s-3],i.addCssStyles(t[s-2],t[s-1]);break;case 47:this.$=[t[s]];break;case 48:t[s-2].push(t[s]),this.$=t[s-2];break;case 50:this.$=t[s-1]+t[s];break;case 58:case 84:case 85:this.$=t[s].replace(/"/g,"");break;case 64:t[s].push(t[s-1]),this.$=t[s];break;case 65:this.$={type:t[s-1],name:t[s]};break;case 66:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 67:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 68:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 69:case 71:case 74:this.$=t[s];break;case 70:this.$=t[s-1]+t[s];break;case 73:t[s-2].push(t[s]),this.$=t[s-2];break;case 75:this.$=t[s].replace(/"/g,"");break;case 76:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(a,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},e(a,Ot,{1:[2,1]}),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e(l,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(l,[2,26]),e(l,[2,27]),e(l,[2,28]),e(l,[2,29]),e(l,[2,30]),e(l,u,{5:44}),e(K,[2,58]),e(K,[2,59]),e(K,[2,60]),e(K,[2,61]),e(K,[2,62]),e(l,[2,36]),e(l,[2,37]),e(l,[2,38]),e(l,[2,39]),{15:45,43:D,44:L},{15:48,43:D,44:L},{15:49,43:D,44:L},{10:50,43:m,51:N,53:I,54:R,55:v},{10:51,43:m,51:N,53:I,54:R,55:v},{15:52,43:D,44:L},{17:53,18:[1,54],56:55,57:56,61:Z},{10:58,43:m,51:N,53:I,54:R,55:v},{68:59,74:[1,60],75:[1,61]},e(j,[2,77]),e(j,[2,78]),e(j,[2,79]),e(j,[2,80]),e(j,[2,81]),e(l,[2,23]),e(l,[2,24]),e(l,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},{12:q,42:64,44:W,45:w,48:66,49:67,51:H,52:Q},e(tt,[2,41]),e(tt,[2,42]),{15:72,43:D,44:L,45:w},{12:q,42:73,44:W,45:w,48:66,49:67,51:H,52:Q},{6:et,9:st,19:[1,75],35:74,50:it},{12:[1,79],14:[1,80]},e(l,[2,16],{67:35,11:81,16:[1,82],45:w,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},e(l,[2,13]),{17:84,18:[2,63],56:55,57:56,61:Z},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},e(xt,[2,82]),e(xt,[2,83]),e(l,[2,31]),e(l,Ot),{6:et,9:st,35:90,45:Nt,50:it},{43:[1,92],44:[1,93]},e(Ct,[2,47],{49:94,12:q,44:W,51:H,52:Q}),e(P,[2,49]),e(P,[2,54]),e(P,[2,55]),e(P,[2,56]),e(P,[2,57]),e(l,[2,45],{45:w}),{6:et,9:st,35:95,45:Nt,50:it},e(l,[2,32]),{10:97,36:96,43:m,51:N,53:I,54:R,55:v},e(l,[2,51]),e(l,[2,52]),e(l,[2,53]),{13:98,43:rt,53:nt,76:at},{15:102,43:D,44:L},{10:103,43:m,51:N,53:I,54:R,55:v},{17:104,18:[1,105],56:55,57:56,61:Z},e(l,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:At,66:It}),e([18,61,65,66],[2,71]),{61:[2,70]},e(l,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(l,[2,40]),{12:q,44:W,48:113,49:67,51:H,52:Q},e(tt,[2,43]),e(tt,[2,44]),e(P,[2,50]),e(l,[2,46]),{10:115,20:[1,114],43:m,51:N,53:I,54:R,55:v},e(Rt,[2,34]),e(l,[2,7]),e(l,[2,84]),e(l,[2,85]),e(l,[2,86]),{12:[1,116],45:w},{12:[1,118],14:[1,117]},{18:[1,119]},e(l,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:It}),e(X,[2,67]),e(yt,[2,72]),e(X,[2,75]),e(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:Z},{15:124,43:D,44:L},e(Ct,[2,48],{49:94,12:q,44:W,51:H,52:Q}),{6:et,9:st,35:125,50:it},e(Rt,[2,35]),{13:126,43:rt,53:nt,76:at},{15:127,43:D,44:L},{13:128,43:rt,53:nt,76:at},e(l,[2,12]),e(X,[2,68]),{63:129,65:At},{18:[1,130]},e(l,[2,19]),e(l,[2,22],{16:[1,131],45:w}),e(l,[2,33]),e(l,[2,10]),{12:[1,132],45:w},e(l,[2,9]),e(yt,[2,73]),e(l,[2,17]),{17:133,18:[1,134],56:55,57:56,61:Z},{13:135,43:rt,53:nt,76:at},{18:[1,136]},e(l,[2,20]),e(l,[2,8]),e(l,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:p(function(n,o){if(o.recoverable)this.trace(n);else{var h=new Error(n);throw h.hash=o,h}},"parseError"),parse:p(function(n){var o=this,h=[0],i=[],y=[null],t=[],J=this.table,s="",ct=0,vt=0,Gt=2,Dt=1,Ft=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(G.yy[kt]=this.yy[kt]);_.setInput(n,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var mt=_.yylloc;t.push(mt);var Yt=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pt(T){h.length=h.length-2*T,y.length=y.length-T,t.length=t.length-T}p(Pt,"popStack");function Lt(){var T;return T=i.pop()||_.lex()||Dt,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}p(Lt,"lex");for(var E,F,O,Et,z={},lt,C,wt,ht;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Lt()),O=J[F]&&J[F][E]),typeof O>"u"||!O.length||!O[0]){var St="";ht=[];for(lt in J[F])this.terminals_[lt]&<>Gt&&ht.push("'"+this.terminals_[lt]+"'");_.showPosition?St="Parse error on line "+(ct+1)+`: +`+_.showPosition()+` +Expecting `+ht.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(ct+1)+": Unexpected "+(E==Dt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:_.match,token:this.terminals_[E]||E,line:_.yylineno,loc:mt,expected:ht})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(O[0]){case 1:h.push(E),y.push(_.yytext),t.push(_.yylloc),h.push(O[1]),E=null,vt=_.yyleng,s=_.yytext,ct=_.yylineno,mt=_.yylloc;break;case 2:if(C=this.productions_[O[1]][1],z.$=y[y.length-C],z._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},Yt&&(z._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(z,[s,vt,ct,G.yy,O[1],y,t].concat(Ft)),typeof Et<"u")return Et;C&&(h=h.slice(0,-1*C*2),y=y.slice(0,-1*C),t=t.slice(0,-1*C)),h.push(this.productions_[O[1]][0]),y.push(z.$),t.push(z._$),wt=J[h[h.length-2]][h[h.length-1]],h.push(wt);break;case 3:return!0}}return!0},"parse")},Bt=(function(){var V={EOF:1,parseError:p(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw new Error(o)},"parseError"),setInput:p(function(n,o){return this.yy=o||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var o=n.length,h=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+o+"^"},"showPosition"),test_match:p(function(n,o){var h,i,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),i=n[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],h=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var t in y)this[t]=y[t];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,h,i;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;to[0].length)){if(o=h,i=t,this.options.backtrack_lexer){if(n=this.test_match(h,y[t]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,y[i]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(o,h,i,y){switch(i){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return h.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return h.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return V})();_t.lexer=Bt;function ot(){this.yy={}}return p(ot,"Parser"),ot.prototype=_t,_t.Parser=ot,new ot})();Tt.parser=Tt;var ae=Tt,oe=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Kt,this.getAccTitle=Zt,this.setAccDescription=jt,this.getAccDescription=qt,this.setDiagramTitle=Wt,this.getDiagramTitle=Ht,this.getConfig=p(()=>$().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{p(this,"ErDB")}addEntity(e,a=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&a&&(this.entities.get(e).alias=a,M.info(`Add alias '${a}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:a,shape:"erBox",look:$().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),M.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,a){const u=this.addEntity(e);let r;for(r=a.length-1;r>=0;r--)a[r].keys||(a[r].keys=[]),a[r].comment||(a[r].comment=""),u.attributes.push(a[r]),M.debug("Added attribute ",a[r].name)}addRelationship(e,a,u,r){let c;if(this.subGraphLookup.has(e))c=e;else{const f=this.addEntity(e);if(!f)return;c=f.id}let b;if(this.subGraphLookup.has(u))b=u;else{const f=this.addEntity(u);if(!f)return;b=f.id}const k={entityA:c,roleA:a,entityB:b,relSpec:r};this.relationships.push(k),M.debug("Added new relationship :",k)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let a=[];for(const u of e){const r=this.classes.get(u);r?.styles&&(a=[...a,...r.styles??[]].map(c=>c.trim())),r?.textStyles&&(a=[...a,...r.textStyles??[]].map(c=>c.trim()))}return a}addCssStyles(e,a){for(const u of e){const r=this.entities.get(u),c=this.subGraphLookup.get(u);if(a){if(r)for(const b of a)r.cssStyles.push(b);if(c){c.cssStyles||(c.cssStyles=[]);for(const b of a)c.cssStyles.push(b)}}}}addClass(e,a){e.forEach(u=>{let r=this.classes.get(u);r===void 0&&(r={id:u,styles:[],textStyles:[]},this.classes.set(u,r)),a&&a.forEach(function(c){if(/color/.exec(c)){const b=c.replace("fill","bgFill");r.textStyles.push(b)}r.styles.push(c)})})}addSubGraph(e,a,u){let r=e.text.trim(),c=u.text;const k=p(g=>{const x=new Set;let B;return{nodeList:g.filter(m=>{if(m?.stmt)return m.stmt==="dir"&&(B=m.value),!1;if(typeof m!="string")return!1;const A=m.trim();return!A||x.has(A)?!1:(x.add(A),!0)}),dir:B}},"uniq")(a.flat()),f=k.nodeList,S=k.dir;r=r??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;const d={id:r,nodes:f,title:c.trim(),classes:[],cssStyles:[],dir:S,labelType:this.sanitizeNodeLabelType(u?.type)};return M.info("Adding",d.id,d.nodes,d.dir),d.nodes=this.makeUniq(d,this.subGraphs).nodes,this.subGraphs.push(d),this.subGraphLookup.set(r,d),r}getSubGraphs(){return this.subGraphs}setClass(e,a){for(const u of e){const r=this.entities.get(u);if(r)for(const b of a)r.cssClasses+=" "+b;const c=this.subGraphLookup.get(u);if(c)for(const b of a)c.classes.push(b)}}subgraphNodeCache(e){const a=new Set;for(const u of e)for(const r of u.nodes)a.add(r);return a}makeUniq(e,a){const u=this.subgraphNodeCache(a),r=[];return e.nodes.forEach((c,b)=>{u.has(c)?M.warn(`Entity '${c}' already belongs to another subgraph and will be ignored`):r.push(e.nodes[b])}),{nodes:r}}sanitizeText(e){return Qt.sanitizeText(e,$())}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,Xt()}getData(){const e=[],a=[],u=$(),r=this.getSubGraphs(),c=new Map,b=new Map;for(let d=r.length-1;d>=0;d--){const g=r[d];g.nodes.length>0&&b.set(g.id,!0);for(const x of g.nodes)c.set(x,g.id)}for(let d=r.length-1;d>=0;d--){const g=r[d];e.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:c.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssStyles:g.cssStyles,cssClasses:g.classes.join(" "),shape:"rect",dir:g.dir,isGroup:!0,look:u.look})}const k=new Set(r.map(d=>d.id));let f=0;for(const d of this.entities.keys()){if(k.has(d))continue;const g=this.entities.get(d);g&&(g.cssCompiledStyles=this.getCompiledStyles(g.cssClasses.split(" ")),g.colorIndex=f++,e.push({...g,parentId:c.get(d),isGroup:!1}))}let S=0;for(const d of this.relationships){const g={id:Jt(d.entityA,d.entityB,{prefix:"id",counter:S++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:u.look,labelType:"markdown"};a.push(g)}return{nodes:e,edges:a,other:{},config:u,direction:this.direction}}},Mt={};te(Mt,{draw:()=>ce});var ce=p(async function(e,a,u,r){M.info("REF0:"),M.info("Drawing er diagram (unified)",a);const{securityLevel:c,er:b,layout:k}=$(),f=r.db.getData(),S=zt(a,c);f.type=r.type,f.layoutAlgorithm=ee(k),f.config.flowchart.nodeSpacing=b?.nodeSpacing||140,f.config.flowchart.rankSpacing=b?.rankSpacing||80,f.direction=r.db.getDirection();const{config:d}=f,{look:g}=d;g==="neo"?f.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:f.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],f.diagramId=a,await se(f,S),f.layoutAlgorithm==="elk"&&S.select(".edges").lower();const x=S.selectAll('[id*="-background"]');Array.from(x).length>0&&x.each(function(){const Y=ie(this),A=Y.attr("id").replace("-background",""),U=S.select(`#${CSS.escape(A)}`);if(!U.empty()){const N=U.attr("transform");Y.attr("transform",N)}});const B=8;re.insertTitle(S,"erDiagramTitleText",b?.titleTopMargin??25,r.db.getDiagramTitle()),Ut(S,B,"erDiagram",b?.useMaxWidth??!0)},"draw"),Vt=p((e,a)=>{const u=ne,r=u(e,"r"),c=u(e,"g"),b=u(e,"b");return $t(r,c,b,a)},"fade"),ut=new Set(["redux-color","redux-dark-color"]),le=p(e=>{const{theme:a,look:u,bkgColorArray:r,borderColorArray:c}=e;if(!ut.has(a))return"";const b=r?.length>0;let k="";for(let f=0;f{const{look:a,theme:u,erEdgeLabelBackground:r,strokeWidth:c}=e;return` + ${le(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${ut.has(u)&&r?r:Vt(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${ut.has(u)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${ut.has(u)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${a==="neo"?c:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${a==="neo"?c:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${Vt(e.tertiaryColor,.5)}; + } + + .cluster rect { + fill: ${e.clusterBkg??e.mainBkg}; + stroke: ${e.clusterBorder??e.nodeBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor??e.textColor}; + } + + .cluster-label text { + fill: ${e.titleColor??e.textColor}; + } +`},"getStyles"),ue=he,_e={parser:ae,get db(){return new oe},renderer:Mt,styles:ue};export{_e as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-BXhIpQde.js b/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-BXhIpQde.js deleted file mode 100644 index efa2fd2db..000000000 --- a/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-BXhIpQde.js +++ /dev/null @@ -1,85 +0,0 @@ -import{g as Mt}from"./chunk-55IACEB6-CeJhGgl3.js";import{s as Bt}from"./chunk-2J33WTMH-C5fSlY2E.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,q as Gt,t as Kt,c as it,l as V,A as Ut,y as Zt,C as jt,E as Wt,p as Qt,r as Xt,d as Ht,u as qt}from"./mermaid.core-Bt2TZ_t_.js";import{c as Jt}from"./channel-DxVW30WC.js";import"./index-C-zUV3mO.js";var _t=(function(){var e=l(function(C,n,c,o){for(c=c||{},o=C.length;o--;c[C[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],I=[1,18],S=[1,21],R=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],A=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],N=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:A},{16:47,40:O,41:A},{16:48,40:O,41:A},e(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:R},{16:50,40:O,41:A},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:I,51:S,52:R},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:N,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:A,42:N},{13:P,38:69,41:z,42:N,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:N,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:N}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:A},{11:94,40:T,48:D,50:I,51:S,52:R},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:N},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:A},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:A},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:N}),e(i,[2,11]),{13:[1,120],42:N},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,At=0,Dt=2,Nt=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function Ct(){var b;return b=r.pop()||_.lex()||Nt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(Ct,"lex");for(var g,v,k,ft,w={},et,E,It,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Ct()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: -`+_.showPosition()+` -Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==Nt?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,At=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,At,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),It=Z[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},vt=(function(){var C={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:l(function(n,c){var o,r,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in p)this[t]=p[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,o,r;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),t=0;tc[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,p[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,p[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,o,r,p){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return o.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return o.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return C})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),f=a.db.getData(),m=Mt(i,u);f.type=a.type,f.layoutAlgorithm=Qt(y),f.config.flowchart.nodeSpacing=d?.nodeSpacing||140,f.config.flowchart.rankSpacing=d?.rankSpacing||80,f.direction=a.db.getDirection();const{config:j}=f,{look:W}=j;W==="neo"?f.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:f.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],f.diagramId=i,await Xt(f,m),f.layoutAlgorithm==="elk"&&m.select(".edges").lower();const T=m.selectAll('[id*="-background"]');Array.from(T).length>0&&T.each(function(){const M=Ht(this),I=M.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(I)}`);if(!S.empty()){const R=S.attr("transform");M.attr("transform",R)}});const Q=8;qt.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,Q,"erDiagram",d?.useMaxWidth??!0)},"draw"),Rt=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let f=0;f{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return` - ${se(e)} - .entityBox { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - } - - .relationshipLabelBox { - fill: ${e.tertiaryColor}; - opacity: 0.7; - background-color: ${e.tertiaryColor}; - rect { - opacity: 0.5; - } - } - - .labelBkg { - background-color: ${rt.has(h)&&a?a:Rt(e.tertiaryColor,.5)}; - } - - .edgeLabel { - background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground}; - } - .edgeLabel .label rect { - fill: ${rt.has(h)&&a?a:e.edgeLabelBackground}; - } - .edgeLabel .label text { - fill: ${e.textColor}; - } - - .edgeLabel .label { - fill: ${e.nodeBorder}; - font-size: 14px; - } - - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - - .edge-pattern-dashed { - stroke-dasharray: 8,8; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon - { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${i==="neo"?u:"1px"}; - } - - .relationshipLine { - stroke: ${e.lineColor}; - stroke-width: ${i==="neo"?u:"1px"}; - fill: none; - } - - .marker { - fill: none !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; - } - [data-look=neo].labelBkg { - background-color: ${Rt(e.tertiaryColor,.5)}; - } -`},"getStyles"),re=ie,he={parser:$t,get db(){return new te},renderer:xt,styles:re};export{he as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js b/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js deleted file mode 100644 index 0e71fb06b..000000000 --- a/apps/pythinker-code/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +++ /dev/null @@ -1,85 +0,0 @@ -import{g as Mt}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as Bt}from"./chunk-2J33WTMH-w4sdiKFO.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,p as Gt,q as Kt,c as it,l as V,z as Ut,x as Zt,B as jt,C as Wt,o as Qt,r as Xt,d as Ht,u as qt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as Jt}from"./channel-DNkUo9e6.js";var _t=(function(){var e=l(function(C,n,c,o){for(c=c||{},o=C.length;o--;c[C[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],p=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],Q=[1,28],M=[1,29],D=[1,20],I=[1,18],S=[1,21],R=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,f,t,Z){var s=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:Q,44:M,48:D,50:I,51:S,52:R},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:R},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:I,51:S,52:R},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(X,[2,37]),e(X,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:I,51:S,52:R},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(X,[2,39]),e(X,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],f=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}l(Vt,"popStack");function Ct(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(Ct,"lex");for(var g,v,k,pt,w={},et,E,It,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Ct()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: -`+_.showPosition()+` -Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),f.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),pt=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],f,t].concat(Lt)),typeof pt<"u")return pt;E&&(o=o.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),It=Z[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},vt=(function(){var C={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` -`+c+"^"},"showPosition"),test_match:l(function(n,c){var o,r,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,o,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;tc[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,f[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,o,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return o.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return o.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return C})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),p=a.db.getData(),m=Mt(i,u);p.type=a.type,p.layoutAlgorithm=Qt(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=a.db.getDirection();const{config:j}=p,{look:W}=j;W==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=i,await Xt(p,m),p.layoutAlgorithm==="elk"&&m.select(".edges").lower();const T=m.selectAll('[id*="-background"]');Array.from(T).length>0&&T.each(function(){const M=Ht(this),I=M.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(I)}`);if(!S.empty()){const R=S.attr("transform");M.attr("transform",R)}});const Q=8;qt.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,Q,"erDiagram",d?.useMaxWidth??!0)},"draw"),Rt=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let p=0;p{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return` - ${se(e)} - .entityBox { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - } - - .relationshipLabelBox { - fill: ${e.tertiaryColor}; - opacity: 0.7; - background-color: ${e.tertiaryColor}; - rect { - opacity: 0.5; - } - } - - .labelBkg { - background-color: ${rt.has(h)&&a?a:Rt(e.tertiaryColor,.5)}; - } - - .edgeLabel { - background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground}; - } - .edgeLabel .label rect { - fill: ${rt.has(h)&&a?a:e.edgeLabelBackground}; - } - .edgeLabel .label text { - fill: ${e.textColor}; - } - - .edgeLabel .label { - fill: ${e.nodeBorder}; - font-size: 14px; - } - - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - - .edge-pattern-dashed { - stroke-dasharray: 8,8; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon - { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${i==="neo"?u:"1px"}; - } - - .relationshipLine { - stroke: ${e.lineColor}; - stroke-width: ${i==="neo"?u:"1px"}; - fill: none; - } - - .marker { - fill: none !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; - } - [data-look=neo].labelBkg { - background-color: ${Rt(e.tertiaryColor,.5)}; - } -`},"getStyles"),re=ie,le={parser:$t,get db(){return new te},renderer:xt,styles:re};export{le as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-93_AFKE1.js b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-93_AFKE1.js new file mode 100644 index 000000000..75dad90df --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-93_AFKE1.js @@ -0,0 +1,168 @@ +import{g as qt}from"./chunk-5VM5RSS4-B6TwRhtM.js";import{g as Xt}from"./chunk-XXDRQBXY-O3ugxnCs.js";import{s as Qt}from"./chunk-POPQ4Y6H-ClOHKyvb.js";import{_ as k,b4 as Jt,F as Ot,l as Z,c as Ae,u as Zt,v as $t,x as it,b as e1,s as t1,n as s1,a as i1,g as r1,o as a1,k as n1,H as u1,J as o1,cb as l1,q as tt,j as st,O as c1,p as h1,b8 as d1,r as p1}from"./mermaidParser.worker-DimdFOud.js";import{f as f1}from"./chunk-F27PBJKO-CYKbU5Oh.js";import{c as g1}from"./channel-BKkxHUFp.js";var b1="flowchart-",A1=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{k(this,"FlowDB")}sanitizeText(e){return n1.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,u,f,l={},b){if(!e||e.trim().length===0)return;let h;if(b!==void 0){let o;b.includes(` +`)?o=b+` +`:o=`{ +`+b+` +}`,h=u1(o,{schema:o1})}const _=this.subGraphLookup.get(e);if(_&&h){_.metadata={..._.metadata,...h};return}const y=this.edges.find(o=>o.id===e);if(y){const o=h;o?.animate!==void 0&&(y.animate=o.animate),o?.animation!==void 0&&(y.animation=o.animation),o?.curve!==void 0&&(y.interpolate=o.curve);return}let L,A=this.vertices.get(e);if(A===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Z.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),A={id:e,labelType:"text",domId:b1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,A)),this.vertexCounter++,i!==void 0?(this.config=Ae(),L=this.sanitizeText(i.text.trim()),A.labelType=i.type,L.startsWith('"')&&L.endsWith('"')&&(L=L.substring(1,L.length-1)),A.text=L):A.text===void 0&&(A.text=e),r!==void 0&&(A.type=r),a?.forEach(o=>{A.styles.push(o)}),u?.forEach(o=>{A.classes.push(o)}),f!==void 0&&(A.dir=f),A.props===void 0?A.props=l:l!==void 0&&Object.assign(A.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!l1(h.shape))throw new Error(`No such shape: ${h.shape}.`);A.type=h?.shape}h?.label&&(A.text=h?.label,A.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(A.icon=h?.icon,!h.label?.trim()&&A.text===e&&(A.text="")),h?.form&&(A.form=h?.form),h?.pos&&(A.pos=h?.pos),h?.img&&(A.img=h?.img,!h.label?.trim()&&A.text===e&&(A.text="")),h?.constraint&&(A.constraint=h.constraint),h.w&&(A.assetWidth=Number(h.w)),h.h&&(A.assetHeight=Number(h.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Z.info("abc78 Got edge...",l);const b=r.text;if(b!==void 0&&(l.text=this.sanitizeText(b.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(b.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(h=>h.id===a))l.id=a,l.isUserDefinedId=!0;else{const h=this.edges.filter(_=>_.start===l.start&&_.end===l.end);h.length===0?l.id=tt(l.start,l.end,{counter:0,prefix:"L"}):l.id=tt(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Z.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Z.info("addLink",e,i,a);for(const u of e)for(const f of i){const l=u===e[e.length-1],b=f===i[0];l&&b?this.addSingleLink(u,f,r,a):this.addSingleLink(u,f,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let u=this.classes.get(a);u===void 0&&(u={id:a,styles:[],textStyles:[]},this.classes.set(a,u)),r?.forEach(f=>{if(/color/.exec(f)){const l=f.replace("fill","bgFill");u.textStyles.push(l)}u.styles.push(f)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const u=this.edges.find(l=>l.id===r);u&&u.classes.push(i);const f=this.subGraphLookup.get(r);f&&f.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(Ae().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let f=0;f{const f=this.lookUpDomId(e),l=document.querySelector(`[id="${f}"]`);l!==null&&l.addEventListener("click",()=>{it.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const u=this.vertices.get(a);u!==void 0&&(u.link=it.formatUrl(i,this.config),u.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=f1();st(e).select("svg").selectAll("g.node").on("mouseover",u=>{const f=st(u.currentTarget),l=f.attr("title");if(l===null)return;const b=u.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(f.attr("title")).style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),i.html(c1.sanitize(l)),f.classed("hover",!0)}).on("mouseout",u=>{i.transition().duration(500).style("opacity",0),st(u.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Ae(),h1()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),u=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=k(L=>{const A={boolean:{},number:{},string:{}},o=[];let c;return{nodeList:L.filter(function(B){const Q=typeof B;return B.stmt&&B.stmt==="dir"?(c=B.value,!1):B.trim()===""?!1:Q in A?A[Q].hasOwnProperty(B)?!1:A[Q][B]=!0:o.includes(B)?!1:o.push(B)}),dir:c}},"uniq")(i.flat()),b=l.nodeList;let h=l.dir;const _=Ae().flowchart??{};if(h=h??(_.inheritDir?this.getDirection()??Ae().direction??void 0:void 0),this.version==="gen-1")for(let L=0;L2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,u=1;for(;a=0){const l=this.indexNodes2(e,f);if(l.result)return{result:!0,count:u+l.count};u=u+l.count}a=a+1}return{result:!1,count:u}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let u=0;u":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let u="normal",f=r.length-1;r.startsWith("=")&&(u="thick"),r.startsWith("~")&&(u="invisible");const l=this.countChar(".",r);return l&&(u="dotted",f=l),{type:a,stroke:u,length:f}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,u)=>{this.exists(i,a)||r.push(e.nodes[u])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,u,f){const l=r.get(e.id),b=a.get(e.id)??!1,h=this.findNode(i,e.id);if(h)h.cssStyles=e.styles,h.cssCompiledStyles=this.getCompiledStyles(e.classes),h.cssClasses=e.classes.join(" ");else{const _={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:u.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:f,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};b?i.push({..._,isGroup:!0,shape:"rect"}):i.push({..._,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}getData(){const e=Ae(),i=[],r=[],a=this.getSubGraphs(),u=new Map,f=new Map,l=new Map;for(const o of a)for(const c of o.nodes)this.subGraphLookup.has(c)&&l.set(c,o.id);const b=k(o=>this.subGraphLookup.get(o)?.metadata?.view==="collapsed","isCollapsed"),h=k(o=>{let c;const S=new Set;let B=o;for(;B!==void 0&&!S.has(B);)S.add(B),b(B)&&(c=B),B=l.get(B);return c},"outermostCollapsed"),_=new Set,y=new Map;for(const o of a){const c=h(o.id);if(c!==void 0){o.id!==c&&(_.add(o.id),y.set(o.id,c));for(const S of o.nodes)S!==c&&(_.add(S),y.set(S,c))}}for(let o=a.length-1;o>=0;o--){const c=a[o];if(!_.has(c.id)){c.nodes.length>0&&f.set(c.id,!0);for(const S of c.nodes)u.set(S,c.id)}}for(let o=a.length-1;o>=0;o--){const c=a[o];_.has(c.id)||(c.metadata?.view==="collapsed"?i.push({id:c.id,label:c.title,labelStyle:"",labelType:c.labelType,parentId:u.get(c.id),padding:8,cssCompiledStyles:this.getCompiledStyles(c.classes),cssClasses:c.classes.join(" "),shape:"collapsedGroup",dir:c.dir,isGroup:!1,look:e.look}):i.push({id:c.id,label:c.title,labelStyle:"",labelType:c.labelType,parentId:u.get(c.id),padding:8,cssCompiledStyles:this.getCompiledStyles(c.classes),cssClasses:c.classes.join(" "),shape:"rect",dir:c.dir,isGroup:!0,look:e.look}))}this.getVertices().forEach(o=>{_.has(o.id)||this.addNodeFromVertex(o,i,u,f,e,e.look||"classic")});const A=this.getEdges();return A.forEach((o,c)=>{const{arrowTypeStart:S,arrowTypeEnd:B}=this.destructEdgeType(o.type),Q=[...A.defaultStyle??[]],de=y.get(o.start)??o.start,pe=y.get(o.end)??o.end;if(de===pe&&(y.has(o.start)||y.has(o.end)))return;o.style&&Q.push(...o.style);const De={id:tt(de,pe,{counter:c,prefix:"L"},o.id),isUserDefinedId:o.isUserDefinedId,start:de,end:pe,type:o.type??"normal",label:o.text,labelType:o.labelType,labelpos:"c",thickness:o.stroke,minlen:o.length,classes:o?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:o?.stroke==="invisible"||o?.type==="arrow_open"?"none":S,arrowTypeEnd:o?.stroke==="invisible"||o?.type==="arrow_open"?"none":B,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(o.classes),labelStyle:Q,style:Q,pattern:o.stroke,look:e.look,animate:o.animate,animation:o.animation,curve:o.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(De)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return d1.flowchart}},k1=k(function(e,i){return i.db.getClasses()},"getClasses"),m1=k(async function(e,i,r,a){Z.info("REF0:"),Z.info("Drawing state diagram (v2)",i);const{securityLevel:u,flowchart:f,layout:l}=Ae();a.db.setDiagramId(i),Z.debug("Before getData: ");const b=a.db.getData();Z.debug("Data: ",b);const h=Xt(i,u),_=a.db.getDirection();b.type=a.type,b.layoutAlgorithm=Zt(l),b.layoutAlgorithm==="dagre"&&l==="elk"&&Z.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),b.direction=_,b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,b.markers=["point","circle","cross"],b.diagramId=i,Z.debug("REF1:",b),await $t(b,h);const y=b.config.flowchart?.diagramPadding??8;it.insertTitle(h,"flowchartTitleText",f?.titleTopMargin||0,a.db.getDiagramTitle()),Qt(h,y,"flowchart",f?.useMaxWidth||!1)},"draw"),C1={getClasses:k1,draw:m1},rt=(function(){var e=k(function(be,d,p,g){for(p=p||{},g=be.length;g--;p[be[g]]=d);return p},"o"),i=[1,4],r=[1,3],a=[1,5],u=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],f=[2,2],l=[1,13],b=[1,14],h=[1,15],_=[1,16],y=[1,23],L=[1,25],A=[1,26],o=[1,27],c=[1,50],S=[1,49],B=[1,29],Q=[1,30],de=[1,31],pe=[1,32],De=[1,33],I=[1,45],w=[1,47],R=[1,43],N=[1,48],G=[1,44],P=[1,51],O=[1,46],M=[1,52],U=[1,53],Oe=[1,34],Me=[1,35],Ue=[1,36],ze=[1,37],We=[1,38],fe=[1,58],E=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ee=[1,62],te=[1,61],se=[1,63],Te=[8,9,11,75,77,78],at=[1,79],Se=[1,92],Ee=[1,97],ye=[1,96],xe=[1,93],Fe=[1,89],_e=[1,95],Be=[1,91],ve=[1,98],Le=[1,94],Ve=[1,99],Ie=[1,90],ke=[8,9,10,11,40,75,77,78],W=[8,9,10,11,40,46,75,77,78],H=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],nt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],we=[44,60,89,102,105,106,109,111,114,115,116],ut=[1,122],ot=[1,123],je=[1,125],Ke=[1,124],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,134],ht=[1,148],dt=[1,149],pt=[1,150],ft=[1,151],gt=[1,136],bt=[1,138],At=[1,142],kt=[1,143],mt=[1,144],Ct=[1,145],Dt=[1,146],Tt=[1,147],St=[1,152],Et=[1,153],yt=[1,132],xt=[1,133],Ft=[1,140],_t=[1,135],Bt=[1,139],vt=[1,137],Xe=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Lt=[1,155],Vt=[1,157],v=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],m=[1,177],j=[1,173],K=[1,174],C=[1,178],D=[1,175],T=[1,176],Re=[77,116,119],x=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],It=[10,106],ge=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],ie=[1,248],re=[1,246],ae=[1,250],ne=[1,244],ue=[1,245],oe=[1,247],le=[1,249],ce=[1,251],Ne=[1,269],wt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],Qe={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:k(function(d,p,g,n,F,t,Pe){var s=t.length-1;switch(F){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:n.setDirection("TB"),this.$="TB";break;case 12:n.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=n.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=n.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=n.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),n.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),n.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:n.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),n.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:n.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:n.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:n.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:n.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],n.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],n.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],n.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],n.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],n.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var V=n.destructLink(t[s],t[s-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[s-1]};break;case 78:var V=n.destructLink(t[s],t[s-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var V=n.destructLink(t[s]);this.$={type:V.type,stroke:V.stroke,length:V.length};break;case 84:var V=n.destructLink(t[s]);this.$={type:V.type,stroke:V.stroke,length:V.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],n.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],n.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],n.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],n.setClickEvent(t[s-3],t[s-2]),n.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],n.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],n.setClickEvent(t[s-4],t[s-3],t[s-2]),n.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],n.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],n.setLink(t[s-4],t[s-2]),n.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],n.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],n.setLink(t[s-6],t[s-4],t[s]),n.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],n.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],n.setLink(t[s-3],t[s-2]),n.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],n.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],n.setLink(t[s-5],t[s-4],t[s]),n.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],n.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],n.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],n.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],n.updateLinkInterpolate([t[s-6]],t[s-2]),n.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],n.updateLinkInterpolate(t[s-6],t[s-2]),n.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],n.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],n.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(u,f,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},e(u,[2,9]),e(u,[2,10]),e(u,[2,11]),{8:[1,55],9:[1,56],10:fe,15:54,18:57},e(E,[2,3]),e(E,[2,4]),e(E,[2,5]),e(E,[2,6]),e(E,[2,7]),e(E,[2,8]),{8:ee,9:te,11:se,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:ee,9:te,11:se,21:68},{8:ee,9:te,11:se,21:69},{8:ee,9:te,11:se,21:70},{8:ee,9:te,11:se,21:71},{8:ee,9:te,11:se,21:72},{8:ee,9:te,10:[1,73],11:se,21:74},e(E,[2,36]),{35:[1,75]},{37:[1,76]},e(E,[2,39]),e(Te,[2,50],{18:77,39:78,10:fe,40:at}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Se,44:Ee,60:ye,80:[1,87],89:xe,95:[1,84],97:[1,85],101:86,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},e(E,[2,185]),e(E,[2,186]),e(E,[2,187]),e(E,[2,188]),e(E,[2,189]),e(ke,[2,51]),e(ke,[2,54],{46:[1,100]}),e(W,[2,72],{113:113,29:[1,101],44:c,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:S,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),e(H,[2,181]),e(H,[2,142]),e(H,[2,143]),e(H,[2,144]),e(H,[2,145]),e(H,[2,146]),e(H,[2,147]),e(H,[2,148]),e(H,[2,149]),e(H,[2,150]),e(H,[2,151]),e(H,[2,152]),e(u,[2,12]),e(u,[2,18]),e(u,[2,19]),{9:[1,114]},e(nt,[2,26],{18:115,10:fe}),e(E,[2,27]),{42:116,43:39,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(E,[2,40]),e(E,[2,41]),e(E,[2,42]),e(we,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ut,81:ot,116:je,119:Ke},{75:[1,126],77:[1,127]},e(lt,[2,83]),e(E,[2,28]),e(E,[2,29]),e(E,[2,30]),e(E,[2,31]),e(E,[2,32]),{10:ct,12:ht,14:dt,27:pt,28:128,32:ft,44:gt,60:bt,75:At,80:[1,130],81:[1,131],83:141,84:kt,85:mt,86:Ct,87:Dt,88:Tt,89:St,90:Et,91:129,105:yt,109:xt,111:Ft,114:_t,115:Bt,116:vt},e(Xe,f,{5:154}),e(E,[2,37]),e(E,[2,38]),e(Te,[2,48],{44:Lt}),e(Te,[2,49],{18:156,10:fe,40:Vt}),e(ke,[2,44]),{44:c,47:158,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{102:[1,159],103:160,105:[1,161]},{44:c,47:162,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{44:c,47:163,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(v,[2,115],{120:168,10:[1,167],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,117],{10:[1,169]}),e(q,[2,183]),e(q,[2,170]),e(q,[2,171]),e(q,[2,172]),e(q,[2,173]),e(q,[2,174]),e(q,[2,175]),e(q,[2,176]),e(q,[2,177]),e(q,[2,178]),e(q,[2,179]),e(q,[2,180]),{44:c,47:170,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{30:171,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:179,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:181,50:[1,180],67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:182,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:183,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:184,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{109:[1,185]},{30:186,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:187,65:[1,188],67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:189,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:190,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:191,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(H,[2,182]),e(u,[2,20]),e(nt,[2,25]),e(Te,[2,46],{39:192,18:193,10:fe,40:at}),e(we,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{77:[1,197],79:198,116:je,119:Ke},e(Re,[2,79]),e(Re,[2,81]),e(Re,[2,82]),e(Re,[2,168]),e(Re,[2,169]),{76:199,79:121,80:ut,81:ot,116:je,119:Ke},e(lt,[2,84]),{8:ee,9:te,10:ct,11:se,12:ht,14:dt,21:201,27:pt,29:[1,200],32:ft,44:gt,60:bt,75:At,83:141,84:kt,85:mt,86:Ct,87:Dt,88:Tt,89:St,90:Et,91:202,105:yt,109:xt,111:Ft,114:_t,115:Bt,116:vt},e(x,[2,101]),e(x,[2,103]),e(x,[2,104]),e(x,[2,157]),e(x,[2,158]),e(x,[2,159]),e(x,[2,160]),e(x,[2,161]),e(x,[2,162]),e(x,[2,163]),e(x,[2,164]),e(x,[2,165]),e(x,[2,166]),e(x,[2,167]),e(x,[2,90]),e(x,[2,91]),e(x,[2,92]),e(x,[2,93]),e(x,[2,94]),e(x,[2,95]),e(x,[2,96]),e(x,[2,97]),e(x,[2,98]),e(x,[2,99]),e(x,[2,100]),{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,203],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},{10:fe,18:204},{44:[1,205]},e(ke,[2,43]),{10:[1,206],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{10:[1,207]},{10:[1,208],106:[1,209]},e(It,[2,128]),{10:[1,210],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{10:[1,211],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{80:[1,212]},e(v,[2,109],{10:[1,213]}),e(v,[2,111],{10:[1,214]}),{80:[1,215]},e(q,[2,184]),{80:[1,216],98:[1,217]},e(ke,[2,55],{113:113,44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),{31:[1,218],67:m,82:219,116:C,117:D,118:T},e(ge,[2,86]),e(ge,[2,88]),e(ge,[2,89]),e(ge,[2,153]),e(ge,[2,154]),e(ge,[2,155]),e(ge,[2,156]),{49:[1,220],67:m,82:219,116:C,117:D,118:T},{30:221,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{51:[1,222],67:m,82:219,116:C,117:D,118:T},{53:[1,223],67:m,82:219,116:C,117:D,118:T},{55:[1,224],67:m,82:219,116:C,117:D,118:T},{57:[1,225],67:m,82:219,116:C,117:D,118:T},{60:[1,226]},{64:[1,227],67:m,82:219,116:C,117:D,118:T},{66:[1,228],67:m,82:219,116:C,117:D,118:T},{30:229,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{31:[1,230],67:m,82:219,116:C,117:D,118:T},{67:m,69:[1,231],71:[1,232],82:219,116:C,117:D,118:T},{67:m,69:[1,234],71:[1,233],82:219,116:C,117:D,118:T},e(Te,[2,45],{18:156,10:fe,40:Vt}),e(Te,[2,47],{44:Lt}),e(we,[2,75]),e(we,[2,74]),{62:[1,235],67:m,82:219,116:C,117:D,118:T},e(we,[2,77]),e(Re,[2,80]),{77:[1,236],79:198,116:je,119:Ke},{30:237,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(Xe,f,{5:238}),e(x,[2,102]),e(E,[2,35]),{43:239,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{10:fe,18:240},{10:ie,60:re,84:ae,92:241,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:252,104:[1,253],105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:254,104:[1,255],105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{105:[1,256]},{10:ie,60:re,84:ae,92:257,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{44:c,47:258,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(v,[2,116]),e(v,[2,118],{10:[1,262]}),e(v,[2,119]),e(W,[2,56]),e(ge,[2,87]),e(W,[2,57]),{51:[1,263],67:m,82:219,116:C,117:D,118:T},e(W,[2,64]),e(W,[2,59]),e(W,[2,60]),e(W,[2,61]),{109:[1,264]},e(W,[2,63]),e(W,[2,65]),{66:[1,265],67:m,82:219,116:C,117:D,118:T},e(W,[2,67]),e(W,[2,68]),e(W,[2,70]),e(W,[2,69]),e(W,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(we,[2,78]),{31:[1,266],67:m,82:219,116:C,117:D,118:T},{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,267],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},e(ke,[2,53]),{43:268,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,121],{106:Ne}),e(wt,[2,130],{108:270,10:ie,60:re,84:ae,105:ne,109:ue,110:oe,111:le,112:ce}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(v,[2,122],{106:Ne}),{10:[1,271]},e(v,[2,123],{106:Ne}),{10:[1,272]},e(It,[2,129]),e(v,[2,105],{106:Ne}),e(v,[2,106],{113:113,44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),e(v,[2,110]),e(v,[2,112],{10:[1,273]}),e(v,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:ee,9:te,11:se,21:278},e(E,[2,34]),e(ke,[2,52]),{10:ie,60:re,84:ae,105:ne,107:279,108:243,109:ue,110:oe,111:le,112:ce},e($,[2,133]),{14:Se,44:Ee,60:ye,89:xe,101:280,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},{14:Se,44:Ee,60:ye,89:xe,101:281,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},{98:[1,282]},e(v,[2,120]),e(W,[2,58]),{30:283,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(W,[2,66]),e(Xe,f,{5:284}),e(wt,[2,131],{108:270,10:ie,60:re,84:ae,105:ne,109:ue,110:oe,111:le,112:ce}),e(v,[2,126],{120:168,10:[1,285],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,127],{120:168,10:[1,286],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,114]),{31:[1,287],67:m,82:219,116:C,117:D,118:T},{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,288],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},{10:ie,60:re,84:ae,92:289,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:290,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},e(W,[2,62]),e(E,[2,33]),e(v,[2,124],{106:Ne}),e(v,[2,125],{106:Ne})],defaultActions:{},parseError:k(function(d,p){if(p.recoverable)this.trace(d);else{var g=new Error(d);throw g.hash=p,g}},"parseError"),parse:k(function(d){var p=this,g=[0],n=[],F=[null],t=[],Pe=this.table,s="",V=0,Rt=0,jt=2,Nt=1,Kt=t.slice.call(arguments,1),z=Object.create(this.lexer),me={yy:{}};for(var Je in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Je)&&(me.yy[Je]=this.yy[Je]);z.setInput(d,me.yy),me.yy.lexer=z,me.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var Ze=z.yylloc;t.push(Ze);var Yt=z.options&&z.options.ranges;typeof me.yy.parseError=="function"?this.parseError=me.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ht(X){g.length=g.length-2*X,F.length=F.length-X,t.length=t.length-X}k(Ht,"popStack");function Gt(){var X;return X=n.pop()||z.lex()||Nt,typeof X!="number"&&(X instanceof Array&&(n=X,X=n.pop()),X=p.symbols_[X]||X),X}k(Gt,"lex");for(var Y,Ce,J,$e,Ge={},He,he,Pt,qe;;){if(Ce=g[g.length-1],this.defaultActions[Ce]?J=this.defaultActions[Ce]:((Y===null||typeof Y>"u")&&(Y=Gt()),J=Pe[Ce]&&Pe[Ce][Y]),typeof J>"u"||!J.length||!J[0]){var et="";qe=[];for(He in Pe[Ce])this.terminals_[He]&&He>jt&&qe.push("'"+this.terminals_[He]+"'");z.showPosition?et="Parse error on line "+(V+1)+`: +`+z.showPosition()+` +Expecting `+qe.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":et="Parse error on line "+(V+1)+": Unexpected "+(Y==Nt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(et,{text:z.match,token:this.terminals_[Y]||Y,line:z.yylineno,loc:Ze,expected:qe})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+Y);switch(J[0]){case 1:g.push(Y),F.push(z.yytext),t.push(z.yylloc),g.push(J[1]),Y=null,Rt=z.yyleng,s=z.yytext,V=z.yylineno,Ze=z.yylloc;break;case 2:if(he=this.productions_[J[1]][1],Ge.$=F[F.length-he],Ge._$={first_line:t[t.length-(he||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(he||1)].first_column,last_column:t[t.length-1].last_column},Yt&&(Ge._$.range=[t[t.length-(he||1)].range[0],t[t.length-1].range[1]]),$e=this.performAction.apply(Ge,[s,Rt,V,me.yy,J[1],F,t].concat(Kt)),typeof $e<"u")return $e;he&&(g=g.slice(0,-1*he*2),F=F.slice(0,-1*he),t=t.slice(0,-1*he)),g.push(this.productions_[J[1]][0]),F.push(Ge.$),t.push(Ge._$),Pt=Pe[g[g.length-2]][g[g.length-1]],g.push(Pt);break;case 3:return!0}}return!0},"parse")},Wt=(function(){var be={EOF:1,parseError:k(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:k(function(d,p){return this.yy=p||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var p=d.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:k(function(d){var p=d.length,g=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===n.length?this.yylloc.first_column:0)+n[n.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(d){this.unput(this.match.slice(d))},"less"),pastInput:k(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var d=this.pastInput(),p=new Array(d.length+1).join("-");return d+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:k(function(d,p){var g,n,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),n=d[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var t in F)this[t]=F[t];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,p,g,n;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),t=0;tp[0].length)){if(p=g,n=t,this.options.backtrack_lexer){if(d=this.test_match(g,F[t]),d!==!1)return d;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(d=this.test_match(p,F[n]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var p=this.next();return p||this.lex()},"lex"),begin:k(function(p){this.conditionStack.push(p)},"begin"),popState:k(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:k(function(p){this.begin(p)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(p,g,n,F){switch(n){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),g.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return g.yytext=g.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return p.lex.firstGraph()&&this.begin("dir"),12;case 36:return p.lex.firstGraph()&&this.begin("dir"),12;case 37:return p.lex.firstGraph()&&this.begin("dir"),12;case 38:return p.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return be})();Qe.lexer=Wt;function Ye(){this.yy={}}return k(Ye,"Parser"),Ye.prototype=Qe,Qe.Parser=Ye,new Ye})();rt.parser=rt;var Mt=rt,Ut=Object.assign({},Mt);Ut.parse=e=>{const i=e.replace(/}\s*\n/g,`} +`);return Mt.parse(i)};var D1=Ut,T1=k((e,i)=>{const r=g1,a=r(e,"r"),u=r(e,"g"),f=r(e,"b");return p1(a,u,f,i)},"fade"),S1=k(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${T1(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + /* Collapsed subgraph node (@{ view: collapsed }) */ + .node .collapsed-indicator { + fill: ${e.clusterBorder}; + stroke: none; + opacity: 0.6; + } + + .node .collapsed-separator { + stroke: ${e.clusterBorder}; + stroke-width: 0.75px; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${qt()} +`,"getStyles"),E1=S1,zt=k(({defaultLayout:e,styles:i=E1}={})=>({parser:D1,get db(){return new A1},renderer:C1,styles:i,init:k(r=>{r.flowchart||(r.flowchart={});const a=Jt().layout??e??r.layout;a&&Ot({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Ot({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),y1=zt(),V1=Object.freeze({__proto__:null,createFlowDiagram:zt,diagram:y1});export{zt as c,V1 as f,E1 as s}; diff --git a/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-B-bmDgjW.js b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-B-bmDgjW.js new file mode 100644 index 000000000..48cedd408 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-B-bmDgjW.js @@ -0,0 +1,168 @@ +import{g as Ht}from"./chunk-5VM5RSS4-CfUbytH6.js";import{g as Xt}from"./chunk-XXDRQBXY-CiRZidGx.js";import{s as Qt}from"./chunk-POPQ4Y6H-Enw1vTgw.js";import{_ as k,b3 as Zt,Y as Ot,l as J,c as Ae,x as Jt,y as $t,z as it,b as e1,s as t1,p as s1,a as i1,g as r1,q as a1,k as n1,Z as u1,$ as o1,ca as l1,t as tt,j as st,r as c1,b7 as h1,u as d1}from"./mermaid.core-CM2luXFy.js";import{f as p1}from"./chunk-F27PBJKO-8JlkC2jZ.js";import{p as f1}from"./purify.es-5AjVNlXF.js";import{c as g1}from"./channel-vcmCqkai.js";var b1="flowchart-",A1=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{k(this,"FlowDB")}sanitizeText(e){return n1.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,u,f,l={},b){if(!e||e.trim().length===0)return;let h;if(b!==void 0){let o;b.includes(` +`)?o=b+` +`:o=`{ +`+b+` +}`,h=u1(o,{schema:o1})}const _=this.subGraphLookup.get(e);if(_&&h){_.metadata={..._.metadata,...h};return}const y=this.edges.find(o=>o.id===e);if(y){const o=h;o?.animate!==void 0&&(y.animate=o.animate),o?.animation!==void 0&&(y.animation=o.animation),o?.curve!==void 0&&(y.interpolate=o.curve);return}let L,A=this.vertices.get(e);if(A===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&J.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),A={id:e,labelType:"text",domId:b1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,A)),this.vertexCounter++,i!==void 0?(this.config=Ae(),L=this.sanitizeText(i.text.trim()),A.labelType=i.type,L.startsWith('"')&&L.endsWith('"')&&(L=L.substring(1,L.length-1)),A.text=L):A.text===void 0&&(A.text=e),r!==void 0&&(A.type=r),a?.forEach(o=>{A.styles.push(o)}),u?.forEach(o=>{A.classes.push(o)}),f!==void 0&&(A.dir=f),A.props===void 0?A.props=l:l!==void 0&&Object.assign(A.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!l1(h.shape))throw new Error(`No such shape: ${h.shape}.`);A.type=h?.shape}h?.label&&(A.text=h?.label,A.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(A.icon=h?.icon,!h.label?.trim()&&A.text===e&&(A.text="")),h?.form&&(A.form=h?.form),h?.pos&&(A.pos=h?.pos),h?.img&&(A.img=h?.img,!h.label?.trim()&&A.text===e&&(A.text="")),h?.constraint&&(A.constraint=h.constraint),h.w&&(A.assetWidth=Number(h.w)),h.h&&(A.assetHeight=Number(h.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};J.info("abc78 Got edge...",l);const b=r.text;if(b!==void 0&&(l.text=this.sanitizeText(b.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(b.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(h=>h.id===a))l.id=a,l.isUserDefinedId=!0;else{const h=this.edges.filter(_=>_.start===l.start&&_.end===l.end);h.length===0?l.id=tt(l.start,l.end,{counter:0,prefix:"L"}):l.id=tt(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))J.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;J.info("addLink",e,i,a);for(const u of e)for(const f of i){const l=u===e[e.length-1],b=f===i[0];l&&b?this.addSingleLink(u,f,r,a):this.addSingleLink(u,f,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let u=this.classes.get(a);u===void 0&&(u={id:a,styles:[],textStyles:[]},this.classes.set(a,u)),r?.forEach(f=>{if(/color/.exec(f)){const l=f.replace("fill","bgFill");u.textStyles.push(l)}u.styles.push(f)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const u=this.edges.find(l=>l.id===r);u&&u.classes.push(i);const f=this.subGraphLookup.get(r);f&&f.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(Ae().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let f=0;f{const f=this.lookUpDomId(e),l=document.querySelector(`[id="${f}"]`);l!==null&&l.addEventListener("click",()=>{it.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const u=this.vertices.get(a);u!==void 0&&(u.link=it.formatUrl(i,this.config),u.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=p1();st(e).select("svg").selectAll("g.node").on("mouseover",u=>{const f=st(u.currentTarget),l=f.attr("title");if(l===null)return;const b=u.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(f.attr("title")).style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),i.html(f1.sanitize(l)),f.classed("hover",!0)}).on("mouseout",u=>{i.transition().duration(500).style("opacity",0),st(u.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Ae(),c1()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),u=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=k(L=>{const A={boolean:{},number:{},string:{}},o=[];let c;return{nodeList:L.filter(function(B){const Q=typeof B;return B.stmt&&B.stmt==="dir"?(c=B.value,!1):B.trim()===""?!1:Q in A?A[Q].hasOwnProperty(B)?!1:A[Q][B]=!0:o.includes(B)?!1:o.push(B)}),dir:c}},"uniq")(i.flat()),b=l.nodeList;let h=l.dir;const _=Ae().flowchart??{};if(h=h??(_.inheritDir?this.getDirection()??Ae().direction??void 0:void 0),this.version==="gen-1")for(let L=0;L2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,u=1;for(;a=0){const l=this.indexNodes2(e,f);if(l.result)return{result:!0,count:u+l.count};u=u+l.count}a=a+1}return{result:!1,count:u}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let u=0;u":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let u="normal",f=r.length-1;r.startsWith("=")&&(u="thick"),r.startsWith("~")&&(u="invisible");const l=this.countChar(".",r);return l&&(u="dotted",f=l),{type:a,stroke:u,length:f}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,u)=>{this.exists(i,a)||r.push(e.nodes[u])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,u,f){const l=r.get(e.id),b=a.get(e.id)??!1,h=this.findNode(i,e.id);if(h)h.cssStyles=e.styles,h.cssCompiledStyles=this.getCompiledStyles(e.classes),h.cssClasses=e.classes.join(" ");else{const _={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:u.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:f,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};b?i.push({..._,isGroup:!0,shape:"rect"}):i.push({..._,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}getData(){const e=Ae(),i=[],r=[],a=this.getSubGraphs(),u=new Map,f=new Map,l=new Map;for(const o of a)for(const c of o.nodes)this.subGraphLookup.has(c)&&l.set(c,o.id);const b=k(o=>this.subGraphLookup.get(o)?.metadata?.view==="collapsed","isCollapsed"),h=k(o=>{let c;const S=new Set;let B=o;for(;B!==void 0&&!S.has(B);)S.add(B),b(B)&&(c=B),B=l.get(B);return c},"outermostCollapsed"),_=new Set,y=new Map;for(const o of a){const c=h(o.id);if(c!==void 0){o.id!==c&&(_.add(o.id),y.set(o.id,c));for(const S of o.nodes)S!==c&&(_.add(S),y.set(S,c))}}for(let o=a.length-1;o>=0;o--){const c=a[o];if(!_.has(c.id)){c.nodes.length>0&&f.set(c.id,!0);for(const S of c.nodes)u.set(S,c.id)}}for(let o=a.length-1;o>=0;o--){const c=a[o];_.has(c.id)||(c.metadata?.view==="collapsed"?i.push({id:c.id,label:c.title,labelStyle:"",labelType:c.labelType,parentId:u.get(c.id),padding:8,cssCompiledStyles:this.getCompiledStyles(c.classes),cssClasses:c.classes.join(" "),shape:"collapsedGroup",dir:c.dir,isGroup:!1,look:e.look}):i.push({id:c.id,label:c.title,labelStyle:"",labelType:c.labelType,parentId:u.get(c.id),padding:8,cssCompiledStyles:this.getCompiledStyles(c.classes),cssClasses:c.classes.join(" "),shape:"rect",dir:c.dir,isGroup:!0,look:e.look}))}this.getVertices().forEach(o=>{_.has(o.id)||this.addNodeFromVertex(o,i,u,f,e,e.look||"classic")});const A=this.getEdges();return A.forEach((o,c)=>{const{arrowTypeStart:S,arrowTypeEnd:B}=this.destructEdgeType(o.type),Q=[...A.defaultStyle??[]],de=y.get(o.start)??o.start,pe=y.get(o.end)??o.end;if(de===pe&&(y.has(o.start)||y.has(o.end)))return;o.style&&Q.push(...o.style);const De={id:tt(de,pe,{counter:c,prefix:"L"},o.id),isUserDefinedId:o.isUserDefinedId,start:de,end:pe,type:o.type??"normal",label:o.text,labelType:o.labelType,labelpos:"c",thickness:o.stroke,minlen:o.length,classes:o?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:o?.stroke==="invisible"||o?.type==="arrow_open"?"none":S,arrowTypeEnd:o?.stroke==="invisible"||o?.type==="arrow_open"?"none":B,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(o.classes),labelStyle:Q,style:Q,pattern:o.stroke,look:e.look,animate:o.animate,animation:o.animation,curve:o.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(De)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return h1.flowchart}},k1=k(function(e,i){return i.db.getClasses()},"getClasses"),m1=k(async function(e,i,r,a){J.info("REF0:"),J.info("Drawing state diagram (v2)",i);const{securityLevel:u,flowchart:f,layout:l}=Ae();a.db.setDiagramId(i),J.debug("Before getData: ");const b=a.db.getData();J.debug("Data: ",b);const h=Xt(i,u),_=a.db.getDirection();b.type=a.type,b.layoutAlgorithm=Jt(l),b.layoutAlgorithm==="dagre"&&l==="elk"&&J.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),b.direction=_,b.nodeSpacing=f?.nodeSpacing||50,b.rankSpacing=f?.rankSpacing||50,b.markers=["point","circle","cross"],b.diagramId=i,J.debug("REF1:",b),await $t(b,h);const y=b.config.flowchart?.diagramPadding??8;it.insertTitle(h,"flowchartTitleText",f?.titleTopMargin||0,a.db.getDiagramTitle()),Qt(h,y,"flowchart",f?.useMaxWidth||!1)},"draw"),C1={getClasses:k1,draw:m1},rt=(function(){var e=k(function(be,d,p,g){for(p=p||{},g=be.length;g--;p[be[g]]=d);return p},"o"),i=[1,4],r=[1,3],a=[1,5],u=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],f=[2,2],l=[1,13],b=[1,14],h=[1,15],_=[1,16],y=[1,23],L=[1,25],A=[1,26],o=[1,27],c=[1,50],S=[1,49],B=[1,29],Q=[1,30],de=[1,31],pe=[1,32],De=[1,33],I=[1,45],w=[1,47],R=[1,43],N=[1,48],G=[1,44],P=[1,51],O=[1,46],M=[1,52],U=[1,53],Oe=[1,34],Me=[1,35],Ue=[1,36],ze=[1,37],We=[1,38],fe=[1,58],E=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ee=[1,62],te=[1,61],se=[1,63],Te=[8,9,11,75,77,78],at=[1,79],Se=[1,92],Ee=[1,97],ye=[1,96],xe=[1,93],Fe=[1,89],_e=[1,95],Be=[1,91],ve=[1,98],Le=[1,94],Ve=[1,99],Ie=[1,90],ke=[8,9,10,11,40,75,77,78],W=[8,9,10,11,40,46,75,77,78],q=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],nt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],we=[44,60,89,102,105,106,109,111,114,115,116],ut=[1,122],ot=[1,123],je=[1,125],Ke=[1,124],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,134],ht=[1,148],dt=[1,149],pt=[1,150],ft=[1,151],gt=[1,136],bt=[1,138],At=[1,142],kt=[1,143],mt=[1,144],Ct=[1,145],Dt=[1,146],Tt=[1,147],St=[1,152],Et=[1,153],yt=[1,132],xt=[1,133],Ft=[1,140],_t=[1,135],Bt=[1,139],vt=[1,137],Xe=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Lt=[1,155],Vt=[1,157],v=[8,9,11],H=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],m=[1,177],j=[1,173],K=[1,174],C=[1,178],D=[1,175],T=[1,176],Re=[77,116,119],x=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],It=[10,106],ge=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],ie=[1,248],re=[1,246],ae=[1,250],ne=[1,244],ue=[1,245],oe=[1,247],le=[1,249],ce=[1,251],Ne=[1,269],wt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],Qe={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:k(function(d,p,g,n,F,t,Pe){var s=t.length-1;switch(F){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:n.setDirection("TB"),this.$="TB";break;case 12:n.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=n.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=n.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=n.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),n.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),n.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:n.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),n.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:n.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:n.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:n.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:n.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],n.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],n.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],n.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],n.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],n.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],n.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var V=n.destructLink(t[s],t[s-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[s-1]};break;case 78:var V=n.destructLink(t[s],t[s-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var V=n.destructLink(t[s]);this.$={type:V.type,stroke:V.stroke,length:V.length};break;case 84:var V=n.destructLink(t[s]);this.$={type:V.type,stroke:V.stroke,length:V.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],n.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],n.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],n.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],n.setClickEvent(t[s-3],t[s-2]),n.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],n.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],n.setClickEvent(t[s-4],t[s-3],t[s-2]),n.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],n.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],n.setLink(t[s-4],t[s-2]),n.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],n.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],n.setLink(t[s-6],t[s-4],t[s]),n.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],n.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],n.setLink(t[s-3],t[s-2]),n.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],n.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],n.setLink(t[s-5],t[s-4],t[s]),n.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],n.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],n.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],n.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],n.updateLinkInterpolate([t[s-6]],t[s-2]),n.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],n.updateLinkInterpolate(t[s-6],t[s-2]),n.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],n.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],n.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(u,f,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},e(u,[2,9]),e(u,[2,10]),e(u,[2,11]),{8:[1,55],9:[1,56],10:fe,15:54,18:57},e(E,[2,3]),e(E,[2,4]),e(E,[2,5]),e(E,[2,6]),e(E,[2,7]),e(E,[2,8]),{8:ee,9:te,11:se,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:ee,9:te,11:se,21:68},{8:ee,9:te,11:se,21:69},{8:ee,9:te,11:se,21:70},{8:ee,9:te,11:se,21:71},{8:ee,9:te,11:se,21:72},{8:ee,9:te,10:[1,73],11:se,21:74},e(E,[2,36]),{35:[1,75]},{37:[1,76]},e(E,[2,39]),e(Te,[2,50],{18:77,39:78,10:fe,40:at}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Se,44:Ee,60:ye,80:[1,87],89:xe,95:[1,84],97:[1,85],101:86,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},e(E,[2,185]),e(E,[2,186]),e(E,[2,187]),e(E,[2,188]),e(E,[2,189]),e(ke,[2,51]),e(ke,[2,54],{46:[1,100]}),e(W,[2,72],{113:113,29:[1,101],44:c,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:S,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),e(q,[2,181]),e(q,[2,142]),e(q,[2,143]),e(q,[2,144]),e(q,[2,145]),e(q,[2,146]),e(q,[2,147]),e(q,[2,148]),e(q,[2,149]),e(q,[2,150]),e(q,[2,151]),e(q,[2,152]),e(u,[2,12]),e(u,[2,18]),e(u,[2,19]),{9:[1,114]},e(nt,[2,26],{18:115,10:fe}),e(E,[2,27]),{42:116,43:39,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(E,[2,40]),e(E,[2,41]),e(E,[2,42]),e(we,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ut,81:ot,116:je,119:Ke},{75:[1,126],77:[1,127]},e(lt,[2,83]),e(E,[2,28]),e(E,[2,29]),e(E,[2,30]),e(E,[2,31]),e(E,[2,32]),{10:ct,12:ht,14:dt,27:pt,28:128,32:ft,44:gt,60:bt,75:At,80:[1,130],81:[1,131],83:141,84:kt,85:mt,86:Ct,87:Dt,88:Tt,89:St,90:Et,91:129,105:yt,109:xt,111:Ft,114:_t,115:Bt,116:vt},e(Xe,f,{5:154}),e(E,[2,37]),e(E,[2,38]),e(Te,[2,48],{44:Lt}),e(Te,[2,49],{18:156,10:fe,40:Vt}),e(ke,[2,44]),{44:c,47:158,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{102:[1,159],103:160,105:[1,161]},{44:c,47:162,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{44:c,47:163,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(v,[2,115],{120:168,10:[1,167],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,117],{10:[1,169]}),e(H,[2,183]),e(H,[2,170]),e(H,[2,171]),e(H,[2,172]),e(H,[2,173]),e(H,[2,174]),e(H,[2,175]),e(H,[2,176]),e(H,[2,177]),e(H,[2,178]),e(H,[2,179]),e(H,[2,180]),{44:c,47:170,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{30:171,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:179,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:181,50:[1,180],67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:182,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:183,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:184,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{109:[1,185]},{30:186,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:187,65:[1,188],67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:189,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:190,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{30:191,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(q,[2,182]),e(u,[2,20]),e(nt,[2,25]),e(Te,[2,46],{39:192,18:193,10:fe,40:at}),e(we,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{77:[1,197],79:198,116:je,119:Ke},e(Re,[2,79]),e(Re,[2,81]),e(Re,[2,82]),e(Re,[2,168]),e(Re,[2,169]),{76:199,79:121,80:ut,81:ot,116:je,119:Ke},e(lt,[2,84]),{8:ee,9:te,10:ct,11:se,12:ht,14:dt,21:201,27:pt,29:[1,200],32:ft,44:gt,60:bt,75:At,83:141,84:kt,85:mt,86:Ct,87:Dt,88:Tt,89:St,90:Et,91:202,105:yt,109:xt,111:Ft,114:_t,115:Bt,116:vt},e(x,[2,101]),e(x,[2,103]),e(x,[2,104]),e(x,[2,157]),e(x,[2,158]),e(x,[2,159]),e(x,[2,160]),e(x,[2,161]),e(x,[2,162]),e(x,[2,163]),e(x,[2,164]),e(x,[2,165]),e(x,[2,166]),e(x,[2,167]),e(x,[2,90]),e(x,[2,91]),e(x,[2,92]),e(x,[2,93]),e(x,[2,94]),e(x,[2,95]),e(x,[2,96]),e(x,[2,97]),e(x,[2,98]),e(x,[2,99]),e(x,[2,100]),{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,203],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},{10:fe,18:204},{44:[1,205]},e(ke,[2,43]),{10:[1,206],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{10:[1,207]},{10:[1,208],106:[1,209]},e(It,[2,128]),{10:[1,210],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{10:[1,211],44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:113,114:O,115:M,116:U},{80:[1,212]},e(v,[2,109],{10:[1,213]}),e(v,[2,111],{10:[1,214]}),{80:[1,215]},e(H,[2,184]),{80:[1,216],98:[1,217]},e(ke,[2,55],{113:113,44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),{31:[1,218],67:m,82:219,116:C,117:D,118:T},e(ge,[2,86]),e(ge,[2,88]),e(ge,[2,89]),e(ge,[2,153]),e(ge,[2,154]),e(ge,[2,155]),e(ge,[2,156]),{49:[1,220],67:m,82:219,116:C,117:D,118:T},{30:221,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{51:[1,222],67:m,82:219,116:C,117:D,118:T},{53:[1,223],67:m,82:219,116:C,117:D,118:T},{55:[1,224],67:m,82:219,116:C,117:D,118:T},{57:[1,225],67:m,82:219,116:C,117:D,118:T},{60:[1,226]},{64:[1,227],67:m,82:219,116:C,117:D,118:T},{66:[1,228],67:m,82:219,116:C,117:D,118:T},{30:229,67:m,80:j,81:K,82:172,116:C,117:D,118:T},{31:[1,230],67:m,82:219,116:C,117:D,118:T},{67:m,69:[1,231],71:[1,232],82:219,116:C,117:D,118:T},{67:m,69:[1,234],71:[1,233],82:219,116:C,117:D,118:T},e(Te,[2,45],{18:156,10:fe,40:Vt}),e(Te,[2,47],{44:Lt}),e(we,[2,75]),e(we,[2,74]),{62:[1,235],67:m,82:219,116:C,117:D,118:T},e(we,[2,77]),e(Re,[2,80]),{77:[1,236],79:198,116:je,119:Ke},{30:237,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(Xe,f,{5:238}),e(x,[2,102]),e(E,[2,35]),{43:239,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},{10:fe,18:240},{10:ie,60:re,84:ae,92:241,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:252,104:[1,253],105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:254,104:[1,255],105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{105:[1,256]},{10:ie,60:re,84:ae,92:257,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{44:c,47:258,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(v,[2,116]),e(v,[2,118],{10:[1,262]}),e(v,[2,119]),e(W,[2,56]),e(ge,[2,87]),e(W,[2,57]),{51:[1,263],67:m,82:219,116:C,117:D,118:T},e(W,[2,64]),e(W,[2,59]),e(W,[2,60]),e(W,[2,61]),{109:[1,264]},e(W,[2,63]),e(W,[2,65]),{66:[1,265],67:m,82:219,116:C,117:D,118:T},e(W,[2,67]),e(W,[2,68]),e(W,[2,70]),e(W,[2,69]),e(W,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(we,[2,78]),{31:[1,266],67:m,82:219,116:C,117:D,118:T},{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,267],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},e(ke,[2,53]),{43:268,44:c,45:40,47:41,60:S,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U},e(v,[2,121],{106:Ne}),e(wt,[2,130],{108:270,10:ie,60:re,84:ae,105:ne,109:ue,110:oe,111:le,112:ce}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(v,[2,122],{106:Ne}),{10:[1,271]},e(v,[2,123],{106:Ne}),{10:[1,272]},e(It,[2,129]),e(v,[2,105],{106:Ne}),e(v,[2,106],{113:113,44:c,60:S,89:I,102:w,105:R,106:N,109:G,111:P,114:O,115:M,116:U}),e(v,[2,110]),e(v,[2,112],{10:[1,273]}),e(v,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:ee,9:te,11:se,21:278},e(E,[2,34]),e(ke,[2,52]),{10:ie,60:re,84:ae,105:ne,107:279,108:243,109:ue,110:oe,111:le,112:ce},e($,[2,133]),{14:Se,44:Ee,60:ye,89:xe,101:280,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},{14:Se,44:Ee,60:ye,89:xe,101:281,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie,120:88},{98:[1,282]},e(v,[2,120]),e(W,[2,58]),{30:283,67:m,80:j,81:K,82:172,116:C,117:D,118:T},e(W,[2,66]),e(Xe,f,{5:284}),e(wt,[2,131],{108:270,10:ie,60:re,84:ae,105:ne,109:ue,110:oe,111:le,112:ce}),e(v,[2,126],{120:168,10:[1,285],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,127],{120:168,10:[1,286],14:Se,44:Ee,60:ye,89:xe,105:Fe,106:_e,109:Be,111:ve,114:Le,115:Ve,116:Ie}),e(v,[2,114]),{31:[1,287],67:m,82:219,116:C,117:D,118:T},{6:11,7:12,8:l,9:b,10:h,11:_,20:17,22:18,23:19,24:20,25:21,26:22,27:y,32:[1,288],33:24,34:L,36:A,38:o,42:28,43:39,44:c,45:40,47:41,60:S,84:B,85:Q,86:de,87:pe,88:De,89:I,102:w,105:R,106:N,109:G,111:P,113:42,114:O,115:M,116:U,121:Oe,122:Me,123:Ue,124:ze,125:We},{10:ie,60:re,84:ae,92:289,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},{10:ie,60:re,84:ae,92:290,105:ne,107:242,108:243,109:ue,110:oe,111:le,112:ce},e(W,[2,62]),e(E,[2,33]),e(v,[2,124],{106:Ne}),e(v,[2,125],{106:Ne})],defaultActions:{},parseError:k(function(d,p){if(p.recoverable)this.trace(d);else{var g=new Error(d);throw g.hash=p,g}},"parseError"),parse:k(function(d){var p=this,g=[0],n=[],F=[null],t=[],Pe=this.table,s="",V=0,Rt=0,jt=2,Nt=1,Kt=t.slice.call(arguments,1),z=Object.create(this.lexer),me={yy:{}};for(var Ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ze)&&(me.yy[Ze]=this.yy[Ze]);z.setInput(d,me.yy),me.yy.lexer=z,me.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var Je=z.yylloc;t.push(Je);var Yt=z.options&&z.options.ranges;typeof me.yy.parseError=="function"?this.parseError=me.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qt(X){g.length=g.length-2*X,F.length=F.length-X,t.length=t.length-X}k(qt,"popStack");function Gt(){var X;return X=n.pop()||z.lex()||Nt,typeof X!="number"&&(X instanceof Array&&(n=X,X=n.pop()),X=p.symbols_[X]||X),X}k(Gt,"lex");for(var Y,Ce,Z,$e,Ge={},qe,he,Pt,He;;){if(Ce=g[g.length-1],this.defaultActions[Ce]?Z=this.defaultActions[Ce]:((Y===null||typeof Y>"u")&&(Y=Gt()),Z=Pe[Ce]&&Pe[Ce][Y]),typeof Z>"u"||!Z.length||!Z[0]){var et="";He=[];for(qe in Pe[Ce])this.terminals_[qe]&&qe>jt&&He.push("'"+this.terminals_[qe]+"'");z.showPosition?et="Parse error on line "+(V+1)+`: +`+z.showPosition()+` +Expecting `+He.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":et="Parse error on line "+(V+1)+": Unexpected "+(Y==Nt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(et,{text:z.match,token:this.terminals_[Y]||Y,line:z.yylineno,loc:Je,expected:He})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+Y);switch(Z[0]){case 1:g.push(Y),F.push(z.yytext),t.push(z.yylloc),g.push(Z[1]),Y=null,Rt=z.yyleng,s=z.yytext,V=z.yylineno,Je=z.yylloc;break;case 2:if(he=this.productions_[Z[1]][1],Ge.$=F[F.length-he],Ge._$={first_line:t[t.length-(he||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(he||1)].first_column,last_column:t[t.length-1].last_column},Yt&&(Ge._$.range=[t[t.length-(he||1)].range[0],t[t.length-1].range[1]]),$e=this.performAction.apply(Ge,[s,Rt,V,me.yy,Z[1],F,t].concat(Kt)),typeof $e<"u")return $e;he&&(g=g.slice(0,-1*he*2),F=F.slice(0,-1*he),t=t.slice(0,-1*he)),g.push(this.productions_[Z[1]][0]),F.push(Ge.$),t.push(Ge._$),Pt=Pe[g[g.length-2]][g[g.length-1]],g.push(Pt);break;case 3:return!0}}return!0},"parse")},Wt=(function(){var be={EOF:1,parseError:k(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:k(function(d,p){return this.yy=p||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var p=d.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:k(function(d){var p=d.length,g=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===n.length?this.yylloc.first_column:0)+n[n.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(d){this.unput(this.match.slice(d))},"less"),pastInput:k(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var d=this.pastInput(),p=new Array(d.length+1).join("-");return d+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:k(function(d,p){var g,n,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),n=d[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var t in F)this[t]=F[t];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,p,g,n;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),t=0;tp[0].length)){if(p=g,n=t,this.options.backtrack_lexer){if(d=this.test_match(g,F[t]),d!==!1)return d;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(d=this.test_match(p,F[n]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var p=this.next();return p||this.lex()},"lex"),begin:k(function(p){this.conditionStack.push(p)},"begin"),popState:k(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:k(function(p){this.begin(p)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(p,g,n,F){switch(n){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),g.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return g.yytext=g.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return p.lex.firstGraph()&&this.begin("dir"),12;case 36:return p.lex.firstGraph()&&this.begin("dir"),12;case 37:return p.lex.firstGraph()&&this.begin("dir"),12;case 38:return p.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return be})();Qe.lexer=Wt;function Ye(){this.yy={}}return k(Ye,"Parser"),Ye.prototype=Qe,Qe.Parser=Ye,new Ye})();rt.parser=rt;var Mt=rt,Ut=Object.assign({},Mt);Ut.parse=e=>{const i=e.replace(/}\s*\n/g,`} +`);return Mt.parse(i)};var D1=Ut,T1=k((e,i)=>{const r=g1,a=r(e,"r"),u=r(e,"g"),f=r(e,"b");return d1(a,u,f,i)},"fade"),S1=k(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${T1(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + /* Collapsed subgraph node (@{ view: collapsed }) */ + .node .collapsed-indicator { + fill: ${e.clusterBorder}; + stroke: none; + opacity: 0.6; + } + + .node .collapsed-separator { + stroke: ${e.clusterBorder}; + stroke-width: 0.75px; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${Ht()} +`,"getStyles"),E1=S1,zt=k(({defaultLayout:e,styles:i=E1}={})=>({parser:D1,get db(){return new A1},renderer:C1,styles:i,init:k(r=>{r.flowchart||(r.flowchart={});const a=Zt().layout??e??r.layout;a&&Ot({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Ot({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),y1=zt();const I1=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:zt,diagram:y1},Symbol.toStringTag,{value:"Module"}));export{zt as c,I1 as f,E1 as s}; diff --git a/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-C0NzPZfg.js b/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-C0NzPZfg.js deleted file mode 100644 index b5c92d184..000000000 --- a/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-C0NzPZfg.js +++ /dev/null @@ -1,162 +0,0 @@ -import{g as qe}from"./chunk-FMBD7UC4-CO8Ccrhy.js";import{_ as b,o as Oe,l as Q,c as g1,p as He,r as Xe,u as ie,b as Qe,s as Je,q as Ze,a as $e,g as et,t as tt,k as st,v as it,J as rt,x as at,y as te,d as se,z as nt,A as ut,B as ot,C as lt}from"./mermaid.core-Bt2TZ_t_.js";import{c as ct}from"./chunk-ND2GUHAM-BBoWOe8j.js";import{g as ht}from"./chunk-55IACEB6-CeJhGgl3.js";import{s as dt}from"./chunk-2J33WTMH-C5fSlY2E.js";import{c as pt}from"./channel-DxVW30WC.js";import"./index-C-zUV3mO.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return st.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},f){if(!e||e.trim().length===0)return;let n;if(f!==void 0){let E;f.includes(` -`)?E=f+` -`:E=`{ -`+f+` -}`,n=it(E,{schema:rt})}const A=this.edges.find(E=>E.id===e);if(A){const E=n;E?.animate!==void 0&&(A.animate=E.animate),E?.animation!==void 0&&(A.animation=E.animation),E?.curve!==void 0&&(A.interpolate=E.curve);return}let S,g=this.vertices.get(e);if(g===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Q.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),g={id:e,labelType:"text",domId:ft+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,i!==void 0?(this.config=g1(),S=this.sanitizeText(i.text.trim()),g.labelType=i.type,S.startsWith('"')&&S.endsWith('"')&&(S=S.substring(1,S.length-1)),g.text=S):g.text===void 0&&(g.text=e),r!==void 0&&(g.type=r),a?.forEach(E=>{g.styles.push(E)}),o?.forEach(E=>{g.classes.push(E)}),d!==void 0&&(g.dir=d),g.props===void 0?g.props=l:l!==void 0&&Object.assign(g.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!at(n.shape))throw new Error(`No such shape: ${n.shape}.`);g.type=n?.shape}n?.label&&(g.text=n?.label,g.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(g.icon=n?.icon,!n.label?.trim()&&g.text===e&&(g.text="")),n?.form&&(g.form=n?.form),n?.pos&&(g.pos=n?.pos),n?.img&&(g.img=n?.img,!n.label?.trim()&&g.text===e&&(g.text="")),n?.constraint&&(g.constraint=n.constraint),n.w&&(g.assetWidth=Number(n.w)),n.h&&(g.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Q.info("abc78 Got edge...",l);const f=r.text;if(f!==void 0&&(l.text=this.sanitizeText(f.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(f.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(A=>A.start===l.start&&A.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Q.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. - -Initialize mermaid with maxEdges set to a higher number to allow more edges. -You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Q.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],f=d===i[0];l&&f?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ct();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const f=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),i.html(nt.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ut()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(g=>{const E={boolean:{},number:{},string:{}},Z=[];let _;return{nodeList:g.filter(function(K){const h1=typeof K;return K.stmt&&K.stmt==="dir"?(_=K.value,!1):K.trim()===""?!1:h1 in E?E[h1].hasOwnProperty(K)?!1:E[h1][K]=!0:Z.includes(K)?!1:Z.push(K)}),dir:_}},"uniq")(i.flat()),f=l.nodeList;let n=l.dir;const A=g1().flowchart??{};if(n=n??(A.inheritDir?this.getDirection()??g1().direction??void 0:void 0),this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),f=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const A={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};f?i.push({...A,isGroup:!0,shape:"rect"}):i.push({...A,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const A=a[n];A.nodes.length>0&&d.set(A.id,!0);for(const S of A.nodes)o.set(S,A.id)}for(let n=a.length-1;n>=0;n--){const A=a[n];i.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const f=this.getEdges();return f.forEach((n,A)=>{const{arrowTypeStart:S,arrowTypeEnd:g}=this.destructEdgeType(n.type),E=[...f.defaultStyle??[]];n.style&&E.push(...n.style);const Z={id:te(n.start,n.end,{counter:A,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":S,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":g,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:E,style:E,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Z)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return ot.flowchart}},bt=b(function(e,i){return i.db.getClasses()},"getClasses"),At=b(async function(e,i,r,a){Q.info("REF0:"),Q.info("Drawing state diagram (v2)",i);const{securityLevel:o,flowchart:d,layout:l}=g1();a.db.setDiagramId(i),Q.debug("Before getData: ");const f=a.db.getData();Q.debug("Data: ",f);const n=ht(i,o),A=a.db.getDirection();f.type=a.type,f.layoutAlgorithm=He(l),f.layoutAlgorithm==="dagre"&&l==="elk"&&Q.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),f.direction=A,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross"],f.diagramId=i,Q.debug("REF1:",f),await Xe(f,n);const S=f.config.flowchart?.diagramPadding??8;ie.insertTitle(n,"flowchartTitleText",d?.titleTopMargin||0,a.db.getDiagramTitle()),dt(n,S,"flowchart",d?.useMaxWidth||!1)},"draw"),kt={getClasses:bt,draw:At},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],f=[1,14],n=[1,15],A=[1,16],S=[1,23],g=[1,25],E=[1,26],Z=[1,27],_=[1,50],v=[1,49],K=[1,29],h1=[1,30],N1=[1,31],G1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],m1=[8,9,11,75,77,78],ae=[1,79],C1=[1,92],D1=[1,97],E1=[1,96],T1=[1,93],S1=[1,89],y1=[1,95],x1=[1,91],F1=[1,98],_1=[1,94],B1=[1,99],v1=[1,90],b1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],Y=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],L1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],K1=[1,125],j1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],Ce=[1,145],De=[1,146],Ee=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],F=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],k=[1,177],z=[1,173],W=[1,174],m=[1,178],C=[1,175],D=[1,176],V1=[77,116,119],y=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],I1=[1,269],we=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,x,t,R1){var s=t.length-1;switch(x){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1]};break;case 78:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length};break;case 84:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(m1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:C1,44:D1,60:E1,80:[1,87],89:T1,95:[1,84],97:[1,85],101:86,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(b1,[2,51]),e(b1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:v,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(Y,[2,181]),e(Y,[2,142]),e(Y,[2,143]),e(Y,[2,144]),e(Y,[2,145]),e(Y,[2,146]),e(Y,[2,147]),e(Y,[2,148]),e(Y,[2,149]),e(Y,[2,150]),e(Y,[2,151]),e(Y,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(L1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:K1,119:j1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(m1,[2,48],{44:Le}),e(m1,[2,49],{18:156,10:d1,40:Ve}),e(b1,[2,44]),{44:_,47:158,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:_,47:163,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(F,[2,115],{120:168,10:[1,167],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,117],{10:[1,169]}),e(q,[2,183]),e(q,[2,170]),e(q,[2,171]),e(q,[2,172]),e(q,[2,173]),e(q,[2,174]),e(q,[2,175]),e(q,[2,176]),e(q,[2,177]),e(q,[2,178]),e(q,[2,179]),e(q,[2,180]),{44:_,47:170,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:179,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:181,50:[1,180],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:182,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:183,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:184,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{109:[1,185]},{30:186,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:187,65:[1,188],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:189,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:190,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:191,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(Y,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(m1,[2,46],{39:192,18:193,10:d1,40:ae}),e(L1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{77:[1,197],79:198,116:K1,119:j1},e(V1,[2,79]),e(V1,[2,81]),e(V1,[2,82]),e(V1,[2,168]),e(V1,[2,169]),{76:199,79:121,80:ue,81:oe,116:K1,119:j1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(y,[2,101]),e(y,[2,103]),e(y,[2,104]),e(y,[2,157]),e(y,[2,158]),e(y,[2,159]),e(y,[2,160]),e(y,[2,161]),e(y,[2,162]),e(y,[2,163]),e(y,[2,164]),e(y,[2,165]),e(y,[2,166]),e(y,[2,167]),e(y,[2,90]),e(y,[2,91]),e(y,[2,92]),e(y,[2,93]),e(y,[2,94]),e(y,[2,95]),e(y,[2,96]),e(y,[2,97]),e(y,[2,98]),e(y,[2,99]),e(y,[2,100]),{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,203],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(b1,[2,43]),{10:[1,206],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(F,[2,109],{10:[1,213]}),e(F,[2,111],{10:[1,214]}),{80:[1,215]},e(q,[2,184]),{80:[1,216],98:[1,217]},e(b1,[2,55],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:k,82:219,116:m,117:C,118:D},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:k,82:219,116:m,117:C,118:D},{30:221,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{51:[1,222],67:k,82:219,116:m,117:C,118:D},{53:[1,223],67:k,82:219,116:m,117:C,118:D},{55:[1,224],67:k,82:219,116:m,117:C,118:D},{57:[1,225],67:k,82:219,116:m,117:C,118:D},{60:[1,226]},{64:[1,227],67:k,82:219,116:m,117:C,118:D},{66:[1,228],67:k,82:219,116:m,117:C,118:D},{30:229,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{31:[1,230],67:k,82:219,116:m,117:C,118:D},{67:k,69:[1,231],71:[1,232],82:219,116:m,117:C,118:D},{67:k,69:[1,234],71:[1,233],82:219,116:m,117:C,118:D},e(m1,[2,45],{18:156,10:d1,40:Ve}),e(m1,[2,47],{44:Le}),e(L1,[2,75]),e(L1,[2,74]),{62:[1,235],67:k,82:219,116:m,117:C,118:D},e(L1,[2,77]),e(V1,[2,80]),{77:[1,236],79:198,116:K1,119:j1},{30:237,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(X1,d,{5:238}),e(y,[2,102]),e(T,[2,35]),{43:239,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:_,47:258,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(F,[2,116]),e(F,[2,118],{10:[1,262]}),e(F,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:k,82:219,116:m,117:C,118:D},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:k,82:219,116:m,117:C,118:D},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(L1,[2,78]),{31:[1,266],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,267],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(b1,[2,53]),{43:268,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,121],{106:I1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(J,[2,132]),e(J,[2,134]),e(J,[2,135]),e(J,[2,136]),e(J,[2,137]),e(J,[2,138]),e(J,[2,139]),e(J,[2,140]),e(J,[2,141]),e(F,[2,122],{106:I1}),{10:[1,271]},e(F,[2,123],{106:I1}),{10:[1,272]},e(Ie,[2,129]),e(F,[2,105],{106:I1}),e(F,[2,106],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(F,[2,110]),e(F,[2,112],{10:[1,273]}),e(F,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(b1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(J,[2,133]),{14:C1,44:D1,60:E1,89:T1,101:280,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{14:C1,44:D1,60:E1,89:T1,101:281,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{98:[1,282]},e(F,[2,120]),e(U,[2,58]),{30:283,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(F,[2,126],{120:168,10:[1,285],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,127],{120:168,10:[1,286],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,114]),{31:[1,287],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,288],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(F,[2,124],{106:I1}),e(F,[2,125],{106:I1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],x=[null],t=[],R1=this.table,s="",B=0,Re=0,We=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),A1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(A1.yy[J1]=this.yy[J1]);M.setInput(c,A1.yy),A1.yy.lexer=M,A1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var je=M.options&&M.options.ranges;typeof A1.yy.parseError=="function"?this.parseError=A1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ye(H){p.length=p.length-2*H,x.length=x.length-H,t.length=t.length-H}b(Ye,"popStack");function Ge(){var H;return H=u.pop()||M.lex()||Ne,typeof H!="number"&&(H instanceof Array&&(u=H,H=u.pop()),H=h.symbols_[H]||H),H}b(Ge,"lex");for(var j,k1,X,$1,w1={},q1,c1,Pe,H1;;){if(k1=p[p.length-1],this.defaultActions[k1]?X=this.defaultActions[k1]:((j===null||typeof j>"u")&&(j=Ge()),X=R1[k1]&&R1[k1][j]),typeof X>"u"||!X.length||!X[0]){var ee="";H1=[];for(q1 in R1[k1])this.terminals_[q1]&&q1>We&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(B+1)+`: -`+M.showPosition()+` -Expecting `+H1.join(", ")+", got '"+(this.terminals_[j]||j)+"'":ee="Parse error on line "+(B+1)+": Unexpected "+(j==Ne?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[j]||j,line:M.yylineno,loc:Z1,expected:H1})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k1+", token: "+j);switch(X[0]){case 1:p.push(j),x.push(M.yytext),t.push(M.yylloc),p.push(X[1]),j=null,Re=M.yyleng,s=M.yytext,B=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[X[1]][1],w1.$=x[x.length-c1],w1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},je&&(w1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(w1,[s,Re,B,A1.yy,X[1],x,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),x=x.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[X[1]][0]),x.push(w1.$),t.push(w1._$),Pe=R1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},ze=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` -`+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in x)this[t]=x[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,x[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,x[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,x){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return f1})();Q1.lexer=ze;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} -`);return Me.parse(i)};var mt=Ue,Ct=b((e,i)=>{const r=pt,a=r(e,"r"),o=r(e,"g"),d=r(e,"b");return lt(a,o,d,i)},"fade"),Dt=b(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span { - color: ${e.titleColor}; - } - .cluster-label span p { - background-color: transparent; - } - - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${e.strokeWidth??1}px; - } - .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .katex path { - fill: #000; - stroke: #000; - stroke-width: 1px; - } - - .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - - .root .anchor path { - fill: ${e.lineColor} !important; - stroke-width: 0; - stroke: ${e.lineColor}; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePath .path { - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth??2}px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${Ct(e.edgeLabelBackground,.5)}; - // background-color: - } - - .cluster rect { - fill: ${e.clusterBkg}; - stroke: ${e.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - - rect.text { - fill: none; - stroke-width: 0; - } - - .icon-shape, .image-shape { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - padding: 2px; - } - .label rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - ${qe()} -`,"getStyles"),Et=Dt,vt={parser:mt,get db(){return new gt},renderer:kt,styles:Et,init:b(e=>{e.flowchart||(e.flowchart={}),e.layout&&Oe({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{vt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js b/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js deleted file mode 100644 index c983cfc64..000000000 --- a/apps/pythinker-code/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +++ /dev/null @@ -1,162 +0,0 @@ -import{g as qe}from"./chunk-FMBD7UC4-B2zs_Y-d.js";import{_ as b,n as Oe,l as Q,c as g1,o as He,r as Xe,u as ie,b as Qe,s as Je,p as Ze,a as $e,g as et,q as tt,k as st,t as it,J as rt,v as at,x as te,d as se,y as nt,z as ut,A as ot,B as lt}from"./mermaidParser.worker-Dx4jPi9z.js";import{c as ct}from"./chunk-ND2GUHAM-C4-rwdcv.js";import{g as ht}from"./chunk-55IACEB6-B5dE1-Um.js";import{s as dt}from"./chunk-2J33WTMH-w4sdiKFO.js";import{c as pt}from"./channel-DNkUo9e6.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return st.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},f){if(!e||e.trim().length===0)return;let n;if(f!==void 0){let E;f.includes(` -`)?E=f+` -`:E=`{ -`+f+` -}`,n=it(E,{schema:rt})}const A=this.edges.find(E=>E.id===e);if(A){const E=n;E?.animate!==void 0&&(A.animate=E.animate),E?.animation!==void 0&&(A.animation=E.animation),E?.curve!==void 0&&(A.interpolate=E.curve);return}let S,g=this.vertices.get(e);if(g===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Q.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),g={id:e,labelType:"text",domId:ft+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,i!==void 0?(this.config=g1(),S=this.sanitizeText(i.text.trim()),g.labelType=i.type,S.startsWith('"')&&S.endsWith('"')&&(S=S.substring(1,S.length-1)),g.text=S):g.text===void 0&&(g.text=e),r!==void 0&&(g.type=r),a?.forEach(E=>{g.styles.push(E)}),o?.forEach(E=>{g.classes.push(E)}),d!==void 0&&(g.dir=d),g.props===void 0?g.props=l:l!==void 0&&Object.assign(g.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!at(n.shape))throw new Error(`No such shape: ${n.shape}.`);g.type=n?.shape}n?.label&&(g.text=n?.label,g.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(g.icon=n?.icon,!n.label?.trim()&&g.text===e&&(g.text="")),n?.form&&(g.form=n?.form),n?.pos&&(g.pos=n?.pos),n?.img&&(g.img=n?.img,!n.label?.trim()&&g.text===e&&(g.text="")),n?.constraint&&(g.constraint=n.constraint),n.w&&(g.assetWidth=Number(n.w)),n.h&&(g.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Q.info("abc78 Got edge...",l);const f=r.text;if(f!==void 0&&(l.text=this.sanitizeText(f.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(f.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(A=>A.start===l.start&&A.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Q.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. - -Initialize mermaid with maxEdges set to a higher number to allow more edges. -You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Q.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],f=d===i[0];l&&f?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ct();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const f=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),i.html(nt.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ut()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(g=>{const E={boolean:{},number:{},string:{}},Z=[];let _;return{nodeList:g.filter(function(K){const h1=typeof K;return K.stmt&&K.stmt==="dir"?(_=K.value,!1):K.trim()===""?!1:h1 in E?E[h1].hasOwnProperty(K)?!1:E[h1][K]=!0:Z.includes(K)?!1:Z.push(K)}),dir:_}},"uniq")(i.flat()),f=l.nodeList;let n=l.dir;const A=g1().flowchart??{};if(n=n??(A.inheritDir?this.getDirection()??g1().direction??void 0:void 0),this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),f=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const A={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};f?i.push({...A,isGroup:!0,shape:"rect"}):i.push({...A,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const A=a[n];A.nodes.length>0&&d.set(A.id,!0);for(const S of A.nodes)o.set(S,A.id)}for(let n=a.length-1;n>=0;n--){const A=a[n];i.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const f=this.getEdges();return f.forEach((n,A)=>{const{arrowTypeStart:S,arrowTypeEnd:g}=this.destructEdgeType(n.type),E=[...f.defaultStyle??[]];n.style&&E.push(...n.style);const Z={id:te(n.start,n.end,{counter:A,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":S,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":g,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:E,style:E,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Z)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return ot.flowchart}},bt=b(function(e,i){return i.db.getClasses()},"getClasses"),At=b(async function(e,i,r,a){Q.info("REF0:"),Q.info("Drawing state diagram (v2)",i);const{securityLevel:o,flowchart:d,layout:l}=g1();a.db.setDiagramId(i),Q.debug("Before getData: ");const f=a.db.getData();Q.debug("Data: ",f);const n=ht(i,o),A=a.db.getDirection();f.type=a.type,f.layoutAlgorithm=He(l),f.layoutAlgorithm==="dagre"&&l==="elk"&&Q.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),f.direction=A,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross"],f.diagramId=i,Q.debug("REF1:",f),await Xe(f,n);const S=f.config.flowchart?.diagramPadding??8;ie.insertTitle(n,"flowchartTitleText",d?.titleTopMargin||0,a.db.getDiagramTitle()),dt(n,S,"flowchart",d?.useMaxWidth||!1)},"draw"),kt={getClasses:bt,draw:At},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],f=[1,14],n=[1,15],A=[1,16],S=[1,23],g=[1,25],E=[1,26],Z=[1,27],_=[1,50],v=[1,49],K=[1,29],h1=[1,30],N1=[1,31],G1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],m1=[8,9,11,75,77,78],ae=[1,79],C1=[1,92],D1=[1,97],E1=[1,96],T1=[1,93],S1=[1,89],y1=[1,95],x1=[1,91],F1=[1,98],_1=[1,94],B1=[1,99],v1=[1,90],b1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],Y=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],L1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],K1=[1,125],j1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],Ce=[1,145],De=[1,146],Ee=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],F=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],k=[1,177],z=[1,173],W=[1,174],m=[1,178],C=[1,175],D=[1,176],V1=[77,116,119],y=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],I1=[1,269],we=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,x,t,R1){var s=t.length-1;switch(x){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1]};break;case 78:var B=u.destructLink(t[s],t[s-2]);this.$={type:B.type,stroke:B.stroke,length:B.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length};break;case 84:var B=u.destructLink(t[s]);this.$={type:B.type,stroke:B.stroke,length:B.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(m1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:C1,44:D1,60:E1,80:[1,87],89:T1,95:[1,84],97:[1,85],101:86,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(b1,[2,51]),e(b1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:v,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(Y,[2,181]),e(Y,[2,142]),e(Y,[2,143]),e(Y,[2,144]),e(Y,[2,145]),e(Y,[2,146]),e(Y,[2,147]),e(Y,[2,148]),e(Y,[2,149]),e(Y,[2,150]),e(Y,[2,151]),e(Y,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(L1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:K1,119:j1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(m1,[2,48],{44:Le}),e(m1,[2,49],{18:156,10:d1,40:Ve}),e(b1,[2,44]),{44:_,47:158,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:_,47:163,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(F,[2,115],{120:168,10:[1,167],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,117],{10:[1,169]}),e(q,[2,183]),e(q,[2,170]),e(q,[2,171]),e(q,[2,172]),e(q,[2,173]),e(q,[2,174]),e(q,[2,175]),e(q,[2,176]),e(q,[2,177]),e(q,[2,178]),e(q,[2,179]),e(q,[2,180]),{44:_,47:170,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:179,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:181,50:[1,180],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:182,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:183,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:184,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{109:[1,185]},{30:186,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:187,65:[1,188],67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:189,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:190,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{30:191,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(Y,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(m1,[2,46],{39:192,18:193,10:d1,40:ae}),e(L1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{77:[1,197],79:198,116:K1,119:j1},e(V1,[2,79]),e(V1,[2,81]),e(V1,[2,82]),e(V1,[2,168]),e(V1,[2,169]),{76:199,79:121,80:ue,81:oe,116:K1,119:j1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:Ce,87:De,88:Ee,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(y,[2,101]),e(y,[2,103]),e(y,[2,104]),e(y,[2,157]),e(y,[2,158]),e(y,[2,159]),e(y,[2,160]),e(y,[2,161]),e(y,[2,162]),e(y,[2,163]),e(y,[2,164]),e(y,[2,165]),e(y,[2,166]),e(y,[2,167]),e(y,[2,90]),e(y,[2,91]),e(y,[2,92]),e(y,[2,93]),e(y,[2,94]),e(y,[2,95]),e(y,[2,96]),e(y,[2,97]),e(y,[2,98]),e(y,[2,99]),e(y,[2,100]),{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,203],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(b1,[2,43]),{10:[1,206],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(F,[2,109],{10:[1,213]}),e(F,[2,111],{10:[1,214]}),{80:[1,215]},e(q,[2,184]),{80:[1,216],98:[1,217]},e(b1,[2,55],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:k,82:219,116:m,117:C,118:D},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:k,82:219,116:m,117:C,118:D},{30:221,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{51:[1,222],67:k,82:219,116:m,117:C,118:D},{53:[1,223],67:k,82:219,116:m,117:C,118:D},{55:[1,224],67:k,82:219,116:m,117:C,118:D},{57:[1,225],67:k,82:219,116:m,117:C,118:D},{60:[1,226]},{64:[1,227],67:k,82:219,116:m,117:C,118:D},{66:[1,228],67:k,82:219,116:m,117:C,118:D},{30:229,67:k,80:z,81:W,82:172,116:m,117:C,118:D},{31:[1,230],67:k,82:219,116:m,117:C,118:D},{67:k,69:[1,231],71:[1,232],82:219,116:m,117:C,118:D},{67:k,69:[1,234],71:[1,233],82:219,116:m,117:C,118:D},e(m1,[2,45],{18:156,10:d1,40:Ve}),e(m1,[2,47],{44:Le}),e(L1,[2,75]),e(L1,[2,74]),{62:[1,235],67:k,82:219,116:m,117:C,118:D},e(L1,[2,77]),e(V1,[2,80]),{77:[1,236],79:198,116:K1,119:j1},{30:237,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(X1,d,{5:238}),e(y,[2,102]),e(T,[2,35]),{43:239,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:_,47:258,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(F,[2,116]),e(F,[2,118],{10:[1,262]}),e(F,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:k,82:219,116:m,117:C,118:D},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:k,82:219,116:m,117:C,118:D},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(L1,[2,78]),{31:[1,266],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,267],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(b1,[2,53]),{43:268,44:_,45:40,47:41,60:v,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(F,[2,121],{106:I1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(J,[2,132]),e(J,[2,134]),e(J,[2,135]),e(J,[2,136]),e(J,[2,137]),e(J,[2,138]),e(J,[2,139]),e(J,[2,140]),e(J,[2,141]),e(F,[2,122],{106:I1}),{10:[1,271]},e(F,[2,123],{106:I1}),{10:[1,272]},e(Ie,[2,129]),e(F,[2,105],{106:I1}),e(F,[2,106],{113:113,44:_,60:v,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(F,[2,110]),e(F,[2,112],{10:[1,273]}),e(F,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(b1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(J,[2,133]),{14:C1,44:D1,60:E1,89:T1,101:280,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{14:C1,44:D1,60:E1,89:T1,101:281,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1,120:88},{98:[1,282]},e(F,[2,120]),e(U,[2,58]),{30:283,67:k,80:z,81:W,82:172,116:m,117:C,118:D},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(F,[2,126],{120:168,10:[1,285],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,127],{120:168,10:[1,286],14:C1,44:D1,60:E1,89:T1,105:S1,106:y1,109:x1,111:F1,114:_1,115:B1,116:v1}),e(F,[2,114]),{31:[1,287],67:k,82:219,116:m,117:C,118:D},{6:11,7:12,8:l,9:f,10:n,11:A,20:17,22:18,23:19,24:20,25:21,26:22,27:S,32:[1,288],33:24,34:g,36:E,38:Z,42:28,43:39,44:_,45:40,47:41,60:v,84:K,85:h1,86:N1,87:G1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(F,[2,124],{106:I1}),e(F,[2,125],{106:I1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],x=[null],t=[],R1=this.table,s="",B=0,Re=0,We=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),A1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(A1.yy[J1]=this.yy[J1]);M.setInput(c,A1.yy),A1.yy.lexer=M,A1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var je=M.options&&M.options.ranges;typeof A1.yy.parseError=="function"?this.parseError=A1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ye(H){p.length=p.length-2*H,x.length=x.length-H,t.length=t.length-H}b(Ye,"popStack");function Ge(){var H;return H=u.pop()||M.lex()||Ne,typeof H!="number"&&(H instanceof Array&&(u=H,H=u.pop()),H=h.symbols_[H]||H),H}b(Ge,"lex");for(var j,k1,X,$1,w1={},q1,c1,Pe,H1;;){if(k1=p[p.length-1],this.defaultActions[k1]?X=this.defaultActions[k1]:((j===null||typeof j>"u")&&(j=Ge()),X=R1[k1]&&R1[k1][j]),typeof X>"u"||!X.length||!X[0]){var ee="";H1=[];for(q1 in R1[k1])this.terminals_[q1]&&q1>We&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(B+1)+`: -`+M.showPosition()+` -Expecting `+H1.join(", ")+", got '"+(this.terminals_[j]||j)+"'":ee="Parse error on line "+(B+1)+": Unexpected "+(j==Ne?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[j]||j,line:M.yylineno,loc:Z1,expected:H1})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k1+", token: "+j);switch(X[0]){case 1:p.push(j),x.push(M.yytext),t.push(M.yylloc),p.push(X[1]),j=null,Re=M.yyleng,s=M.yytext,B=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[X[1]][1],w1.$=x[x.length-c1],w1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},je&&(w1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(w1,[s,Re,B,A1.yy,X[1],x,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),x=x.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[X[1]][0]),x.push(w1.$),t.push(w1._$),Pe=R1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},ze=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` -`+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in x)this[t]=x[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,x[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,x[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,x){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 125;case 60:return 78;case 61:return 105;case 62:return 111;case 63:return 46;case 64:return 60;case 65:return 44;case 66:return 8;case 67:return 106;case 68:return 115;case 69:return this.popState(),77;case 70:return this.pushState("edgeText"),75;case 71:return 119;case 72:return this.popState(),77;case 73:return this.pushState("thickEdgeText"),75;case 74:return 119;case 75:return this.popState(),77;case 76:return this.pushState("dottedEdgeText"),75;case 77:return 119;case 78:return 77;case 79:return this.popState(),53;case 80:return"TEXT";case 81:return this.pushState("ellipseText"),52;case 82:return this.popState(),55;case 83:return this.pushState("text"),54;case 84:return this.popState(),57;case 85:return this.pushState("text"),56;case 86:return 58;case 87:return this.pushState("text"),67;case 88:return this.popState(),64;case 89:return this.pushState("text"),63;case 90:return this.popState(),49;case 91:return this.pushState("text"),48;case 92:return this.popState(),69;case 93:return this.popState(),71;case 94:return 117;case 95:return this.pushState("trapText"),68;case 96:return this.pushState("trapText"),70;case 97:return 118;case 98:return 67;case 99:return 90;case 100:return"SEP";case 101:return 89;case 102:return 115;case 103:return 111;case 104:return 44;case 105:return 109;case 106:return 114;case 107:return 116;case 108:return this.popState(),62;case 109:return this.pushState("text"),62;case 110:return this.popState(),51;case 111:return this.pushState("text"),50;case 112:return this.popState(),31;case 113:return this.pushState("text"),29;case 114:return this.popState(),66;case 115:return this.pushState("text"),65;case 116:return"TEXT";case 117:return"QUOTE";case 118:return 9;case 119:return 10;case 120:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},shapeData:{rules:[8,11,12,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackargs:{rules:[17,18,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},callbackname:{rules:[14,15,16,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},href:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},click:{rules:[21,24,33,34,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dottedEdgeText:{rules:[21,24,75,77,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},thickEdgeText:{rules:[21,24,72,74,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},edgeText:{rules:[21,24,69,71,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},trapText:{rules:[21,24,78,81,83,85,89,91,92,93,94,95,96,109,111,113,115],inclusive:!1},ellipseText:{rules:[21,24,78,79,80,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},text:{rules:[21,24,78,81,82,83,84,85,88,89,90,91,95,96,108,109,110,111,112,113,114,115,116],inclusive:!1},vertex:{rules:[21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_descr:{rules:[3,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},acc_title:{rules:[1,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},md_string:{rules:[19,20,21,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},string:{rules:[21,22,23,24,78,81,83,85,89,91,95,96,109,111,113,115],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,78,81,83,85,86,87,89,91,95,96,97,98,99,100,101,102,103,104,105,106,107,109,111,113,115,117,118,119,120],inclusive:!0}}};return f1})();Q1.lexer=ze;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} -`);return Me.parse(i)};var mt=Ue,Ct=b((e,i)=>{const r=pt,a=r(e,"r"),o=r(e,"g"),d=r(e,"b");return lt(a,o,d,i)},"fade"),Dt=b(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span { - color: ${e.titleColor}; - } - .cluster-label span p { - background-color: transparent; - } - - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${e.strokeWidth??1}px; - } - .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .katex path { - fill: #000; - stroke: #000; - stroke-width: 1px; - } - - .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - - .root .anchor path { - fill: ${e.lineColor} !important; - stroke-width: 0; - stroke: ${e.lineColor}; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePath .path { - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth??2}px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${Ct(e.edgeLabelBackground,.5)}; - // background-color: - } - - .cluster rect { - fill: ${e.clusterBkg}; - stroke: ${e.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - - rect.text { - fill: none; - stroke-width: 0; - } - - .icon-shape, .image-shape { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - padding: 2px; - } - .label rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - ${qe()} -`,"getStyles"),Et=Dt,Bt={parser:mt,get db(){return new gt},renderer:kt,styles:Et,init:b(e=>{e.flowchart||(e.flowchart={}),e.layout&&Oe({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{Bt as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/freemarker2-C_dr9LiI.js b/apps/pythinker-code/dist-web/assets/freemarker2-C0l6anS_.js similarity index 92% rename from apps/pythinker-code/dist-web/assets/freemarker2-C_dr9LiI.js rename to apps/pythinker-code/dist-web/assets/freemarker2-C0l6anS_.js index f36940562..5939d4767 100644 --- a/apps/pythinker-code/dist-web/assets/freemarker2-C_dr9LiI.js +++ b/apps/pythinker-code/dist-web/assets/freemarker2-C0l6anS_.js @@ -1,3 +1,3 @@ -import{l as c}from"./editor.main-PjnZnl8g.js";import"./index-C-zUV3mO.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:` +import{l as c}from"./editor.main-CYqrlDj5.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:` \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${d.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:` -\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(r,t),i=_(a,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const x={conf:l(r),language:_(r,k)},$={conf:l(a),language:_(a,k)},E={conf:l(r),language:_(r,p)},B={conf:l(a),language:_(a,p)},D={conf:g(),language:A(k)},C={conf:g(),language:A(p)};export{E as TagAngleInterpolationBracket,x as TagAngleInterpolationDollar,C as TagAutoInterpolationBracket,D as TagAutoInterpolationDollar,B as TagBracketInterpolationBracket,$ as TagBracketInterpolationDollar}; +\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(r,t),i=_(a,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const $={conf:l(r),language:_(r,k)},E={conf:l(a),language:_(a,k)},B={conf:l(r),language:_(r,p)},D={conf:l(a),language:_(a,p)},C={conf:g(),language:A(k)},v={conf:g(),language:A(p)};export{B as TagAngleInterpolationBracket,$ as TagAngleInterpolationDollar,v as TagAutoInterpolationBracket,C as TagAutoInterpolationDollar,D as TagBracketInterpolationBracket,E as TagBracketInterpolationDollar}; diff --git a/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js b/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js deleted file mode 100644 index 19f9412a1..000000000 --- a/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +++ /dev/null @@ -1,292 +0,0 @@ -import{bf as on,bg as $n,bh as cn,bi as un,bj as ln,bk as ue,bl as On,b4 as oe,g as Hn,s as Nn,q as Pn,p as Rn,a as Vn,b as zn,_ as d,c as Yt,d as Zt,e as qn,bm as rt,l as Tt,k as Bn,j as Zn,z as Xn,u as Gn}from"./mermaidParser.worker-Dx4jPi9z.js";import{b as jn,t as Ne,c as Qn,a as Jn,l as Kn}from"./linear-3mB6q2-g.js";import{i as tr}from"./init-Gi6I4Gst.js";import"./defaultLocale-CCNgq9ws.js";function er(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ir(t){return"translate("+t+",0)"}function sr(t){return"translate(0,"+t+")"}function ar(t){return e=>+t(e)}function or(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,a=6,c=6,m=3,Y=typeof window<"u"&&window.devicePixelRatio>1?0:.5,C=t===Gt||t===Xt?-1:1,p=t===Xt||t===le?"x":"y",L=t===Gt||t===xe?ir:sr;function _(S){var B=r??(e.ticks?e.ticks.apply(e,n):e.domain()),A=i??(e.tickFormat?e.tickFormat.apply(e,n):rr),U=Math.max(a,0)+m,I=e.range(),N=+I[0]+Y,W=+I[I.length-1]+Y,q=(e.bandwidth?or:ar)(e.copy(),Y),j=S.selection?S.selection():S,k=j.selectAll(".domain").data([null]),g=j.selectAll(".tick").data(B,e).order(),y=g.exit(),h=g.enter().append("g").attr("class","tick"),D=g.select("line"),w=g.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),g=g.merge(h),D=D.merge(h.append("line").attr("stroke","currentColor").attr(p+"2",C*a)),w=w.merge(h.append("text").attr("fill","currentColor").attr(p,C*U).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),S!==j&&(k=k.transition(S),g=g.transition(S),D=D.transition(S),w=w.transition(S),y=y.transition(S).attr("opacity",Pe).attr("transform",function(T){return isFinite(T=q(T))?L(T+Y):this.getAttribute("transform")}),h.attr("opacity",Pe).attr("transform",function(T){var v=this.parentNode.__axis;return L((v&&isFinite(v=v(T))?v:q(T))+Y)})),y.remove(),k.attr("d",t===Xt||t===le?c?"M"+C*c+","+N+"H"+Y+"V"+W+"H"+C*c:"M"+Y+","+N+"V"+W:c?"M"+N+","+C*c+"V"+Y+"H"+W+"V"+C*c:"M"+N+","+Y+"H"+W),g.attr("opacity",1).attr("transform",function(T){return L(q(T)+Y)}),D.attr(p+"2",C*a),w.attr(p,C*U).text(A),j.filter(cr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),j.each(function(){this.__axis=q})}return _.scale=function(S){return arguments.length?(e=S,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(S){return arguments.length?(n=S==null?[]:Array.from(S),_):n.slice()},_.tickValues=function(S){return arguments.length?(r=S==null?null:Array.from(S),_):r&&r.slice()},_.tickFormat=function(S){return arguments.length?(i=S,_):i},_.tickSize=function(S){return arguments.length?(a=c=+S,_):a},_.tickSizeInner=function(S){return arguments.length?(a=+S,_):a},_.tickSizeOuter=function(S){return arguments.length?(c=+S,_):c},_.tickPadding=function(S){return arguments.length?(m=+S,_):m},_.offset=function(S){return arguments.length?(Y=+S,_):Y},_}function ur(t){return fn(Gt,t)}function lr(t){return fn(xe,t)}const fr=Math.PI/180,dr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,hr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=$n(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),a,c;return e===n&&n===r?a=c=i:(a=fe((.4360747*e+.3850649*n+.1430804*r)/dn),c=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(a-i),200*(i-c),t.opacity)}function mr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,mr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>hr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const c=i(a),m=i.ceil(a);return a-c(e(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,m)=>{const Y=[];if(a=i.ceil(a),m=m==null?1:Math.floor(m),!(a0))return Y;let C;do Y.push(C=new Date(+a)),e(a,m),t(a);while(Cet(c=>{if(c>=c)for(;t(c),!a(c);)c.setTime(c-1)},(c,m)=>{if(c>=c)if(m<0)for(;++m<=0;)for(;e(c,-1),!a(c););else for(;--m>=0;)for(;e(c,1),!a(c););}),n&&(i.count=(a,c)=>(ge.setTime(+a),ye.setTime(+c),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const Et=et(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?et(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Re=yt*30,ke=yt*365,vt=et(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Ot=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Ot.range;const vr=et(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());vr.range;const Ht=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Ht.range;const Tr=et(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());Tr.range;const xt=et(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const xr=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));xr.range;function Dt(t){return et(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const Rt=Dt(0),Nt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);Rt.range;Nt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return et(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),br=Mt(2),wr=Mt(3),It=Mt(4),Dr=Mt(5),Mr=Mt(6);wn.range;re.range;br.range;wr.range;It.range;Dr.range;Mr.range;const Pt=et(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Pt.range;const Cr=et(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Cr.range;const kt=et(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=et(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Sr(t,e,n,r,i,a){const c=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[a,1,ct],[a,5,5*ct],[a,15,15*ct],[a,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Re],[e,3,3*Re],[t,1,ke]];function m(C,p,L){const _=pU).right(c,_);if(S===c.length)return t.every(Ne(C/ke,p/ke,L));if(S===0)return Et.every(Math.max(Ne(C,p,L),1));const[B,A]=c[_/c[S-1][2]53)return null;"w"in l||(l.w=1),"Z"in l?($=ve(At(l.y,0,1)),Q=$.getUTCDay(),$=Q>4||Q===0?re.ceil($):re($),$=_e.offset($,(l.V-1)*7),l.y=$.getUTCFullYear(),l.m=$.getUTCMonth(),l.d=$.getUTCDate()+(l.w+6)%7):($=pe(At(l.y,0,1)),Q=$.getDay(),$=Q>4||Q===0?Nt.ceil($):Nt($),$=xt.offset($,(l.V-1)*7),l.y=$.getFullYear(),l.m=$.getMonth(),l.d=$.getDate()+(l.w+6)%7)}else("W"in l||"U"in l)&&("w"in l||(l.w="u"in l?l.u%7:"W"in l?1:0),Q="Z"in l?ve(At(l.y,0,1)).getUTCDay():pe(At(l.y,0,1)).getDay(),l.m=0,l.d="W"in l?(l.w+6)%7+l.W*7-(Q+5)%7:l.w+l.U*7-(Q+6)%7);return"Z"in l?(l.H+=l.Z/100|0,l.M+=l.Z%100,ve(l)):pe(l)}}function y(M,H,R,l){for(var J=0,$=H.length,Q=R.length,G,it;J<$;){if(l>=Q)return-1;if(G=H.charCodeAt(J++),G===37){if(G=H.charAt(J++),it=j[G in Ve?H.charAt(J++):G],!it||(l=it(M,R,l))<0)return-1}else if(G!=R.charCodeAt(l++))return-1}return l}function h(M,H,R){var l=C.exec(H.slice(R));return l?(M.p=p.get(l[0].toLowerCase()),R+l[0].length):-1}function D(M,H,R){var l=S.exec(H.slice(R));return l?(M.w=B.get(l[0].toLowerCase()),R+l[0].length):-1}function w(M,H,R){var l=L.exec(H.slice(R));return l?(M.w=_.get(l[0].toLowerCase()),R+l[0].length):-1}function T(M,H,R){var l=I.exec(H.slice(R));return l?(M.m=N.get(l[0].toLowerCase()),R+l[0].length):-1}function v(M,H,R){var l=A.exec(H.slice(R));return l?(M.m=U.get(l[0].toLowerCase()),R+l[0].length):-1}function u(M,H,R){return y(M,e,H,R)}function f(M,H,R){return y(M,n,H,R)}function x(M,H,R){return y(M,r,H,R)}function b(M){return c[M.getDay()]}function F(M){return a[M.getDay()]}function o(M){return Y[M.getMonth()]}function X(M){return m[M.getMonth()]}function s(M){return i[+(M.getHours()>=12)]}function E(M){return 1+~~(M.getMonth()/3)}function z(M){return c[M.getUTCDay()]}function V(M){return a[M.getUTCDay()]}function P(M){return Y[M.getUTCMonth()]}function K(M){return m[M.getUTCMonth()]}function O(M){return i[+(M.getUTCHours()>=12)]}function st(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var H=k(M+="",W);return H.toString=function(){return M},H},parse:function(M){var H=g(M+="",!1);return H.toString=function(){return M},H},utcFormat:function(M){var H=k(M+="",q);return H.toString=function(){return M},H},utcParse:function(M){var H=g(M+="",!0);return H.toString=function(){return M},H}}}var Ve={"-":"",_:" ",0:"0"},nt=/^\s*\d+/,Ur=/^%/,Er=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Lr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Nr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Pr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zr(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function jr(t,e){return Z(t.getHours(),e,2)}function Qr(t,e){return Z(t.getHours()%12||12,e,2)}function Jr(t,e){return Z(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function Kr(t,e){return Dn(t,e)+"000"}function ti(t,e){return Z(t.getMonth()+1,e,2)}function ei(t,e){return Z(t.getMinutes(),e,2)}function ni(t,e){return Z(t.getSeconds(),e,2)}function ri(t){var e=t.getDay();return e===0?7:e}function ii(t,e){return Z(Rt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function si(t,e){return t=Mn(t),Z(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ai(t){return t.getDay()}function oi(t,e){return Z(Nt.count(kt(t)-1,t),e,2)}function ci(t,e){return Z(t.getFullYear()%100,e,2)}function ui(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function li(t,e){return Z(t.getFullYear()%1e4,e,4)}function fi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function di(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function hi(t,e){return Z(t.getUTCHours(),e,2)}function mi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function gi(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function yi(t,e){return Cn(t,e)+"000"}function ki(t,e){return Z(t.getUTCMonth()+1,e,2)}function pi(t,e){return Z(t.getUTCMinutes(),e,2)}function vi(t,e){return Z(t.getUTCSeconds(),e,2)}function Ti(t){var e=t.getUTCDay();return e===0?7:e}function xi(t,e){return Z(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function bi(t,e){return t=Sn(t),Z(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function wi(t){return t.getUTCDay()}function Di(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Mi(t,e){return Z(t.getUTCFullYear()%100,e,2)}function Ci(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Si(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function _i(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Yi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Fi({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fi(t){return St=Fr(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ui(t){return new Date(t)}function Ei(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,a,c,m,Y,C){var p=Qn(),L=p.invert,_=p.domain,S=C(".%L"),B=C(":%S"),A=C("%I:%M"),U=C("%I %p"),I=C("%a %d"),N=C("%b %d"),W=C("%B"),q=C("%Y");function j(k){return(Y(k)4&&(S+=7),_.add(S,n));return B.diff(A,"week")+1},m.isoWeekday=function(C){return this.$utils().u(C)?this.day()||7:this.day(this.day()%7?C:C-7)};var Y=m.startOf;m.startOf=function(C,p){var L=this.$utils(),_=!!L.u(p)||p;return L.p(C)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):Y.bind(this)(C,p)}}}))})(jt)),jt.exports}var Wi=Ai(),$i=oe(Wi),Qt={exports:{}},Oi=Qt.exports,tn;function Hi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Oi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,c=/\d\d?/,m=/\d*[^-_:/,()\s\d]+/,Y={},C=function(U){return(U=+U)+(U>68?1900:2e3)},p=function(U){return function(I){this[U]=+I}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var N=I.match(/([+-]|\d\d)/g),W=60*N[1]+(+N[2]||0);return W===0?0:N[0]==="+"?-W:W})(U)}],_=function(U){var I=Y[U];return I&&(I.indexOf?I:I.s.concat(I.f))},S=function(U,I){var N,W=Y.meridiem;if(W){for(var q=1;q<=24;q+=1)if(U.indexOf(W(q,0,I))>-1){N=q>12;break}}else N=U===(I?"pm":"PM");return N},B={A:[m,function(U){this.afternoon=S(U,!1)}],a:[m,function(U){this.afternoon=S(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],s:[c,p("seconds")],ss:[c,p("seconds")],m:[c,p("minutes")],mm:[c,p("minutes")],H:[c,p("hours")],h:[c,p("hours")],HH:[c,p("hours")],hh:[c,p("hours")],D:[c,p("day")],DD:[a,p("day")],Do:[m,function(U){var I=Y.ordinal,N=U.match(/\d+/);if(this.day=N[0],I)for(var W=1;W<=31;W+=1)I(W).replace(/\[|\]/g,"")===U&&(this.day=W)}],w:[c,p("week")],ww:[a,p("week")],M:[c,p("month")],MM:[a,p("month")],MMM:[m,function(U){var I=_("months"),N=(_("monthsShort")||I.map((function(W){return W.slice(0,3)}))).indexOf(U)+1;if(N<1)throw new Error;this.month=N%12||N}],MMMM:[m,function(U){var I=_("months").indexOf(U)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,p("year")],YY:[a,function(U){this.year=C(U)}],YYYY:[/\d{4}/,p("year")],Z:L,ZZ:L};function A(U){var I,N;I=U,N=Y&&Y.formats;for(var W=(U=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,w,T){var v=T&&T.toUpperCase();return w||N[T]||n[T]||N[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(u,f,x){return f||x.slice(1)}))}))).match(r),q=W.length,j=0;j-1)return new Date((F==="X"?1e3:1)*b);var s=A(F)(b),E=s.year,z=s.month,V=s.day,P=s.hours,K=s.minutes,O=s.seconds,st=s.milliseconds,M=s.zone,H=s.week,R=new Date,l=V||(E||z?1:R.getDate()),J=E||R.getFullYear(),$=0;E&&!z||($=z>0?z-1:R.getMonth());var Q,G=P||0,it=K||0,at=O||0,pt=st||0;return M?new Date(Date.UTC(J,$,l,G,it,at,pt+60*M.offset*1e3)):o?new Date(Date.UTC(J,$,l,G,it,at,pt)):(Q=new Date(J,$,l,G,it,at,pt),H&&(Q=X(Q).week(H).toDate()),Q)}catch{return new Date("")}})(k,h,g,N),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),T&&k!=this.format(h)&&(this.$d=new Date("")),Y={}}else if(h instanceof Array)for(var u=h.length,f=1;f<=u;f+=1){y[1]=h[f-1];var x=N.apply(this,y);if(x.isValid()){this.$d=x.$d,this.$L=x.$L,this.init();break}f===u&&(this.$d=new Date(""))}else q.call(this,j)}}}))})(Qt)),Qt.exports}var Ni=Hi(),Pi=oe(Ni),Jt={exports:{}},Ri=Jt.exports,en;function Vi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,a=i.format;i.format=function(c){var m=this,Y=this.$locale();if(!this.isValid())return a.bind(this)(c);var C=this.$utils(),p=(c||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(L){switch(L){case"Q":return Math.ceil((m.$M+1)/3);case"Do":return Y.ordinal(m.$D);case"gggg":return m.weekYear();case"GGGG":return m.isoWeekYear();case"wo":return Y.ordinal(m.week(),"W");case"w":case"ww":return C.s(m.week(),L==="w"?1:2,"0");case"W":case"WW":return C.s(m.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return C.s(String(m.$H===0?24:m.$H),L==="k"?1:2,"0");case"X":return Math.floor(m.$d.getTime()/1e3);case"x":return m.$d.getTime();case"z":return"["+m.offsetName()+"]";case"zzz":return"["+m.offsetName("long")+"]";default:return L}}));return a.bind(this)(p)}}}))})(Jt)),Jt.exports}var zi=Vi(),qi=oe(zi),Kt={exports:{}},Bi=Kt.exports,nn;function Zi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Bi,(function(){var n,r,i=1e3,a=6e4,c=36e5,m=864e5,Y=31536e6,C=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,L=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:Y,months:C,days:m,hours:c,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},S=function(k){return k instanceof q},B=function(k,g,y){return new q(k,y,g.$l)},A=function(k){return r.p(k)+"s"},U=function(k){return k<0},I=function(k){return U(k)?Math.ceil(k):Math.floor(k)},N=function(k){return Math.abs(k)},W=function(k,g){return k?U(k)?{negative:!0,format:""+N(k)+g}:{negative:!1,format:""+k+g}:{negative:!1,format:""}},q=(function(){function k(y,h,D){var w=this;if(this.$d={},this.$l=D,y===void 0&&(this.$ms=0,this.parseFromMilliseconds()),h)return B(y*_[A(h)],this);if(typeof y=="number")return this.$ms=y,this.parseFromMilliseconds(),this;if(typeof y=="object")return Object.keys(y).forEach((function(u){w.$d[A(u)]=y[u]})),this.calMilliseconds(),this;if(typeof y=="string"){var T=y.match(p);if(T){var v=T.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=v[0],this.$d.months=v[1],this.$d.weeks=v[2],this.$d.days=v[3],this.$d.hours=v[4],this.$d.minutes=v[5],this.$d.seconds=v[6],this.calMilliseconds(),this}}return this}var g=k.prototype;return g.calMilliseconds=function(){var y=this;this.$ms=Object.keys(this.$d).reduce((function(h,D){return h+(y.$d[D]||0)*_[D]}),0)},g.parseFromMilliseconds=function(){var y=this.$ms;this.$d.years=I(y/Y),y%=Y,this.$d.months=I(y/C),y%=C,this.$d.days=I(y/m),y%=m,this.$d.hours=I(y/c),y%=c,this.$d.minutes=I(y/a),y%=a,this.$d.seconds=I(y/i),y%=i,this.$d.milliseconds=y},g.toISOString=function(){var y=W(this.$d.years,"Y"),h=W(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var w=W(D,"D"),T=W(this.$d.hours,"H"),v=W(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var f=W(u,"S"),x=y.negative||h.negative||w.negative||T.negative||v.negative||f.negative,b=T.format||v.format||f.format?"T":"",F=(x?"-":"")+"P"+y.format+h.format+w.format+b+T.format+v.format+f.format;return F==="P"||F==="-P"?"P0D":F},g.toJSON=function(){return this.toISOString()},g.format=function(y){var h=y||"YYYY-MM-DDTHH:mm:ss",D={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return h.replace(L,(function(w,T){return T||String(D[w])}))},g.as=function(y){return this.$ms/_[A(y)]},g.get=function(y){var h=this.$ms,D=A(y);return D==="milliseconds"?h%=1e3:h=D==="weeks"?I(h/_[D]):this.$d[D],h||0},g.add=function(y,h,D){var w;return w=h?y*_[A(h)]:S(y)?y.$ms:B(y,this).$ms,B(this.$ms+w*(D?-1:1),this)},g.subtract=function(y,h){return this.add(y,h,!0)},g.locale=function(y){var h=this.clone();return h.$l=y,h},g.clone=function(){return B(this.$ms,this)},g.humanize=function(y){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!y)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},k})(),j=function(k,g,y){return k.add(g.years()*y,"y").add(g.months()*y,"M").add(g.days()*y,"d").add(g.hours()*y,"h").add(g.minutes()*y,"m").add(g.seconds()*y,"s").add(g.milliseconds()*y,"ms")};return function(k,g,y){n=y,r=y().$utils(),y.duration=function(w,T){var v=y.locale();return B(w,{$l:v},T)},y.isDuration=S;var h=g.prototype.add,D=g.prototype.subtract;g.prototype.add=function(w,T){return S(w)?j(this,w,1):h.bind(this)(w,T)},g.prototype.subtract=function(w,T){return S(w)?j(this,w,-1):D.bind(this)(w,T)}}}))})(Kt)),Kt.exports}var Xi=Zi(),Gi=oe(Xi),we=(function(){var t=d(function(v,u,f,x){for(f=f||{},x=v.length;x--;f[v[x]]=u);return f},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],c=[1,30],m=[1,31],Y=[1,32],C=[1,33],p=[1,34],L=[1,9],_=[1,10],S=[1,11],B=[1,12],A=[1,13],U=[1,14],I=[1,15],N=[1,16],W=[1,19],q=[1,20],j=[1,21],k=[1,22],g=[1,23],y=[1,25],h=[1,35],D={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(u,f,x,b,F,o,X){var s=o.length-1;switch(F){case 1:return o[s-1];case 2:this.$=[];break;case 3:o[s-1].push(o[s]),this.$=o[s-1];break;case 4:case 5:this.$=o[s];break;case 6:case 7:this.$=[];break;case 8:b.setWeekday("monday");break;case 9:b.setWeekday("tuesday");break;case 10:b.setWeekday("wednesday");break;case 11:b.setWeekday("thursday");break;case 12:b.setWeekday("friday");break;case 13:b.setWeekday("saturday");break;case 14:b.setWeekday("sunday");break;case 15:b.setWeekend("friday");break;case 16:b.setWeekend("saturday");break;case 17:b.setDateFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 18:b.enableInclusiveEndDates(),this.$=o[s].substr(18);break;case 19:b.TopAxis(),this.$=o[s].substr(8);break;case 20:b.setAxisFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 21:b.setTickInterval(o[s].substr(13)),this.$=o[s].substr(13);break;case 22:b.setExcludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 23:b.setIncludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 24:b.setTodayMarker(o[s].substr(12)),this.$=o[s].substr(12);break;case 27:b.setDiagramTitle(o[s].substr(6)),this.$=o[s].substr(6);break;case 28:this.$=o[s].trim(),b.setAccTitle(this.$);break;case 29:case 30:this.$=o[s].trim(),b.setAccDescription(this.$);break;case 31:b.addSection(o[s].substr(8)),this.$=o[s].substr(8);break;case 33:b.addTask(o[s-1],o[s]),this.$="task";break;case 34:this.$=o[s-1],b.setClickEvent(o[s-1],o[s],null);break;case 35:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],o[s]);break;case 36:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],null),b.setLink(o[s-2],o[s]);break;case 37:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-2],o[s-1]),b.setLink(o[s-3],o[s]);break;case 38:this.$=o[s-2],b.setClickEvent(o[s-2],o[s],null),b.setLink(o[s-2],o[s-1]);break;case 39:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-1],o[s]),b.setLink(o[s-3],o[s-2]);break;case 40:this.$=o[s-1],b.setLink(o[s-1],o[s]);break;case 41:case 47:this.$=o[s-1]+" "+o[s];break;case 42:case 43:case 45:this.$=o[s-2]+" "+o[s-1]+" "+o[s];break;case 44:case 46:this.$=o[s-3]+" "+o[s-2]+" "+o[s-1]+" "+o[s];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(u,f){if(f.recoverable)this.trace(u);else{var x=new Error(u);throw x.hash=f,x}},"parseError"),parse:d(function(u){var f=this,x=[0],b=[],F=[null],o=[],X=this.table,s="",E=0,z=0,V=2,P=1,K=o.slice.call(arguments,1),O=Object.create(this.lexer),st={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(st.yy[M]=this.yy[M]);O.setInput(u,st.yy),st.yy.lexer=O,st.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var H=O.yylloc;o.push(H);var R=O.options&&O.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function l(ot){x.length=x.length-2*ot,F.length=F.length-ot,o.length=o.length-ot}d(l,"popStack");function J(){var ot;return ot=b.pop()||O.lex()||P,typeof ot!="number"&&(ot instanceof Array&&(b=ot,ot=b.pop()),ot=f.symbols_[ot]||ot),ot}d(J,"lex");for(var $,Q,G,it,at={},pt,ut,He,Bt;;){if(Q=x[x.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:(($===null||typeof $>"u")&&($=J()),G=X[Q]&&X[Q][$]),typeof G>"u"||!G.length||!G[0]){var ce="";Bt=[];for(pt in X[Q])this.terminals_[pt]&&pt>V&&Bt.push("'"+this.terminals_[pt]+"'");O.showPosition?ce="Parse error on line "+(E+1)+`: -`+O.showPosition()+` -Expecting `+Bt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":ce="Parse error on line "+(E+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(ce,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:H,expected:Bt})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+$);switch(G[0]){case 1:x.push($),F.push(O.yytext),o.push(O.yylloc),x.push(G[1]),$=null,z=O.yyleng,s=O.yytext,E=O.yylineno,H=O.yylloc;break;case 2:if(ut=this.productions_[G[1]][1],at.$=F[F.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},R&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),it=this.performAction.apply(at,[s,z,E,st.yy,G[1],F,o].concat(K)),typeof it<"u")return it;ut&&(x=x.slice(0,-1*ut*2),F=F.slice(0,-1*ut),o=o.slice(0,-1*ut)),x.push(this.productions_[G[1]][0]),F.push(at.$),o.push(at._$),He=X[x[x.length-2]][x[x.length-1]],x.push(He);break;case 3:return!0}}return!0},"parse")},w=(function(){var v={EOF:1,parseError:d(function(f,x){if(this.yy.parser)this.yy.parser.parseError(f,x);else throw new Error(f)},"parseError"),setInput:d(function(u,f){return this.yy=f||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var f=u.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:d(function(u){var f=u.length,x=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===b.length?this.yylloc.first_column:0)+b[b.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(u){this.unput(this.match.slice(u))},"less"),pastInput:d(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var u=this.pastInput(),f=new Array(u.length+1).join("-");return u+this.upcomingInput()+` -`+f+"^"},"showPosition"),test_match:d(function(u,f){var x,b,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),b=u[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,f,x,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;of[0].length)){if(f=x,b=o,this.options.backtrack_lexer){if(u=this.test_match(x,F[o]),u!==!1)return u;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(u=this.test_match(f,F[b]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var f=this.next();return f||this.lex()},"lex"),begin:d(function(f){this.conditionStack.push(f)},"begin"),popState:d(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:d(function(f){this.begin(f)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(f,x,b,F){switch(b){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return v})();D.lexer=w;function T(){this.yy={}}return d(T,"Parser"),T.prototype=D,D.Parser=T,new T})();we.parser=we;var ji=we;rt.extend($i);rt.extend(Pi);rt.extend(qi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Vt=[],zt=[],Ee=new Map,Ie=[],se=[],Lt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Qi=d(function(){Ie=[],se=[],Lt="",Ae=[],te=0,Ce=void 0,ee=void 0,tt=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Vt=[],zt=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Xn(),$e="sunday",ae="saturday"},"clear"),Ji=d(function(t){_t=t},"setDiagramId"),Ki=d(function(t){Ye=t},"setAxisFormat"),ts=d(function(){return Ye},"getAxisFormat"),es=d(function(t){Fe=t},"setTickInterval"),ns=d(function(){return Fe},"getTickInterval"),rs=d(function(t){Ue=t},"setTodayMarker"),is=d(function(){return Ue},"getTodayMarker"),ss=d(function(t){lt=t},"setDateFormat"),as=d(function(){qt=!0},"enableInclusiveEndDates"),os=d(function(){return qt},"endDatesAreInclusive"),cs=d(function(){We=!0},"enableTopAxis"),us=d(function(){return We},"topAxisEnabled"),ls=d(function(t){Le=t},"setDisplayMode"),fs=d(function(){return Le},"getDisplayMode"),ds=d(function(){return lt},"getDateFormat"),hs=d(function(t){Vt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),ms=d(function(){return Vt},"getIncludes"),gs=d(function(t){zt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),ys=d(function(){return zt},"getExcludes"),ks=d(function(){return Ee},"getLinks"),ps=d(function(t){Lt=t,Ie.push(t)},"addSection"),vs=d(function(){return Ie},"getSections"),Ts=d(function(){let t=sn();const e=10;let n=0;for(;!t&&nm))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,c]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(m=>{const Y=m.trim();return Y==="x"||Y==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const a=/^after\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let m=null;for(const C of a.groups.ids.split(" ")){let p=Ct(C);p!==void 0&&(!m||p.endTime>m.endTime)&&(m=p)}if(m)return m.endTime;const Y=new Date;return Y.setHours(0,0,0,0),Y}let c=rt(n,e.trim(),!0);if(c.isValid())return c.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const m=new Date(n);if(m===void 0||isNaN(m.getTime())||m.getFullYear()<-1e4||m.getFullYear()>1e4)throw new Error("Invalid date:"+n);return m}},"getStartDate"),En=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),In=d(function(t,e,n,r=!1){n=n.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let p=null;for(const _ of a.groups.ids.split(" ")){let S=Ct(_);S!==void 0&&(!p||S.startTime{window.open(n,"_self")}),Ee.set(r,n))}),An(t,"clickable")},"setLink"),An=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Fs=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Gn.runFunc(e,...r)})},"setClickFun"),Wn=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Us=d(function(t,e,n){t.split(",").forEach(function(r){Fs(r,e,n)}),An(t,"clickable")},"setClickEvent"),Es=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Is={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Qi,setDateFormat:ss,getDateFormat:ds,enableInclusiveEndDates:as,endDatesAreInclusive:os,enableTopAxis:cs,topAxisEnabled:us,setAxisFormat:Ki,getAxisFormat:ts,setTickInterval:es,getTickInterval:ns,setTodayMarker:rs,getTodayMarker:is,setAccTitle:zn,getAccTitle:Vn,setDiagramTitle:Rn,getDiagramTitle:Pn,setDiagramId:Ji,setDisplayMode:ls,getDisplayMode:fs,setAccDescription:Nn,getAccDescription:Hn,addSection:ps,getSections:vs,getTasks:Ts,addTask:Ss,findTaskById:Ct,addTaskOrg:_s,setIncludes:hs,getIncludes:ms,setExcludes:gs,getExcludes:ys,setClickEvent:Us,setLink:Ys,getLinks:ks,bindFunctions:Es,parseDuration:En,isInvalidDate:Fn,setWeekday:xs,getWeekday:bs,setWeekend:ws};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const a="^\\s*"+i+"\\s*$",c=new RegExp(a);t[0].match(c)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");rt.extend(Gi);var Ls=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Nt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:Rt},As=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((a,c)=>a.startTime-c.startTime||a.order-c.order),i=0;for(const a of r)for(let c=0;c=n[c]){n[c]=a.endTime,a.order=c+e,c>i&&(i=c);break}return i},"getMaxIntersections"),dt,Te=1e4,Ws=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const a=Yt().securityLevel;let c;a==="sandbox"&&(c=Zt("#i"+e));const m=a==="sandbox"?Zt(c.nodes()[0].contentDocument.body):Zt("body"),Y=a==="sandbox"?c.nodes()[0].contentDocument:document,C=Y.getElementById(e);dt=C.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const p=r.db.getTasks();let L=[];for(const h of p)L.push(h.type);L=y(L);const _={};let S=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const h={};for(const w of p)h[w.section]===void 0?h[w.section]=[w]:h[w.section].push(w);let D=0;for(const w of Object.keys(h)){const T=As(h[w],D)+1;D+=T,S+=T*(i.barHeight+i.barGap),_[w]=T}}else{S+=p.length*(i.barHeight+i.barGap);for(const h of L)_[h]=p.filter(D=>D.type===h).length}C.setAttribute("viewBox","0 0 "+dt+" "+S);const B=m.select(`[id="${e}"]`),A=Ii().domain([nr(p,function(h){return h.startTime}),er(p,function(h){return h.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(h,D){const w=h.startTime,T=D.startTime;let v=0;return w>T?v=1:ws.vert===E.vert?0:s.vert?1:-1);const b=[...new Set(h.map(s=>s.order))].map(s=>h.find(E=>E.order===s));B.append("g").selectAll("rect").data(b).enter().append("rect").attr("x",0).attr("y",function(s,E){return E=s.order,E*D+w-2}).attr("width",function(){return f-i.rightPadding/2}).attr("height",D).attr("class",function(s){for(const[E,z]of L.entries())if(s.type===z)return"section section"+E%i.numberSectionStyles;return"section section0"}).enter();const F=B.append("g").selectAll("rect").data(h).enter(),o=r.db.getLinks();if(F.append("rect").attr("id",function(s){return e+"-"+s.id}).attr("rx",3).attr("ry",3).attr("x",function(s){return s.milestone?A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))-.5*v:A(s.startTime)+T}).attr("y",function(s,E){return E=s.order,s.vert?i.gridLineStartPadding:E*D+w}).attr("width",function(s){return s.milestone?v:s.vert?.08*v:A(s.renderEndTime||s.endTime)-A(s.startTime)}).attr("height",function(s){return s.vert?p.length*(i.barHeight+i.barGap)+i.barHeight*2:v}).attr("transform-origin",function(s,E){return E=s.order,(A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))).toString()+"px "+(E*D+w+.5*v).toString()+"px"}).attr("class",function(s){const E="task";let z="";s.classes.length>0&&(z=s.classes.join(" "));let V=0;for(const[K,O]of L.entries())s.type===O&&(V=K%i.numberSectionStyles);let P="";return s.active?s.crit?P+=" activeCrit":P=" active":s.done?s.crit?P=" doneCrit":P=" done":s.crit&&(P+=" crit"),P.length===0&&(P=" task"),s.milestone&&(P=" milestone "+P),s.vert&&(P=" vert "+P),P+=V,P+=" "+z,E+P}),F.append("text").attr("id",function(s){return e+"-"+s.id+"-text"}).text(function(s){return s.task}).attr("font-size",i.fontSize).attr("x",function(s){let E=A(s.startTime),z=A(s.renderEndTime||s.endTime);if(s.milestone&&(E+=.5*(A(s.endTime)-A(s.startTime))-.5*v,z=E+v),s.vert)return A(s.startTime)+T;const V=this.getBBox().width;return V>z-E?z+V+1.5*i.leftPadding>f?E+T-5:z+T+5:(z-E)/2+E+T}).attr("y",function(s,E){return s.vert?i.gridLineStartPadding+p.length*(i.barHeight+i.barGap)+60:(E=s.order,E*D+i.barHeight/2+(i.fontSize/2-2)+w)}).attr("text-height",v).attr("class",function(s){const E=A(s.startTime);let z=A(s.endTime);s.milestone&&(z=E+v);const V=this.getBBox().width;let P="";s.classes.length>0&&(P=s.classes.join(" "));let K=0;for(const[st,M]of L.entries())s.type===M&&(K=st%i.numberSectionStyles);let O="";return s.active&&(s.crit?O="activeCritText"+K:O="activeText"+K),s.done?s.crit?O=O+" doneCritText"+K:O=O+" doneText"+K:s.crit&&(O=O+" critText"+K),s.milestone&&(O+=" milestoneText"),s.vert&&(O+=" vertText"),V>z-E?z+V+1.5*i.leftPadding>f?P+" taskTextOutsideLeft taskTextOutside"+K+" "+O:P+" taskTextOutsideRight taskTextOutside"+K+" "+O+" width-"+V:P+" taskText taskText"+K+" "+O+" width-"+V}),Yt().securityLevel==="sandbox"){let s;s=Zt("#i"+e);const E=s.nodes()[0].contentDocument;F.filter(function(z){return o.has(z.id)}).each(function(z){var V=E.querySelector("#"+CSS.escape(e+"-"+z.id)),P=E.querySelector("#"+CSS.escape(e+"-"+z.id+"-text"));const K=V.parentNode;var O=E.createElement("a");O.setAttribute("xlink:href",o.get(z.id)),O.setAttribute("target","_top"),K.appendChild(O),O.appendChild(V),O.appendChild(P)})}}d(N,"drawRects");function W(h,D,w,T,v,u,f,x){if(f.length===0&&x.length===0)return;let b,F;for(const{startTime:V,endTime:P}of u)(b===void 0||VF)&&(F=P);if(!b||!F)return;if(rt(F).diff(rt(b),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const o=r.db.getDateFormat(),X=[];let s=null,E=rt(b);for(;E.valueOf()<=F;)r.db.isInvalidDate(E,o,f,x)?s?s.end=E:s={start:E,end:E}:s&&(X.push(s),s=null),E=E.add(1,"d");B.append("g").selectAll("rect").data(X).enter().append("rect").attr("id",V=>e+"-exclude-"+V.start.format("YYYY-MM-DD")).attr("x",V=>A(V.start.startOf("day"))+w).attr("y",i.gridLineStartPadding).attr("width",V=>A(V.end.endOf("day"))-A(V.start.startOf("day"))).attr("height",v-D-i.gridLineStartPadding).attr("transform-origin",function(V,P){return(A(V.start)+w+.5*(A(V.end)-A(V.start))).toString()+"px "+(P*h+.5*v).toString()+"px"}).attr("class","exclude-range")}d(W,"drawExcludeDays");function q(h,D,w,T){if(w<=0||h>D)return 1/0;const v=D-h,u=rt.duration({[T??"day"]:w}).asMilliseconds();return u<=0?1/0:Math.ceil(v/u)}d(q,"getEstimatedTickCount");function j(h,D,w,T){const v=r.db.getDateFormat(),u=r.db.getAxisFormat();let f;u?f=u:v==="D"?f="%d":f=i.axisFormat??"%Y-%m-%d";let x=lr(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(F!==null){const o=parseInt(F[1],10);if(isNaN(o)||o<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const X=F[2],s=r.db.getWeekday()||i.weekday,E=A.domain(),z=E[0],V=E[1],P=q(z,V,o,X);if(P>Te)Tt.warn(`The tick interval "${o}${X}" would generate ${P} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(X){case"millisecond":x.ticks(Et.every(o));break;case"second":x.ticks(vt.every(o));break;case"minute":x.ticks(Ot.every(o));break;case"hour":x.ticks(Ht.every(o));break;case"day":x.ticks(xt.every(o));break;case"week":x.ticks(an[s].every(o));break;case"month":x.ticks(Pt.every(o));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+h+", "+(T-50)+")").call(x).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let o=ur(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));if(F!==null){const X=parseInt(F[1],10);if(isNaN(X)||X<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const s=F[2],E=r.db.getWeekday()||i.weekday,z=A.domain(),V=z[0],P=z[1];if(q(V,P,X,s)<=Te)switch(s){case"millisecond":o.ticks(Et.every(X));break;case"second":o.ticks(vt.every(X));break;case"minute":o.ticks(Ot.every(X));break;case"hour":o.ticks(Ht.every(X));break;case"day":o.ticks(xt.every(X));break;case"week":o.ticks(an[E].every(X));break;case"month":o.ticks(Pt.every(X));break}}}B.append("g").attr("class","grid").attr("transform","translate("+h+", "+D+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(j,"makeGrid");function k(h,D){let w=0;const T=Object.keys(_).map(v=>[v,_[v]]);B.append("g").selectAll("text").data(T).enter().append(function(v){const u=v[0].split(Bn.lineBreakRegex),f=-(u.length-1)/2,x=Y.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("dy",f+"em");for(const[b,F]of u.entries()){const o=Y.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttribute("alignment-baseline","central"),o.setAttribute("x","10"),b>0&&o.setAttribute("dy","1em"),o.textContent=F,x.appendChild(o)}return x}).attr("x",10).attr("y",function(v,u){if(u>0)for(let f=0;f` - .mermaid-main-font { - font-family: ${t.fontFamily}; - } - - .exclude-range { - fill: ${t.excludeBkgColor}; - } - - .section { - stroke: none; - opacity: 0.2; - } - - .section0 { - fill: ${t.sectionBkgColor}; - } - - .section2 { - fill: ${t.sectionBkgColor2}; - } - - .section1, - .section3 { - fill: ${t.altSectionBkgColor}; - opacity: 0.2; - } - - .sectionTitle0 { - fill: ${t.titleColor}; - } - - .sectionTitle1 { - fill: ${t.titleColor}; - } - - .sectionTitle2 { - fill: ${t.titleColor}; - } - - .sectionTitle3 { - fill: ${t.titleColor}; - } - - .sectionTitle { - text-anchor: start; - font-family: ${t.fontFamily}; - } - - - /* Grid and axis */ - - .grid .tick { - stroke: ${t.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - } - - .grid .tick text { - font-family: ${t.fontFamily}; - fill: ${t.textColor}; - } - - .grid path { - stroke-width: 0; - } - - - /* Today line */ - - .today { - fill: none; - stroke: ${t.todayLineColor}; - stroke-width: 2px; - } - - - /* Task styling */ - - /* Default task */ - - .task { - stroke-width: 2; - } - - .taskText { - text-anchor: middle; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideRight { - fill: ${t.taskTextDarkColor}; - text-anchor: start; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideLeft { - fill: ${t.taskTextDarkColor}; - text-anchor: end; - } - - - /* Special case clickable */ - - .task.clickable { - cursor: pointer; - } - - .taskText.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - - /* Specific task settings for the sections*/ - - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${t.taskTextColor}; - } - - .task0, - .task1, - .task2, - .task3 { - fill: ${t.taskBkgColor}; - stroke: ${t.taskBorderColor}; - } - - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${t.taskTextOutsideColor}; - } - - .taskTextOutside1, - .taskTextOutside3 { - fill: ${t.taskTextOutsideColor}; - } - - - /* Active task */ - - .active0, - .active1, - .active2, - .active3 { - fill: ${t.activeTaskBkgColor}; - stroke: ${t.activeTaskBorderColor}; - } - - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${t.taskTextDarkColor} !important; - } - - - /* Completed task */ - - .done0, - .done1, - .done2, - .done3 { - stroke: ${t.doneTaskBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - } - - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${t.taskTextDarkColor} !important; - } - - /* Done task text displayed outside the bar sits against the diagram background, - not against the done-task bar, so it must use the outside/contrast color. */ - .doneText0.taskTextOutsideLeft, - .doneText0.taskTextOutsideRight, - .doneText1.taskTextOutsideLeft, - .doneText1.taskTextOutsideRight, - .doneText2.taskTextOutsideLeft, - .doneText2.taskTextOutsideRight, - .doneText3.taskTextOutsideLeft, - .doneText3.taskTextOutsideRight { - fill: ${t.taskTextOutsideColor} !important; - } - - - /* Tasks on the critical line */ - - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${t.critBorderColor}; - fill: ${t.critBkgColor}; - stroke-width: 2; - } - - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.activeTaskBkgColor}; - stroke-width: 2; - } - - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; - } - - .milestone { - transform: rotate(45deg) scale(0.8,0.8); - } - - .milestoneText { - font-style: italic; - } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - /* Done-crit task text outside the bar — same reasoning as doneText above. */ - .doneCritText0.taskTextOutsideLeft, - .doneCritText0.taskTextOutsideRight, - .doneCritText1.taskTextOutsideLeft, - .doneCritText1.taskTextOutsideRight, - .doneCritText2.taskTextOutsideLeft, - .doneCritText2.taskTextOutsideRight, - .doneCritText3.taskTextOutsideLeft, - .doneCritText3.taskTextOutsideRight { - fill: ${t.taskTextOutsideColor} !important; - } - - .vert { - stroke: ${t.vertLineColor}; - } - - .vertText { - font-size: 15px; - text-anchor: middle; - fill: ${t.vertLineColor} !important; - } - - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.titleColor||t.textColor}; - font-family: ${t.fontFamily}; - } -`,"getStyles"),Hs=Os,zs={parser:ji,db:Is,renderer:$s,styles:Hs};export{zs as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-D0aRnxaO.js b/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-D0aRnxaO.js deleted file mode 100644 index 978ef0683..000000000 --- a/apps/pythinker-code/dist-web/assets/ganttDiagram-6RSMTGT7-D0aRnxaO.js +++ /dev/null @@ -1,292 +0,0 @@ -import{bf as on,bg as $n,bh as cn,bi as un,bj as ln,bk as ue,bl as On,b4 as oe,g as Hn,s as Nn,t as Pn,q as Rn,a as Vn,b as zn,_ as d,c as Yt,d as Zt,e as qn,bm as rt,l as Tt,k as Bn,j as Zn,A as Xn,u as Gn}from"./mermaid.core-Bt2TZ_t_.js";import{b as jn,t as Ne,c as Qn,a as Jn,l as Kn}from"./linear-HCDmDFmI.js";import{i as tr}from"./init-Gi6I4Gst.js";import"./index-C-zUV3mO.js";import"./defaultLocale-DX6XiGOO.js";function er(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ir(t){return"translate("+t+",0)"}function sr(t){return"translate(0,"+t+")"}function ar(t){return e=>+t(e)}function or(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,a=6,c=6,m=3,Y=typeof window<"u"&&window.devicePixelRatio>1?0:.5,C=t===Gt||t===Xt?-1:1,p=t===Xt||t===le?"x":"y",L=t===Gt||t===xe?ir:sr;function _(S){var B=r??(e.ticks?e.ticks.apply(e,n):e.domain()),A=i??(e.tickFormat?e.tickFormat.apply(e,n):rr),U=Math.max(a,0)+m,I=e.range(),N=+I[0]+Y,W=+I[I.length-1]+Y,q=(e.bandwidth?or:ar)(e.copy(),Y),j=S.selection?S.selection():S,k=j.selectAll(".domain").data([null]),g=j.selectAll(".tick").data(B,e).order(),y=g.exit(),h=g.enter().append("g").attr("class","tick"),D=g.select("line"),w=g.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),g=g.merge(h),D=D.merge(h.append("line").attr("stroke","currentColor").attr(p+"2",C*a)),w=w.merge(h.append("text").attr("fill","currentColor").attr(p,C*U).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),S!==j&&(k=k.transition(S),g=g.transition(S),D=D.transition(S),w=w.transition(S),y=y.transition(S).attr("opacity",Pe).attr("transform",function(T){return isFinite(T=q(T))?L(T+Y):this.getAttribute("transform")}),h.attr("opacity",Pe).attr("transform",function(T){var v=this.parentNode.__axis;return L((v&&isFinite(v=v(T))?v:q(T))+Y)})),y.remove(),k.attr("d",t===Xt||t===le?c?"M"+C*c+","+N+"H"+Y+"V"+W+"H"+C*c:"M"+Y+","+N+"V"+W:c?"M"+N+","+C*c+"V"+Y+"H"+W+"V"+C*c:"M"+N+","+Y+"H"+W),g.attr("opacity",1).attr("transform",function(T){return L(q(T)+Y)}),D.attr(p+"2",C*a),w.attr(p,C*U).text(A),j.filter(cr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),j.each(function(){this.__axis=q})}return _.scale=function(S){return arguments.length?(e=S,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(S){return arguments.length?(n=S==null?[]:Array.from(S),_):n.slice()},_.tickValues=function(S){return arguments.length?(r=S==null?null:Array.from(S),_):r&&r.slice()},_.tickFormat=function(S){return arguments.length?(i=S,_):i},_.tickSize=function(S){return arguments.length?(a=c=+S,_):a},_.tickSizeInner=function(S){return arguments.length?(a=+S,_):a},_.tickSizeOuter=function(S){return arguments.length?(c=+S,_):c},_.tickPadding=function(S){return arguments.length?(m=+S,_):m},_.offset=function(S){return arguments.length?(Y=+S,_):Y},_}function ur(t){return fn(Gt,t)}function lr(t){return fn(xe,t)}const fr=Math.PI/180,dr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,hr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=$n(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),a,c;return e===n&&n===r?a=c=i:(a=fe((.4360747*e+.3850649*n+.1430804*r)/dn),c=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(a-i),200*(i-c),t.opacity)}function mr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,mr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>hr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const c=i(a),m=i.ceil(a);return a-c(e(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,m)=>{const Y=[];if(a=i.ceil(a),m=m==null?1:Math.floor(m),!(a0))return Y;let C;do Y.push(C=new Date(+a)),e(a,m),t(a);while(Cet(c=>{if(c>=c)for(;t(c),!a(c);)c.setTime(c-1)},(c,m)=>{if(c>=c)if(m<0)for(;++m<=0;)for(;e(c,-1),!a(c););else for(;--m>=0;)for(;e(c,1),!a(c););}),n&&(i.count=(a,c)=>(ge.setTime(+a),ye.setTime(+c),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const Et=et(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?et(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Re=yt*30,ke=yt*365,vt=et(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Ot=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Ot.range;const vr=et(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());vr.range;const Ht=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Ht.range;const Tr=et(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());Tr.range;const xt=et(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const xr=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));xr.range;function Dt(t){return et(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const Rt=Dt(0),Nt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);Rt.range;Nt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return et(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),br=Mt(2),wr=Mt(3),It=Mt(4),Dr=Mt(5),Mr=Mt(6);wn.range;re.range;br.range;wr.range;It.range;Dr.range;Mr.range;const Pt=et(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Pt.range;const Cr=et(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Cr.range;const kt=et(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=et(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Sr(t,e,n,r,i,a){const c=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[a,1,ct],[a,5,5*ct],[a,15,15*ct],[a,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Re],[e,3,3*Re],[t,1,ke]];function m(C,p,L){const _=pU).right(c,_);if(S===c.length)return t.every(Ne(C/ke,p/ke,L));if(S===0)return Et.every(Math.max(Ne(C,p,L),1));const[B,A]=c[_/c[S-1][2]53)return null;"w"in l||(l.w=1),"Z"in l?($=ve(At(l.y,0,1)),Q=$.getUTCDay(),$=Q>4||Q===0?re.ceil($):re($),$=_e.offset($,(l.V-1)*7),l.y=$.getUTCFullYear(),l.m=$.getUTCMonth(),l.d=$.getUTCDate()+(l.w+6)%7):($=pe(At(l.y,0,1)),Q=$.getDay(),$=Q>4||Q===0?Nt.ceil($):Nt($),$=xt.offset($,(l.V-1)*7),l.y=$.getFullYear(),l.m=$.getMonth(),l.d=$.getDate()+(l.w+6)%7)}else("W"in l||"U"in l)&&("w"in l||(l.w="u"in l?l.u%7:"W"in l?1:0),Q="Z"in l?ve(At(l.y,0,1)).getUTCDay():pe(At(l.y,0,1)).getDay(),l.m=0,l.d="W"in l?(l.w+6)%7+l.W*7-(Q+5)%7:l.w+l.U*7-(Q+6)%7);return"Z"in l?(l.H+=l.Z/100|0,l.M+=l.Z%100,ve(l)):pe(l)}}function y(M,H,R,l){for(var J=0,$=H.length,Q=R.length,G,it;J<$;){if(l>=Q)return-1;if(G=H.charCodeAt(J++),G===37){if(G=H.charAt(J++),it=j[G in Ve?H.charAt(J++):G],!it||(l=it(M,R,l))<0)return-1}else if(G!=R.charCodeAt(l++))return-1}return l}function h(M,H,R){var l=C.exec(H.slice(R));return l?(M.p=p.get(l[0].toLowerCase()),R+l[0].length):-1}function D(M,H,R){var l=S.exec(H.slice(R));return l?(M.w=B.get(l[0].toLowerCase()),R+l[0].length):-1}function w(M,H,R){var l=L.exec(H.slice(R));return l?(M.w=_.get(l[0].toLowerCase()),R+l[0].length):-1}function T(M,H,R){var l=I.exec(H.slice(R));return l?(M.m=N.get(l[0].toLowerCase()),R+l[0].length):-1}function v(M,H,R){var l=A.exec(H.slice(R));return l?(M.m=U.get(l[0].toLowerCase()),R+l[0].length):-1}function u(M,H,R){return y(M,e,H,R)}function f(M,H,R){return y(M,n,H,R)}function x(M,H,R){return y(M,r,H,R)}function b(M){return c[M.getDay()]}function F(M){return a[M.getDay()]}function o(M){return Y[M.getMonth()]}function X(M){return m[M.getMonth()]}function s(M){return i[+(M.getHours()>=12)]}function E(M){return 1+~~(M.getMonth()/3)}function z(M){return c[M.getUTCDay()]}function V(M){return a[M.getUTCDay()]}function P(M){return Y[M.getUTCMonth()]}function K(M){return m[M.getUTCMonth()]}function O(M){return i[+(M.getUTCHours()>=12)]}function st(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var H=k(M+="",W);return H.toString=function(){return M},H},parse:function(M){var H=g(M+="",!1);return H.toString=function(){return M},H},utcFormat:function(M){var H=k(M+="",q);return H.toString=function(){return M},H},utcParse:function(M){var H=g(M+="",!0);return H.toString=function(){return M},H}}}var Ve={"-":"",_:" ",0:"0"},nt=/^\s*\d+/,Ur=/^%/,Er=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Lr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Hr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Nr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Pr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zr(t,e,n){var r=Ur.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Gr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function jr(t,e){return Z(t.getHours(),e,2)}function Qr(t,e){return Z(t.getHours()%12||12,e,2)}function Jr(t,e){return Z(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function Kr(t,e){return Dn(t,e)+"000"}function ti(t,e){return Z(t.getMonth()+1,e,2)}function ei(t,e){return Z(t.getMinutes(),e,2)}function ni(t,e){return Z(t.getSeconds(),e,2)}function ri(t){var e=t.getDay();return e===0?7:e}function ii(t,e){return Z(Rt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function si(t,e){return t=Mn(t),Z(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ai(t){return t.getDay()}function oi(t,e){return Z(Nt.count(kt(t)-1,t),e,2)}function ci(t,e){return Z(t.getFullYear()%100,e,2)}function ui(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function li(t,e){return Z(t.getFullYear()%1e4,e,4)}function fi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function di(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function hi(t,e){return Z(t.getUTCHours(),e,2)}function mi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function gi(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function yi(t,e){return Cn(t,e)+"000"}function ki(t,e){return Z(t.getUTCMonth()+1,e,2)}function pi(t,e){return Z(t.getUTCMinutes(),e,2)}function vi(t,e){return Z(t.getUTCSeconds(),e,2)}function Ti(t){var e=t.getUTCDay();return e===0?7:e}function xi(t,e){return Z(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function bi(t,e){return t=Sn(t),Z(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function wi(t){return t.getUTCDay()}function Di(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Mi(t,e){return Z(t.getUTCFullYear()%100,e,2)}function Ci(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Si(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function _i(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Yi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Fi({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fi(t){return St=Fr(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ui(t){return new Date(t)}function Ei(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,a,c,m,Y,C){var p=Qn(),L=p.invert,_=p.domain,S=C(".%L"),B=C(":%S"),A=C("%I:%M"),U=C("%I %p"),I=C("%a %d"),N=C("%b %d"),W=C("%B"),q=C("%Y");function j(k){return(Y(k)4&&(S+=7),_.add(S,n));return B.diff(A,"week")+1},m.isoWeekday=function(C){return this.$utils().u(C)?this.day()||7:this.day(this.day()%7?C:C-7)};var Y=m.startOf;m.startOf=function(C,p){var L=this.$utils(),_=!!L.u(p)||p;return L.p(C)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):Y.bind(this)(C,p)}}}))})(jt)),jt.exports}var Wi=Ai();const $i=oe(Wi);var Qt={exports:{}},Oi=Qt.exports,tn;function Hi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Oi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,c=/\d\d?/,m=/\d*[^-_:/,()\s\d]+/,Y={},C=function(U){return(U=+U)+(U>68?1900:2e3)},p=function(U){return function(I){this[U]=+I}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var N=I.match(/([+-]|\d\d)/g),W=60*N[1]+(+N[2]||0);return W===0?0:N[0]==="+"?-W:W})(U)}],_=function(U){var I=Y[U];return I&&(I.indexOf?I:I.s.concat(I.f))},S=function(U,I){var N,W=Y.meridiem;if(W){for(var q=1;q<=24;q+=1)if(U.indexOf(W(q,0,I))>-1){N=q>12;break}}else N=U===(I?"pm":"PM");return N},B={A:[m,function(U){this.afternoon=S(U,!1)}],a:[m,function(U){this.afternoon=S(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],s:[c,p("seconds")],ss:[c,p("seconds")],m:[c,p("minutes")],mm:[c,p("minutes")],H:[c,p("hours")],h:[c,p("hours")],HH:[c,p("hours")],hh:[c,p("hours")],D:[c,p("day")],DD:[a,p("day")],Do:[m,function(U){var I=Y.ordinal,N=U.match(/\d+/);if(this.day=N[0],I)for(var W=1;W<=31;W+=1)I(W).replace(/\[|\]/g,"")===U&&(this.day=W)}],w:[c,p("week")],ww:[a,p("week")],M:[c,p("month")],MM:[a,p("month")],MMM:[m,function(U){var I=_("months"),N=(_("monthsShort")||I.map((function(W){return W.slice(0,3)}))).indexOf(U)+1;if(N<1)throw new Error;this.month=N%12||N}],MMMM:[m,function(U){var I=_("months").indexOf(U)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,p("year")],YY:[a,function(U){this.year=C(U)}],YYYY:[/\d{4}/,p("year")],Z:L,ZZ:L};function A(U){var I,N;I=U,N=Y&&Y.formats;for(var W=(U=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,w,T){var v=T&&T.toUpperCase();return w||N[T]||n[T]||N[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(u,f,x){return f||x.slice(1)}))}))).match(r),q=W.length,j=0;j-1)return new Date((F==="X"?1e3:1)*b);var s=A(F)(b),E=s.year,z=s.month,V=s.day,P=s.hours,K=s.minutes,O=s.seconds,st=s.milliseconds,M=s.zone,H=s.week,R=new Date,l=V||(E||z?1:R.getDate()),J=E||R.getFullYear(),$=0;E&&!z||($=z>0?z-1:R.getMonth());var Q,G=P||0,it=K||0,at=O||0,pt=st||0;return M?new Date(Date.UTC(J,$,l,G,it,at,pt+60*M.offset*1e3)):o?new Date(Date.UTC(J,$,l,G,it,at,pt)):(Q=new Date(J,$,l,G,it,at,pt),H&&(Q=X(Q).week(H).toDate()),Q)}catch{return new Date("")}})(k,h,g,N),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),T&&k!=this.format(h)&&(this.$d=new Date("")),Y={}}else if(h instanceof Array)for(var u=h.length,f=1;f<=u;f+=1){y[1]=h[f-1];var x=N.apply(this,y);if(x.isValid()){this.$d=x.$d,this.$L=x.$L,this.init();break}f===u&&(this.$d=new Date(""))}else q.call(this,j)}}}))})(Qt)),Qt.exports}var Ni=Hi();const Pi=oe(Ni);var Jt={exports:{}},Ri=Jt.exports,en;function Vi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,a=i.format;i.format=function(c){var m=this,Y=this.$locale();if(!this.isValid())return a.bind(this)(c);var C=this.$utils(),p=(c||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(L){switch(L){case"Q":return Math.ceil((m.$M+1)/3);case"Do":return Y.ordinal(m.$D);case"gggg":return m.weekYear();case"GGGG":return m.isoWeekYear();case"wo":return Y.ordinal(m.week(),"W");case"w":case"ww":return C.s(m.week(),L==="w"?1:2,"0");case"W":case"WW":return C.s(m.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return C.s(String(m.$H===0?24:m.$H),L==="k"?1:2,"0");case"X":return Math.floor(m.$d.getTime()/1e3);case"x":return m.$d.getTime();case"z":return"["+m.offsetName()+"]";case"zzz":return"["+m.offsetName("long")+"]";default:return L}}));return a.bind(this)(p)}}}))})(Jt)),Jt.exports}var zi=Vi();const qi=oe(zi);var Kt={exports:{}},Bi=Kt.exports,nn;function Zi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Bi,(function(){var n,r,i=1e3,a=6e4,c=36e5,m=864e5,Y=31536e6,C=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,L=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:Y,months:C,days:m,hours:c,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},S=function(k){return k instanceof q},B=function(k,g,y){return new q(k,y,g.$l)},A=function(k){return r.p(k)+"s"},U=function(k){return k<0},I=function(k){return U(k)?Math.ceil(k):Math.floor(k)},N=function(k){return Math.abs(k)},W=function(k,g){return k?U(k)?{negative:!0,format:""+N(k)+g}:{negative:!1,format:""+k+g}:{negative:!1,format:""}},q=(function(){function k(y,h,D){var w=this;if(this.$d={},this.$l=D,y===void 0&&(this.$ms=0,this.parseFromMilliseconds()),h)return B(y*_[A(h)],this);if(typeof y=="number")return this.$ms=y,this.parseFromMilliseconds(),this;if(typeof y=="object")return Object.keys(y).forEach((function(u){w.$d[A(u)]=y[u]})),this.calMilliseconds(),this;if(typeof y=="string"){var T=y.match(p);if(T){var v=T.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=v[0],this.$d.months=v[1],this.$d.weeks=v[2],this.$d.days=v[3],this.$d.hours=v[4],this.$d.minutes=v[5],this.$d.seconds=v[6],this.calMilliseconds(),this}}return this}var g=k.prototype;return g.calMilliseconds=function(){var y=this;this.$ms=Object.keys(this.$d).reduce((function(h,D){return h+(y.$d[D]||0)*_[D]}),0)},g.parseFromMilliseconds=function(){var y=this.$ms;this.$d.years=I(y/Y),y%=Y,this.$d.months=I(y/C),y%=C,this.$d.days=I(y/m),y%=m,this.$d.hours=I(y/c),y%=c,this.$d.minutes=I(y/a),y%=a,this.$d.seconds=I(y/i),y%=i,this.$d.milliseconds=y},g.toISOString=function(){var y=W(this.$d.years,"Y"),h=W(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var w=W(D,"D"),T=W(this.$d.hours,"H"),v=W(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var f=W(u,"S"),x=y.negative||h.negative||w.negative||T.negative||v.negative||f.negative,b=T.format||v.format||f.format?"T":"",F=(x?"-":"")+"P"+y.format+h.format+w.format+b+T.format+v.format+f.format;return F==="P"||F==="-P"?"P0D":F},g.toJSON=function(){return this.toISOString()},g.format=function(y){var h=y||"YYYY-MM-DDTHH:mm:ss",D={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return h.replace(L,(function(w,T){return T||String(D[w])}))},g.as=function(y){return this.$ms/_[A(y)]},g.get=function(y){var h=this.$ms,D=A(y);return D==="milliseconds"?h%=1e3:h=D==="weeks"?I(h/_[D]):this.$d[D],h||0},g.add=function(y,h,D){var w;return w=h?y*_[A(h)]:S(y)?y.$ms:B(y,this).$ms,B(this.$ms+w*(D?-1:1),this)},g.subtract=function(y,h){return this.add(y,h,!0)},g.locale=function(y){var h=this.clone();return h.$l=y,h},g.clone=function(){return B(this.$ms,this)},g.humanize=function(y){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!y)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},k})(),j=function(k,g,y){return k.add(g.years()*y,"y").add(g.months()*y,"M").add(g.days()*y,"d").add(g.hours()*y,"h").add(g.minutes()*y,"m").add(g.seconds()*y,"s").add(g.milliseconds()*y,"ms")};return function(k,g,y){n=y,r=y().$utils(),y.duration=function(w,T){var v=y.locale();return B(w,{$l:v},T)},y.isDuration=S;var h=g.prototype.add,D=g.prototype.subtract;g.prototype.add=function(w,T){return S(w)?j(this,w,1):h.bind(this)(w,T)},g.prototype.subtract=function(w,T){return S(w)?j(this,w,-1):D.bind(this)(w,T)}}}))})(Kt)),Kt.exports}var Xi=Zi();const Gi=oe(Xi);var we=(function(){var t=d(function(v,u,f,x){for(f=f||{},x=v.length;x--;f[v[x]]=u);return f},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],c=[1,30],m=[1,31],Y=[1,32],C=[1,33],p=[1,34],L=[1,9],_=[1,10],S=[1,11],B=[1,12],A=[1,13],U=[1,14],I=[1,15],N=[1,16],W=[1,19],q=[1,20],j=[1,21],k=[1,22],g=[1,23],y=[1,25],h=[1,35],D={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(u,f,x,b,F,o,X){var s=o.length-1;switch(F){case 1:return o[s-1];case 2:this.$=[];break;case 3:o[s-1].push(o[s]),this.$=o[s-1];break;case 4:case 5:this.$=o[s];break;case 6:case 7:this.$=[];break;case 8:b.setWeekday("monday");break;case 9:b.setWeekday("tuesday");break;case 10:b.setWeekday("wednesday");break;case 11:b.setWeekday("thursday");break;case 12:b.setWeekday("friday");break;case 13:b.setWeekday("saturday");break;case 14:b.setWeekday("sunday");break;case 15:b.setWeekend("friday");break;case 16:b.setWeekend("saturday");break;case 17:b.setDateFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 18:b.enableInclusiveEndDates(),this.$=o[s].substr(18);break;case 19:b.TopAxis(),this.$=o[s].substr(8);break;case 20:b.setAxisFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 21:b.setTickInterval(o[s].substr(13)),this.$=o[s].substr(13);break;case 22:b.setExcludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 23:b.setIncludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 24:b.setTodayMarker(o[s].substr(12)),this.$=o[s].substr(12);break;case 27:b.setDiagramTitle(o[s].substr(6)),this.$=o[s].substr(6);break;case 28:this.$=o[s].trim(),b.setAccTitle(this.$);break;case 29:case 30:this.$=o[s].trim(),b.setAccDescription(this.$);break;case 31:b.addSection(o[s].substr(8)),this.$=o[s].substr(8);break;case 33:b.addTask(o[s-1],o[s]),this.$="task";break;case 34:this.$=o[s-1],b.setClickEvent(o[s-1],o[s],null);break;case 35:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],o[s]);break;case 36:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],null),b.setLink(o[s-2],o[s]);break;case 37:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-2],o[s-1]),b.setLink(o[s-3],o[s]);break;case 38:this.$=o[s-2],b.setClickEvent(o[s-2],o[s],null),b.setLink(o[s-2],o[s-1]);break;case 39:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-1],o[s]),b.setLink(o[s-3],o[s-2]);break;case 40:this.$=o[s-1],b.setLink(o[s-1],o[s]);break;case 41:case 47:this.$=o[s-1]+" "+o[s];break;case 42:case 43:case 45:this.$=o[s-2]+" "+o[s-1]+" "+o[s];break;case 44:case 46:this.$=o[s-3]+" "+o[s-2]+" "+o[s-1]+" "+o[s];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:p,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:k,36:g,37:24,38:y,40:h},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(u,f){if(f.recoverable)this.trace(u);else{var x=new Error(u);throw x.hash=f,x}},"parseError"),parse:d(function(u){var f=this,x=[0],b=[],F=[null],o=[],X=this.table,s="",E=0,z=0,V=2,P=1,K=o.slice.call(arguments,1),O=Object.create(this.lexer),st={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(st.yy[M]=this.yy[M]);O.setInput(u,st.yy),st.yy.lexer=O,st.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var H=O.yylloc;o.push(H);var R=O.options&&O.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function l(ot){x.length=x.length-2*ot,F.length=F.length-ot,o.length=o.length-ot}d(l,"popStack");function J(){var ot;return ot=b.pop()||O.lex()||P,typeof ot!="number"&&(ot instanceof Array&&(b=ot,ot=b.pop()),ot=f.symbols_[ot]||ot),ot}d(J,"lex");for(var $,Q,G,it,at={},pt,ut,He,Bt;;){if(Q=x[x.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:(($===null||typeof $>"u")&&($=J()),G=X[Q]&&X[Q][$]),typeof G>"u"||!G.length||!G[0]){var ce="";Bt=[];for(pt in X[Q])this.terminals_[pt]&&pt>V&&Bt.push("'"+this.terminals_[pt]+"'");O.showPosition?ce="Parse error on line "+(E+1)+`: -`+O.showPosition()+` -Expecting `+Bt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":ce="Parse error on line "+(E+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(ce,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:H,expected:Bt})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+$);switch(G[0]){case 1:x.push($),F.push(O.yytext),o.push(O.yylloc),x.push(G[1]),$=null,z=O.yyleng,s=O.yytext,E=O.yylineno,H=O.yylloc;break;case 2:if(ut=this.productions_[G[1]][1],at.$=F[F.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},R&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),it=this.performAction.apply(at,[s,z,E,st.yy,G[1],F,o].concat(K)),typeof it<"u")return it;ut&&(x=x.slice(0,-1*ut*2),F=F.slice(0,-1*ut),o=o.slice(0,-1*ut)),x.push(this.productions_[G[1]][0]),F.push(at.$),o.push(at._$),He=X[x[x.length-2]][x[x.length-1]],x.push(He);break;case 3:return!0}}return!0},"parse")},w=(function(){var v={EOF:1,parseError:d(function(f,x){if(this.yy.parser)this.yy.parser.parseError(f,x);else throw new Error(f)},"parseError"),setInput:d(function(u,f){return this.yy=f||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var f=u.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:d(function(u){var f=u.length,x=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===b.length?this.yylloc.first_column:0)+b[b.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(u){this.unput(this.match.slice(u))},"less"),pastInput:d(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var u=this.pastInput(),f=new Array(u.length+1).join("-");return u+this.upcomingInput()+` -`+f+"^"},"showPosition"),test_match:d(function(u,f){var x,b,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),b=u[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,f,x,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;of[0].length)){if(f=x,b=o,this.options.backtrack_lexer){if(u=this.test_match(x,F[o]),u!==!1)return u;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(u=this.test_match(f,F[b]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var f=this.next();return f||this.lex()},"lex"),begin:d(function(f){this.conditionStack.push(f)},"begin"),popState:d(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:d(function(f){this.begin(f)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(f,x,b,F){switch(b){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return v})();D.lexer=w;function T(){this.yy={}}return d(T,"Parser"),T.prototype=D,D.Parser=T,new T})();we.parser=we;var ji=we;rt.extend($i);rt.extend(Pi);rt.extend(qi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Vt=[],zt=[],Ee=new Map,Ie=[],se=[],Lt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Qi=d(function(){Ie=[],se=[],Lt="",Ae=[],te=0,Ce=void 0,ee=void 0,tt=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Vt=[],zt=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Xn(),$e="sunday",ae="saturday"},"clear"),Ji=d(function(t){_t=t},"setDiagramId"),Ki=d(function(t){Ye=t},"setAxisFormat"),ts=d(function(){return Ye},"getAxisFormat"),es=d(function(t){Fe=t},"setTickInterval"),ns=d(function(){return Fe},"getTickInterval"),rs=d(function(t){Ue=t},"setTodayMarker"),is=d(function(){return Ue},"getTodayMarker"),ss=d(function(t){lt=t},"setDateFormat"),as=d(function(){qt=!0},"enableInclusiveEndDates"),os=d(function(){return qt},"endDatesAreInclusive"),cs=d(function(){We=!0},"enableTopAxis"),us=d(function(){return We},"topAxisEnabled"),ls=d(function(t){Le=t},"setDisplayMode"),fs=d(function(){return Le},"getDisplayMode"),ds=d(function(){return lt},"getDateFormat"),hs=d(function(t){Vt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),ms=d(function(){return Vt},"getIncludes"),gs=d(function(t){zt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),ys=d(function(){return zt},"getExcludes"),ks=d(function(){return Ee},"getLinks"),ps=d(function(t){Lt=t,Ie.push(t)},"addSection"),vs=d(function(){return Ie},"getSections"),Ts=d(function(){let t=sn();const e=10;let n=0;for(;!t&&nm))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,c]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(m=>{const Y=m.trim();return Y==="x"||Y==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const a=/^after\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let m=null;for(const C of a.groups.ids.split(" ")){let p=Ct(C);p!==void 0&&(!m||p.endTime>m.endTime)&&(m=p)}if(m)return m.endTime;const Y=new Date;return Y.setHours(0,0,0,0),Y}let c=rt(n,e.trim(),!0);if(c.isValid())return c.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const m=new Date(n);if(m===void 0||isNaN(m.getTime())||m.getFullYear()<-1e4||m.getFullYear()>1e4)throw new Error("Invalid date:"+n);return m}},"getStartDate"),En=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),In=d(function(t,e,n,r=!1){n=n.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let p=null;for(const _ of a.groups.ids.split(" ")){let S=Ct(_);S!==void 0&&(!p||S.startTime{window.open(n,"_self")}),Ee.set(r,n))}),An(t,"clickable")},"setLink"),An=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Fs=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Gn.runFunc(e,...r)})},"setClickFun"),Wn=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Us=d(function(t,e,n){t.split(",").forEach(function(r){Fs(r,e,n)}),An(t,"clickable")},"setClickEvent"),Es=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Is={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Qi,setDateFormat:ss,getDateFormat:ds,enableInclusiveEndDates:as,endDatesAreInclusive:os,enableTopAxis:cs,topAxisEnabled:us,setAxisFormat:Ki,getAxisFormat:ts,setTickInterval:es,getTickInterval:ns,setTodayMarker:rs,getTodayMarker:is,setAccTitle:zn,getAccTitle:Vn,setDiagramTitle:Rn,getDiagramTitle:Pn,setDiagramId:Ji,setDisplayMode:ls,getDisplayMode:fs,setAccDescription:Nn,getAccDescription:Hn,addSection:ps,getSections:vs,getTasks:Ts,addTask:Ss,findTaskById:Ct,addTaskOrg:_s,setIncludes:hs,getIncludes:ms,setExcludes:gs,getExcludes:ys,setClickEvent:Us,setLink:Ys,getLinks:ks,bindFunctions:Es,parseDuration:En,isInvalidDate:Fn,setWeekday:xs,getWeekday:bs,setWeekend:ws};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const a="^\\s*"+i+"\\s*$",c=new RegExp(a);t[0].match(c)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");rt.extend(Gi);var Ls=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Nt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:Rt},As=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((a,c)=>a.startTime-c.startTime||a.order-c.order),i=0;for(const a of r)for(let c=0;c=n[c]){n[c]=a.endTime,a.order=c+e,c>i&&(i=c);break}return i},"getMaxIntersections"),dt,Te=1e4,Ws=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const a=Yt().securityLevel;let c;a==="sandbox"&&(c=Zt("#i"+e));const m=a==="sandbox"?Zt(c.nodes()[0].contentDocument.body):Zt("body"),Y=a==="sandbox"?c.nodes()[0].contentDocument:document,C=Y.getElementById(e);dt=C.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const p=r.db.getTasks();let L=[];for(const h of p)L.push(h.type);L=y(L);const _={};let S=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const h={};for(const w of p)h[w.section]===void 0?h[w.section]=[w]:h[w.section].push(w);let D=0;for(const w of Object.keys(h)){const T=As(h[w],D)+1;D+=T,S+=T*(i.barHeight+i.barGap),_[w]=T}}else{S+=p.length*(i.barHeight+i.barGap);for(const h of L)_[h]=p.filter(D=>D.type===h).length}C.setAttribute("viewBox","0 0 "+dt+" "+S);const B=m.select(`[id="${e}"]`),A=Ii().domain([nr(p,function(h){return h.startTime}),er(p,function(h){return h.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(h,D){const w=h.startTime,T=D.startTime;let v=0;return w>T?v=1:ws.vert===E.vert?0:s.vert?1:-1);const b=[...new Set(h.map(s=>s.order))].map(s=>h.find(E=>E.order===s));B.append("g").selectAll("rect").data(b).enter().append("rect").attr("x",0).attr("y",function(s,E){return E=s.order,E*D+w-2}).attr("width",function(){return f-i.rightPadding/2}).attr("height",D).attr("class",function(s){for(const[E,z]of L.entries())if(s.type===z)return"section section"+E%i.numberSectionStyles;return"section section0"}).enter();const F=B.append("g").selectAll("rect").data(h).enter(),o=r.db.getLinks();if(F.append("rect").attr("id",function(s){return e+"-"+s.id}).attr("rx",3).attr("ry",3).attr("x",function(s){return s.milestone?A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))-.5*v:A(s.startTime)+T}).attr("y",function(s,E){return E=s.order,s.vert?i.gridLineStartPadding:E*D+w}).attr("width",function(s){return s.milestone?v:s.vert?.08*v:A(s.renderEndTime||s.endTime)-A(s.startTime)}).attr("height",function(s){return s.vert?p.length*(i.barHeight+i.barGap)+i.barHeight*2:v}).attr("transform-origin",function(s,E){return E=s.order,(A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))).toString()+"px "+(E*D+w+.5*v).toString()+"px"}).attr("class",function(s){const E="task";let z="";s.classes.length>0&&(z=s.classes.join(" "));let V=0;for(const[K,O]of L.entries())s.type===O&&(V=K%i.numberSectionStyles);let P="";return s.active?s.crit?P+=" activeCrit":P=" active":s.done?s.crit?P=" doneCrit":P=" done":s.crit&&(P+=" crit"),P.length===0&&(P=" task"),s.milestone&&(P=" milestone "+P),s.vert&&(P=" vert "+P),P+=V,P+=" "+z,E+P}),F.append("text").attr("id",function(s){return e+"-"+s.id+"-text"}).text(function(s){return s.task}).attr("font-size",i.fontSize).attr("x",function(s){let E=A(s.startTime),z=A(s.renderEndTime||s.endTime);if(s.milestone&&(E+=.5*(A(s.endTime)-A(s.startTime))-.5*v,z=E+v),s.vert)return A(s.startTime)+T;const V=this.getBBox().width;return V>z-E?z+V+1.5*i.leftPadding>f?E+T-5:z+T+5:(z-E)/2+E+T}).attr("y",function(s,E){return s.vert?i.gridLineStartPadding+p.length*(i.barHeight+i.barGap)+60:(E=s.order,E*D+i.barHeight/2+(i.fontSize/2-2)+w)}).attr("text-height",v).attr("class",function(s){const E=A(s.startTime);let z=A(s.endTime);s.milestone&&(z=E+v);const V=this.getBBox().width;let P="";s.classes.length>0&&(P=s.classes.join(" "));let K=0;for(const[st,M]of L.entries())s.type===M&&(K=st%i.numberSectionStyles);let O="";return s.active&&(s.crit?O="activeCritText"+K:O="activeText"+K),s.done?s.crit?O=O+" doneCritText"+K:O=O+" doneText"+K:s.crit&&(O=O+" critText"+K),s.milestone&&(O+=" milestoneText"),s.vert&&(O+=" vertText"),V>z-E?z+V+1.5*i.leftPadding>f?P+" taskTextOutsideLeft taskTextOutside"+K+" "+O:P+" taskTextOutsideRight taskTextOutside"+K+" "+O+" width-"+V:P+" taskText taskText"+K+" "+O+" width-"+V}),Yt().securityLevel==="sandbox"){let s;s=Zt("#i"+e);const E=s.nodes()[0].contentDocument;F.filter(function(z){return o.has(z.id)}).each(function(z){var V=E.querySelector("#"+CSS.escape(e+"-"+z.id)),P=E.querySelector("#"+CSS.escape(e+"-"+z.id+"-text"));const K=V.parentNode;var O=E.createElement("a");O.setAttribute("xlink:href",o.get(z.id)),O.setAttribute("target","_top"),K.appendChild(O),O.appendChild(V),O.appendChild(P)})}}d(N,"drawRects");function W(h,D,w,T,v,u,f,x){if(f.length===0&&x.length===0)return;let b,F;for(const{startTime:V,endTime:P}of u)(b===void 0||VF)&&(F=P);if(!b||!F)return;if(rt(F).diff(rt(b),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const o=r.db.getDateFormat(),X=[];let s=null,E=rt(b);for(;E.valueOf()<=F;)r.db.isInvalidDate(E,o,f,x)?s?s.end=E:s={start:E,end:E}:s&&(X.push(s),s=null),E=E.add(1,"d");B.append("g").selectAll("rect").data(X).enter().append("rect").attr("id",V=>e+"-exclude-"+V.start.format("YYYY-MM-DD")).attr("x",V=>A(V.start.startOf("day"))+w).attr("y",i.gridLineStartPadding).attr("width",V=>A(V.end.endOf("day"))-A(V.start.startOf("day"))).attr("height",v-D-i.gridLineStartPadding).attr("transform-origin",function(V,P){return(A(V.start)+w+.5*(A(V.end)-A(V.start))).toString()+"px "+(P*h+.5*v).toString()+"px"}).attr("class","exclude-range")}d(W,"drawExcludeDays");function q(h,D,w,T){if(w<=0||h>D)return 1/0;const v=D-h,u=rt.duration({[T??"day"]:w}).asMilliseconds();return u<=0?1/0:Math.ceil(v/u)}d(q,"getEstimatedTickCount");function j(h,D,w,T){const v=r.db.getDateFormat(),u=r.db.getAxisFormat();let f;u?f=u:v==="D"?f="%d":f=i.axisFormat??"%Y-%m-%d";let x=lr(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(F!==null){const o=parseInt(F[1],10);if(isNaN(o)||o<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const X=F[2],s=r.db.getWeekday()||i.weekday,E=A.domain(),z=E[0],V=E[1],P=q(z,V,o,X);if(P>Te)Tt.warn(`The tick interval "${o}${X}" would generate ${P} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(X){case"millisecond":x.ticks(Et.every(o));break;case"second":x.ticks(vt.every(o));break;case"minute":x.ticks(Ot.every(o));break;case"hour":x.ticks(Ht.every(o));break;case"day":x.ticks(xt.every(o));break;case"week":x.ticks(an[s].every(o));break;case"month":x.ticks(Pt.every(o));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+h+", "+(T-50)+")").call(x).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let o=ur(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(ie(f));if(F!==null){const X=parseInt(F[1],10);if(isNaN(X)||X<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const s=F[2],E=r.db.getWeekday()||i.weekday,z=A.domain(),V=z[0],P=z[1];if(q(V,P,X,s)<=Te)switch(s){case"millisecond":o.ticks(Et.every(X));break;case"second":o.ticks(vt.every(X));break;case"minute":o.ticks(Ot.every(X));break;case"hour":o.ticks(Ht.every(X));break;case"day":o.ticks(xt.every(X));break;case"week":o.ticks(an[E].every(X));break;case"month":o.ticks(Pt.every(X));break}}}B.append("g").attr("class","grid").attr("transform","translate("+h+", "+D+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(j,"makeGrid");function k(h,D){let w=0;const T=Object.keys(_).map(v=>[v,_[v]]);B.append("g").selectAll("text").data(T).enter().append(function(v){const u=v[0].split(Bn.lineBreakRegex),f=-(u.length-1)/2,x=Y.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("dy",f+"em");for(const[b,F]of u.entries()){const o=Y.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttribute("alignment-baseline","central"),o.setAttribute("x","10"),b>0&&o.setAttribute("dy","1em"),o.textContent=F,x.appendChild(o)}return x}).attr("x",10).attr("y",function(v,u){if(u>0)for(let f=0;f` - .mermaid-main-font { - font-family: ${t.fontFamily}; - } - - .exclude-range { - fill: ${t.excludeBkgColor}; - } - - .section { - stroke: none; - opacity: 0.2; - } - - .section0 { - fill: ${t.sectionBkgColor}; - } - - .section2 { - fill: ${t.sectionBkgColor2}; - } - - .section1, - .section3 { - fill: ${t.altSectionBkgColor}; - opacity: 0.2; - } - - .sectionTitle0 { - fill: ${t.titleColor}; - } - - .sectionTitle1 { - fill: ${t.titleColor}; - } - - .sectionTitle2 { - fill: ${t.titleColor}; - } - - .sectionTitle3 { - fill: ${t.titleColor}; - } - - .sectionTitle { - text-anchor: start; - font-family: ${t.fontFamily}; - } - - - /* Grid and axis */ - - .grid .tick { - stroke: ${t.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - } - - .grid .tick text { - font-family: ${t.fontFamily}; - fill: ${t.textColor}; - } - - .grid path { - stroke-width: 0; - } - - - /* Today line */ - - .today { - fill: none; - stroke: ${t.todayLineColor}; - stroke-width: 2px; - } - - - /* Task styling */ - - /* Default task */ - - .task { - stroke-width: 2; - } - - .taskText { - text-anchor: middle; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideRight { - fill: ${t.taskTextDarkColor}; - text-anchor: start; - font-family: ${t.fontFamily}; - } - - .taskTextOutsideLeft { - fill: ${t.taskTextDarkColor}; - text-anchor: end; - } - - - /* Special case clickable */ - - .task.clickable { - cursor: pointer; - } - - .taskText.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${t.taskTextClickableColor} !important; - font-weight: bold; - } - - - /* Specific task settings for the sections*/ - - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${t.taskTextColor}; - } - - .task0, - .task1, - .task2, - .task3 { - fill: ${t.taskBkgColor}; - stroke: ${t.taskBorderColor}; - } - - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${t.taskTextOutsideColor}; - } - - .taskTextOutside1, - .taskTextOutside3 { - fill: ${t.taskTextOutsideColor}; - } - - - /* Active task */ - - .active0, - .active1, - .active2, - .active3 { - fill: ${t.activeTaskBkgColor}; - stroke: ${t.activeTaskBorderColor}; - } - - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${t.taskTextDarkColor} !important; - } - - - /* Completed task */ - - .done0, - .done1, - .done2, - .done3 { - stroke: ${t.doneTaskBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - } - - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${t.taskTextDarkColor} !important; - } - - /* Done task text displayed outside the bar sits against the diagram background, - not against the done-task bar, so it must use the outside/contrast color. */ - .doneText0.taskTextOutsideLeft, - .doneText0.taskTextOutsideRight, - .doneText1.taskTextOutsideLeft, - .doneText1.taskTextOutsideRight, - .doneText2.taskTextOutsideLeft, - .doneText2.taskTextOutsideRight, - .doneText3.taskTextOutsideLeft, - .doneText3.taskTextOutsideRight { - fill: ${t.taskTextOutsideColor} !important; - } - - - /* Tasks on the critical line */ - - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${t.critBorderColor}; - fill: ${t.critBkgColor}; - stroke-width: 2; - } - - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.activeTaskBkgColor}; - stroke-width: 2; - } - - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${t.critBorderColor}; - fill: ${t.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; - } - - .milestone { - transform: rotate(45deg) scale(0.8,0.8); - } - - .milestoneText { - font-style: italic; - } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - /* Done-crit task text outside the bar — same reasoning as doneText above. */ - .doneCritText0.taskTextOutsideLeft, - .doneCritText0.taskTextOutsideRight, - .doneCritText1.taskTextOutsideLeft, - .doneCritText1.taskTextOutsideRight, - .doneCritText2.taskTextOutsideLeft, - .doneCritText2.taskTextOutsideRight, - .doneCritText3.taskTextOutsideLeft, - .doneCritText3.taskTextOutsideRight { - fill: ${t.taskTextOutsideColor} !important; - } - - .vert { - stroke: ${t.vertLineColor}; - } - - .vertText { - font-size: 15px; - text-anchor: middle; - fill: ${t.vertLineColor} !important; - } - - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${t.taskTextDarkColor} !important; - } - - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${t.titleColor||t.textColor}; - font-family: ${t.fontFamily}; - } -`,"getStyles"),Hs=Os,qs={parser:ji,db:Is,renderer:$s,styles:Hs};export{qs as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-Cv91TEJM.js b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-Cv91TEJM.js new file mode 100644 index 000000000..b0c9a5595 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-Cv91TEJM.js @@ -0,0 +1,292 @@ +import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,b4 as oe,g as Nn,s as Pn,q as Vn,p as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,o as Xn,r as Gn,z as jn}from"./mermaid.core-CM2luXFy.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-BzSwLvr2.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +`+H.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;og[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)=>{const n=e.toLowerCase().split(/[\s,]+/).filter(r=>r!=="");return[...new Set([...t,...n])]},"mergeTokens"),ms=d(function(t){Lt=Fn(Lt,t)},"setIncludes"),gs=d(function(){return Lt},"getIncludes"),ys=d(function(t){At=Fn(At,t)},"setExcludes"),ks=d(function(){return At},"getExcludes"),ps=d(function(){return Ee},"getLinks"),vs=d(function(t){Wt=t,Ie.push(t)},"addSection"),Ts=d(function(){return Ie},"getSections"),xs=d(function(){let t=sn();const e=10;let n=0;for(;!t&&ny))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(y=>{const F=y.trim();return F==="x"||F==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const s=/^after\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let y=null;for(const S of s.groups.ids.split(" ")){let w=Ct(S);w!==void 0&&(!y||w.endTime>y.endTime)&&(y=w)}if(y)return y.endTime;const F=new Date;return F.setHours(0,0,0,0),F}let a=it(n,e.trim(),!0);if(a.isValid())return a.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const y=new Date(n);if(y===void 0||isNaN(y.getTime())||y.getFullYear()<-1e4||y.getFullYear()>1e4)throw new Error("Invalid date:"+n);return y}},"getStartDate"),In=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Ln=d(function(t,e,n,r=!1){n=n.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let w=null;for(const _ of s.groups.ids.split(" ")){let Y=Ct(_);Y!==void 0&&(!w||Y.startTime{window.open(n,"_self")}),Ee.set(r,n))}),Wn(t,"clickable")},"setLink"),Wn=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Us=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{jn.runFunc(e,...r)})},"setClickFun"),$n=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Es=d(function(t,e,n){t.split(",").forEach(function(r){Us(r,e,n)}),Wn(t,"clickable")},"setClickEvent"),Is=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Ls={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Ji,setDateFormat:as,getDateFormat:hs,enableInclusiveEndDates:os,endDatesAreInclusive:cs,enableTopAxis:us,topAxisEnabled:ls,setAxisFormat:ts,getAxisFormat:es,setTickInterval:ns,getTickInterval:rs,setTodayMarker:is,getTodayMarker:ss,setAccTitle:qn,getAccTitle:zn,setDiagramTitle:Rn,getDiagramTitle:Vn,setDiagramId:Ki,setDisplayMode:fs,getDisplayMode:ds,setAccDescription:Pn,getAccDescription:Nn,addSection:vs,getSections:Ts,getTasks:xs,addTask:_s,findTaskById:Ct,addTaskOrg:Ys,setIncludes:ms,getIncludes:gs,setExcludes:ys,getExcludes:ks,setClickEvent:Es,setLink:Fs,getLinks:ps,bindFunctions:Is,parseDuration:In,isInvalidDate:Un,setWeekday:bs,getWeekday:ws,setWeekend:Ds};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");it.extend(ji);var As=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Vt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:zt},Ws=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of r)for(let a=0;a=n[a]){n[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),dt,Te=1e4,$s=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const s=Yt().securityLevel;let a;s==="sandbox"&&(a=Zt("#i"+e));const y=s==="sandbox"?Zt(a.nodes()[0].contentDocument.body):Zt("body"),F=s==="sandbox"?a.nodes()[0].contentDocument:document,S=F.getElementById(e);dt=S.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const w=r.db.getTasks(),P=w.filter(x=>!x.vert);let _=[];for(const x of P)_.push(x.type);_=L(_);const Y={};let X=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const x={};for(const M of P)x[M.section]===void 0?x[M.section]=[M]:x[M.section].push(M);let C=0;for(const M of Object.keys(x)){const D=Ws(x[M],C)+1;C+=D,X+=D*(i.barHeight+i.barGap),Y[M]=D}}else{X+=P.length*(i.barHeight+i.barGap);for(const x of _)Y[x]=P.filter(C=>C.type===x).length}S.setAttribute("viewBox","0 0 "+dt+" "+X);const B=y.select(`[id="${e}"]`),v=Li().domain([rr(w,function(x){return x.startTime}),nr(w,function(x){return x.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(x,C){const M=x.startTime,D=C.startTime;let c=0;return M>D?c=1:Ml.vert===$.vert?0:l.vert?1:-1);const m=x.filter(l=>!l.vert),o=[...new Set(m.map(l=>l.order))].map(l=>m.find($=>$.order===l));B.append("g").selectAll("rect").data(o).enter().append("rect").attr("x",0).attr("y",function(l,$){return $=l.order,$*C+M-2}).attr("width",function(){return b-i.rightPadding/2}).attr("height",C).attr("class",function(l){for(const[$,O]of _.entries())if(l.type===O)return"section section"+$%i.numberSectionStyles;return"section section0"}).enter();const W=B.append("g").selectAll("rect").data(x).enter(),u=r.db.getLinks();if(W.append("rect").attr("id",function(l){return e+"-"+l.id}).attr("rx",3).attr("ry",3).attr("x",function(l){return l.milestone?v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))-.5*c:v(l.startTime)+D}).attr("y",function(l,$){return $=l.order,l.vert?i.gridLineStartPadding:$*C+M}).attr("width",function(l){return l.milestone?c:l.vert?.08*c:v(l.renderEndTime||l.endTime)-v(l.startTime)}).attr("height",function(l){return l.vert?m.length*(i.barHeight+i.barGap)+i.barHeight*2:c}).attr("transform-origin",function(l,$){return $=l.order,(v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))).toString()+"px "+($*C+M+.5*c).toString()+"px"}).attr("class",function(l){const $="task";let O="";l.classes.length>0&&(O=l.classes.join(" "));let j=0;for(const[J,h]of _.entries())l.type===h&&(j=J%i.numberSectionStyles);let H="";return l.active?l.crit?H+=" activeCrit":H=" active":l.done?l.crit?H=" doneCrit":H=" done":l.crit&&(H+=" crit"),H.length===0&&(H=" task"),l.milestone&&(H=" milestone "+H),l.vert&&(H=" vert "+H),H+=j,H+=" "+O,$+H}),W.append("text").attr("id",function(l){return e+"-"+l.id+"-text"}).text(function(l){return l.task}).attr("font-size",i.fontSize).attr("x",function(l){let $=v(l.startTime),O=v(l.renderEndTime||l.endTime);if(l.milestone&&($+=.5*(v(l.endTime)-v(l.startTime))-.5*c,O=$+c),l.vert)return v(l.startTime)+D;const j=this.getBBox().width;return j>O-$?O+j+1.5*i.leftPadding>b?$+D-5:O+D+5:(O-$)/2+$+D}).attr("y",function(l,$){return l.vert?i.gridLineStartPadding+m.length*(i.barHeight+i.barGap)+60:($=l.order,$*C+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",c).attr("class",function(l){const $=v(l.startTime);let O=v(l.endTime);l.milestone&&(O=$+c);const j=this.getBBox().width;let H="";l.classes.length>0&&(H=l.classes.join(" "));let J=0;for(const[N,V]of _.entries())l.type===V&&(J=N%i.numberSectionStyles);let h="";return l.active&&(l.crit?h="activeCritText"+J:h="activeText"+J),l.done?l.crit?h=h+" doneCritText"+J:h=h+" doneText"+J:l.crit&&(h=h+" critText"+J),l.milestone&&(h+=" milestoneText"),l.vert&&(h+=" vertText"),j>O-$?O+j+1.5*i.leftPadding>b?H+" taskTextOutsideLeft taskTextOutside"+J+" "+h:H+" taskTextOutsideRight taskTextOutside"+J+" "+h+" width-"+j:H+" taskText taskText"+J+" "+h+" width-"+j}),Yt().securityLevel==="sandbox"){let l;l=Zt("#i"+e);const $=l.nodes()[0].contentDocument;W.filter(function(O){return u.has(O.id)}).each(function(O){var j=$.querySelector("#"+CSS.escape(e+"-"+O.id)),H=$.querySelector("#"+CSS.escape(e+"-"+O.id+"-text"));const J=j.parentNode;var h=$.createElement("a");h.setAttribute("xlink:href",u.get(O.id)),h.setAttribute("target","_top"),J.appendChild(h),h.appendChild(j),h.appendChild(H)})}}d(E,"drawRects");function z(x,C,M,D,c,g,b,m){if(b.length===0&&m.length===0)return;let I,o;for(const{startTime:O,endTime:j}of g)(I===void 0||Oo)&&(o=j);if(!I||!o)return;if(it(o).diff(it(I),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const W=r.db.getDateFormat(),u=[];let K=null,l=it(I);for(;l.valueOf()<=o;)r.db.isInvalidDate(l,W,b,m)?K?K.end=l:K={start:l,end:l}:K&&(u.push(K),K=null),l=l.add(1,"d");B.append("g").selectAll("rect").data(u).enter().append("rect").attr("id",O=>e+"-exclude-"+O.start.format("YYYY-MM-DD")).attr("x",O=>v(O.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",O=>v(O.end.endOf("day"))-v(O.start.startOf("day"))).attr("height",c-C-i.gridLineStartPadding).attr("transform-origin",function(O,j){return(v(O.start)+M+.5*(v(O.end)-v(O.start))).toString()+"px "+(j*x+.5*c).toString()+"px"}).attr("class","exclude-range")}d(z,"drawExcludeDays");function G(x,C,M,D){if(M<=0||x>C)return 1/0;const c=C-x,g=it.duration({[D??"day"]:M}).asMilliseconds();return g<=0?1/0:Math.ceil(c/g)}d(G,"getEstimatedTickCount");function T(x,C,M,D){const c=r.db.getDateFormat(),g=r.db.getAxisFormat();let b;g?b=g:c==="D"?b="%d":b=i.axisFormat??"%Y-%m-%d";let m=fr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(o!==null){const W=parseInt(o[1],10);if(isNaN(W)||W<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const u=o[2],K=r.db.getWeekday()||i.weekday,l=v.domain(),$=l[0],O=l[1],j=G($,O,W,u);if(j>Te)Tt.warn(`The tick interval "${W}${u}" would generate ${j} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(u){case"millisecond":m.ticks(Et.every(W));break;case"second":m.ticks(vt.every(W));break;case"minute":m.ticks(Nt.every(W));break;case"hour":m.ticks(Pt.every(W));break;case"day":m.ticks(xt.every(W));break;case"week":m.ticks(an[K].every(W));break;case"month":m.ticks(Rt.every(W));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+x+", "+(D-50)+")").call(m).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let W=lr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));if(o!==null){const u=parseInt(o[1],10);if(isNaN(u)||u<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const K=o[2],l=r.db.getWeekday()||i.weekday,$=v.domain(),O=$[0],j=$[1];if(G(O,j,u,K)<=Te)switch(K){case"millisecond":W.ticks(Et.every(u));break;case"second":W.ticks(vt.every(u));break;case"minute":W.ticks(Nt.every(u));break;case"hour":W.ticks(Pt.every(u));break;case"day":W.ticks(xt.every(u));break;case"week":W.ticks(an[l].every(u));break;case"month":W.ticks(Rt.every(u));break}}}B.append("g").attr("class","grid").attr("transform","translate("+x+", "+C+")").call(W).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(T,"makeGrid");function k(x,C){let M=0;const D=Object.keys(Y).map(c=>[c,Y[c]]);B.append("g").selectAll("text").data(D).enter().append(function(c){const g=c[0].split(Zn.lineBreakRegex),b=-(g.length-1)/2,m=F.createElementNS("http://www.w3.org/2000/svg","text");m.setAttribute("dy",b+"em");for(const[I,o]of g.entries()){const W=F.createElementNS("http://www.w3.org/2000/svg","tspan");W.setAttribute("alignment-baseline","central"),W.setAttribute("x","10"),I>0&&W.setAttribute("dy","1em"),W.textContent=o,m.appendChild(W)}return m}).attr("x",10).attr("y",function(c,g){if(g>0)for(let b=0;b` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Ns=Hs,Zs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{Zs as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-e6aGOOKl.js b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-e6aGOOKl.js new file mode 100644 index 000000000..f413c51df --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-e6aGOOKl.js @@ -0,0 +1,292 @@ +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,b5 as oe,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bn as it,l as Tt,k as Zn,G as Xn,p as Gn,x as jn}from"./mermaidParser.worker-DimdFOud.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-C54H8aK0.js";import{i as er}from"./init-Gi6I4Gst.js";import"./defaultLocale-CCNgq9ws.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi(),Oi=oe($i),Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni(),Vi=oe(Pi),Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi(),Bi=oe(qi),Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi(),ji=oe(Gi),we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +`+H.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;og[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)=>{const n=e.toLowerCase().split(/[\s,]+/).filter(r=>r!=="");return[...new Set([...t,...n])]},"mergeTokens"),ms=d(function(t){Lt=Fn(Lt,t)},"setIncludes"),gs=d(function(){return Lt},"getIncludes"),ys=d(function(t){At=Fn(At,t)},"setExcludes"),ks=d(function(){return At},"getExcludes"),ps=d(function(){return Ee},"getLinks"),vs=d(function(t){Wt=t,Ie.push(t)},"addSection"),Ts=d(function(){return Ie},"getSections"),xs=d(function(){let t=sn();const e=10;let n=0;for(;!t&&ny))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(y=>{const F=y.trim();return F==="x"||F==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const s=/^after\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let y=null;for(const S of s.groups.ids.split(" ")){let w=Ct(S);w!==void 0&&(!y||w.endTime>y.endTime)&&(y=w)}if(y)return y.endTime;const F=new Date;return F.setHours(0,0,0,0),F}let a=it(n,e.trim(),!0);if(a.isValid())return a.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const y=new Date(n);if(y===void 0||isNaN(y.getTime())||y.getFullYear()<-1e4||y.getFullYear()>1e4)throw new Error("Invalid date:"+n);return y}},"getStartDate"),In=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Ln=d(function(t,e,n,r=!1){n=n.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let w=null;for(const _ of s.groups.ids.split(" ")){let Y=Ct(_);Y!==void 0&&(!w||Y.startTime{window.open(n,"_self")}),Ee.set(r,n))}),Wn(t,"clickable")},"setLink"),Wn=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Us=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{jn.runFunc(e,...r)})},"setClickFun"),$n=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Es=d(function(t,e,n){t.split(",").forEach(function(r){Us(r,e,n)}),Wn(t,"clickable")},"setClickEvent"),Is=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Ls={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Ji,setDateFormat:as,getDateFormat:hs,enableInclusiveEndDates:os,endDatesAreInclusive:cs,enableTopAxis:us,topAxisEnabled:ls,setAxisFormat:ts,getAxisFormat:es,setTickInterval:ns,getTickInterval:rs,setTodayMarker:is,getTodayMarker:ss,setAccTitle:qn,getAccTitle:zn,setDiagramTitle:Rn,getDiagramTitle:Vn,setDiagramId:Ki,setDisplayMode:fs,getDisplayMode:ds,setAccDescription:Pn,getAccDescription:Nn,addSection:vs,getSections:Ts,getTasks:xs,addTask:_s,findTaskById:Ct,addTaskOrg:Ys,setIncludes:ms,getIncludes:gs,setExcludes:ys,getExcludes:ks,setClickEvent:Es,setLink:Fs,getLinks:ps,bindFunctions:Is,parseDuration:In,isInvalidDate:Un,setWeekday:bs,getWeekday:ws,setWeekend:Ds};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");it.extend(ji);var As=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Vt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:zt},Ws=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of r)for(let a=0;a=n[a]){n[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),dt,Te=1e4,$s=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const s=Yt().securityLevel;let a;s==="sandbox"&&(a=Zt("#i"+e));const y=s==="sandbox"?Zt(a.nodes()[0].contentDocument.body):Zt("body"),F=s==="sandbox"?a.nodes()[0].contentDocument:document,S=F.getElementById(e);dt=S.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const w=r.db.getTasks(),P=w.filter(x=>!x.vert);let _=[];for(const x of P)_.push(x.type);_=L(_);const Y={};let X=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const x={};for(const M of P)x[M.section]===void 0?x[M.section]=[M]:x[M.section].push(M);let C=0;for(const M of Object.keys(x)){const D=Ws(x[M],C)+1;C+=D,X+=D*(i.barHeight+i.barGap),Y[M]=D}}else{X+=P.length*(i.barHeight+i.barGap);for(const x of _)Y[x]=P.filter(C=>C.type===x).length}S.setAttribute("viewBox","0 0 "+dt+" "+X);const B=y.select(`[id="${e}"]`),v=Li().domain([rr(w,function(x){return x.startTime}),nr(w,function(x){return x.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(x,C){const M=x.startTime,D=C.startTime;let c=0;return M>D?c=1:Ml.vert===$.vert?0:l.vert?1:-1);const m=x.filter(l=>!l.vert),o=[...new Set(m.map(l=>l.order))].map(l=>m.find($=>$.order===l));B.append("g").selectAll("rect").data(o).enter().append("rect").attr("x",0).attr("y",function(l,$){return $=l.order,$*C+M-2}).attr("width",function(){return b-i.rightPadding/2}).attr("height",C).attr("class",function(l){for(const[$,O]of _.entries())if(l.type===O)return"section section"+$%i.numberSectionStyles;return"section section0"}).enter();const W=B.append("g").selectAll("rect").data(x).enter(),u=r.db.getLinks();if(W.append("rect").attr("id",function(l){return e+"-"+l.id}).attr("rx",3).attr("ry",3).attr("x",function(l){return l.milestone?v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))-.5*c:v(l.startTime)+D}).attr("y",function(l,$){return $=l.order,l.vert?i.gridLineStartPadding:$*C+M}).attr("width",function(l){return l.milestone?c:l.vert?.08*c:v(l.renderEndTime||l.endTime)-v(l.startTime)}).attr("height",function(l){return l.vert?m.length*(i.barHeight+i.barGap)+i.barHeight*2:c}).attr("transform-origin",function(l,$){return $=l.order,(v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))).toString()+"px "+($*C+M+.5*c).toString()+"px"}).attr("class",function(l){const $="task";let O="";l.classes.length>0&&(O=l.classes.join(" "));let j=0;for(const[J,h]of _.entries())l.type===h&&(j=J%i.numberSectionStyles);let H="";return l.active?l.crit?H+=" activeCrit":H=" active":l.done?l.crit?H=" doneCrit":H=" done":l.crit&&(H+=" crit"),H.length===0&&(H=" task"),l.milestone&&(H=" milestone "+H),l.vert&&(H=" vert "+H),H+=j,H+=" "+O,$+H}),W.append("text").attr("id",function(l){return e+"-"+l.id+"-text"}).text(function(l){return l.task}).attr("font-size",i.fontSize).attr("x",function(l){let $=v(l.startTime),O=v(l.renderEndTime||l.endTime);if(l.milestone&&($+=.5*(v(l.endTime)-v(l.startTime))-.5*c,O=$+c),l.vert)return v(l.startTime)+D;const j=this.getBBox().width;return j>O-$?O+j+1.5*i.leftPadding>b?$+D-5:O+D+5:(O-$)/2+$+D}).attr("y",function(l,$){return l.vert?i.gridLineStartPadding+m.length*(i.barHeight+i.barGap)+60:($=l.order,$*C+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",c).attr("class",function(l){const $=v(l.startTime);let O=v(l.endTime);l.milestone&&(O=$+c);const j=this.getBBox().width;let H="";l.classes.length>0&&(H=l.classes.join(" "));let J=0;for(const[N,V]of _.entries())l.type===V&&(J=N%i.numberSectionStyles);let h="";return l.active&&(l.crit?h="activeCritText"+J:h="activeText"+J),l.done?l.crit?h=h+" doneCritText"+J:h=h+" doneText"+J:l.crit&&(h=h+" critText"+J),l.milestone&&(h+=" milestoneText"),l.vert&&(h+=" vertText"),j>O-$?O+j+1.5*i.leftPadding>b?H+" taskTextOutsideLeft taskTextOutside"+J+" "+h:H+" taskTextOutsideRight taskTextOutside"+J+" "+h+" width-"+j:H+" taskText taskText"+J+" "+h+" width-"+j}),Yt().securityLevel==="sandbox"){let l;l=Zt("#i"+e);const $=l.nodes()[0].contentDocument;W.filter(function(O){return u.has(O.id)}).each(function(O){var j=$.querySelector("#"+CSS.escape(e+"-"+O.id)),H=$.querySelector("#"+CSS.escape(e+"-"+O.id+"-text"));const J=j.parentNode;var h=$.createElement("a");h.setAttribute("xlink:href",u.get(O.id)),h.setAttribute("target","_top"),J.appendChild(h),h.appendChild(j),h.appendChild(H)})}}d(E,"drawRects");function z(x,C,M,D,c,g,b,m){if(b.length===0&&m.length===0)return;let I,o;for(const{startTime:O,endTime:j}of g)(I===void 0||Oo)&&(o=j);if(!I||!o)return;if(it(o).diff(it(I),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const W=r.db.getDateFormat(),u=[];let K=null,l=it(I);for(;l.valueOf()<=o;)r.db.isInvalidDate(l,W,b,m)?K?K.end=l:K={start:l,end:l}:K&&(u.push(K),K=null),l=l.add(1,"d");B.append("g").selectAll("rect").data(u).enter().append("rect").attr("id",O=>e+"-exclude-"+O.start.format("YYYY-MM-DD")).attr("x",O=>v(O.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",O=>v(O.end.endOf("day"))-v(O.start.startOf("day"))).attr("height",c-C-i.gridLineStartPadding).attr("transform-origin",function(O,j){return(v(O.start)+M+.5*(v(O.end)-v(O.start))).toString()+"px "+(j*x+.5*c).toString()+"px"}).attr("class","exclude-range")}d(z,"drawExcludeDays");function G(x,C,M,D){if(M<=0||x>C)return 1/0;const c=C-x,g=it.duration({[D??"day"]:M}).asMilliseconds();return g<=0?1/0:Math.ceil(c/g)}d(G,"getEstimatedTickCount");function T(x,C,M,D){const c=r.db.getDateFormat(),g=r.db.getAxisFormat();let b;g?b=g:c==="D"?b="%d":b=i.axisFormat??"%Y-%m-%d";let m=fr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(o!==null){const W=parseInt(o[1],10);if(isNaN(W)||W<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const u=o[2],K=r.db.getWeekday()||i.weekday,l=v.domain(),$=l[0],O=l[1],j=G($,O,W,u);if(j>Te)Tt.warn(`The tick interval "${W}${u}" would generate ${j} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(u){case"millisecond":m.ticks(Et.every(W));break;case"second":m.ticks(vt.every(W));break;case"minute":m.ticks(Nt.every(W));break;case"hour":m.ticks(Pt.every(W));break;case"day":m.ticks(xt.every(W));break;case"week":m.ticks(an[K].every(W));break;case"month":m.ticks(Rt.every(W));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+x+", "+(D-50)+")").call(m).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let W=lr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));if(o!==null){const u=parseInt(o[1],10);if(isNaN(u)||u<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const K=o[2],l=r.db.getWeekday()||i.weekday,$=v.domain(),O=$[0],j=$[1];if(G(O,j,u,K)<=Te)switch(K){case"millisecond":W.ticks(Et.every(u));break;case"second":W.ticks(vt.every(u));break;case"minute":W.ticks(Nt.every(u));break;case"hour":W.ticks(Pt.every(u));break;case"day":W.ticks(xt.every(u));break;case"week":W.ticks(an[l].every(u));break;case"month":W.ticks(Rt.every(u));break}}}B.append("g").attr("class","grid").attr("transform","translate("+x+", "+C+")").call(W).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(T,"makeGrid");function k(x,C){let M=0;const D=Object.keys(Y).map(c=>[c,Y[c]]);B.append("g").selectAll("text").data(D).enter().append(function(c){const g=c[0].split(Zn.lineBreakRegex),b=-(g.length-1)/2,m=F.createElementNS("http://www.w3.org/2000/svg","text");m.setAttribute("dy",b+"em");for(const[I,o]of g.entries()){const W=F.createElementNS("http://www.w3.org/2000/svg","tspan");W.setAttribute("alignment-baseline","central"),W.setAttribute("x","10"),I>0&&W.setAttribute("dy","1em"),W.textContent=o,m.appendChild(W)}return m}).attr("x",10).attr("y",function(c,g){if(g>0)for(let b=0;b` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Ns=Hs,qs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{qs as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-BRUFe5tO.js b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-BRUFe5tO.js deleted file mode 100644 index d46adee5a..000000000 --- a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-BRUFe5tO.js +++ /dev/null @@ -1,106 +0,0 @@ -import{p as le}from"./chunk-4BX2VUAB-Byfpbsm0.js";import{I as he}from"./chunk-QZHKN3VN-B-qKGIEB.js";import{t as $e,q as fe,s as ge,g as ue,a as ye,b as xe,_ as h,F as J,l as w,d as me,c as W,u as pe,G as be,A as we,k as B,H as ke,I as ve,K as Ce}from"./mermaid.core-Bt2TZ_t_.js";import{p as Ee}from"./wardley-L42UT6IY-7UoWEQ2c.js";import"./index-C-zUV3mO.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new he(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Ie=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Re=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Ie,branch:Re,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{le(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ke(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ue(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=h(e=>e.branch,"parseCheckout"),Ue=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,I=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],R=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),R=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-I).attr("y",t.y+13.5).attr("width",l.width+2*I).attr("height",l.height+2*I),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` - ${s-i/2-L/2},${x+I} - ${s-i/2-L/2},${x-I} - ${t.posWithOffset-i/2-L},${x-c-I} - ${t.posWithOffset+i/2+L},${x-c-I} - ${t.posWithOffset+i/2+L},${x+c+I} - ${t.posWithOffset-i/2-L},${x+c+I}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` - ${t.x},${u+2} - ${t.x},${u-2} - ${t.x+O},${u-c-2} - ${t.x+O+i+4},${u-c-2} - ${t.x+O+i+4},${u+c+2} - ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>R&&(R=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",R),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",R),k.attr("x2",p)):y==="BT"&&(k.attr("y1",R),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const K=c.name,D=oe(K),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",R),M.attr("transform","translate("+(p-v.width/2-5)+", "+R+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(R+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` -`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,K)=>{const D=oe(k.name),T=l.append("g"),U=T.insert("g").attr("class","branchLabel"),M=U.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,K,v,n),M.remove(),U.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` - .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } - .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } - .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } - .label${r} { fill: ${e["git"+t]}; } - .arrow${r} { stroke: ${e["git"+t]}; } - `}).join(` -`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` - .commit-id, - .commit-msg, - .branch-label { - fill: lightgrey; - color: lightgrey; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - } - - ${s?kr(e):vr(e)} - - .branch { - stroke-width: ${e.strokeWidth}; - stroke: ${e.commitLineColor??e.lineColor}; - stroke-dasharray: ${s?"4 2":"2"}; - } - .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} - .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } - .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} - .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } - .tag-hole { fill: ${e.textColor}; } - - .commit-merge { - stroke: ${s?e.mainBkg:e.primaryColor}; - fill: ${s?e.mainBkg:e.primaryColor}; - } - .commit-reverse { - stroke: ${s?e.mainBkg:e.primaryColor}; - fill: ${s?e.mainBkg:e.primaryColor}; - stroke-width: ${s?e.strokeWidth:3}; - } - .commit-highlight-outer { - } - .commit-highlight-inner { - stroke: ${s?e.mainBkg:e.primaryColor}; - fill: ${s?e.mainBkg:e.primaryColor}; - } - - .arrow { - /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${de.has(t)?e.strokeWidth:8}; - stroke-linecap: round; - fill: none - } - .gitTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } -`},"getStyles"),Er=Cr,Rr={parser:Ve,db:se,renderer:yr,styles:Er};export{Rr as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-Ba6FufWL.js b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-Ba6FufWL.js new file mode 100644 index 000000000..3b24eae26 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-Ba6FufWL.js @@ -0,0 +1,106 @@ +import{I as le}from"./chunk-2Q5K7J3B-CTeS1k9U.js";import{p as he}from"./chunk-JWPE2WC7-CM6UswKM.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,A as J,l as w,j as me,c as W,z as pe,B as be,r as we,k as B,D as ke,E as ve,F as Ce}from"./mermaid.core-CM2luXFy.js";import{p as Ee}from"./cynefin-OW5HDTMX-B2xW2LGa.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` + ${s-i/2-L/2},${x+R} + ${s-i/2-L/2},${x-R} + ${t.posWithOffset-i/2-L},${x-c-R} + ${t.posWithOffset+i/2+L},${x-c-R} + ${t.posWithOffset+i/2+L},${x+c+R} + ${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` + ${t.x},${u+2} + ${t.x},${u-2} + ${t.x+O},${u-c-2} + ${t.x+O+i+4},${u-c-2} + ${t.x+O+i+4},${u+c+2} + ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` + .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } + .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } + .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } + .label${r} { fill: ${e["git"+t]}; } + .arrow${r} { stroke: ${e["git"+t]}; } + `}).join(` +`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${s?kr(e):vr(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${s?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + stroke-width: ${s?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${de.has(t)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles"),Er=Cr,Or={parser:Ve,db:se,renderer:yr,styles:Er};export{Or as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-NJxV01JK.js similarity index 94% rename from apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js rename to apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-NJxV01JK.js index f493694e6..9b83850d1 100644 --- a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js +++ b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-NJxV01JK.js @@ -1,4 +1,4 @@ -import{p as le}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{I as he}from"./chunk-QZHKN3VN-_Rz9_NuS.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,D as J,l as w,d as me,c as W,u as pe,E as be,z as we,k as B,F as ke,G as ve,H as Ce}from"./mermaidParser.worker-Dx4jPi9z.js";import{p as Ee}from"./wardley-L42UT6IY-BJFn8eDD.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new he(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{le(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-Fw0ursww.js";import{p as he}from"./chunk-JWPE2WC7-B_FDSHPF.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,j as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaidParser.worker-DimdFOud.js";import{p as Ee}from"./cynefin-OW5HDTMX-CZChzy6K.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} @@ -10,8 +10,8 @@ import{p as le}from"./chunk-4BX2VUAB-WqrE2gaw.js";import{I as he}from"./chunk-QZ ${t.x+O},${u-c-2} ${t.x+O+i+4},${u-c-2} ${t.x+O+i+4},${u+c+2} - ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` -`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=q(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n1?i.setNode(s,r):i.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=C,this._children[t]={},this._children[C][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],S(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),S(b(this._in[t]),r),delete this._in[t],delete this._preds[t],S(b(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;S(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),S(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&S(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,m as A,Wt as B,g as C,Le as D,de as E,zi as F,gt as G,V as H,Z as I,Fi as J,dt as K,Jt as L,ye as M,Je as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,$n as Y,S as Z,F as _,he as a,se as a0,Ji as a1,ce as b,Q as c,Ae as d,ke as e,Ve as f,ir as g,et as h,R as i,Br as j,jn as k,Kr as l,j as m,M as n,nr as o,b as p,zn as q,w as r,Zt as s,Fn as t,ot as u,Hn as v,O as w,Gr as x,Ce as y,W as z}; diff --git a/apps/pythinker-code/dist-web/assets/graph-BwjfAU3j.js b/apps/pythinker-code/dist-web/assets/graph-BwjfAU3j.js deleted file mode 100644 index 0d76f7cff..000000000 --- a/apps/pythinker-code/dist-web/assets/graph-BwjfAU3j.js +++ /dev/null @@ -1 +0,0 @@ -var Ze=typeof global=="object"&&global&&global.Object===Object&&global,pt=typeof self=="object"&&self&&self.Object===Object&&self,w=Ze||pt||Function("return this")(),y=w.Symbol,We=Object.prototype,_t=We.hasOwnProperty,bt=We.toString,D=y?y.toStringTag:void 0;function yt(e){var t=_t.call(e,D),r=e[D];try{e[D]=void 0;var n=!0}catch{}var i=bt.call(e);return n&&(t?e[D]=r:delete e[D]),i}var vt=Object.prototype,Ot=vt.toString;function mt(e){return Ot.call(e)}var wt="[object Null]",Tt="[object Undefined]",Oe=y?y.toStringTag:void 0;function M(e){return e==null?e===void 0?Tt:wt:Oe&&Oe in Object(e)?yt(e):mt(e)}function j(e){return e!=null&&typeof e=="object"}var At="[object Symbol]";function he(e){return typeof e=="symbol"||j(e)&&M(e)==At}function Je(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++to))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n1?i.setNode(s,r):i.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=C,this._children[t]={},this._children[C][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],$(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),$(b(this._in[t]),r),delete this._in[t],delete this._preds[t],$(b(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;$(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),$(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&$(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,m as A,Wt as B,g as C,Le as D,de as E,zi as F,gt as G,V as H,Z as I,Fi as J,dt as K,Jt as L,ye as M,Je as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,Sn as Y,$ as Z,F as _,he as a,se as a0,Ji as a1,ce as b,Q as c,Ae as d,ke as e,Ve as f,ir as g,et as h,R as i,Br as j,jn as k,Kr as l,j as m,M as n,nr as o,b as p,zn as q,w as r,Zt as s,Fn as t,ot as u,Hn as v,O as w,Gr as x,Ce as y,W as z}; diff --git a/apps/pythinker-code/dist-web/assets/handlebars-C3vjJ5wA.js b/apps/pythinker-code/dist-web/assets/handlebars-C3vjJ5wA.js deleted file mode 100644 index aa1710b0f..000000000 --- a/apps/pythinker-code/dist-web/assets/handlebars-C3vjJ5wA.js +++ /dev/null @@ -1 +0,0 @@ -import{l as e}from"./editor.main-PjnZnl8g.js";import"./index-C-zUV3mO.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{m as conf,r as language}; diff --git a/apps/pythinker-code/dist-web/assets/handlebars-CrwlbXzI.js b/apps/pythinker-code/dist-web/assets/handlebars-CrwlbXzI.js new file mode 100644 index 000000000..24dbb3848 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/handlebars-CrwlbXzI.js @@ -0,0 +1 @@ +import{l as e}from"./editor.main-CYqrlDj5.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},i={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{r as conf,i as language}; diff --git a/apps/pythinker-code/dist-web/assets/html-BG3YQOlK.js b/apps/pythinker-code/dist-web/assets/html-BG3YQOlK.js deleted file mode 100644 index 6ab9bb254..000000000 --- a/apps/pythinker-code/dist-web/assets/html-BG3YQOlK.js +++ /dev/null @@ -1 +0,0 @@ -import{l as e}from"./editor.main-PjnZnl8g.js";import"./index-C-zUV3mO.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},o={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{r as conf,o as language}; diff --git a/apps/pythinker-code/dist-web/assets/html-Clnn5ww4.js b/apps/pythinker-code/dist-web/assets/html-Clnn5ww4.js new file mode 100644 index 000000000..3226a9614 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/html-Clnn5ww4.js @@ -0,0 +1 @@ +import{l as e}from"./editor.main-CYqrlDj5.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},s={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{o as conf,s as language}; diff --git a/apps/pythinker-code/dist-web/assets/htmlMode-B2JxHnrC.js b/apps/pythinker-code/dist-web/assets/htmlMode-B2JxHnrC.js new file mode 100644 index 000000000..7858bf7a9 --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/htmlMode-B2JxHnrC.js @@ -0,0 +1 @@ +import{c as D,l as t}from"./editor.main-CYqrlDj5.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-CQG5isp7.js";import{a as b,e as y,d as T,R as U,i as x,j as M,t as j,k as O}from"./lspLanguageFeatures-CQG5isp7.js";import"./index-rMXX6Fbt.js";import"./purify.es-5AjVNlXF.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-C8KWqYYR.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function F(i){const n=new f(i),e=(...o)=>n.getLanguageServiceWorker(...o);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function L(i){const n=[],e=[],r=new f(i);n.push(r);const o=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(o))),a.hovers&&e.push(t.registerHoverProvider(s,new d(o))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new l(o))),a.links&&e.push(t.registerLinkProvider(s,new c(o))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new h(o))),a.rename&&e.push(t.registerRenameProvider(s,new p(o))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new u(o))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new m(o))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(o))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(o)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,b as DefinitionAdapter,y as DiagnosticsAdapter,T as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,U as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,x as fromPosition,M as fromRange,L as setupMode,F as setupMode1,j as toRange,O as toTextEdit}; diff --git a/apps/pythinker-code/dist-web/assets/htmlMode-DzKTVOy0.js b/apps/pythinker-code/dist-web/assets/htmlMode-DzKTVOy0.js deleted file mode 100644 index 7764b2487..000000000 --- a/apps/pythinker-code/dist-web/assets/htmlMode-DzKTVOy0.js +++ /dev/null @@ -1 +0,0 @@ -import{c as D,l as t}from"./editor.main-PjnZnl8g.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-BqLYp7da.js";import{a as H,e as b,d as y,R as T,i as U,j as x,t as M,k as j}from"./lspLanguageFeatures-BqLYp7da.js";import"./index-C-zUV3mO.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-C8KWqYYR.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function A(i){const n=new f(i),e=(...s)=>n.getLanguageServiceWorker(...s);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function F(i){const n=[],e=[],r=new f(i);n.push(r);const s=(...o)=>r.getLanguageServiceWorker(...o);function P(){const{languageId:o,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(o,new v(s))),a.hovers&&e.push(t.registerHoverProvider(o,new d(s))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(o,new l(s))),a.links&&e.push(t.registerLinkProvider(o,new c(s))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(o,new h(s))),a.rename&&e.push(t.registerRenameProvider(o,new p(s))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(o,new u(s))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(o,new m(s))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(o,new w(s))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(o,new _(s)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,H as DefinitionAdapter,b as DiagnosticsAdapter,y as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,T as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,U as fromPosition,x as fromRange,F as setupMode,A as setupMode1,M as toRange,j as toTextEdit}; diff --git a/apps/pythinker-code/dist-web/assets/index-BALCJgS_.js b/apps/pythinker-code/dist-web/assets/index-CsDiodhg.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index-BALCJgS_.js rename to apps/pythinker-code/dist-web/assets/index-CsDiodhg.js index e5d79de81..ba65f555d 100644 --- a/apps/pythinker-code/dist-web/assets/index-BALCJgS_.js +++ b/apps/pythinker-code/dist-web/assets/index-CsDiodhg.js @@ -1,4 +1,4 @@ -import{t as ee,b as Jn,n as Do,c as Po,a as _o,d as Fo,s as Oo,g as No,e as zo}from"./index-D4amJRyl.js";import{f as Rc}from"./index-D4amJRyl.js";import{bR as w}from"./index-C-zUV3mO.js";const ur="diffs-container",Uo=(()=>{try{return!1}catch{return!1}})(),Vo=/(?=^From [a-f0-9]+ .+$)/m,fr=/(?=^diff --git)/gm,$h=/(?=^---\s+\S)/gm,Wh=/(?=^@@ )/gm,Bo=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,$o=/(?<=\n)/,Wo=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Go=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,jo=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,qo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Gh=/^<{7,}(?:\s.*)?$/,jh=/^\|{7,}(?:\s.*)?$/,qh=/^={7,}$/,Kh=/^>{7,}(?:\s.*)?$/,Hn="header-prefix",Mn="header-filename-suffix",Dn="header-metadata",Pn="header-custom",O={dark:"pierre-dark",light:"pierre-light"},pr="data-theme-css",gr="data-unsafe-css",Ko="data-core-css",Yo="data-diffs-scrollbar-measure",Xo="data-diffs-code-view-header",Qo="data-diffs-code-view-footer",mr="--diffs-scrollbar-gutter-measured",Yh=1,Zo=1e5,_n={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},et={..._n,hunkLineCount:1},Jo={paddingTop:8,paddingBottom:8,gap:8},es={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},ts=Object.freeze({fromStart:0,fromEnd:0}),Xe={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vr={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Oe=new Set;let we=null;function G(e){Oe.add(e),we??=requestAnimationFrame(Cr)}function ze(e){Oe.delete(e)&&Oe.size===0&&we!=null&&(cancelAnimationFrame(we),we=null)}function Xh(){Oe.clear(),we!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(we),we=null}function Cr(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?we=requestAnimationFrame(Cr):we=null}function Qe(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Je(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Fn(e,t){const n=e?.theme??O,i=t?.theme??O,r=ei(e),o=ei(t);return Je(n,i)&&Qe(e,t,["theme","parseDiffOptions"])&&Qe(r,o)}function ei(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function _t(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function cn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const d=Math.max(e-r,0),c=Math.min(e+l,t);return{top:d,bottom:Math.max(c,d)}}let a=e+n/2-s/2,h=a+s;return a<0&&(a=0),h>t&&(h=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(h,t),a))}}function Te(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const ns=new TextEncoder,is=new TextDecoder("utf-8",{ignoreBOM:!0}),rs=/[\uD800-\uDFFF]/,un=1024;let qe=new Uint8Array(un);function Sr(){qe.length!==un&&(qe=new Uint8Array(un))}function B(e){if(e.length===0)return e;if(rs.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;qe.length0&&r.deletions>0||o.type!=="context")continue;const s=r.additions>0,l=s?t.additionLines:t.deletionLines,a=s?r.additionLineIndex:r.deletionLineIndex,h=s?r.additions:r.deletions,d=l[a]??"";if(d.trim()!=="")continue;let c=!0;for(let C=1;Cos)return null;const a=[];for(let g=0;gn;let c=0,u=-1;for(let g=0;g<=l;g++){let C=0;for(let m=0;mu&&(u=C,c=g)}if(c===0)return null;const f=[],p=(g,C,m,v)=>{(g>0||C>0)&&f.push({type:"change",deletions:g,additions:C,deletionLineIndex:m,additionLineIndex:v})};return d?(p(0,c,r,o),p(s,s,r,o+c),p(0,i-s-c,r+s,o+c+s)):(p(c,0,r,o),p(s,s,r+c,o),p(n-s-c,0,r+c+s,o+s)),f}const hs=/\s+/g;function ti(e){return e.replace(hs,"")}function cs(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r0&&(f[f.length-1]===` +import{t as ee,b as Jn,n as Do,c as Po,a as _o,d as Fo,s as Oo,g as No,e as zo}from"./index-F0Uxsiuo.js";import{f as Rc}from"./index-F0Uxsiuo.js";import{bR as w}from"./index-rMXX6Fbt.js";const ur="diffs-container",Uo=(()=>{try{return!1}catch{return!1}})(),Vo=/(?=^From [a-f0-9]+ .+$)/m,fr=/(?=^diff --git)/gm,$h=/(?=^---\s+\S)/gm,Wh=/(?=^@@ )/gm,Bo=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,$o=/(?<=\n)/,Wo=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Go=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,jo=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,qo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Gh=/^<{7,}(?:\s.*)?$/,jh=/^\|{7,}(?:\s.*)?$/,qh=/^={7,}$/,Kh=/^>{7,}(?:\s.*)?$/,Hn="header-prefix",Mn="header-filename-suffix",Dn="header-metadata",Pn="header-custom",O={dark:"pierre-dark",light:"pierre-light"},pr="data-theme-css",gr="data-unsafe-css",Ko="data-core-css",Yo="data-diffs-scrollbar-measure",Xo="data-diffs-code-view-header",Qo="data-diffs-code-view-footer",mr="--diffs-scrollbar-gutter-measured",Yh=1,Zo=1e5,_n={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},et={..._n,hunkLineCount:1},Jo={paddingTop:8,paddingBottom:8,gap:8},es={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},ts=Object.freeze({fromStart:0,fromEnd:0}),Xe={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vr={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Oe=new Set;let we=null;function G(e){Oe.add(e),we??=requestAnimationFrame(Cr)}function ze(e){Oe.delete(e)&&Oe.size===0&&we!=null&&(cancelAnimationFrame(we),we=null)}function Xh(){Oe.clear(),we!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(we),we=null}function Cr(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?we=requestAnimationFrame(Cr):we=null}function Qe(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Je(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Fn(e,t){const n=e?.theme??O,i=t?.theme??O,r=ei(e),o=ei(t);return Je(n,i)&&Qe(e,t,["theme","parseDiffOptions"])&&Qe(r,o)}function ei(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function _t(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function cn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const d=Math.max(e-r,0),c=Math.min(e+l,t);return{top:d,bottom:Math.max(c,d)}}let a=e+n/2-s/2,h=a+s;return a<0&&(a=0),h>t&&(h=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(h,t),a))}}function Te(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const ns=new TextEncoder,is=new TextDecoder("utf-8",{ignoreBOM:!0}),rs=/[\uD800-\uDFFF]/,un=1024;let qe=new Uint8Array(un);function Sr(){qe.length!==un&&(qe=new Uint8Array(un))}function B(e){if(e.length===0)return e;if(rs.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;qe.length0&&r.deletions>0||o.type!=="context")continue;const s=r.additions>0,l=s?t.additionLines:t.deletionLines,a=s?r.additionLineIndex:r.deletionLineIndex,h=s?r.additions:r.deletions,d=l[a]??"";if(d.trim()!=="")continue;let c=!0;for(let C=1;Cos)return null;const a=[];for(let g=0;gn;let c=0,u=-1;for(let g=0;g<=l;g++){let C=0;for(let m=0;mu&&(u=C,c=g)}if(c===0)return null;const f=[],p=(g,C,m,v)=>{(g>0||C>0)&&f.push({type:"change",deletions:g,additions:C,deletionLineIndex:m,additionLineIndex:v})};return d?(p(0,c,r,o),p(s,s,r,o+c),p(0,i-s-c,r+s,o+c+s)):(p(c,0,r,o),p(s,s,r+c,o),p(n-s-c,0,r+c+s,o+s)),f}const hs=/\s+/g;function ti(e){return e.replace(hs,"")}function cs(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r0&&(f[f.length-1]===` `||f[f.length-1]==="\r"||f[f.length-1]===`\r `||f[f.length-1]==="");)f.pop();const{additionStart:y,deletionStart:S}=g;d=h?d:S-1,c=h?c:y-1;const L={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:y,additionLines:C,deletionCount:g.deletionCount,deletionStart:S,deletionLines:m,deletionLineIndex:d,additionLineIndex:c,hunkContent:[],hunkContext:oi(g.hunkContext),hunkSpecs:B(p),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let x=0,E=0;for(let k=1;k=L.additionCount&&E>=L.deletionCount&&!R.startsWith("\\")){if(o&&bs(R)&&!ys(R))throw Error("parsePatchContent: hunk has more lines than expected");break}const F=R[0];if(F!=="+"&&F!=="-"&&F!==" "&&F!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${F}", full line: "${R}"`),console.error("processFile: invalid rawLine:",R);continue}const T=ks(F);if(T==="addition"){if(o&&x>=L.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const I=Kt(R);(v==null||v.type!=="change")&&(v=Yt("change",d,c),L.hunkContent.push(v)),c++,x++,h&&a.additionLines.push(I),v.additions++,C++,b="addition"}else if(T==="deletion"){if(o&&E>=L.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const I=Kt(R);(v==null||v.type!=="change")&&(v=Yt("change",d,c),L.hunkContent.push(v)),d++,E++,h&&a.deletionLines.push(I),v.deletions++,m++,b="deletion"}else if(T==="context"){if(o&&(E>=L.deletionCount||x>=L.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const I=Kt(R);(v==null||v.type!=="context")&&(v=Yt("context",d,c),L.hunkContent.push(v)),c++,d++,x++,E++,h&&(a.deletionLines.push(I),a.additionLines.push(I)),v.lines++,b="context"}else if(T==="metadata"&&v!=null){if(v.type==="context"?(L.noEOFCRAdditions=!0,L.noEOFCRDeletions=!0):b==="deletion"?L.noEOFCRDeletions=!0:b==="addition"&&(L.noEOFCRAdditions=!0),h&&(b==="addition"||b==="context")){const I=a.additionLines.length-1;I>=0&&(a.additionLines[I]=Te(a.additionLines[I]))}if(h&&(b==="deletion"||b==="context")){const I=a.deletionLines.length-1;I>=0&&(a.deletionLines[I]=Te(a.deletionLines[I]))}}}if(o&&(x!==L.additionCount||E!==L.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");L.additionLines=C,L.deletionLines=m,L.collapsedBefore=Math.max(oe(L.additionStart,L.additionCount)-s,0),a.hunks.push(L),s=W(L.additionStart,L.additionCount);for(const k of L.hunkContent)k.type==="context"?(L.splitLineCount+=k.lines,L.unifiedLineCount+=k.lines):(L.splitLineCount+=Math.max(k.additions,k.deletions),L.unifiedLineCount+=k.deletions+k.additions);L.splitLineStart=a.splitLineCount+L.collapsedBefore,L.unifiedLineStart=a.unifiedLineCount+L.collapsedBefore,a.splitLineCount+=L.collapsedBefore+L.splitLineCount,a.unifiedLineCount+=L.collapsedBefore+L.unifiedLineCount}if(a!=null){if(o&&h&&!n&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!h&&a.additionLines.length>0&&a.deletionLines.length>0){const u=a.hunks[a.hunks.length-1],f=W(u.additionStart,u.additionCount),p=a.additionLines.length,g=Math.max(p-f,0);a.splitLineCount+=g,a.unifiedLineCount+=g}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),as(a),a}}function gs(e,t,n=!1){const i=[],r=ms(e)?e.split(Vo):[e];for(const o of r)try{i.push(us(o,t!=null?`${t}-${i.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return i}function ms(e){return e.startsWith("From ")||e.includes(` From `)}function ni(e){const t=yr(e);for(let n=0;ni.map(i=>d[i]); -import{bR as Q}from"./index-C-zUV3mO.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-BALCJgS_.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CsDiodhg.js","assets/index-F0Uxsiuo.js","assets/index-rMXX6Fbt.js","assets/index-qbGiRbdE.css"])))=>i.map(i=>d[i]); +import{bR as Q}from"./index-rMXX6Fbt.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-CsDiodhg.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` `),n=i.split(` `);let r=0;for(;r` ${a}`),...t.slice(r,t.length-o).map(a=>`- ${a}`),...n.slice(r,n.length-o).map(a=>`+ ${a}`),...t.slice(t.length-o).map(a=>` ${a}`)].join(` `)}function he(e){return new G(e)}function ue(e={}){let i,t,n,r,o,a="text",d="",p="",h,c=0,g="system",S=U(e),T=q(e);const L={disableLineNumbers:e.lineNumbers===!1,overflow:e.wordWrap==="on"?"wrap":"scroll",enableLineSelection:e.enableLineSelection},M=()=>({...L,theme:S,themeType:g});async function H(s,l,u){k();const w=c;if(N(s,e),h=s,a=R(u),_(l))return V(s,l,a);if(e.stream===!1)return O(s,l,a);const f=new K({...M(),...F(e),fileName:`code.${a}`,language:a,maxHeight:e.MAX_HEIGHT,autoScroll:e.autoScrollOnUpdate===!1?"never":"near-bottom",autoScrollThresholdPx:e.autoScrollThresholdPx,workerManager:e.workerManager});if(i=f,f.append(l),await f.mount(s),w!==c||i!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>f.getText(),s,()=>f.getFinalizedSurface(),m=>f.onDidRender(m)),r}async function I(s,l,u,w){k();const f=c;N(s,e),h=s,a=R(w),d=l,p=u;let m,v;if(e.stream===!1){if(m=x({kind:"diff",oldFile:y(l),newFile:y(u),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),...F(e)}}),n=m,await m.mount(s),f!==c||n!==m||h!==s)throw m.dispose(),new Error("Editor creation was cancelled");e.onController?.(m)}else{if(v=new G({...M(),...F(e),fileName:`code.${a}`,language:a,diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),maxHeight:e.MAX_HEIGHT,wrap:e.wordWrap==="on",workerManager:e.workerManager}),t=v,await v.mount(s,l,u),f!==c||t!==v||h!==s)throw v.dispose(),new Error("Editor creation was cancelled");e.onController?.(v)}return o=oe(()=>d,()=>p,s,()=>m??v?.getFinalizedSurface()),o}async function X(s,l=a){const u=R(l);if(_(s)){n?.getInput().kind==="merge-conflict"?(a=u,await n.updateMergeConflict(y(s),e.lineAnnotations)):h&&await V(h,s,u);return}if(e.stream===!1){n?.getInput().kind==="file"?(a=u,await n.updateFile(y(s),e.lineAnnotations)):h&&await O(h,s,u);return}if(!i){h&&await H(h,s,u);return}if(i.getState()==="finalized"){s!==i.getText()&&await i.reset(s);return}if(u!==a){a=u,await i.setLanguage(u),s!==i.getText()&&await i.reset(s);return}const w=i.getText();s.startsWith(w)?i.append(s.slice(w.length)):await i.reset(s)}async function P(s,l,u=a){if(d=s,p=l,a=R(u),t){await t.update(s,l);return}if(!n){h&&await I(h,s,l,u);return}await n.updateDiff(y(s),y(l))}function k(){c++,i?.dispose(),t?.dispose(),t||n?.dispose(),i=void 0,t=void 0,n=void 0,r=void 0,o=void 0,h=void 0}async function O(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"file",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}async function V(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"merge-conflict",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}function _(s){return e.mergeConflict===!1?!1:/^<<<<<<< .+$/m.test(s)&&/^=======$/m.test(s)&&/^>>>>>>> .+$/m.test(s)}async function J(s){if(s){if(typeof s=="string"){const l=e.themes;if(l?.[0]===s){await W(),g="dark",i?.setThemeType("dark"),t?.setThemeType("dark"),n?.setThemeType("dark");return}if(l?.[1]===s){await W(),g="light",i?.setThemeType("light"),t?.setThemeType("light"),n?.setThemeType("light");return}}T=void 0,S=s,await j(s)}}async function W(){const s=q(e);!s||s===T||(T=s,S=U(e),await j(S))}async function j(s){await i?.setTheme(s),await t?.setTheme(s),await n?.setTheme(s)}function y(s){return E(`code.${a||"txt"}`,s,a)}return{runtimeKind:"stream-diffs",createEditor:H,createDiffEditor:I,updateCode:X,appendCode(s){i?.append(s)},async finalizeCode(){if(!i||i.getState()==="finalized")return i?.getFinalizedSurface();const s=F(e);return delete s.lineAnnotations,await i.finalize({view:"file",...s,theme:S,themeType:g,annotations:e.lineAnnotations,workerManager:e.workerManager}),i.getFinalizedSurface()},async finalizeDiff(){return t&&(n=await t.finalize(e.lineAnnotations)),n},updateDiff:P,updateOriginal(s,l=a){return P(s,p,l)},updateModified(s,l=a){return P(d,s,l)},appendOriginal(s,l=a){return P(d+s,p,l)},appendModified(s,l=a){return P(d,p+s,l)},cleanupEditor:k,safeClean:k,setTheme:J,async setLanguage(s){if(a=R(s),await i?.setLanguage(a),await t?.setLanguage(a),n&&!t){const l=n.getInput();l.kind==="file"||l.kind==="merge-conflict"?await n.update({...l,file:{...l.file,lang:a}}):l.kind==="diff"&&"oldFile"in l&&await n.update({...l,oldFile:{...l.oldFile,lang:a},newFile:{...l.newFile,lang:a}})}},getCurrentTheme:()=>S,getEditor:()=>le,getEditorView:()=>r??null,getDiffEditorView:()=>o??null,getDiffModels:()=>({original:D(()=>d),modified:D(()=>n?.getResolvedFile()?.contents??t?.getModified()??p)}),getCode:()=>{const s=n?.getInput();return s?.kind==="diff"||s?.kind==="patch"?{original:d,modified:n?.getResolvedFile()?.contents??p}:s?.kind==="file"||s?.kind==="merge-conflict"?s.file.contents:t?{original:t.getOriginal(),modified:t.getModified()}:i?.getText()??null},refreshDiffPresentation:()=>n?.update(n.getInput()),whenVisualReady:async()=>{const s=h,l=c,u=n??i?.getFinalizedSurface()??t?.getFinalizedSurface();return!u||!await u.whenVisualReady()?!1:ne(s,()=>l===c&&s===h&&u===(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()),()=>se(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()))}}}async function ne(e,i,t){if(!e||typeof window>"u")return!1;let n="",r,o=0;for(let a=0;a<120;a+=1){if(!i())return!1;const d=e.querySelector(".stream-diffs-shell"),p=d?.querySelector("diffs-container")?.shadowRoot?.querySelector("pre"),h=d?.getBoundingClientRect(),c=p?.textContent??"";if(h&&h.width>0&&h.height>0&&p&&t()){const g=`${Math.round(h.width)}:${Math.round(h.height)}:${p.scrollWidth}:${p.scrollHeight}:${c.length}`;if(o=p===r&&g===n?o+1:1,r=p,n=g,o>=2)return!0}else n="",r=void 0,o=0;await ae()}return!1}function se(e){if(!e)return!0;const i=e.getNativeInstance(),t=i?.fileRenderer??i?.hunksRenderer;if(!t)return!0;const n=t.renderCache;if(!n?.result)return!1;if(n.highlighted===!0)return!0;const r=e.getInput();if(R(r.kind==="file"||r.kind==="merge-conflict"?r.file.lang:"oldFile"in r?r.oldFile.lang??r.newFile.lang:e.getDiff()?.lang)==="text")return!0;const o=Number(t.getTokenizeMaxLength?.()??1e5);if(r.kind==="file"||r.kind==="merge-conflict")return re(r.file.contents)>o;const a=e.getDiff();return!!a&&Math.max(a.additionLines.length,a.deletionLines.length)>o}function R(e){return!e||/^(?:text|txt|plain|plaintext)$/i.test(e)?"text":e}function re(e){if(!e)return 0;let i=1;for(let t=0;t{let i=!1;const t=()=>{i||(i=!0,window.clearTimeout(r),window.cancelAnimationFrame(n),e())},n=window.requestAnimationFrame(t),r=window.setTimeout(t,50)})}function U(e){return e.themes?.length&&typeof e.themes[0]=="string"&&typeof e.themes[1]=="string"?{dark:e.themes[0],light:e.themes[1]}:e.theme??void 0}function q(e){if(!(typeof e.themes?.[0]!="string"||typeof e.themes?.[1]!="string"))return`${e.themes[0]} diff --git a/apps/pythinker-code/dist-web/assets/index-D4amJRyl.js b/apps/pythinker-code/dist-web/assets/index-F0Uxsiuo.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index-D4amJRyl.js rename to apps/pythinker-code/dist-web/assets/index-F0Uxsiuo.js index d0ca0b1fb..73523c876 100644 --- a/apps/pythinker-code/dist-web/assets/index-D4amJRyl.js +++ b/apps/pythinker-code/dist-web/assets/index-F0Uxsiuo.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-DXfck5VN.js","assets/ruby-C0TQ7zu5.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-BWmVpMyf.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-5Bft2YPA.js","assets/r-Cf5RLm7j.js","assets/just-Cwhn7H3k.js","assets/perl-B9cMNwum.js","assets/latex-D5pSuvFb.js","assets/tex-D96PA37w.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-D1_yUvq7.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/org-DM6o9KBp.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-Csjmro_R.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-B1yitclQ.js","assets/scala-CqE71os6.js","assets/csharp-DSvCPggb.js","assets/dart-bE4Kk8sk.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/rst-bs7f0vWN.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Cjom0U5J.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/ts-tags-D351s5mN.js","assets/twig-27uCiNez.js","assets/typst-BUadGCkm.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-BmBUJMz7.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-BqiEGhQt.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]); -import{bR as c}from"./index-C-zUV3mO.js";var Dt=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Wi=Object.getOwnPropertyNames,zi=Object.prototype.hasOwnProperty,qi=(e,t)=>{let n={};for(var r in e)Dt(n,r,{get:e[r],enumerable:!0});return Dt(n,Symbol.toStringTag,{value:"Module"}),n},Xi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Wi(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Hi(t,a))||r.enumerable});return e},Ki=(e,t,n)=>(Xi(e,t,"default"),n);const Yt=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>c(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>c(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>c(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>c(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>c(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>c(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>c(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>c(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>c(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>c(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>c(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>c(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>c(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>c(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],cr=Object.fromEntries(Yt.map(e=>[e.id,e.import])),dr=Object.fromEntries(Yt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),pr={...cr,...dr},hr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],fr=Object.fromEntries(hr.map(e=>[e.id,e.import]));var Zt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Qi(){return 2147483648}function Ji(){return typeof performance<"u"?performance.now():Date.now()}const Yi=(e,t)=>e+(t-e%t)%t;async function Zi(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=Qi();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const _=Math.min(E,Yi(Math.max(h,g),65536));if(s(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let _="";for(;m>10,56320|I&1023)}}return _}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:Ji,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var eo=Object.defineProperty,to=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>to(e,typeof t!="symbol"?t+"":t,n);let D=null;function no(e){throw new Zt(e.UTF8ToString(e.getLastOnigError()))}class st{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=st._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const at=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new Zt("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new st(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(at,"LAST_ID",0);P(at,"_sharedPtr",0);P(at,"_sharedPtrInUse",!1);let mr=at;class ro{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new Zt("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),io(r)?r=await r.instantiator(n):oo(r)?r=await r.default(n):(so(r)&&(r=r.data),ao(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await uo(r)(n):r=await co(r)(n):lo(r)?r=await Et(r)(n):r instanceof WebAssembly.Module?r=await Et(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Et(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Ue=t(),Ue}function Et(e){return t=>WebAssembly.instantiate(e,t)}function uo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function co(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let gr;function po(e){gr=e}function ho(){return gr}async function _r(e){return e&&await en(e),{createScanner(t){return new ro(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new mr(t)}}}const fo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:_r,getDefaultWasmLoader:ho,loadWasm:en,setDefaultWasmLoader:po},Symbol.toStringTag,{value:"Module"}));var yr=qi({});Ki(yr,fo);var S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function mo(e){return tn(e)}function tn(e){return Array.isArray(e)?go(e):e instanceof RegExp?e:typeof e=="object"?_o(e):e}function go(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function br(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?br(e.substring(0,e.length-1)):e.substr(~t+1)}var bt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(bt.lastIndex=0,bt.test(e))}static replaceCaptures(e,t,n){return e.replace(bt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function wr(e,t){return et?1:0}function vr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>yo(e.parent,i.parentScopes));return r?new kr(r.fontStyle,r.foreground,r.background):null}},wt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Eo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Eo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function bo(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new wo(E,b,i,l,u,p)}}return n}var wo=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function vo(e,t){e.sort((l,u)=>{let p=wr(l.scope,u.scope);return p!==0||(p=vr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Co(t),s=new kr(n,o.getId(r),o.getId(i)),a=new ko(new Nt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},ko=class Vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Vt._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Vt(this._mainRule.clone(),Nt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ye(e,t){const n=[],r=So(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(vn(i)){const l=[];do l.push(i),i=r.next();while(vn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function vn(e){return!!e&&!!e.match(/[\w\.:]+/)}function So(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Lr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Lo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ro=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Io=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ro;for(const n of e)To(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function To(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ke({baseGrammar:o,selfGrammar:i},r):$t(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function $t(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Ze([r],t,n)}}function Ke(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ze(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Er({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ze(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Rr(o);switch(s.kind){case 0:Ke({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ke(t,n);break;case 2:$t(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?$t(s.ruleName,l,n):Ke(l,n)}else s.kind===4?n.add(new Lo(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Po=class{kind=0},Oo=class{kind=1},xo=class{constructor(e){this.ruleName=e}kind=2},Do=class{constructor(e){this.scopeName=e}kind=3},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Rr(e){if(e==="$base")return new Po;if(e==="$self")return new Oo;const t=e.indexOf("#");if(t===-1)return new Do(e);if(t===0)return new xo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new No(n,r)}}var Vo=/\\(\d+)/,Cn=/\\(\d+)/g,$o=-1,Ir=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${br(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Mo=class extends Ne{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Go=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},An=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},et=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Tr=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Mo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Go(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Er({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new An(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new Mt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Cn.lastIndex=0,this.source.replace(Cn,(i,o)=>Cr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new kn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new kn(e,r,this._items.map(i=>i.ruleId))}},kn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{let n={};for(var r in e)Dt(n,r,{get:e[r],enumerable:!0});return Dt(n,Symbol.toStringTag,{value:"Module"}),n},Xi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Wi(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Hi(t,a))||r.enumerable});return e},Ki=(e,t,n)=>(Xi(e,t,"default"),n);const Yt=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>c(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>c(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>c(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>c(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>c(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>c(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>c(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>c(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>c(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>c(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>c(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>c(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>c(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>c(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],cr=Object.fromEntries(Yt.map(e=>[e.id,e.import])),dr=Object.fromEntries(Yt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),pr={...cr,...dr},hr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],fr=Object.fromEntries(hr.map(e=>[e.id,e.import]));var Zt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Qi(){return 2147483648}function Ji(){return typeof performance<"u"?performance.now():Date.now()}const Yi=(e,t)=>e+(t-e%t)%t;async function Zi(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=Qi();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const _=Math.min(E,Yi(Math.max(h,g),65536));if(s(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let _="";for(;m>10,56320|I&1023)}}return _}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:Ji,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var eo=Object.defineProperty,to=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>to(e,typeof t!="symbol"?t+"":t,n);let D=null;function no(e){throw new Zt(e.UTF8ToString(e.getLastOnigError()))}class st{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=st._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const at=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new Zt("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new st(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(at,"LAST_ID",0);P(at,"_sharedPtr",0);P(at,"_sharedPtrInUse",!1);let mr=at;class ro{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new Zt("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),io(r)?r=await r.instantiator(n):oo(r)?r=await r.default(n):(so(r)&&(r=r.data),ao(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await uo(r)(n):r=await co(r)(n):lo(r)?r=await Et(r)(n):r instanceof WebAssembly.Module?r=await Et(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Et(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Ue=t(),Ue}function Et(e){return t=>WebAssembly.instantiate(e,t)}function uo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function co(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let gr;function po(e){gr=e}function ho(){return gr}async function _r(e){return e&&await en(e),{createScanner(t){return new ro(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new mr(t)}}}const fo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:_r,getDefaultWasmLoader:ho,loadWasm:en,setDefaultWasmLoader:po},Symbol.toStringTag,{value:"Module"}));var yr=qi({});Ki(yr,fo);var S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function mo(e){return tn(e)}function tn(e){return Array.isArray(e)?go(e):e instanceof RegExp?e:typeof e=="object"?_o(e):e}function go(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function br(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?br(e.substring(0,e.length-1)):e.substr(~t+1)}var bt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(bt.lastIndex=0,bt.test(e))}static replaceCaptures(e,t,n){return e.replace(bt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function wr(e,t){return et?1:0}function vr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>yo(e.parent,i.parentScopes));return r?new kr(r.fontStyle,r.foreground,r.background):null}},wt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Eo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Eo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function bo(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new wo(E,b,i,l,u,p)}}return n}var wo=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function vo(e,t){e.sort((l,u)=>{let p=wr(l.scope,u.scope);return p!==0||(p=vr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Co(t),s=new kr(n,o.getId(r),o.getId(i)),a=new ko(new Nt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},ko=class Vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Vt._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Vt(this._mainRule.clone(),Nt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ye(e,t){const n=[],r=So(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(vn(i)){const l=[];do l.push(i),i=r.next();while(vn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function vn(e){return!!e&&!!e.match(/[\w\.:]+/)}function So(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Lr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Lo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ro=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Io=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ro;for(const n of e)To(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function To(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ke({baseGrammar:o,selfGrammar:i},r):$t(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function $t(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Ze([r],t,n)}}function Ke(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ze(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Er({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ze(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Rr(o);switch(s.kind){case 0:Ke({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ke(t,n);break;case 2:$t(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?$t(s.ruleName,l,n):Ke(l,n)}else s.kind===4?n.add(new Lo(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Po=class{kind=0},Oo=class{kind=1},xo=class{constructor(e){this.ruleName=e}kind=2},Do=class{constructor(e){this.scopeName=e}kind=3},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Rr(e){if(e==="$base")return new Po;if(e==="$self")return new Oo;const t=e.indexOf("#");if(t===-1)return new Do(e);if(t===0)return new xo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new No(n,r)}}var Vo=/\\(\d+)/,Cn=/\\(\d+)/g,$o=-1,Ir=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${br(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Mo=class extends Ne{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Go=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},An=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},et=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Tr=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Mo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Go(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Er({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new An(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new Mt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Cn.lastIndex=0,this.source.replace(Cn,(i,o)=>Cr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new kn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new kn(e,r,this._items.map(i=>i.ruleId))}},kn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new vt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Gt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Uo=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Cr(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Sn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Or(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,p=-1;if(s){const h=Fo(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,p=h.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Sn(i,!0);f()}return new Sn(i,!1);function f(){const h=jo(e,t,n,r,i,p);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,E=h.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(E===$o){const g=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ce(e,t,n,i,o,g.endCaptures,m),o.produce(i,m[0].end);const _=i;if(i=i.parent,p=_.getAnchorPos(),!b&&_.getEnterPos()===r){i=_,o.produce(i,l),u=!0;return}}else{const g=e.getRule(E);o.produce(i,m[0].start);const _=i,w=g.getName(t.content,m),A=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(E,r,p,m[0].end===l,null,A,A),g instanceof Mt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!b&&_.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(g instanceof et){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!b&&_.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ce(e,t,n,i,o,g.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Fo(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof et&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:p}=zo(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,p);if(d){if(d.ruleId!==Ir){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Ce(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function jo(e,t,n,r,i,o){const s=Ho(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Wo(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,p=l.captureIndices[0].start;return p=a)&&(a=w,l=_.captureIndices,u=_.ruleId,p=m.priority,a===i))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:u}:null}function xr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function zo(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ce(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],p=s[0].end;for(let d=0;dp)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const E=f.getName(a,s),b=r.contentNameScopesList.pushAttributed(E,e),g=f.getContentName(a,s),_=b.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,_),A=e.createOnigString(a.substring(0,h.end));Or(e,A,n&&h.start===0,h.start,w,i,!1,0),Lr(A);continue}const m=f.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new qo(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var qo=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Xo(e,t,n,r,i,o,s,a){return new Qo(e,t,n,r,i,o,s,a)}function Ln(e,t,n,r,i){const o=Ye(t,tt),s=Tr.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function tt(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var Qo=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Bo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Rn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Ye(l,tt);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)Ln(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&Ln(t,l,a,this,a)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Rn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Tr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Bt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),d=le.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Ae.createRootAndLookUpScopeName(f,d,this):h=Ae.createRoot("unknown",d),t=new Bt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` `;const o=this.createOnigString(e),s=o.content.length,a=new Yo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Or(this,o,i,0,t,a,!0,r);return Lr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Rn(e,t){return e=mo(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ae=class K{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=wt.push(i,o.scopeNames),r=new K(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new K(null,new wt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new wt(null,t),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(n,i,s);return new K(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return K.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),le.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return K._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=K._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(t.tokenAttributes,i,s);return new K(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Bt=class ie{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ie(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ie._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ae.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ie._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new ie(this,t,n,r,i,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ie(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ae.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ie(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ae.fromExtension(r,n.contentNameScopesList))}},Jo=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ye(n,tt).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ye(n,tt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Yo=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=le.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=le.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Ut=Bt.NULL;function Ie(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function ee(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Dr(e){return Array.isArray(e)?e:[e]}async function nn(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Ve(e){return!e||["plaintext","txt","text","plain"].includes(e)}function rn(e){return e==="ansi"||Ve(e)}function $e(e){return e==="none"}function on(e){return $e(e)}const ts=/(\r?\n)/g;function Me(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(ts);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?In.light:In.dark),n||(n=t.type==="light"?Tn.light:Tn.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const p={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,p.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,p.settings.background=d}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Pn,{enumerable:!1,writable:!1,value:!0}),t}async function Nr(e){return[...new Set((await Promise.all(e.filter(t=>!rn(t)).map(async t=>await nn(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Vr(e){return(await Promise.all(e.map(async t=>on(t)?null:lt(await nn(t))))).filter(t=>!!t)}function $r(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new S(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var ns=class extends es{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=lt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Je.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=$r(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new S(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},rs=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let ve=0;function ut(e){ve+=1,e.warnings!==!1&&ve>=10&&ve%10===0&&console.warn(`[Shiki] ${ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new S("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(lt),i=new ns(new rs(e.engine,n),r,n,e.langAlias);let o;function s(_){return $r(_,e.langAlias)}function a(_){b();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new S(`Language \`${_}\` not found, you may need to load it first`);return w}function l(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const w=i.getTheme(_);if(!w)throw new S(`Theme \`${_}\` not found, you may need to load it first`);return w}function u(_){b();const w=l(_);return o!==_&&(i.setTheme(w),o=_),{theme:w,colorMap:i.getColorMap()}}function p(){return b(),i.getLoadedThemes()}function d(){return b(),i.getLoadedLanguages()}function f(..._){b(),i.loadLanguages(_.flat(1))}async function h(..._){return f(await Nr(_))}function m(..._){b();for(const w of _.flat(1))i.loadTheme(w)}async function E(..._){return b(),m(await Vr(_))}function b(){if(t)throw new S("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),ve-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:E,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}const is=ut;async function sn(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Vr(e.themes||[]),Nr(e.langs||[]),e.engine]);return ut({...e,themes:t,langs:n,engine:r})}const os=sn,Mr=new WeakMap;function ct(e,t){Mr.set(e,t)}function Te(e){return Mr.get(e)}var dt=class Gr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Gr(Object.fromEntries(Dr(n).map(r=>[r,Ut])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return ss(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function ss(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function as(e,t){if(!(e instanceof dt))throw new S("Invalid grammar state");return e.getInternalStack(t)}const ls=/,/,us=/ /;function Br(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Ve(e.resolveLangAlias(n.lang||"text"))||$e(r))return Me(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Fr(t,s,i,o,n)}function Ur(...e){if(e.length===2)return Te(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(Ve(i)||$e(o))throw new S("Plain language does not have grammar state");if(i==="ansi")throw new S("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new dt(an(n,l,s,a,r).stateStack,l.name,s.name)}function Fr(e,t,n,r,i){const o=an(e,t,n,r,i),s=new dt(o.stateStack,t.name,n.name);return ct(o.tokens,s),o.tokens}function an(e,t,n,r,i){const o=Ie(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Me(e);let p=i.grammarState?as(i.grammarState,n.name)??Ut:i.grammarContextCode!=null?an(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ut,d=[];const f=[];for(let h=0,m=u.length;h0&&E.length>=s){d=[],f.push([{content:E,offset:b,color:"",fontStyle:0}]);continue}let g,_,w;l&&l!=="tokenType"&&(g=t.tokenizeLine(E,p,a),_=g.tokens,w=0);const A=t.tokenizeLine2(E,p,a),k=A.tokens.length/2;for(let I=0;Iyt.trim());break;case"object":pe=Q.scope;break;default:continue}En.push({settings:Q,selectors:pe.map(yt=>yt.split(us))})}q.explanation=[];let bn=0;for(;M+bn({scopeName:t}))}function ds(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)On(e[r],n[i])&&(r-=1),i-=1;return r===-1}function hs(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(ps(s,t,n)){r.push(o);break}return r}function ln(e,t,n,r=Br){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const p=r(e,t,{...n,theme:u.theme});return{tokens:p,state:Te(p),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=fs(...o.map(u=>u.tokens)),a=s[0].map((u,p)=>u.map((d,f)=>{const h={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=d.explanation),s.forEach((m,E)=>{const{content:b,explanation:g,offset:_,...w}=m[p][f];h.variants[i[E].color]=w}),h})),l=o[0].state?new dt(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&ct(a,l),a}function fs(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u4&&n.slice(0,4)==="data"&&bs.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Dn,Cs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Dn.test(o)){let s=o.replace(Es,vs);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=un}return new i(r,t)}function vs(e){return"-"+e.toLowerCase()}function Cs(e){return e.charAt(1).toUpperCase()}const As=jr([Hr,_s,qr,Xr,Kr],"html"),Qr=jr([Hr,ys,qr,Xr,Kr],"svg"),Nn={}.hasOwnProperty;function ks(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Nn.call(i,e)){const l=String(i[e]);s=Nn.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ss=/["&'<>`]/g,Ls=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rs=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Is=/[|\\{}()[\]^$+*?.]/g,Vn=new WeakMap;function Ts(e,t){if(e=e.replace(t.subset?Ps(t.subset):Ss,r),t.subset||t.escapeOnly)return e;return e.replace(Ls,n).replace(Rs,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function Ps(e){let t=Vn.get(e);return t||(t=Os(e),Vn.set(e,t)),t}function Os(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ms=["cent","copy","divide","gt","lt","not","para","times"],Jr={}.hasOwnProperty,Wt={};let je;for(je in At)Jr.call(At,je)&&(Wt[At[je]]=je);const Gs=/[^\dA-Za-z]/;function Bs(e,t,n,r){const i=String.fromCharCode(e);if(Jr.call(Wt,i)){const o=Wt[i],s="&"+o;return n&&$s.includes(o)&&!Ms.includes(o)&&(!r||t&&t!==61&&Gs.test(String.fromCharCode(t)))?s:s+";"}return""}function Us(e,t,n){let r=Ds(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Bs(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Vs(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],Hs=["<",">"];function Ws(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return ye(o,Object.assign({},r.settings.characterReferences,{subset:Hs}))}}function zs(e,t,n,r){return""}function $n(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qs(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Xs(e){return e.join(" ").trim()}const Ks=/[ \t\n\f\r]/g;function cn(e){return typeof e=="object"?e.type==="text"?Mn(e.value):!1:Mn(e)}function Mn(e){return e.replace(Ks,"")===""}const x=Zr(1),Yr=Zr(-1),Qs=[];function Zr(e){return t;function t(n,r,i){const o=n?n.children:Qs;let s=(r||0)+e,a=o[s];if(!i)for(;a&&cn(a);)s+=e,a=o[s];return a}}const Js={}.hasOwnProperty;function ei(e){return t;function t(n,r,i){return Js.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const dn=ei({body:Zs,caption:kt,colgroup:kt,dd:ra,dt:na,head:kt,html:Ys,li:ta,optgroup:ia,option:oa,p:ea,rp:Gn,rt:Gn,tbody:aa,td:Bn,tfoot:la,th:Bn,thead:sa,tr:ua});function kt(e,t,n){const r=x(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&cn(r.value.charAt(0)))}function Ys(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function Zs(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function ea(e,t,n){const r=x(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ta(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="li"}function na(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ra(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Gn(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ia(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function oa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function sa(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function aa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function la(e,t,n){return!x(n,t)}function ua(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Bn(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ca=ei({body:ha,colgroup:fa,head:pa,html:da,tbody:ma});function da(e){const t=x(e,-1);return!t||t.type!=="comment"}function pa(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function ha(e){const t=x(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&cn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fa(e,t,n){const r=Yr(n,t),i=x(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&dn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ma(e,t,n){const r=Yr(n,t),i=x(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&dn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const He={name:[[` \f\r &/=>`.split(""),` diff --git a/apps/pythinker-code/dist-web/assets/index-C-zUV3mO.js b/apps/pythinker-code/dist-web/assets/index-rMXX6Fbt.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/index-C-zUV3mO.js rename to apps/pythinker-code/dist-web/assets/index-rMXX6Fbt.js index 91e4b40d9..34fe26828 100644 --- a/apps/pythinker-code/dist-web/assets/index-C-zUV3mO.js +++ b/apps/pythinker-code/dist-web/assets/index-rMXX6Fbt.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Egp23i6M.js","assets/DesignSystemView-DzHBvWAf.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-DqRBT_Oz.js","assets/safeRaf-DGuzXxDK.js","assets/index5-CBYFkVKG.js","assets/index11-16yWfZMq.js","assets/editor.main-PjnZnl8g.js","assets/editor-Ck3IbhyB.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Dsz3gtgF.js","assets/DesignSystemView-DzHBvWAf.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-CM2luXFy.js","assets/purify.es-5AjVNlXF.js","assets/CodeBlockNode-BWr5oh7o.js","assets/safeRaf-DGuzXxDK.js","assets/index5-Dh6mobVc.js","assets/index11-k-mhqMlJ.js","assets/editor.main-CYqrlDj5.js","assets/editor-Ck3IbhyB.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();/** * @vue/shared v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -457,7 +457,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemVie -`,VW='',WW='',qW='',UW='',ZW='',KW='',GW='',YW='',XW='',JW='',QW='',eq='',tq='',nq='',jy='',oq='',sq='',rq='',lq='',iq='',aq='',cq='',uq='',dq='',fq='',pq='',hq='',mq='',gq='',vq='',wq='',yq='',kq='',bq='',_q='',Oy='',xq='',Sq='',Cq='',Mq='',Aq='',Eq='',Tq='',Iq='',Lq='',Fy='',$q='',Nq='',zq='',Bq='',jq='',Oq='',Fq='',Rq='',Hq='',Pq='',Dq='',Vq='',Wq='',qq='',Uq='',Zq='',Kq='',Gq='',Yq='',Xq='',Jq='',Qq='',eU='',tU='',nU='',oU='',sU='',l4={sm:14,md:16,lg:20};function Nt(e,t){return{component:e,svg:t}}function E0(e){return{svg:e,animated:!0}}const MA={plus:Nt(YH,KW),"chat-new":Nt(xH,NW),"calendar-close":Nt(LP,rq),"calendar-schedule":Nt(zP,lq),"calendar-todo":Nt(OP,iq),close:Nt(VP,cq),check:Nt(HP,aq),archive:Nt(rP,XW),search:E0(RW),copy:Nt(CD,bq),link:Nt(dV,Nq),"external-link":Nt(pD,vq),download:Nt(tD,pq),undo:Nt(hP,eq),send:Nt(Ny,jy),image:Nt(By,Fy),settings:E0(HW),sliders:Nt(iD,mq),"cute-bot":E0(zW),microscope:Nt(TV,Rq),flask:Nt(jD,Sq),eye:Nt(gD,wq),"eye-off":Nt(yD,yq),"log-in":Nt(kV,jq),"chevron-down":Nt(dP,QW),"chevron-right":Nt(kP,nq),"chevron-up":Nt(CP,oq),"arrow-up":Nt(Ny,jy),"arrow-down":Nt(aP,JW),"arrow-right":Nt(vP,tq),minus:Nt(kW,eU),"panel-collapse":Nt(PH,qW),"panel-expand":Nt(WH,UW),expand:Nt(uD,gq),collapse:Nt(GP,dq),list:Nt(vV,Bq),sort:Nt(rW,Gq),grip:Nt(sD,hq),folder:E0(jW),"folder-closed":Nt(MH,BW),"folder-plus":Nt(DD,Mq),"folder-solid":Nt(qD,Aq),file:Nt(zy,Oy),"file-text":Nt(ND,xq),"file-edit":Nt(ED,_q),"file-plus":Nt(_D,kq),"file-off":Nt(zy,Oy),attachment:Nt(ZH,ZW),"image-off":Nt(By,Fy),code:Nt(UP,uq),terminal:E0(PW),pencil:Nt(BV,Pq),tool:Nt(TW,oU),glob:Nt(EP,sq),globe:Nt(oV,Lq),"check-list":Nt(hV,zq),bolt:Nt(RD,Cq),"git-fork":Nt(KD,Eq),"git-pull-request":Nt(XD,Tq),message:Nt(MV,Fq),mail:Nt(xV,Oq),user:Nt($W,sU),info:Nt(aV,$q),"help-circle":Nt(ZV,qq),"alert-triangle":Nt(nP,YW),fingerprint:Nt(eV,Iq),"shield-question":Nt(QV,Zq),"full-access":Nt(YV,Uq),trash:Nt(JP,fq),clock:Nt(MW,nU),"loading-spinner":E0(OW),sparkles:Nt(aW,Yq),thinking:Nt($H,DW),target:Nt(xW,tU),pause:Nt($V,Hq),play:Nt(FV,Dq),power:Nt(nW,Kq),stop:Nt(vW,Qq),star:Nt(dW,Xq),"star-outline":Nt(hW,Jq),"dots-horizontal":Nt(TH,FW),"circle-check":Nt(BH,VW),"circle-dashed":Nt(FH,WW),"pushpin-line":Nt(WV,Wq),"pushpin-fill":Nt(PV,Vq),"gen-title":Nt(QH,GW)};function AA(e){return MA[e]}function rU(e,t){return e.replaceAll(/\s(?:width|height)="[^"]*"/g,"").replace(/^